query
stringlengths
9
43.3k
document
stringlengths
17
1.17M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Deletes the constraints for a question
function deleteConstraints($question_id) { global $ilDB; $result = $ilDB->queryF("SELECT constraint_fi FROM svy_qst_constraint WHERE question_fi = %s AND survey_fi = %s", array('integer','integer'), array($question_id, $this->getSurveyId()) ); $constraints = array(); while ($row = $ilDB->fetchAssoc($result)) { array_push($constraints, $row["constraint_fi"]); } foreach ($constraints as $constraint_id) { $this->deleteConstraint($constraint_id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeConstraintsConcerningQuestion($question_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT constraint_fi FROM svy_qst_constraint WHERE question_fi = %s AND survey_fi = %s\",\n\t\t\tarray('integer','integer'),\n\t\t\tarray($question_id, $this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows() > 0)\n\t\t{\n\t\t\t$remove_constraints = array();\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tarray_push($remove_constraints, $row[\"constraint_fi\"]);\n\t\t\t}\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qst_constraint WHERE question_fi = %s AND survey_fi = %s\",\n\t\t\t\tarray('integer','integer'),\n\t\t\t\tarray($question_id, $this->getSurveyId())\n\t\t\t);\n\t\t\tforeach ($remove_constraints as $key => $constraint_id)\n\t\t\t{\n\t\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_constraint WHERE constraint_id = %s\",\n\t\t\t\t\tarray('integer'),\n\t\t\t\t\tarray($constraint_id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function deleteConstraint($constraint_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_constraint WHERE constraint_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($constraint_id)\n\t\t);\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qst_constraint WHERE constraint_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($constraint_id)\n\t\t);\n\t}", "public function testRemoveConstraint()\n {\n $constraint = new MyConstraint();\n $same = $this->uut->addConstraint($constraint, $constraint)->removeConstraint(MyConstraint::class);\n $this->assertSame($this->uut, $same);\n $this->assertEquals([], $this->uut->getConstraints());\n }", "public function destroy(Questions $questions)\n {\n //\n }", "public function remove($constraints)\n {\n $query = $this->getModel();\n\n // loop over all given constraints\n\n foreach ($constraints as $where) {\n $query = $query->where($where[0], $where[1], $where[2]);\n }\n return $query->delete();\n }", "function editCleanUp($question_id)\r\n {\r\n \t\t$this->query('DELETE FROM questions WHERE id='.$question_id);\r\n\t\t$this->query('DELETE FROM responses WHERE question_id='.$question_id);\r\n\t\t$this->query('DELETE FROM survey_questions WHERE question_id='.$question_id);\r\n }", "function delete(){\n // Renumber resolutions\n $resolutions = resolution::getResolutions($this->committeeId, $this->topicId);\n foreach($resolutions as $resolution){\n if($resolution->resolutionNum <= $this->resolutionNum)\n continue;\n $resolution->resolutionNum--;\n $resolution->saveInfo();\n }\n // Delete subclauses\n foreach($this->preambulatory as $clause){\n $clause->delete();\n }\n foreach($this->operative as $clause){\n $clause->delete();\n }\n // Delete resolution\n mysql_query(\"DELETE FROM resolution_list WHERE id='$this->resolutionId'\") or die(mysql_error());\n }", "public function forceDeleted(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "public function dropForeignKey($columns, $constraint = null)\r\n {\r\n \r\n }", "public function deleted(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "public function destroy(Question $Question)\n {\n //\n }", "public function deleteRequirements(array $requirements = []);", "function delete(){\n // Delete subclauses\n foreach($this->subClause as $clause){\n $clause->delete();\n }\n \n mysql_query(\"DELETE FROM resolution WHERE id='$this->clauseId'\") or die(mysql_error());\n }", "public function destroy(Question $question)\n {\n\n\n }", "public function testDelete_MultiConstraint()\n {\n $this->setExpectedException('Q\\DB_Constraint_Exception');\n $this->conn->delete('test', array('status'=>'ACTIVE'), DB::SINGLE_ROW);\n }", "public function deleteAnswersByQuestion($idQuestion)\n\t{\n\t\t$this->db->delete('respostas', \" `id_pergunta` = '\".$idQuestion.\"'\"); \n\t}", "public function destroy(question $question)\n {\n //\n }", "public function destroy(Question $question)\n {\n //\n }", "public function destroy(Question $question)\n {\n //\n }", "public function destroy(Question $question)\n {\n //\n }", "public function updateQuestionFieldIdSchema()\n {\n try {\n $this->client->run(sprintf('DROP INDEX ON :%s(%s)', 'Question', 'field_id'));\n } catch (Neo4jException $e) {\n if (strpos($e->getMessage(), 'Index belongs to constraint') === false) {\n throw $e;\n }\n\n // If the property already belongs to a constraint, then the index\n // has been already been dropped and should not be dropped again.\n // As such one may ignore this exception.\n }\n\n $this->client->run(sprintf(\n 'CREATE CONSTRAINT ON (n:%s) ASSERT n.%s IS UNIQUE',\n 'Question',\n 'field_id'\n ));\n }", "function delete()\n\t{\n\t\t$remove = parent::delete();\n\t\t// always call parent delete function first!!\n\t\tif (!$remove)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->deleteMetaData();\n\n\t\t// Delete all survey questions, constraints and materials\n\t\tforeach ($this->questions as $question_id)\n\t\t{\n\t\t\t$this->removeQuestion($question_id);\n\t\t}\n\t\t$this->deleteSurveyRecord();\n\t\t\n\t\tilUtil::delDir($this->getImportDirectory());\n\t\treturn true;\n\t}", "public function delete_question(){\n $question_id = $this->input->post('question_id');\n $challenge_id = $this->input->post('challenge_id');\n\n $question = new stdClass();\n\n if($this->questionlib->isSafeToDelete($question_id) === true){\n $question->question_id = $question_id;\n\n $this->question_model->delete($question);\n $this->challenge_question_model->delete($challenge_id, $question_id);\n $out['deleted'] = true;\n }else{\n $out['message'] = \"Question have associate data, it can't be deleted\";\n }\n $this->output->set_output(json_encode($out));\n\n }", "function removeConstraint($constraintType, $columnName, $referencesTableName, $referencesColumnName) {\n foreach ($this->constraints as $key => $c) {\n if ($c->equals(new DbConstraint($constraintType, $columnName, $referencesTableName, $referencesColumnName))) {\n unset($this->constraints[$key]);\n }\n }\n }", "public function clearQuestionComments()\n\t{\n\t\t$this->collQuestionComments = null; // important to set this to NULL since that means it is uninitialized\n\t}", "function deleteQuestions(Query $q = null) {\n\t\treturn $this->deleteQuestionsRelatedByQuizId($q);\n\t}", "public function delete_question($session_key, $sid, $gid, $qid)\n\t{\n if ($this->_checkSessionKey($session_key))\n {\n\t\t\t$sid = sanitize_int($sid);\n\t\t\t$gid = sanitize_int($gid);\n\t\t\t$qid = sanitize_int($qid);\t\t\t\n\t\t\t$surveyidExists = Survey::model()->findByPk($sid);\n\t\t\tif (!isset($surveyidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid surveyid', 22);\n \t\t \n\t\t\t$groupidExists = Groups::model()->findByAttributes(array('gid' => $gid));\n\t\t\tif (!isset($groupidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid groupid', 22);\n\n\t\t\t$questionidExists = Questions::model()->findByAttributes(array('qid' => $qid));\n\t\t\tif (!isset($questionidExists))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid questionid', 22);\n\t\t\n\t\t\tif($surveyidExists['active']=='Y')\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Survey is active and not editable', 35);\t\n\t\t\t\t\t\t\t\n if (hasSurveyPermission($sid, 'surveycontent', 'delete'))\n {\n\t\t\t\t$ccresult = Conditions::model()->findAllByAttributes(array('cqid' => $qid));\n\t\t\t\tif(count($ccresult)>0)\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Cannot delete Question. There are conditions for other questions that rely on this question ', 37);\n\t\t\t\t\n\t\t\t\t$row = Questions::model()->findByAttributes(array('qid' => $qid))->attributes;\n\t\t\t\tif ($row['gid']!=$gid)\n\t\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Missmatch in groupid and questionid', 21);\t\n\n\t\t\t\tLimeExpressionManager::RevertUpgradeConditionsToRelevance(NULL,$qid);\n\n Conditions::model()->deleteAllByAttributes(array('qid' => $qid));\n Question_attributes::model()->deleteAllByAttributes(array('qid' => $qid));\n Answers::model()->deleteAllByAttributes(array('qid' => $qid));\n\n $criteria = new CDbCriteria;\n $criteria->addCondition('qid = :qid or parent_qid = :qid');\n $criteria->params[':qid'] = $qid;\n Questions::model()->deleteAll($criteria);\n\n Defaultvalues::model()->deleteAllByAttributes(array('qid' => $qid));\n Quota_members::model()->deleteAllByAttributes(array('qid' => $qid));\n Questions::updateSortOrder($gid, $sid);\n \n return \"Deleted \".$qid;\n }\n else\n throw new Zend_XmlRpc_Server_Exception('No permission', 2);\n }\t\t\n\t}", "protected function confirmRemoveQuestions()\n\t{\n\t\tglobal $ilCtrl;\n\t\t\n\t\t// gather ids\n\t\t$ids = array();\n\t\tforeach ($_POST as $key => $value)\n\t\t{\n\t\t\tif (preg_match(\"/id_(\\d+)/\", $key, $matches))\n\t\t\t{\n\t\t\t\tarray_push($ids, $matches[1]);\n\t\t\t}\n\t\t}\n\n\n\t\t$pages = $this->object->getSurveyPages();\n\t\t$source = $pages[$this->current_page-1];\n\n\t\t$block_id = $source;\n\t\t$block_id = array_shift($block_id);\n\t\t$block_id = $block_id[\"questionblock_id\"];\n\n\t\tif(sizeof($ids) && sizeof($source) > sizeof($ids))\n\t\t{\n\t\t\t// block is obsolete\n\t\t\tif(sizeof($source)-sizeof($ids) == 1)\n\t\t\t{\n\t\t\t\t$this->object->unfoldQuestionblocks(array($block_id));\n\t\t\t}\n\t\t\t// block will remain, remove question(s) from block\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach($ids as $qid)\n\t\t\t\t{\n\t\t\t\t\t$this->object->removeQuestionFromBlock($qid, $block_id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->object->removeQuestions($ids, array());\n\t\t}\n\t\t// all items on page \n\t\telse \n\t\t{\n\t\t\t// remove complete block\n\t\t\tif($block_id)\n\t\t\t{\n\t\t\t\t$this->object->removeQuestions(array(), array($block_id));\n\t\t\t}\n\t\t\t// remove single question\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->object->removeQuestions($ids, array());\n\t\t\t}\n\n\t\t\t// render previous page\n\t\t\tif($this->current_page > 1)\n\t\t\t{\n\t\t\t\t$this->current_page--;\n\t\t\t}\n\t\t}\n\n\t\t$this->object->saveCompletionStatus();\n\t\t\t\n\t\t// #10567\n\t\t$ilCtrl->setParameter($this, \"pgov\", $this->current_page);\n\t\t$ilCtrl->redirect($this, \"renderPage\");\n\t}", "function pubf_DeleteSingleAnswer(){\n //delete all relations from table actividadrespuesta\n $DeleteSingleAnswer=$this->prepare(\"DELETE FROM actividadrespuesta WHERE idRespuesta = :idRespuesta\");\n $DeleteSingleAnswer->bindParam(':idRespuesta' , $this->idRespuesta);\n $this->executeQueryPrepare($DeleteSingleAnswer);\n $DeleteRelatedAnswer=$this->prepare(\"DELETE FROM respuesta WHERE idRespuesta = :idRespuesta\");\n $DeleteRelatedAnswer->bindParam(':idRespuesta' , $this->idRespuesta);\n $this->executeQueryPrepare($DeleteRelatedAnswer);\n }", "function removeQuestion($question_id)\n\t{\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t$question =& $this->_instanciateQuestion($question_id);\n\t\t$question->delete($question_id);\n\t\t$this->removeConstraintsConcerningQuestion($question_id);\n\t}" ]
[ "0.7881212", "0.67480516", "0.62292206", "0.6099111", "0.6098317", "0.59233725", "0.5878233", "0.5873267", "0.58533317", "0.5787125", "0.5772609", "0.57714754", "0.575713", "0.5745757", "0.5728653", "0.5721524", "0.568195", "0.563303", "0.563303", "0.563303", "0.5614375", "0.5576407", "0.55514383", "0.5540593", "0.5482696", "0.5481633", "0.54771465", "0.5468818", "0.544794", "0.5434789" ]
0.8023022
0
Sets the obligatory states for questions in a survey from the questions form
function setObligatoryStates($obligatory_questions) { global $ilDB; $result = $ilDB->queryF("SELECT * FROM svy_svy_qst WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); if ($result->numRows()) { while ($row = $ilDB->fetchAssoc($result)) { if (!array_key_exists($row["question_fi"], $obligatory_questions)) { $obligatory_questions[$row["question_fi"]] = 0; } } } // set the obligatory states in the database $affectedRows = $ilDB->manipulateF("DELETE FROM svy_qst_oblig WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); // set the obligatory states in the database foreach ($obligatory_questions as $question_fi => $obligatory) { $next_id = $ilDB->nextId('svy_qst_oblig'); $affectedRows = $ilDB->manipulateF("INSERT INTO svy_qst_oblig (question_obligatory_id, survey_fi, question_fi, " . "obligatory, tstamp) VALUES (%s, %s, %s, %s, %s)", array('integer','integer','integer','text','integer'), array($next_id, $this->getSurveyId(), $question_fi, (strlen($obligatory)) ? $obligatory : 0, time()) ); // #12420 $ilDB->manipulate("UPDATE svy_question". " SET obligatory = ".$ilDB->quote($obligatory, "integer"). " WHERE question_id = ".$ilDB->quote($question_fi, "integer")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _set_fields()\n {\n @$this->form_data->survey_id = 0;\n $this->form_data->survey_title = '';\n $this->form_data->survey_description = '';\n $this->form_data->survey_status = 'open';\n $this->form_data->survey_anms = 'yes';\n $this->form_data->survey_expiry_date = '';\n $this->form_data->question_ids = array();\n\n $this->form_data->filter_survey_title = '';\n $this->form_data->filter_status = '';\n }", "public function set_data($question) {\n /* accessing the form in this way is probably not correct style */\n $wronganswers = $this->get_wrong_answers($question);\n /* this gets manipulated by javascript */\n $settingsdata = $this->get_itemsettings($question);\n $this->_form->getElement('itemsettings')->setValue($settingsdata);\n $this->_form->getElement('wronganswers')->setValue(array('text' => $wronganswers));\n parent::set_data($question);\n }", "private function _set_fields()\n {\n @$this->form_data->question_id = 0;\n\n $this->form_data->category_id = 0;\n $this->form_data->sub_category_id = 0;\n $this->form_data->sub_two_category_id = 0;\n $this->form_data->sub_three_category_id = 0;\n $this->form_data->sub_four_category_id = 0;\n\n $this->form_data->ques_text = '';\n $this->form_data->survey_weight = '';\n $this->form_data->ques_type = '';\n $this->form_data->qus_fixed = 0;\n $this->form_data->ques_expiry_date = '';\n\n\n $this->form_data->filter_question = '';\n $this->form_data->filter_category = 0;\n $this->form_data->filter_type = '';\n $this->form_data->filter_expired = '';\n }", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "public function testUpdateSurveyQuestionChoice0()\n {\n }", "function ipal_make_student_form(){\r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\tglobal $USER;\r\n\tglobal $course;\r\n\t$disabled='';\r\n\t\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t\r\n\tif($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t\t$question=$DB->get_record('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t\t$qid=$question->question_id;\r\n\t\t$myFormArray= ipal_get_questions_student($qid);\r\n//\t\t$disabled=ipal_check_if_answered($USER->id,$myFormArray[0]['id'],$ipal_quiz->quiz_id,$course->id,$ipal->id);\r\n\t\techo \"<br><br><br>\";\r\n\t\techo \"<form action=\\\"?\".$_SERVER['QUERY_STRING'].\"\\\" method=\\\"post\\\">\\n\"; \r\n\t\techo $myFormArray[0]['question'];\r\n\t\techo \"<br>\";\r\n\t\tif(ipal_get_qtype($qid) == 'essay'){\r\n\t\t\techo \"<INPUT TYPE=\\\"text\\\" NAME=\\\"a_text\\\" >\\n<br />\";\r\n\t\t\techo \"<INPUT TYPE=hidden NAME=\\\"answer_id\\\" value=\\\"-1\\\">\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach($myFormArray[0]['answers'] as $k=>$v){\r\n\t\t\techo \"<input type=\\\"radio\\\" name=\\\"answer_id\\\" value=\\\"$k\\\" \".$disabled.\"/> \".strip_tags($v).\"<br />\\n\";\r\n//\t\t\techo \"<br>\";\r\n\t\t\t}\r\n\t\t\techo \"<INPUT TYPE=hidden NAME=a_text VALUE=\\\" \\\">\";\r\n\t\t}\r\n\techo \"<INPUT TYPE=hidden NAME=question_id VALUE=\\\"\".$myFormArray[0]['id'].\"\\\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=active_question_id VALUE=\\\"$question->id\\\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=course_id VALUE=\\\"$course->id\\\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=user_id VALUE=\\\"$USER->id\\\">\";\r\n\techo \"<INPUT TYPE=submit NAME=submit VALUE=\\\"Submit\\\" \".$disabled.\">\";\r\n\techo \"<INPUT TYPE=hidden NAME=ipal_id VALUE=\\\"$ipal->id\\\">\";\r\n echo \"<INPUT TYPE=hidden NAME=instructor VALUE=\\\"\".findInstructor($course->id).\"\\\">\";\r\n\techo \"</form>\";\r\n\t}else{\r\n\techo \"<br><br>No Current Question.\";}\r\n}", "function answerQuestions() {\n $this->layout = 'survey'; // use the more basic survey layout\n if (!$this->request->is('post')) {\n // if there is no data then show the initial view\n $survey = $this->Session->read('Survey.original'); // get the survey being used\n if (empty($survey['Question'])) { // if there are no questions then we don't need to show the question form at all\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n $questions = $survey['Question'];\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // check to see if there are already answers in the session\n $choices = array(); // gather choices here keyed to each question id\n foreach ($questions as &$q) { // go through each question and look to see if there is an answer for it\n $checkId = $q['id'];\n $choices[$checkId] = array();\n if (isset($q['Choice'])) {\n foreach ($q['Choice'] as $choice) {\n $choices[$checkId][$choice['id']] = $choice['value'];\n }\n }\n foreach ($answers as $a) {\n if ($a['question_id'] == $checkId) {\n if ($q['type'] == MULTI_SELECT) {\n $q['answer'] = Set::extract('/id',$a['answer']);\n } else {\n $q['answer'] = $a['answer'];\n }\n break;\n }\n }\n }\n $this->set('questions', $questions); // send questions to the view\n $this->set('choices', $choices); // send choices for questions to the view, ordered for form elements\n } else { // we have form data so process it here\n if (isset($this->request->data['Answer'])) {\n // make sure we have answers in the data set\n $this->Session->write('Survey.answers', $this->request->data['Answer']); // write the answers to the session\n }\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n }", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function changeQuestionAndAnswers () {\n global $ilUser, $tpl, $ilTabs, $ilCtrl;\n $ilTabs->activateTab(\"editQuiz\");\n\n // update database\n // create wizard object\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n $wiz->changeQuestionAndAnswers($this->object);\n\n $_GET['question_id'] = $_POST['question_id'];\n $this->initQuestionAndAnswersEditForm();\n\n // load changed data and display them\n }", "function setCorrectAnswers($a_correct_answers)\n\t{\n\t\t$this->correctanswers = $a_correct_answers;\n\t}", "public function testUpdateSurveyQuestion0()\n {\n }", "public function testUpdateSurveyQuestion0()\n {\n }", "function game_get_question_states(&$questions, $cmoptions, $attempt, $lastattemptid = false) {\n global $DB, $QTYPES;\n\n // get the question ids\n $ids = array_keys( $questions);\n $questionlist = implode(',', $ids);\n\n $statefields = 'questionid as question, manualcomment, score as grade';\n\n $sql = \"SELECT $statefields\".\n \" FROM {game_questions} \".\n \" WHERE attemptid = '$attempt->id'\".\n \" AND questionid IN ($questionlist)\";\n $states = $DB->get_records_sql($sql);\n\t\n // loop through all questions and set the last_graded states\n foreach ($ids as $i) {\t\n\t\t// Create the empty question type specific information\n if (!$QTYPES[$questions[$i]->qtype]->create_session_and_responses(\n\t\t\t$questions[$i], $states[$i], $cmoptions, $attempt)) {\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$states[$i]->last_graded = clone($states[$i]);\n }\n return $states;\n}", "function &getObligatoryStates()\n\t{\n\t\tglobal $ilDB;\n\t\t$obligatory_states = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_qst_oblig WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$obligatory_states[$row[\"question_fi\"]] = $row[\"obligatory\"];\n\t\t\t}\n\t\t}\n\t\treturn $obligatory_states;\n\t}", "function question_dataset_dependent_definitions_form($submiturl, $question){\n global $QTYPES;\n $this->question = $question;\n $this->qtypeobj =& $QTYPES[$this->question->qtype];\n parent::moodleform($submiturl);\n }", "function kilman_prep_for_questionform($kilman, $qid, $qtype) {\n $context = context_module::instance($kilman->cm->id);\n if ($qid != 0) {\n $question = clone($kilman->questions[$qid]);\n $question->qid = $question->id;\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n $qid, array('subdirs' => true), $question->content);\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n\n if (isset($question->dependencies)) {\n foreach ($question->dependencies as $dependencies) {\n if ($dependencies->dependandor === \"and\") {\n $question->dependquestions_and[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_and[] = $dependencies->dependlogic;\n } else if ($dependencies->dependandor === \"or\") {\n $question->dependquestions_or[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_or[] = $dependencies->dependlogic;\n }\n }\n }\n } else {\n $question = \\mod_kilman\\question\\base::question_builder($qtype);\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $question->type_id = $qtype;\n $question->type = '';\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n null, array('subdirs' => true), '');\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n }\n return $question;\n}", "public function set_questions (array $questions) {\n $this->questions = $questions;\n }", "public function testCreateSurveyQuestionChoice0()\n {\n }", "public function testCreateSurveyQuestionChoice0()\n {\n }", "public function GetFormPostedValuesQuestions() {\n\t\t/* THE ARRAY OF POSTED FIELDS */\n\t\t$req_fields=array(\"survey_id\",\"question\");\n\n\t\tfor ($i=0;$i<count($req_fields);$i++) {\n\n\t\t\t//echo $_POST['application_id'];\n\t\t\tif (ISSET($_POST[$req_fields[$i]]) && !EMPTY($_POST[$req_fields[$i]])) {\n\t\t\t\t$this->SetVariable($req_fields[$i],EscapeData($_POST[$req_fields[$i]]));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//echo \"<br>\".$this->req_fields[$i].\"<br>\";\n\t\t\t\t$this->$req_fields[$i]=\"\";\n\t\t\t}\n\t\t}\n\t}", "function save_session_and_responses(&$question, &$state) {\n // field.\n // The serialized format for multiple choice quetsions\n // is (optionally) a comma separated list of answer ids\n // followed by a colon, followed by another comma separated\n // list of answer ids, which are the radio/checkboxes that were\n // ticked.\n // E.g. 1,3,2,4:2,4 means that the answers were shown in the order\n // 1, 3, 2 and then 4 and the answers 2 and 4 were checked.\n\n $tempVal = $state->responses;\n $tempAnswers = array();\n $tempOrder = $state->options->order;\n $tempOrder = array_flip($tempOrder);\n\n /*\n foreach($tempOrder as $key=>$value) {\n if (!array_key_exists($key, $tempVal)) {\n $state->responses[$key] = '';\n }\n }\n */\n ksort($state->responses);\n\n // t3lib_div::debug($state->options->order, '$state->options->order');\n // t3lib_div::debug($state->responses, '$state->responses');\n $responses = implode(',', $state->options->order) . ':';\n $responses .= implode(',', $state->responses);\n // t3lib_div::debug($responses, '$responses2');\n // Set the legacy answer field\n if (!set_field('question_states', 'answer', $responses, 'id', $state->id)) {\n return false;\n }\n return true;\n }", "public function initQuestionAndAnswersEditForm () {\n global $tpl, $ilCtrl;\n\n $my_tpl = new ilTemplate(\"tpl.question_and_answers.html\", true, true,\n \"Customizing/global/plugins/Services/Repository/RepositoryObject/MobileQuiz\");\n $rtokenFactory = new ilCtrl();\n $my_tpl->setVariable(\"ACTION_URL\",$this->ctrl->getFormAction($this));\n $my_tpl->setVariable(\"SUBMIT_BUTTON\", $this->txt(\"save\"));\n $my_tpl->setVariable(\"NEW_QUESTION\", $this->txt(\"question_add_head\"));\n $my_tpl->setVariable(\"QUESTION\", $this->txt(\"question_add_text\"));\n $my_tpl->setVariable(\"QUESTION_TYPE\", $this->txt(\"question_add_type\"));\n $my_tpl->setVariable(\"CHOICES\", $this->txt(\"choice_add_texts\"));\n $my_tpl->setVariable(\"MINIMUM\", $this->txt(\"choice_add_numeric_minimum\"));\n $my_tpl->setVariable(\"MAXIMUM\", $this->txt(\"choice_add_numeric_maximum\"));\n $my_tpl->setVariable(\"STEP\", $this->txt(\"choice_add_numeric_steprange\"));\n $my_tpl->setVariable(\"CORRECT_VALUE\", $this->txt(\"choice_add_numeric_correctvalue\"));\n $my_tpl->setVariable(\"TOLERANCE_RANGE\", $this->txt(\"choice_add_numeric_tolerenace_range\"));\n $my_tpl->setVariable(\"VAR_1\", \"value1\");\n $my_tpl->setVariable(\"COMMAND\", \"cmd[changeQuestionAndAnswers]\");\n $my_tpl->setVariable(\"HIDE_QUESTION_TYPE\", 'style=\"display:none;\"');\n \n $my_tpl->setVariable(\"DELETE\", $this->txt(\"choice_delete\"));\n $my_tpl->setVariable(\"DELETE_INFO\", $this->txt(\"choice_delete_info\"));\n $my_tpl->setVariable(\"MOVE_UP\", $this->txt(\"choice_up\"));\n $my_tpl->setVariable(\"MOVE_UP_INFO\", $this->txt(\"choice_up_info\"));\n $my_tpl->setVariable(\"MOVE_DOWN\", $this->txt(\"choice_down\"));\n $my_tpl->setVariable(\"MOVE_DOWN_INFO\", $this->txt(\"choice_down_info\"));\n \n \n // refill fields\n include_once('class.ilObjMobileQuizWizard.php');\n $wiz = new ilObjMobileQuizWizard();\n $wiz -> loadAnswerAndQuestions($_GET['question_id'],$my_tpl, $this->object);\n\n $html = $my_tpl->get();\n $tpl->setContent($html);\n\n $this->ctrl->clearParameters($this);\n }", "private function reset() {\n\t\t$this->conditions = array();\n\t\t$this->setFormByConditions();\n\t}", "private function setRequirements()\n {\n if (! $this->iataClassification == self::IATA_NONE) {\n $this->setBatteryDecRequired();\n }\n\n // Set the appropriate sticker for chemistry\n if ($this->isLiIonClass()) {\n $this->setStickerLiIonRequired();\n } else if ($this->isLiMetalClass()) {\n $this->setStickerLimetalRequired();\n }\n\n // Lithium metal batteries on their own require additional stickers\n if ($this->isLiMetalOnlyClass()) {\n $this->setStickerForbiddenRequired();\n $this->setStickerCargoOnlyRequired();\n }\n\n // Large batteries require class 9 hazard stickers\n if ($this->isHazardClass()) {\n $this->setStickerHazardRequired();\n }\n }", "function recommends_req_wizard_verification($form, &$form_state) {\n \n $output_info = array(\n 'prefix' => $form_state['prefix'],\n 'firstname' => $form_state['firstname'],\n 'lastname' => $form_state['lastname'],\n 'initial' => $form_state['initial'],\n 'suffix' => $form_state['suffix'],\n 's_email' => $form_state['s_email'],\n 's_school' => $form_state['s_school'],\n 's_req_date' => $form_state['s_req_date'],\n 's_master_doc' => $form_state['s_master_doc'],\n 's_comments' => $form_state['s_comments'],\n \t);\n \t\n \t $email_values = array(\n 'email' => $form_state['s_email'],\n 'message' => \"\\n\" . \"\\n\" .\n \"Name Prefix: \" . $output_info['prefix'] . \"\\n\" .\n \"First Name: \" . $output_info['firstname'] . \"\\n\" .\n \"Initial: \" . $output_info['initial'] . \"\\n\" .\n \"Last Name: \" . $output_info['lastname'] . \"\\n\" .\n \"Name Suffix: \" . $output_info['suffix'] . \"\\n\" .\n \"Student Email: \" . $output_info['s_email'] . \"\\n\" .\n \"Statement of intent, Point of view : \" . \"\\n\" . $output_info['s_comments'] . \"\\n\"\n );\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n\t\t\n\t\t$output_schools[$i] = array(\n \t'r_email'=> $form_state['s_email'],\n \t'num_schools'=> $form_state['num_schools'],\n \t'r_school'=> $form_state['schoolname'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t'r_program'=> $form_state['schoolprogram'][$i],\n \t 'r_school_contact_email' => $form_state['r_school_contact_email'][$i],\n \t 'r_school_contact_postal' => $form_state['r_school_contact_postal'][$i],\n \t'r_school_contact'=> $form_state['r_school_contact_postal'][$i],\n \t'r_date_due_month' => $form_state['r_date_due'][$i]['month'],\n 'r_date_due_day' => $form_state['r_date_due'][$i]['day'],\n 'r_date_due_year' => $form_state['r_date_due'][$i]['year'],\n \t'r_status'=> \"Initial\",\n\t\t\n \t);\n }\n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Schools to receive recommendation.\" . \"\\n\\n\";\n \n $school_values = array(array());\n \n for ($i = 1; $i <= $output_schools[1]['num_schools']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . $output_schools[$i]['r_school'] . \"\\n\" .\n \t\"School Program/Position: \" .\n \t\n \t$output_schools[$i]['r_program'] . \"\\n\" .\n \t\"School contact postal: \" .\n \t$output_schools[$i]['r_school_contact_postal'] . \"\\n\" . \n \t\"School contact email: \" .\n \t$output_schools[$i]['r_school_contact_email'] . \"\\n\" . \t\n \t\"Final Date required by school: \" . \n \t$output_schools[$i]['r_date_due_month'] . \"/\" . \n \t$output_schools[$i]['r_date_due_day'] . \"/\" . \n \t$output_schools[$i]['r_date_due_year'] . \"\\n\\n\";\n \n };\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n\t\t\n\t\t$pid = $form_state['input']['crsname'][$i]['i_pid'];\n\t\t\n\t\t$output_courses[$i] = array(\n \t'c_email' => $form_state['s_email'],\n \t'num_courses' => $form_state['num_courses'],\n \t'c_course' => $form_state['coursenum'][$i],\n \t'c_semester' => $form_state['coursesemester'][$i],\n \t'c_year' => $form_state['courseyear'][$i],\n \t'c_other' => $form_state['courseother'][$i],\n \t);\n \t\n }\n \n $email_values['message'] = $email_values['message'] .\n \"\\n\" . \"Courses in which enrolled with the professor.\" . \"\\n\";\n \n $course_values = array(array());\n \n for ($i = 1; $i <= $output_courses[1]['num_courses']; $i++) {\t\n \t\n \t$email_values['message'] = $email_values['message'] . \n \t\"\\n\" . \"Course: \" .\n \t\n \t$output_courses[$i]['c_course'] . \" \" .\n \t\"Semester: \" . \n \t$output_courses[$i]['c_semester'] .\n \t\" Year: \" . \n \t$output_courses[$i]['c_year'] . \"\\n\\n\" . $output_courses[$i]['c_other'] ;\n \n }; \n \n \n $msg = \"Please review the following information that you entered. Press Finish to send the information or cancel to abort the operation\";\n drupal_set_message('<pre id=rqmsgsize>' . print_r($msg, TRUE) . print_r($email_values['message'], TRUE) . '</pre>');\n \n // We will have many fields with the same name, so we need to be able to\n // access the form hierarchically.\n $form['#tree'] = TRUE;\n\n $form['description'] = array(\n '#type' => 'item',\n );\n\n if (empty($form_state['num_courses'])) {\n $form_state['num_courses'] = 1;\n }\n\n \n\n // Adds \"Add another course\" button\n $form['add_course'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('recommends_req_intro'),\n );\n\n\n return $form;\n}", "function _setupForm(){\n\n //Defines the call back function for HTML Quickform to use when validating the form.\n $this->form->addFormRule(array(&$this,'XINValidate'));\n\n // display test name\n $this->form->addElement('header', 'instrument_title', \"Radiology Review Form\");\n\n // automatically adds examiner & date of administration\n $this->_addMetadataFields();\n\n $yes_no_option= array(NULL=>\"\", \"no\"=>\"No\", \"yes\"=>\"Yes\", \"not_answered\"=>\"Not Answered\");\n \t$normal_option= array(NULL=>\"\", \"normal\"=>\"Normal\",\"abnormal\"=>\"Abnormal\", \"atypical\"=>\"Atypical\", \"not_answered\"=>\"Not Answered\");\n \t$exclusionaryOrNot = array(NULL=>\"\", \"exclusionary\"=>\"Exclusionary\", \"non_exclusionary\"=>\"Non-Exclusionary\", \"not_answered\"=>\"Not Answered\");\n\n $this->form->addElement('header', null, '3D T1 MP-Rage');\n $this->form->addElement('select', 'Scan_done', 'Was an MRI performed?', $yes_no_option);\n \t$this->form->addElement('static', null, 'If Yes?'); \n\n \t//These date fields were first not added to $this->dateTimeFields so they weren't saving.\n// $this->form->addElement('date', 'MRI_date', 'Date of MRI acquisition');\n//\t $this->form->addElement('date', 'Review_date', 'Date of local radiology review');\n\n $this->addDateElement('MRI', 'Date of MRI acquisition');\n $this->XINRegisterRule(\"MRI_date\", array(\"Scan_done{@}=={@}yes\"), \"Please enter the scan information\", \"MRI_date_group\");\n $this->addDateElement('Review', 'Date of local radiology review');\n $this->XINRegisterRule(\"Review_date\", array(\"Scan_done{@}=={@}yes\"), \"Please enter the scan information\", \"Review_date_group\");\n\n $this->form->addElement('select', 'Review_results', 'Results of local radiology review?', $normal_option);\n $this->XINRegisterRule(\"Review_results\", array(\"Scan_done{@}=={@}yes\"), \"Please enter the scan information\");\n\n $this->form->addElement('select', 'abnormal_atypical_exclusionary', $this->indent . \"If the results are ABNORMAL or ATYPICAL:\", $exclusionaryOrNot);\n $this->XINRegisterRule('abnormal_atypical_exclusionary', array('Review_results{@}=={@}abnormal|atypical'), \"Please indicate if the Abnormal or Atypical review is Exclusionary or Not.\");\n \n \t$this->form->addElement('static', null, $this->indent . $this->indent . 'If Abnormal or Atypical, describe incidental finding(s)'); \n// $this->form->addElement('textarea', 'Incidental_findings', 'Description of incidental findings:');\n $this->addTextAreaElement('Incidental_findings', $this->indent . $this->indent . 'Description of incidental findings:', array(\"Review_results{@}=={@}abnormal\"), \"Please describe the abnormality\");\n }", "function recommends_req_form_courses_callback($form, $form_state) {\n $entry = $form_state['entries'][$form_state['values']['i_pid']];\n // Setting the #value of items is the only way I was able to figure out\n // to get replaced defaults on these items. #default_value will not do it\n // and shouldn't.\n \n foreach (array('i_pid', 'i_course', 'i_semester', 'i_year', 'i_coursename', 'i_objective', 'i_grade_a', 'i_grade_b', 'i_grade_other', 'i_timestamp') as $item) {\n $form[$item]['#value'] = $entry->$item;\n }\n return $form;\n}", "public function SetFlaggedQuestions($flaggedQuestions)\n {\n $this->flaggedQuestions = $flaggedQuestions;\n }", "function surveyObject()\n\t{\n\t\t$form = $this->initTagsForm(\"survey\", \"saveSurveySettings\",\n\t\t\t\"advanced_editing_survey_settings\");\n\t\t\n\t\t$this->tpl->setContent($form->getHTML());\t\t\n\t}", "public function initQuestionOffensives()\n\t{\n\t\t$this->collQuestionOffensives = array();\n\t}" ]
[ "0.6337575", "0.61228806", "0.58547163", "0.5735297", "0.5735297", "0.5635384", "0.5628491", "0.55577195", "0.5529153", "0.5384287", "0.53805846", "0.53805846", "0.5334043", "0.5316992", "0.53063595", "0.5304815", "0.53028923", "0.5271887", "0.5271887", "0.52575123", "0.5250212", "0.5245621", "0.5233022", "0.52201813", "0.5211531", "0.52106994", "0.5206756", "0.5167544", "0.5163662", "0.51632106" ]
0.7669189
0
Gets specific obligatory states of the survey
function &getObligatoryStates() { global $ilDB; $obligatory_states = array(); $result = $ilDB->queryF("SELECT * FROM svy_qst_oblig WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); if ($result->numRows()) { while ($row = $ilDB->fetchAssoc($result)) { $obligatory_states[$row["question_fi"]] = $row["obligatory"]; } } return $obligatory_states; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setObligatoryStates($obligatory_questions)\n\t{\n\t\tglobal $ilDB;\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\tif (!array_key_exists($row[\"question_fi\"], $obligatory_questions))\n\t\t\t\t{\n\t\t\t\t\t$obligatory_questions[$row[\"question_fi\"]] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t // set the obligatory states in the database\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qst_oblig WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\n\t // set the obligatory states in the database\n\t\tforeach ($obligatory_questions as $question_fi => $obligatory)\n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_qst_oblig');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qst_oblig (question_obligatory_id, survey_fi, question_fi, \" .\n\t\t\t\t\"obligatory, tstamp) VALUES (%s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer','integer','integer','text','integer'),\n\t\t\t\tarray($next_id, $this->getSurveyId(), $question_fi, (strlen($obligatory)) ? $obligatory : 0, time())\n\t\t\t);\n\t\t\t\n\t\t\t// #12420\n\t\t\t$ilDB->manipulate(\"UPDATE svy_question\".\n\t\t\t\t\" SET obligatory = \".$ilDB->quote($obligatory, \"integer\").\n\t\t\t\t\" WHERE question_id = \".$ilDB->quote($question_fi, \"integer\"));\n\t\t}\n\t}", "function getOffStudyStatuses() {\n return array(self::ON_STUDY => self::ON_STUDY,\n self::COMPLETED => self::COMPLETED,\n self::OSINELIGIBLE => self::OSINELIGIBLE,\n self::WITHDRAWN => self::WITHDRAWN,\n self::LOST => self::LOST,\n self::ADVERSE_EVENTS => self::ADVERSE_EVENTS,\n self::OTHER => self::OTHER);\n }", "public function getConditions();", "public function getConditions();", "public function getConditions();", "public function GetState()\n\t{\n\t\treturn SPUtils::join_key_values_encode(\"=\", \"&\", array_intersect_key($this->__oauth, array_flip($this->include_in_state)));\n\t}", "public static function getStates()\n {\n /** @var Loyalty $module */\n $module = Module::getInstanceByName('loyalty');\n\n return [\n static::getDefaultId() => $module->getL('Awaiting validation'),\n static::getValidationId() => $module->getL('Available'),\n static::getCancelId() => $module->getL('Cancelled'),\n static::getConvertId() => $module->getL('Already converted'),\n ];\n }", "function game_get_question_states(&$questions, $cmoptions, $attempt, $lastattemptid = false) {\n global $DB, $QTYPES;\n\n // get the question ids\n $ids = array_keys( $questions);\n $questionlist = implode(',', $ids);\n\n $statefields = 'questionid as question, manualcomment, score as grade';\n\n $sql = \"SELECT $statefields\".\n \" FROM {game_questions} \".\n \" WHERE attemptid = '$attempt->id'\".\n \" AND questionid IN ($questionlist)\";\n $states = $DB->get_records_sql($sql);\n\t\n // loop through all questions and set the last_graded states\n foreach ($ids as $i) {\t\n\t\t// Create the empty question type specific information\n if (!$QTYPES[$questions[$i]->qtype]->create_session_and_responses(\n\t\t\t$questions[$i], $states[$i], $cmoptions, $attempt)) {\n\t\t\t\treturn false;\n\t\t}\n\n\t\t$states[$i]->last_graded = clone($states[$i]);\n }\n return $states;\n}", "public function getStates() {\n return $this->createQuery()\n ->select(\"DISTINCT c.state\")\n ->from(\"Companies_Model_Company c\")\n ->whereIn(\"c.status\", Companies_Model_Company::getActiveStatuses())\n ->andWhere(\"c.local_business\")\n ->orderBy(\"c.state ASC\")\n ->execute(array(), Doctrine_Core::HYDRATE_SCALAR);\n }", "public static function getStates()\n {\n return self::$statesUSA;\n }", "public static function getStates() {\n $db = Zend_Registry::get('dbAdapterReadOnly');\n $select = $db->select()\n ->from(array('ps' => 'printer_states'))\n ->order('ps.id');\n\n return $db->fetchAll($select);\n }", "public function chosen()\n\t{\n\t\treturn $this->responses()->whereEquals('state', 1);\n\t}", "public function getStatesProperty()\n {\n return State::where('name', 'LIKE', \"%{$this->searchTerm}%\")\n ->whereNotIn('id', $this->selectedStates)\n ->whereCountryId($this->country)->get();\n }", "public function getStates(): StateSet;", "public function getStates() {\n return $this->state;\n }", "public function getReviewstate() {}", "public static function availableStates()\n {\n return array(\n self::STATUS_CLOSED,\n self::STATUS_MODERATED,\n self::STATUS_PUBLISHED,\n self::STATUS_VALIDATED\n );\n }", "public function getQuestionStatuses()\n {\n return \\NDP\\Question\\Model\\Question\\Status::getOptionArray();\n }", "public function getInDoorInterests()\r\n {\r\n return $this->_inDoorInterests;\r\n }", "public function getInDoorInterests()\r\n {\r\n return $this->_inDoorInterests;\r\n }", "public function states()\n\t{\n\t\t$states = State::all();\n\t\treturn StudentResource::collection($states);\n\t}", "public static function active(): array {\n\n // Find the states we don't want.\n $rejection_states_text_ids = [\n 'reject_journal_title',\n 'reject_init_review',\n 'reject_bm_review',\n 'reject_full_review',\n 'full_end',\n ];\n $storage = \\Drupal::entityTypeManager()->getStorage('taxonomy_term');\n $query = $storage->getQuery()->accessCheck(FALSE);\n $query->condition('vid', 'states');\n $query->condition('field_text_id', $rejection_states_text_ids, 'IN');\n $rejection_state_ids = $query->execute();\n\n // Find the decisions we don't want.\n $unwanted_decisions = [\n 'Not cited',\n 'Cited (citation only)',\n 'Cited (legacy)',\n 'Text approved',\n ];\n $query = $storage->getQuery()->accessCheck(FALSE);\n $query->condition('vid', 'board_decisions');\n $query->condition('name', $unwanted_decisions, 'IN');\n $unwanted_decision_ids = $query->execute();\n\n // Create the query.\n $query = \\Drupal::database()->select('ebms_article', 'article');\n $query->addField('article', 'id');\n $query->addExpression('CONVERT(article.source_id, UNSIGNED INTEGER)', 'pmid');\n $query->join('ebms_state', 'state', 'state.article = article.id');\n $query->condition('state.current', 1);\n $query->condition('state.value', $rejection_state_ids, 'NOT IN');\n $query->join('taxonomy_term__field_text_id', 'state_text_id', 'state_text_id.entity_id = state.value');\n $query->leftJoin('ebms_state__decisions', 'state_decisions', 'state_decisions.entity_id = state.id');\n $group = $query->orConditionGroup()\n ->condition('state_decisions.decisions_decision', $unwanted_decision_ids, 'NOT IN')\n ->isNull('state_decisions.decisions_decision');\n $query->condition($group);\n $query->orderBy('pmid');\n $active = [];\n foreach ($query->execute() as $row) {\n $active[$row->id] = $row->pmid;\n }\n return $active;\n }", "protected function get_conditions( ) {\n// to decode all conditions. To learn more about weather condition codes, visit section\n// 12.6.8 - Present Weather Group of the Federal Meteorological Handbook No. 1 at\n// www.nws.noaa.gov/oso/oso1/oso12/fmh1/fmh1ch12.htm\n if (preg_match('#^(-|\\+|VC)?(NSW|TS|SH|FZ|BL|DR|MI|BC|PR|RA|DZ|SN|SG|GR|GS|PE|IC|UP|BR|FG|FU|VA|DU|SA|HZ|PY|PO|SQ|FC|SS|DS|WS//)+$#',$this->current_group_text,$pieces)) {\n $this->varConcatenate($this->wxInfo['ITEMS'][$this->tend],'CODE_CONDITIONS', $this->current_group_text);\n if (!isset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'])) {\n//$this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = '';\n $join = '';\n }\n else {\n $join = ', ';\n }\n if (substr($this->current_group_text,0,1) == '-') {\n $prefix = $this->get_i18nCondition('-');\n $this->current_group_text = substr($this->current_group_text,1);\n }\n elseif (substr($this->current_group_text,0,1) == '+') {\n $prefix = $this->get_i18nCondition('+');\n $this->current_group_text = substr($this->current_group_text,1);\n }\n else $prefix = ''; // moderate conditions have no descriptor\n while ($code = substr($this->current_group_text,0,2)) {\n if (!isset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'])) {\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = '';\n }\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] .= $join . $this->get_i18nCondition($code) . ' ';\n $this->current_group_text = substr($this->current_group_text,2);\n }\n if (strlen($prefix)>0) {\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] .= $prefix ;\n }\n $this->current_ptr++;\n }\n else {\n if (isset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'])) {\n//$this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = '';\n $this->wxInfo['ITEMS'][$this->tend]['CONDITIONS'] = trim($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS']);\n if ($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS']=='') unset($this->wxInfo['ITEMS'][$this->tend]['CONDITIONS']);\n }\n $this->current_group++;\n }\n }", "function getstates() {\n\t\t$sql = Processwire\\wire('database')->prepare(\"SELECT abbreviation as state, name FROM states\");\n\t\t$sql->execute();\n\t\treturn $sql->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function getStates() {\n\t\t$statement = $this->database->prepare(\"SELECT * FROM tbl_state\");\n\t\t$statement->execute();\n\t\t$results = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n\t\treturn $results ? $results : false;\n\t}", "public function &getConditions() {\n return $this->conditions;\n }", "function quiz_get_newgraded_states($attemptidssql, $idxattemptq = true, $fields='qs.*'){\n global $CFG, $DB;\n if ($attemptidssql && is_array($attemptidssql)){\n list($usql, $params) = $DB->get_in_or_equal($attemptidssql);\n $gradedstatesql = \"SELECT $fields FROM \" .\n \"{question_sessions} qns, \" .\n \"{question_states} qs \" .\n \"WHERE qns.attemptid $usql AND \" .\n \"qns.newest = qs.id\";\n $gradedstates = $DB->get_records_sql($gradedstatesql, $params);\n } else if ($attemptidssql && is_object($attemptidssql)){\n $gradedstatesql = \"SELECT $fields FROM \" .\n $attemptidssql->from.\",\".\n \"{question_sessions} qns, \" .\n \"{question_states} qs \" .\n \"WHERE qns.attemptid = qa.uniqueid AND \" .\n $attemptidssql->where.\" AND \".\n \"qns.newest = qs.id\";\n $gradedstates = $DB->get_records_sql($gradedstatesql, $attemptidssql->params);\n } else {\n return array();\n }\n if ($idxattemptq){\n return quiz_report_index_by_keys($gradedstates, array('attempt', 'question'));\n } else {\n return $gradedstates;\n }\n}", "public function state_full()\r\n {\r\n\r\n // $address = new PiplApi_Address(array('country' => 'US', 'state' => 'CO'));\r\n // print $address->state; // Outputs \"CO\"\r\n // print $address->state_full(); // Outputs \"Colorado\"\r\n\r\n if ($this->is_valid_state())\r\n {\r\n return PiplApi_Utils::$piplapi_states[strtoupper($this->country)][strtoupper($this->state)];\r\n }\r\n return;\r\n }", "abstract public function states();", "function getSurveyFilter() {\n if (!empty ($this->selectSurvey)) {\n if ( in_array( self::JOIN_TABLE, $this->checkTables ) ) {\n return sprintf (\"%s.surveyID = %s \", self::getTableAlias( self::JOIN_TABLE ), $this->selectSurvey);\n }\n else if ( in_array( 'Detection', $this->checkTables ) ) {\n return sprintf (\"%s.surveyID = %s \", self::getTableAlias( 'Detection' ), $this->selectSurvey);\n }\n else if ( in_array( 'DetectionOrphan', $this->checkTables ) ) {\n return sprintf (\"%s.surveyID = %s \", self::getTableAlias( 'DetectionOrphan' ), $this->selectSurvey);\n }\n }\n return;\n }" ]
[ "0.6290752", "0.58042216", "0.5729389", "0.5729389", "0.5729389", "0.55378246", "0.553542", "0.5507895", "0.5455487", "0.53993696", "0.5362926", "0.5317281", "0.528784", "0.5274955", "0.5249336", "0.52271587", "0.5225755", "0.5221843", "0.5209202", "0.5209202", "0.5159135", "0.51459384", "0.514135", "0.51189137", "0.50892615", "0.5084785", "0.5083415", "0.5079824", "0.5069504", "0.50629205" ]
0.7765785
0
Returns the survey pages in an array (a page contains one or more questions)
function &getSurveyPages() { global $ilDB; $obligatory_states =& $this->getObligatoryStates(); // get questionblocks $all_questions = array(); $result = $ilDB->queryF("SELECT svy_question.*, svy_qtype.type_tag, svy_svy_qst.heading FROM " . "svy_question, svy_qtype, svy_svy_qst WHERE svy_svy_qst.survey_fi = %s AND " . "svy_svy_qst.question_fi = svy_question.question_id AND svy_question.questiontype_fi = svy_qtype.questiontype_id ". "ORDER BY svy_svy_qst.sequence", array('integer'), array($this->getSurveyId()) ); while ($row = $ilDB->fetchAssoc($result)) { $all_questions[$row["question_id"]] = $row; } // get all questionblocks $questionblocks = array(); if (count($all_questions)) { $result = $ilDB->queryF("SELECT svy_qblk.*, svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst ". "WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND svy_qblk_qst.survey_fi = %s ". "AND " . $ilDB->in('svy_qblk_qst.question_fi', array_keys($all_questions), false, 'integer'), array('integer'), array($this->getSurveyId()) ); while ($row = $ilDB->fetchAssoc($result)) { $questionblocks[$row['question_fi']] = $row; } } $all_pages = array(); $pageindex = -1; $currentblock = ""; foreach ($all_questions as $question_id => $row) { if (array_key_exists($question_id, $obligatory_states)) { $all_questions[$question_id]["obligatory"] = $obligatory_states[$question_id]; } $constraints = array(); if (isset($questionblocks[$question_id])) { if (!$currentblock or ($currentblock != $questionblocks[$question_id]['questionblock_id'])) { $pageindex++; } $all_questions[$question_id]['page'] = $pageindex; $all_questions[$question_id]["questionblock_title"] = $questionblocks[$question_id]['title']; $all_questions[$question_id]["questionblock_id"] = $questionblocks[$question_id]['questionblock_id']; $all_questions[$question_id]["questionblock_show_questiontext"] = $questionblocks[$question_id]['show_questiontext']; $all_questions[$question_id]["questionblock_show_blocktitle"] = $questionblocks[$question_id]['show_blocktitle']; $currentblock = $questionblocks[$question_id]['questionblock_id']; $constraints = $this->getConstraints($question_id); $all_questions[$question_id]["constraints"] = $constraints; } else { $pageindex++; $all_questions[$question_id]['page'] = $pageindex; $all_questions[$question_id]["questionblock_title"] = ""; $all_questions[$question_id]["questionblock_id"] = ""; $all_questions[$question_id]["questionblock_show_questiontext"] = 1; $all_questions[$question_id]["questionblock_show_blocktitle"] = 1; $currentblock = ""; $constraints = $this->getConstraints($question_id); $all_questions[$question_id]["constraints"] = $constraints; } if (!isset($all_pages[$pageindex])) { $all_pages[$pageindex] = array(); } array_push($all_pages[$pageindex], $all_questions[$question_id]); } // calculate position percentage for every page $max = count($all_pages); $counter = 1; foreach ($all_pages as $index => $block) { foreach ($block as $blockindex => $question) { $all_pages[$index][$blockindex]["position"] = $counter / $max; } $counter++; } return $all_pages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ipal_get_questions(){ \r\n \r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\tglobal $CFG;\r\n\t$q='';\t\r\n\t$pagearray2=array();\r\n\t // is there an quiz associated with an ipal?\r\n//\t$ipal_quiz=$DB->get_record('ipal_quiz',array('ipal_id'=>$ipal->id));\r\n\t\r\n\t// get quiz and put it into an array\r\n\t$quiz=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\t\r\n\t//Get the question ids\r\n\t$questions=explode(\",\",$quiz->questions);\r\n\t\r\n\t//get the questions and stuff them into an array\r\n\t\tforeach($questions as $q){\t\r\n\t\t\t\r\n\t\t $aquestions=$DB->get_record('question',array('id'=>$q));\r\n\t\t if(isset($aquestions->questiontext)){\r\n\t\t $pagearray2[]=array('id'=>$q, 'question'=>strip_tags($aquestions->questiontext), 'answers'=>ipal_get_answers($q));\r\n\t\t\t\t \r\n\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t}\r\n \r\n\treturn($pagearray2);\r\n\t}", "function ipal_get_questions_student($qid){\r\n\r\n global $ipal;\r\n global $DB;\r\n global $CFG;\r\n\t\t$q='';\r\n\t\t$pagearray2=array();\r\n\t\t\r\n $aquestions=$DB->get_record('question',array('id'=>$qid));\r\n\t\t\tif($aquestions->questiontext != \"\"){ \r\n\r\n\t$pagearray2[]=array('id'=>$qid, 'question'=>$aquestions->questiontext, 'answers'=>ipal_get_answers_student($qid));\r\n\t\t\t\t\t\t\t}\r\n return($pagearray2);\r\n}", "public static function getPages(): ?array\n {\n return collect(Filament::getPages())\n ->filter(function ($page) {\n if (Utils::isGeneralExcludeEnabled()) {\n return ! in_array(Str::afterLast($page, '\\\\'), Utils::getExcludedPages());\n }\n\n return true;\n })\n ->reduce(function ($pages, $page) {\n $prepend = Str::of(Utils::getPagePermissionPrefix())->append('_');\n $name = Str::of(class_basename($page))\n ->prepend($prepend);\n\n $pages[\"{$name}\"] = \"{$name}\";\n\n return $pages;\n }, collect())\n ->toArray();\n }", "public function getPages() {\r\n\t$pages = array();\r\n\tforeach ($this->pages as $key => $page) {\r\n\t $page = $this->getPage($key);\r\n\t if ($page != FALSE)\r\n\t\t$pages[$key] = $page;\r\n\t}\r\n\treturn $pages;\r\n }", "public function getPages()\n {\n $types = Page::all();\n $values = [];\n foreach ($types as $key) {\n $values[] = $key->page;\n }\n return $values;\n }", "public function getPages();", "function surveyPageFields(\\Plugin\\Project $project, $fieldList, $form_name, $question_section)\n{\n $page = 1;\n // Field counter\n $i = 1;\n // Create empty array\n $pageFields = array();\n $firstField = $project->getFirstFieldName();\n $metaData = $project->getMetadata();\n\n // Loop through all form fields and designate fields to page based on location of section headers\n foreach ($fieldList as $field_name)\n {\n $fieldMeta = $metaData->getField($field_name);\n // Do not include record identifier field nor form status field (since they are not shown on survey)\n if ($field_name == $firstField || $field_name == $form_name.\"_complete\") continue;\n // If field has a section header, then increment the page number (ONLY for surveys that have paging enabled)\n if ($question_section && $fieldMeta->getElementPrecedingHeader() != \"\" && $i != 1) $page++;\n // Add field to array\n $pageFields[$page][$i] = $field_name;\n // Increment field count\n $i++;\n }\n // Return array\n return array($pageFields, count($pageFields));\n}", "function getPages() {\n\t\t$sql = 'SELECT * FROM page WHERE vis = 1 ORDER BY psn';\n\t\t$qrh = mysqli_query($this->lnk, $sql);\n\t\t$i = 1;\n\t\t\n\t\t// iterate and extract data to be passed to view\n\t\twhile ( $res = mysqli_fetch_array($qrh)) {\n\t\t\t$results[] = array('id' => $res['id'],'name' => $res['nam']);\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\treturn $results;\n\t\t\n\t}", "public function getPages()\n {\n list($page_id, $scope_pages, $scope_page_type) = array(\n $this['page_id'],\n $this['scope']['pages'],\n $this['scope']['page_type']\n );\n\n $result_pages = array();\n\n if ($scope_pages == 'this') {\n /**\n * Only current page\n */\n $result_pages[] = $page_id;\n } elseif (in_array($scope_pages, array('descendants', 'children'))) {\n /**\n * All descendants\n */\n $finder = fx::data('content')->descendantsOf($page_id);\n if ($scope_page_type) {\n $finder->where('type', $scope_page_type);\n }\n $result_pages = array_merge($result_pages, $finder->all()->getValues('id'));\n /**\n * With self page\n */\n if ($scope_pages == 'descendants') {\n $result_pages[] = $page_id;\n }\n }\n return array_unique($result_pages);\n }", "public function getSurveys() {\n $surveys = array();\n $jsonData = $this->getDataFromDataFolder();\n foreach($jsonData as $surveyData) {\n $surveys[] = $this->serializer->deserialize(\n json_encode($surveyData->survey), Survey::class, 'json'\n );\n }\n $surveys = array_unique($surveys, SORT_REGULAR);\n return $surveys;\n }", "public function get_pages()\n\t{\n\t\treturn $this->_EE->db->select(array('heading', 'short_name'))\n\t\t\t ->get('exp_dd_doc_sections')\n\t\t\t ->result_array();\n\t}", "public function getPages() {}", "final public function getPages(): array\n {\n return $this->pages;\n }", "public function getSurveys() {\n return $this->_request(\n \"surveys/\"\n );\n }", "public function getPages() : array\n {\n return $this->pages;\n }", "public function getPageResults(int $page = 1): array;", "public function getQuestions()\n {\n $title = \"Questions\";\n $subtitle = \"Here you will find all the questions!\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n // Get all the questions\n $questions = $this->di->get(\"questionModel\")->getQuestions();\n\n // Get number of answers\n $answers = [];\n foreach ($questions as $question) {\n $ans = $this->di->get(\"answerModel\")->getAnswersWhere(\"questionId\", $question->id);\n $answers[$question->id] = count($ans);\n }\n\n $data = [\n \"questions\" => $questions,\n \"subtitle\" => $subtitle,\n \"noOfAnswers\" => $answers,\n ];\n\n $view->add(\"pages/questions\", $data);\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function getPagination($questions)\n {\n $req = $this->di->get(\"request\");\n $page = intval($req->getGet(\"p\", 1));\n $length = intval($req->getGet(\"l\", 0)) ?: 5;\n $last = intval(ceil(count($questions) / $length));\n $start = $page <= 1 ? 1 : $page - 1;\n $end = $page >= $last ? $last : $page + 1;\n\n return [\n \"page\" => $page,\n \"offset\" => ($page - 1) * $length,\n \"length\" => $length,\n \"last\" => $last,\n \"start\" => $start,\n \"end\" => $end,\n ];\n }", "public function getPages()\n {\n return $this->getTable('ExhibitPage')->findBy(array('exhibit' => $this->id, 'sort_field' => 'order'));\n }", "public function questions($survey = \"\")\n {\n\n $surveyPrefix = \"\";\n $surveyData = $this->survey_model->getSurveyPrefix($survey);\n $data[\"valid_survey\"] = true;\n $data[\"show_questions\"] = true;\n $data[\"survey_errors\"] = false;\n\n // check if the provided slug was valid\n if($surveyData != null) {\n\n // populate survery information\n $surveyPrefix = $surveyData->prefix;\n $data[\"survey_title\"] = $surveyData->title;\n $data[\"survey_subtitle\"] = $surveyData->subtitle;\n }\n else {\n $data[\"valid_survey\"] = false; // display error\n }\n\n // check if the survey was submitted\n if($_SERVER['REQUEST_METHOD'] == 'POST' && $data[\"valid_survey\"]) {\n $result = $this->survey_model->validateSubmission($surveyPrefix);\n if(array_key_exists(\"errors\", $result)) {\n $data[\"errors\"] = $result[\"errors\"];\n $data[\"survey_errors\"] = true;\n }\n else {\n $data[\"show_questions\"] = false;\n }\n }\n\n // check if the user specified a valid survey\n if(!empty($surveyPrefix)) {\n\n $data[\"questions\"] = $this->survey_model->getSurveyData($surveyPrefix);\n ($data[\"questions\"] === null) ? $data[\"valid_survey\"] = false: \"\";\n }\n\n $data[\"active_surveys\"] = \"\";\n $this->load->view('templates/survey/header', $data);\n $this->load->view('templates/survey/nav');\n $this->load->view('templates/survey/survey', $data);\n $this->load->view('templates/survey/footer');\n }", "public function get(): array\n\t{\n\t\t$roundedNumber = $this->count();\n\t\t$page = 1;\n\t\t\n\t\t$arrayPage = array();\n\t\t\n\t\tfor ($i = 0; $i < $roundedNumber; $i++) {\n\t\t\t$arrayPage[] = $page;\n\t\t\t$page++;\n\t\t}\n\t\treturn $arrayPage;\n\t}", "public function toArray() \n {\n\t return $this->page_array;\n\t}", "function getPages() {\r\n\tglobal $S;\r\n\tif (!is_array($S->arbo)) {\r\n\t\trequire_once('../lib/class/class_arbo.php');\r\n\t\t$S =& new ARBO();\r\n\t\t$S->fields = array('id', 'pid', 'type_id', 'titre_fr');\r\n\t\t$S->buildArbo();\r\n\t}\r\n\t$options = array();\r\n\tforeach($S->arbo as $rid=>$tmp) {\r\n\t\t$options[urlencode($S->arbo[$rid]['url'])] = $S->arbo[$rid]['titre_fr'].' (#'.$rid.')';\r\n\t}\r\n\treturn $options;\r\n}", "function workspace_getPages($workspaces) {\n\tglobal $Auth;\n\t## multiclient\n\t$client_id = $Auth->auth[\"client_id\"];\n\n\t$db_connection = new DB_Sql();\n\t\n\t\n\t## prepare the query\n\t$query = '';\n\tforeach($workspaces as $current_workspace) {\n\t\tif($query=='') {\n\t\t\t$query .= \"workspace_id='\".$current_workspace.\"'\";\n\t\t} else {\n\t\t\t$query .= \" OR workspace_id='\".$current_workspace.\"'\";\n\t\t}\n\t}\t\n\t\n\t## now do the actually query\n\t$query = \"SELECT DISTINCT(workspace_item) FROM \".DB_PREFIX.\"workspace_item WHERE client_id='$client_id' AND (\".$query.\")\";\n\t$result_pointer = $db_connection->query($query);\n\n\t$results = array();\n\twhile($db_connection->next_record()) {\t\n\t\t$results[] = $db_connection->Record[\"workspace_item\"];\t\n\t}\n\treturn $results;\t\n}", "public function getPages()\n\t{\n\t\treturn $this->getOptionData('tl_page');\n\t}", "public function __invoke(): Collection|array\n {\n return Survey::all();\n }", "function get_survey_questions($survey_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated survey answers\r\n $sql = \"SELECT id\r\n FROM questions\r\n WHERE is_active = '1' AND survey = '$survey_id';\";\r\n\r\n $questions_data = array();\r\n $questions = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $questions_data[$key] = $value;\r\n foreach ($questions_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $questions[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $questions;\r\n}", "public function getChildPages(): array\n {\n return $this->childPages;\n }", "public function getPage(): array\n {\n $postIdList = $this->getPostIdList();\n $postRepository = new PostRepository();\n $postsArray= $postRepository->getByIds($postIdList);\n foreach ($postsArray as $post)\n $post->picLinkMin = picHandler::getMin($post->pic_link);\n\n return $postsArray;\n }", "function survey_data() {\n $surveys = array();\n foreach ( $this->sites as $name => $blog ) {\n $this->println(sprintf(\"Surveying Blog #%s: %s.\", $blog->id, $blog->name));\n $survey = $this->survey_site($blog->id);\n $surveys[$blog->name] = $survey;\n }\n\n // Compile meta survey.\n $posts = array();\n $site_counts = array();\n $meta_survey = array(\n 'posts' => 0,\n 'media-images' => 0,\n 'media-images-sans-alt' => 0,\n 'embedded-images' => 0,\n 'embedded-images-sans-alt' => 0,\n 'embedded-images-sans-media' => 0,\n 'embedded-images-external' => 0\n );\n foreach ( $surveys as $name => $survey ) {\n $posts += $survey['posts'];\n $counts = $survey['counts'];\n $meta_survey['posts'] += $counts['posts'];\n $meta_survey['media-images'] += $counts['media-images'];\n $meta_survey['media-images-sans-alt'] += $counts['media-images-sans-alt'];\n $meta_survey['embedded-images'] += $counts['embedded-images'];\n $meta_survey['embedded-images-sans-alt'] += $counts['embedded-images-sans-alt'];\n $meta_survey['embedded-images-sans-media'] += $counts['embedded-images-sans-media'];\n $site_counts[$name] = $counts;\n }\n\n // Count non-uploaded images\n foreach ( $posts as $post ) {\n $meta_survey['embedded-images-external'] += count($post->external_embedded_images());\n }\n\n $report_f = <<<EOB\nSITES:\n%s\n\nMETA:\n%s\nEOB;\n return sprintf($report_f, print_r($site_counts, 1), print_r($meta_survey, 1));\n }" ]
[ "0.6715821", "0.634927", "0.62863326", "0.6253571", "0.62053716", "0.6192171", "0.61818564", "0.61721593", "0.6106592", "0.6055463", "0.60480917", "0.59566444", "0.594176", "0.59143597", "0.59123755", "0.5898344", "0.58709574", "0.5858872", "0.5824961", "0.5787953", "0.57629585", "0.57485664", "0.5743989", "0.56694597", "0.5651095", "0.56496197", "0.56304574", "0.56274074", "0.560477", "0.5550257" ]
0.7121661
0
Returns the available question pools for the active user
function &getAvailableQuestionpools($use_obj_id = false, $could_be_offline = false, $showPath = FALSE, $permission = "read") { include_once "./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php"; return ilObjSurveyQuestionPool::_getAvailableQuestionpools($use_obj_id, $could_be_offline, $showPath, $permission); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function &getQuestionpoolTitles($could_be_offline = FALSE, $showPath = FALSE) \n\t{\n\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.ilObjSurveyQuestionPool.php\";\n\t\treturn ilObjSurveyQuestionPool::_getAvailableQuestionpools($use_object_id = TRUE, $could_be_offline, $showPath);\n\t}", "public function getPools()\r\n\t{\r\n\t\treturn $this->pools;\r\n\t}", "public function getPools()\n\t{\n\t\t$pools = array();\n\t\t$result = '';\n\t\t\n\t\tswitch( $this->db_link->getDriver() )\n\t\t{\n\t\t\tcase 'sqlite':\n\t\t\tcase 'mysql':\n\t\t\t\t$query \t\t= \"SELECT name, numvols, poolid FROM Pool\";\n\t\t\tbreak;\n\t\t\tcase 'pgsql':\n\t\t\t\t$query \t\t= \"SELECT name, numvols, poolid FROM pool\";\n\t\t\tbreak;\n\t\t}\n\n\t\t$result = $this->db_link->runQuery($query);\n\t\tforeach( $result->fetchAll() as $pool )\n\t\t\t$pools[] = $pool;\n\n\t\treturn $pools;\n\t}", "public function getPoolSize();", "function getPools() {\n\n include_once 'pool.php';\n\n $result = new pool();\n $authenticate = $result->getPools();\n\n // checking if bookings have been gotten from database\n if (!$authenticate) {\n echo \"Error getting pool data\";\n return;\n }\n\n $row = $result->fetch();\n if (!$row) {\n echo \"unable to get pool data\";\n return;\n } else {\n\t\t\techo '{\"result\":1,\"pool\":[';\n\t\t\twhile ($row) {\n\t\t\t\techo json_encode($row);\n\t\t\t\t$row = $result->fetch();\n\t\t\t\t\tif ($row) {\n\t\t\t\t\t\techo ',';\n\t\t\t\t\t}\n\t\t\t}\n\t\t\techo ']}';\n\t\t\t\t// echo $row['user_username'];\n\t\t\t\t// $row = $result->fetch();\n\t\t\t}\n }", "function getAssignedQuestions($user_id){\n\n\t$results = DB::query(\"SELECT question_id \n\t\t\t\t\t\t\tFROM question_has_experts \n\t\t\t\t\t\t\tWHERE user_id = \" . $user_id . \" \");\n\n\n\tif (DB::count() === 0){\n\t\techo 'Query returned no results';\n\t}\n\n\treturn $results;\n\n\n}", "function get_available_by_user_surveys($user_id) {\r\n // get available by time\r\n $available_by_time_surveys = array();\r\n if (get_available_by_time_surveys()) {\r\n $available_by_time_surveys = get_available_by_time_surveys();\r\n }\r\n\r\n // get user groups\r\n $user_staff_groups = get_user_staff_groups($user_id);\r\n $user_student_groups = get_user_student_groups($user_id);\r\n $user_local_groups = get_user_local_groups($user_id);\r\n\r\n // set available_by_user_surveys\r\n $available_by_user_surveys = array();\r\n foreach ($available_by_time_surveys as $survey_id) {\r\n // check whether is already voted\r\n // get survey groups\r\n $survey_staff_groups = get_survey_staff_groups($survey_id);\r\n $survey_student_groups = get_survey_student_groups($survey_id);\r\n $survey_local_groups = get_survey_local_groups($survey_id);\r\n\r\n // get common groups\r\n $staff_groups = array_intersect($user_staff_groups, $survey_staff_groups);\r\n $student_groups = array_intersect($user_student_groups, $survey_student_groups);\r\n $local_groups = array_intersect($user_local_groups, $survey_local_groups);\r\n\r\n // get all available surveys\r\n if (!empty($staff_groups) || !empty($student_groups) || !empty($local_groups)) {\r\n array_push($available_by_user_surveys, $survey_id);\r\n }\r\n }\r\n\r\n return $available_by_user_surveys;\r\n}", "public function getAvailableSites();", "private function getUserResources()\n {\n $result = array();\n $userdata = $this->get('security.context')->getToken()->getUser();\n $groups = $userdata->getUserGroups()->toArray();\n foreach ($groups as $grp) {\n $resources = $grp->getResources();\n foreach ($resources as $res) {\n $result[$res->getId()] = $res->getName();\n }\n }\n\n return $result;\n }", "public function getAvailableTasks();", "function &getAvailableAnswers()\n\t{\n\t\t$available_answers = array();\n\t\tforeach ($this->answers as $answer)\n\t\t{\n\t\t\tarray_push($available_answers, $answer->getAnswertext());\n\t\t}\n\t\treturn $available_answers;\n\t}", "private function _Questions ( ) {\n\t\t$Config = $this->Get ( 'Config' );\n\t\t$quests = $Config['questions'];\n\t\t$groups = $Config['question_groups'];\n\t\tforeach ( $groups as $g => $group ) {\n\t\t\t$Groups[$group] = new stdClass();\n\t\t\t$Groups[$group]->Label = $Config['question_group_labels'][$g];\n\t\t\tforeach ( $quests as $q => $quest ) {\n\t\t\t\tif ( $Config['question_group'][$q] != $g ) continue;\n\t\t\t\t$Groups[$group]->Questions[$quest] = new stdClass();\n\t\t\t\t$Groups[$group]->Questions[$quest]->Label = $Config['question_labels'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Type = $Config['question_types'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Field = $Config['question_fields'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Social = $Config['question_social'][$q];\n\t\t\t\t$Groups[$group]->Questions[$quest]->Display = $Config['question_display'][$q];\n\t\t\t\tif ( $Config['question_options'][$q] )\n\t\t\t\t\t$Groups[$group]->Questions[$quest]->Options = explode ( '|', $Config['question_options'][$q] );\n\t\t\t}\n\t\t\tksort ( $Groups[$group]->Questions );\n\t\t}\n\t\tksort ( $Groups );\n\t\treturn ( $Groups );\n\t}", "public function getAvailablePackages() {}", "public function getRandomAvailableNumberProviders(){\n\n return [\n [[1,2,3,4],[5,6,7,8,9]],\n [[1,1,2,2],[3,4,5,6,7,8,9]],\n [[1,2,3,4,5,6,7,8],[9]],\n [[], [1,2,3,4,5,6,7,8,9]],\n ];\n }", "function available() {\n if(empty($this->pool)) {\n JError::raiseError(404, JText::_('No pool nor default pool specified'));\n }\n }", "public function getAllUserAvailableSurveys(){\n // $takenSurveys = \\App\\TakenSurvey::where('user_id', \\Auth::user()->id);\n $result = \\DB::table('surveys')->\n whereRaw('id not in (select distinct survey_id from taken_surveys where user_id = ?)', [\\Auth::user()->id])->get();\n // $surveys = \\App\\Survey::\n\n // dd($result);\n echo $result;\n }", "public function getRecommendedResources()\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $interestIds = DB::table('user_interest')\n ->select('interest_id')\n ->where('user_id', $currentUser['id'])->get();\n $userInterestIds = collect($interestIds)->pluck('interest_id')->all();\n $recommendedResources = $this->resourceRepository->fetchRecommendedResources();\n\n return $recommendedResources;\n }", "public function getSalespersonAllQuestions() {\n return $this->_salespersonDatasource->getSalespersonAllQuestions();\n }", "public function userChoices()\n {\n return R::findAll('choice');\n }", "public function getQuestionsAnswered($user_id)\n\t{\n\t\t$list = Yii::app()->db->createCommand(\n\t\t\t'select a.user_answer,DATE_FORMAT(a.date_created,\\'%m/%d/%Y\\') as date_created,\n\t\t\tq.content,qc.content as choice,c.display_name as category\n\t\t\tfrom answer a join question q on q.question_id=a.question_id \n\t\t\tleft join question_choice qc on a.question_choice_id = qc.question_choice_id \n\t\t\tleft join category_question cg on cg.question_id = a.question_id \n\t\t\tleft join category c on cg.category_id=c.category_id and a.user_id= :user_id\n\t\t\tand a.is_active = 1')->\n\t\t\tbindValues(array(\n\t\t\t\t':user_id'=>Yii::app()->user->id,\n\t\t\t))->queryAll();\n\t\t\treturn $list;\n\t}", "public function getQuestions()\n {\n return DB::table('questionbank_quizzes')\n ->where('quize_id','=',$this->id)\n ->orderBy('subject_id')\n ->get();\n }", "static function getAvailableUserInstances() {\n return array(new Administrator(), new Member());\n }", "private function questionList()\n {\n \t$requiredQuestions = [];\n\n \tfor ($x = 1; $x <= count($this->questions); $x++) {\n \t\t$requiredQuestions[ config('constants.questionInputPrefix') . $x] = 'required';\n \t}\n\n \treturn $requiredQuestions;\n }", "public function availablePlans()\n {\n return Spark::teamPlans();\n }", "public function displayQuestions() {\n $listQuestions = array();\n $sql = 'SELECT `id`, `question`, `picture` FROM `' . self::PREFIX . 'question`';\n $result = $this->db->query($sql);\n $listQuestions = $result->fetchAll(PDO::FETCH_OBJ);\n return $listQuestions;\n }", "public function getAvailableWorkspaces() {}", "private function _getUPGroups()\n\t{\n\t\ttry{\n\t\t\t$preferences = trim(Factory::service(\"UserPreference\")->getOption(Core::getUser(), self::PREFERENCE_PARAM_NAME));\n\t\t\t$return = ($preferences === '' ? array() : json_decode($preferences,true));\n\t\t\treturn $return;\n\t\t}\n\t\tcatch(Exception $ex){\n\t\t\treturn array();\n\t\t}\n\t}", "public function getAllPolls()\n {\n $pollz = $this->em\n ->getRepository('NkgPollBundle:Poll')\n ->findAll();\n\n return $pollz;\n }", "public function questionnaires()\n {\n return $this->morphedByMany(Questionnaire::class, 'model', 'authorizables')\n ->withPivot('user_id')\n ->withTimestamps();\n }", "function get_qoptions($qid){\n\n\tglobal $dbc;\n\t$sql = $dbc->query(\"select * from questionoptions where qid = '$qid' \");\n\t// $rows[]=\"\";\n\twhile($row = $sql->fetch_array()){\n\t\t$rows[] = $row;\n\t}\n\treturn $rows;\n}" ]
[ "0.64823866", "0.6334974", "0.61729574", "0.57729745", "0.5689585", "0.5673255", "0.56548464", "0.5453457", "0.5433869", "0.5419453", "0.5415845", "0.5324766", "0.53116727", "0.5295904", "0.5282456", "0.52791405", "0.5264242", "0.5259273", "0.52269673", "0.51680255", "0.5146646", "0.51385564", "0.5123324", "0.5096857", "0.50967366", "0.50854295", "0.5073191", "0.50529206", "0.5047159", "0.5043019" ]
0.71549195
0
Returns a precondition with a given id
function getPrecondition($id) { global $ilDB; $result_array = array(); $result = $ilDB->queryF("SELECT svy_constraint.*, svy_relation.*, svy_qst_constraint.question_fi ref_question_fi FROM svy_qst_constraint, svy_constraint, ". "svy_relation WHERE svy_constraint.relation_fi = svy_relation.relation_id AND ". "svy_qst_constraint.constraint_fi = svy_constraint.constraint_id AND svy_constraint.constraint_id = %s", array('integer'), array($id) ); $pc = array(); if ($result->numRows()) { $pc = $ilDB->fetchAssoc($result); } return $pc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function requireById($id);", "public static function load($id) {\n global $DB;\n\n if ($id) {\n $useand = $DB->get_field('ddtaquiz_condition', 'useand', array('id' => $id), MUST_EXIST);\n\n $parts = $DB->get_records('ddtaquiz_condition_part', array('conditionid' => $id));\n $partobjs = array_map(function($part) {\n return new condition_part($part->id, $part->type, $part->on_qinstance, $part->grade);\n },\n array_values($parts));\n } else {\n $partobjs = array();\n $useand = true;\n }\n return new condition($id, $partobjs, $useand);\n }", "function getRecruitmentContractMission($id)\n\t\t{\n\t\t\t$query = \"SELECT * from Recruitment WHERE contract_mission_id='\".$id.\"'\";\n\t\t\tif(($result = $this->getQuery($query,true))!=NULL)\n\t\t\t\treturn $result;\n\t\t\telse\n\t\t\t\treturn NULL;\n\t\t}", "private function getQuestion($id){\n $q = new Question();\n return $q->find($id);\n }", "public function checkCorrectProject($id)\n {\n return $this->getProject($id);\n }", "function GetID($ConditionString);", "public function getCheckById($id) {\n foreach (static::getChecks() as $check) {\n if ($check->id() == $id) {\n return $check;\n }\n }\n\n return NULL;\n }", "public function getConstraint($param);", "public function get_by_id($id) {\n $this->db->select('*');\n $this->db->from(\"violations\");\n $this->db->where('id', $id);\n\n $query = $this->db->get();\n\n return $query->row();\n }", "function get_by_id_question($id)\n {\n $this->db->where('tfselect_tfque_fk', $id);\n $query = $this->db->get('fis_dtraining_feedback_selections');\n return $query->result();\n }", "public function getById(RequisitionId $id)\n {\n }", "public function getQuestionById($id){\n\n $this->db->where('q_id', $id);\n $query = $this->db->get('question');\n return $query->row();\n }", "function exeGetMandatoryContriEdit($id) {\n if($this->uri->segment(1) == 'mandatory' || $this->uri->segment(1) == 'overtime' || $this->uri->segment(1) == 'absences' || $this->uri->segment(1) == 'report') {\n $where = \" WHERE a.user_id = \".$this->db->escape($id).\" \";\n } else {\n $where = \" WHERE a.id = \".$this->db->escape($id).\" \";\n }\n $exeGetMandatoryContriEdit = $this->db->query(\"SELECT *\n FROM emp_contributions a\n LEFT JOIN employees b\n ON a.user_id = b.user_id\n LEFT JOIN employee_details c\n ON c.user_id = b.user_id\n $where \");\n \n if($exeGetMandatoryContriEdit->num_rows() > 0) {\n return $exeGetMandatoryContriEdit->result_array();\n } else {\n return false;\n }\n }", "function cicleinscription_get_status_prematriculation($status_prematriculationid){\n\tglobal $DB;\n\treturn $DB->get_record('ci_status_prematriculation', array('id' => $status_prematriculationid));\n}", "public static function Load($intId) {\n\t\t\t// Use QuerySingle to Perform the Query\n\t\t\treturn StrategyQuestionConditional::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StrategyQuestionConditional()->Id, $intId)\n\t\t\t);\n\t\t}", "function get_purchase_request_by_id($db, $id)\n{\n\n\t$sql = 'SELECT * FROM purchase_requests where id='.$id;\n\t$st = $db->prepare($sql);\n\t$st->execute();\n\t$us = $st->fetchAll();\n\treturn $us[0];\n}", "public function check($id);", "function get_by_id($id)\n {\n $this->db->where($this->id, $id);\n $this->db->join('tbl_disciplines', 'tbl_items.id_disciplines = tbl_disciplines.id_discipline');\n $this->db->join('tbl_projects', 'tbl_items.id_projects = tbl_projects.id_project');\n return $this->db->get($this->table)->row();\n }", "public static function LoadById($intId, $objOptionalClauses = null) {\n\t\t\treturn StrategyQuestionConditional::QuerySingle(\n\t\t\t\tQQ::Equal(QQN::StrategyQuestionConditional()->Id, $intId)\n\t\t\t, $objOptionalClauses\n\t\t\t);\n\t\t}", "function getQuestion($id) { \n\ttry {\n\t\t$question = ORM::for_table('questions')->where('id', $id)->find_one();\n\t\tif (!$question) { \n\t\t\treturn 0;\n\t\t} else {\n\t\t\t$theQuestion = array();\n\t\t\t$theQuestion['id'] = $question->id;\n\t\t\t$theQuestion['text'] = $question->text;\n\t\t\t$theQuestion['answer1'] = $question->answer1;\n\t\t\t$theQuestion['answer2'] = $question->answer2;\n\t\t\t$theQuestion['vote_answer1'] = $question->vote_answer1;\n\t\t\t$theQuestion['vote_answer2'] = $question->vote_answer2;\n\t\t\treturn $theQuestion;\n\t\t}\n\t} catch (Exception $e) { \n\t\treturn 0;\n\t}\n}", "function get_claim($id)\n {\n return $this->db->get_where('claim', array('id' => $id))->row_array();\n }", "public function getQuestionById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Query set up\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_question', '*', \"id = {$id}\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}", "function getProject($id = 0)\n {\n $this->db->where('Id',$id);\n $sql = $this->db->get('projectdetails');\n return $sql->row();\n }", "static function GetValidProblemOfContest($contest_id) {\n\t\t$problemCreator = new NewProblemInContestTest();\n\t\t$problem_id = $problemCreator->testCreateValidProblem($contest_id);\n\n\t\treturn $problem_id;\n\t}", "public function get_project($id = 0)\n {\n if (!$id) {\n return false;\n }\n $query = 'SELECT * FROM '.$this->Tbl['cal_project'].' WHERE uid='.$this->uid.' AND id='.doubleval($id);\n $qh = $this->query($query);\n if (false === $qh || !is_object($qh)) {\n return false;\n }\n return $this->assoc($qh);\n }", "function get($id) {\r\n\t\treturn SurveyAnswerQuery::create()->findPk($id);\r\n\t}", "public function findOrThrowException($id);", "public function findOrThrowException($id);", "public function getPracticeTitleById($id){\r\n if (($practiceTest = Cache::read('getPracticeTitleById'.$id)) === false) {\r\n $practiceTest = $this->field('title', array('PracticeTest.id'=>$id));\r\n\r\n Cache::write('getPracticeTitleById'.$id, $practiceTest);\r\n }\r\n return $practiceTest;\r\n\r\n }", "public function planFind($id);" ]
[ "0.5939098", "0.5937577", "0.58155537", "0.576101", "0.564473", "0.5592406", "0.5533152", "0.5408247", "0.5360486", "0.5358488", "0.53553253", "0.53521174", "0.53162414", "0.5277123", "0.5262634", "0.52604336", "0.5240228", "0.52237964", "0.52147186", "0.5199423", "0.5197007", "0.5183832", "0.5183232", "0.51754725", "0.51727843", "0.5167557", "0.5165357", "0.5165357", "0.5154076", "0.51385355" ]
0.695928
0
Returns all variables of a question
function &getVariables($question_id) { global $ilDB; $result_array = array(); $result = $ilDB->queryF("SELECT svy_variable.*, svy_category.title FROM svy_variable LEFT JOIN ". "svy_category ON svy_variable.category_fi = svy_category.category_id WHERE svy_variable.question_fi = %s ". "ORDER BY svy_variable.sequence", array('integer'), array($question_id) ); while ($row = $ilDB->fetchObject($result)) { $result_array[$row->sequence] = $row; } return $result_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVariables()\n {\n \treturn isset($this->all['variables']) ? $this->all['variables'] : array();\n }", "protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}", "public function variables(): array;", "public function variables(): array;", "public function getAll(): array\n {\n return $this->variables;\n }", "public function getVariables(): Mailcode_Variables_Collection_Regular;", "public function getVars()\n {\n return $this->_variables;\n }", "public function vars()\n\t{\n\t\treturn $this->vars;\n\t}", "public function vars()\n {\n return $this->vars;\n }", "public function getVariables()\n {\n return $this->variables;\n }", "public function getVariables()\n {\n return $this->variables;\n }", "public function getVariables()\n {\n return $this->variables;\n }", "public function getGetVariables();", "public function getVars()\n\t{\n\t\treturn $this->vars;\n\t}", "public function getVars()\n {\n return $this->vars;\n }", "public function getVariables() {\n\t\treturn $this->variables;\n\t}", "public function getVariablesList() {\n return $this->_get(4);\n }", "public function getVars() {\r\n return $this->VARS;\r\n }", "public function getVars()\n {\n return $this->vars;\n }", "public function getVars()\n {\n return $this->vars;\n }", "public function getVariablesList() {\n return $this->_get(2);\n }", "public function getVars() {\n\t\treturn $this->vars;\n\t}", "public function getVars() {\n\t\treturn $this->vars;\n\t}", "public function getVars() : array {\n\n\t\t\treturn $this->variables;\n\t\t}", "public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }", "public function getVars() {\n return array();\n }", "function getVars() {\n return $this->vars;\n }", "public function getVariables ()\n {\n /**\n * Specification:\n * - itemkey used to identify variable in your other functions\n * - type text, textarea, yesno, password, hidden (type hidden are variables used by CE and are required)\n * - description description of the variable, displayed in ClientExec\n * - encryptable used to indicate the variable's value must be encrypted in the database\n */\n $variables = array(\n lang('Name') => array(\n 'type' => 'hidden',\n 'description' => lang('Used by ClientExec to display plugin. It must match the action function name(s).'),\n 'value' => 'InterWorx-CP'\n ),\n lang('Description') => array (\n 'type' => 'hidden',\n 'description' => lang('Description viewable by admin in server settings'),\n 'value' => lang('InterWorx-CP integration.')\n ),\n lang('Access Key') => array (\n 'type' => 'textarea',\n 'description' => lang('Access key used to authenticate to server.'),\n 'value' => '',\n 'encryptable' => true\n ),\n lang('Actions') => array (\n 'type' => 'hidden',\n 'description' => lang('Actions currently available for this plugin.'),\n 'value' => 'Create,Delete,Suspend,UnSuspend'\n )\n );\n\n return $variables;\n }", "public function GetVariables()\n {\n $variables = '';\n if(count($this->variables)) {\n $vlist = array();\n foreach($this->variables as $name => $value) {\n $var = $name;\n if(is_array($value)) {\n if(isset($value[0]) && isset($value[count($value)-1])) {\n $var .= '=[' . implode(',', $value) . ']';\n } else {\n $vs = array();\n foreach($value as $k => $v)\n if($k)\n $vs[] = \"$k:$v\";\n\n $var .= '={' . implode(',', $vs) . '}';\n }\n } elseif(!is_null($value)) {\n $var .= \"=$value\";\n }\n $vlist[] = $var;\n }\n $variables = \"var \" . implode(', ', $vlist) . \";\";\n }\n // comments can be stuck with the variables\n if(count($this->comments)) {\n foreach($this->comments as $c) {\n if(!is_string($c))\n $c = print_r($c, TRUE);\n $variables .= \"\\n// \" . str_replace(\"\\n\", \"\\n// \", $c);\n }\n }\n return $variables;\n }", "public function getGetVariables() {}" ]
[ "0.7224944", "0.69258636", "0.6840276", "0.6840276", "0.6829594", "0.67934245", "0.67915314", "0.67826504", "0.6745642", "0.67189676", "0.67189676", "0.67189676", "0.67025876", "0.66505307", "0.66306925", "0.6624924", "0.6614208", "0.6611479", "0.65822893", "0.65822893", "0.65743124", "0.6545022", "0.6545022", "0.6540218", "0.6537742", "0.65096366", "0.6458143", "0.6435663", "0.6433471", "0.64323443" ]
0.7451109
0
Adds a constraint to a question
public function addConstraintToQuestion($to_question_id, $constraint_id) { global $ilDB; $next_id = $ilDB->nextId('svy_qst_constraint'); $affectedRows = $ilDB->manipulateF("INSERT INTO svy_qst_constraint (question_constraint_id, survey_fi, question_fi, ". "constraint_fi) VALUES (%s, %s, %s, %s)", array('integer','integer','integer','integer'), array($next_id, $this->getSurveyId(), $to_question_id, $constraint_id) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addConstraint($constraint) {\n $this->constraint[] = $constraint;\n return $this;\n }", "public function addConstraint(WorkflowConstraintInterface $constraint)\n {\n $this->constraints[] = $constraint;\n }", "private function addQueryConstraint(\\TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Qom\\ConstraintInterface $constraint) {\r\n\t\t$this->queryConstraints[] = $constraint;\r\n\t}", "public function testAddConstraint()\n {\n $constraint = new MyConstraint();\n $same = $this->uut->addConstraint($constraint, $constraint);\n $this->assertSame($this->uut, $same);\n $this->assertEquals([$constraint, $constraint], $this->uut->getConstraints());\n }", "public function addConstraint($constraint, $message = null) {\n\t\tif (!is_callable($constraint)) {\n\t\t\tthrow new \\Exception('addConstraint must be callable');\n\t\t}\n\n\t\t$this->rules[$this->rule]['constraints'][] = [\n\t\t\t'test' => $constraint,\n\t\t\t'message' => $message\n\t\t];\n\n\t\treturn $this;\n\t}", "public function addConstraint(Constraint $constraint)\n {\n $this->constraints[] = $constraint;\n\n return $this;\n }", "public function addConstraints()\n {\n if (static::$constraints) {\n $this->query->where($this->ownerKey, '==', $this->child->{$this->foreignKey});\n }\n }", "public function addConstraints()\n {\n $this->setJoin ()->setWhere ();\n }", "public function addConstraint($tag, StylesheetConstraint $constraint)\n {\n $tag = (string) $tag;\n $constraint->setTag($tag);\n\n $this->constraints[] = $constraint;\n }", "public function addConstraints()\n {\n if (static::$constraints)\n {\n $this->query->where($this->foreignKey, '=', $this->getParentKey());\n\n $this->query->whereNotNull($this->foreignKey);\n\n $this->query->where($this->rootKey, '=', $this->getRootKey());\n\n $this->query->whereNotNull($this->rootKey);\n\n }\n }", "public function addConstraints(): void\n\t{\n\t\tif (static::$constraints) {\n\t\t\t$this->addEagerConstraints([$this->getParent()]);\n\t\t}\n\t}", "public function addConstraints( $attr, $constraints )\n {\n // Check 1: el atributo existe.\n if (!$this->hasAttribute($attr)) throw new Exception(\"Se intenta definir una restriccion en [\". get_class($this) .\"] para un atributo que no existe ($attr) \" . __FILE__ . \" \" . __LINE__);\n \n // Check 2: constraints debe ser un array.\n if (!is_array($constraints)) throw new Exception(\"El parametro 'constraints' debe ser un array \" . __FILE__ . \" \" . __LINE__);\n \n // TODO: CHECK 3: constraints debe ser un array de restricciones (subclases de Constraint).\n \n // Si ya hay constraints para ese atributo, no las redefine.\n // Deberia chequear por tipo de cosntraint tmb? asi puedo definir constraints para \n // distintos atributos en distintas clases en la jerarquia de herencia?\n \n // Quiero que las redefiniciones de restricciones sobreescriban las viejas\n // (no se verifica que ya exista una restriccion para el campo).\n // El problema es si una subclase define una restriccion para un atributo\n // de la superclase y esta ya tiene una restriccion definida.\n $this->constraints[$attr] = $constraints;\n }", "public function constraint(){\n try {\n // Sparql11query.g:227:3: ( brackettedExpression | builtInCall | functionCall ) \n $alt28=3;\n $LA28 = $this->input->LA(1);\n if($this->getToken('OPEN_BRACE')== $LA28)\n {\n $alt28=1;\n }\n else if($this->getToken('COALESCE')== $LA28||$this->getToken('IF')== $LA28||$this->getToken('STR')== $LA28||$this->getToken('LANG')== $LA28||$this->getToken('LANGMATCHES')== $LA28||$this->getToken('DATATYPE')== $LA28||$this->getToken('BOUND')== $LA28||$this->getToken('SAMETERM')== $LA28||$this->getToken('ISIRI')== $LA28||$this->getToken('ISURI')== $LA28||$this->getToken('ISBLANK')== $LA28||$this->getToken('ISLITERAL')== $LA28||$this->getToken('REGEX')== $LA28)\n {\n $alt28=2;\n }\n else if($this->getToken('IRI_REF')== $LA28||$this->getToken('PNAME_NS')== $LA28||$this->getToken('PNAME_LN')== $LA28)\n {\n $alt28=3;\n }\n else{\n $nvae =\n new NoViableAltException(\"\", 28, 0, $this->input);\n\n throw $nvae;\n }\n\n switch ($alt28) {\n case 1 :\n // Sparql11query.g:228:3: brackettedExpression \n {\n $this->pushFollow(self::$FOLLOW_brackettedExpression_in_constraint780);\n $this->brackettedExpression();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 2 :\n // Sparql11query.g:229:5: builtInCall \n {\n $this->pushFollow(self::$FOLLOW_builtInCall_in_constraint786);\n $this->builtInCall();\n\n $this->state->_fsp--;\n\n\n }\n break;\n case 3 :\n // Sparql11query.g:230:5: functionCall \n {\n $this->pushFollow(self::$FOLLOW_functionCall_in_constraint792);\n $this->functionCall();\n\n $this->state->_fsp--;\n\n\n }\n break;\n\n }\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function addConstraints()\n {\n if (static::$constraints) {\n /*\n * For belongs to relationships, which are essentially the inverse of has one\n * or has many relationships, we need to actually query on the primary key\n * of the parent model matching on the INCOMING relationship by name.\n *\n * We are trying to achieve a Cypher that goes something like:\n *\n * MATCH (phone:`Phone`), (phone)<-[:PHONE]-(owner:`User`)\n * WHERE id(phone) = 1006\n * RETURN owner;\n *\n * (phone:`Phone`) represents a matching statement where\n * 'phone' is the parent Node's placeholder and '`Phone`' is the parentLabel.\n * All node placeholders must be lowercased letters and will be used\n * throught the query to represent the actual Node.\n *\n * Resulting from:\n * class Phone extends NeoEloquent {\n *\n * public function owner()\n * {\n * return $this->belongsTo('User', 'PHONE');\n * }\n * }\n */\n\n // Get the parent node's placeholder.\n $parentNode = $this->query->getQuery()->modelAsNode($this->parent->nodeLabel());\n // Tell the query that we only need the related model returned.\n $this->query->select($this->relation);\n // Set the parent node's placeholder as the RETURN key.\n $this->query->getQuery()->from = array($parentNode);\n // Build the MATCH ()<-[]-() Cypher clause.\n $this->query->matchOut($this->parent, $this->related, $this->relation, $this->relationType, $this->otherKey, $this->parent->{$this->otherKey});\n // Add WHERE clause over the parent node's matching key = value.\n $this->query->where($this->otherKey, '=', $this->parent->{$this->otherKey});\n }\n }", "function getConstraint() ;", "function getConstraint() ;", "public function add_requirement( sn\\base\\requirement\\I_Requirement $requirement );", "public function SetConstraints ($constraints = []);", "public function addQuestion($question) {\r\n\t\tarray_push($this -> questions, $question);\r\n\t}", "public function addQuestion($question)\n {\n $this->questions[] = $question;\n }", "public function getConstraint();", "public function addConstraints()\n {\n $this->performJoins();\n\n if (static::$constraints) {\n $local_value = $this->parent->{$this->getFirstForeignKeyName()};\n\n $this->query->where($this->getQualifiedFirstLocalKeyName(), '=', $local_value);\n }\n }", "public function add_constraint($param, $op, $val)\n {\n if (!$this->check_sanity())\n {\n return false;\n }\n $this->qb_count->add_constraint($param, $op, $val);\n return $this->qb->add_constraint($param, $op, $val);\n }", "public function getConstraint() {}", "public function getConstraint() {}", "public function foreignConstraint();", "function getConstraint1() ;", "function getConstraint1() ;", "public function addquestion(Request $request, Survey $survey)\n {\n $this->validate($request, [\n 'label'=>'required|max:255',\n 'options'=>'required_if:type,select,checkbox-list,section',\n 'required'=>'boolean'\n ]);\n $data = array();\n $data = $request->intersect([\n 'label', 'question_type', 'options', 'required', 'css_class'\n ]);\n /*\n $data['label'] = $request->input('label');\n $data['question_type'] = $request->input('type');\n if($request->has('options')) {\n $data['options'] = $request->input('options');\n }\n if($request->has('required') && $request->input('type') != 'section') {\n $data['required'] = '1';\n }\n */\n // return($data);\n $survey->questions()->create($data);\n return redirect('/addquestion/' . $survey->id . '#new-question-form');\n }", "abstract public function handleConstraint(string $rule): Constraint;" ]
[ "0.71513575", "0.68696004", "0.66308165", "0.6623082", "0.6490927", "0.6467618", "0.6433734", "0.63226867", "0.63222665", "0.6304293", "0.628926", "0.623163", "0.6112871", "0.6079158", "0.60358626", "0.60358626", "0.59731764", "0.597036", "0.5926024", "0.58590287", "0.5854491", "0.5794797", "0.57772046", "0.5758636", "0.5758636", "0.5708434", "0.5683382", "0.5683382", "0.56118333", "0.55913615" ]
0.7105923
1
Disinvites a user from a survey
public function disinviteUser($user_id) { global $ilDB; $affectedRows = $ilDB->manipulateF("DELETE FROM svy_inv_usr WHERE survey_fi = %s AND user_fi = %s", array('integer','integer'), array($this->getSurveyId(), $user_id) ); include_once './Services/User/classes/class.ilObjUser.php'; ilObjUser::_dropDesktopItem($user_id, $this->getRefId(), "svy"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function disinvite($user) {\n\t\t$invitation = $this->event->getInvitation($user);\n\t\t$this->event->removeInvitation($invitation); // this should also automatically remove the invitation from the database\t\t\n\t\t$this->event->save();\n\t}", "public function test_user_cant_decline_not_their_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n factory(Box::class, 3)->create();\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 1, //Box doesn't matter\n 'role' => 'coach',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 2,\n 'role' => 'owner',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $invite = Invite::create([\n 'email' => \"[email protected]\",\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $this->actingAs($user);\n\n $response = $this->post(route('frontend.invites.decline', $invite));\n\n $response->assertStatus(302);\n\n $invites = $user->invites();\n\n $this->assertEquals(3, $invites->count());\n\n }", "public function declineSingle(){\n\t\tif(isset($_SESSION['admin_email'])){\n\t\t$this->model(\"AdminApproveModel\");\n\t\tif(isset($_POST['admin_decline'])){\n\t\t\t$this->sanitizeString($_POST['admin_decline']);\n\t\t\t$id = $this->sanitizeString($_POST['id']);\n\t\t\tAdminApproveModel::where('id', $id)->delete();\n\t\t}\n\t}\n\n\t}", "public function unsubscribeInviteReminder(){\n\n\t\tif(null === $this->id){\n\t\t\t$this->load();\n\t\t}\n\n\t\t// unsubscribe only if the gift/email is still subscribed\n\t\tif($this->isSubscribedInviteReminder()) {\n\t\t\t// add an unsubscribe entry for this email/gift/template\n\t\t\t$worker = new inviteReminderUnsubscribeEmailWorker();\n\t\t\t$worker->send($this->id);\n\t\t}\n\n\t}", "public function reject() {\n\t\t$query = array(\n\t\t\t'group' => $this->group->createReference(),\n\t\t\t'invitee' => $this->candidate->createReference(),\n\t\t);\n\t\t$invite = EpicDb_Mongo::db('invitation')->fetchOne($query);\n\t\tif($invite) $invite->delete();\n\t\t// Reject this application\n\t\t$this->status = \"rejected\";\n\t\t$this->save();\n\t}", "public function rejectInvitation() {\n\t\t$this->autoRender = false;\n\t\t$communityId = $this->request->data['communityId'];\n\t\t$community = $this->Community->findById($communityId);\n\t\tif (!empty($community)) {\n\t\t\t$userId = $this->Auth->user('id');\n\t\t\t$this->CommunityMember->reject($communityId, $userId);\n\t\t\t//Community unfollow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId\n\t\t\t);\n\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t$this->Session->setFlash(__('The invitation has been rejected.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__($this->invalidMessage), 'error');\n\t\t}\n\t}", "public function actionUnsubscribe(){\n $perfil = \\app\\models\\PerfilUsuario::find()->where(['fk_usuario'=>Yii::$app->user->id])->one();\n $igualas_user_viejo = \\app\\models\\IgualasUsers::find()->where(['fk_users_cliente'=>$perfil->id, 'estatus'=>'concretado'])->one();\n if ($igualas_user_viejo){\n $plan_viejo = \\app\\models\\Igualas::find()->where(['id'=>$igualas_user_viejo->fk_iguala])->one();\n try {\n $agreement_viejo = paypalSuspendPlanToUser($igualas_user_viejo->subscription_id);\n }catch(\\Exception $e){\n Yii::$app->getSession()->setFlash('danger',$e->getMessage());\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }\n // $igualas_user_viejo->delete();\n if ($agreement_viejo){\n $igualas_user_viejo->estatus = \"cancelado\";\n $igualas_user_viejo->save();\n Yii::$app->session->setFlash('success', 'Usted ha cancelado la subscripción correctamente.');\n }\n else{\n Yii::$app->session->setFlash('error', 'Problemas al cancelar la subscripción');\n }\n }\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }", "public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function test_user_can_decline_their_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n factory(Box::class, 3)->create();\n\n $invite = Invite::create([\n 'email' => $user->email,\n 'box_id' => 1, //Box doesn't matter\n 'role' => 'coach',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 2,\n 'role' => 'owner',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $this->actingAs($user);\n\n $response = $this->post(route('frontend.invites.decline', $invite));\n\n $response->assertStatus(200);\n\n $invites = $user->invites();\n\n $this->assertEquals(2, $invites->count());\n\n }", "public function rejectInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->delete();\n return redirect()->back();\n }", "private function declineMeetingRequest(\\App\\Request $request)\n {\n $user = Auth::user();\n //if sender or receiver of meeting request\n if($request->users->contains($user)){\n foreach($request->invites as $invite){\n $invite->delete();\n }\n $request->delete();\n }\n }", "public function handleDeclineInvite($iid) {\n\t\tCourseListModel::declineInvite($iid);\n\t\t$this->redirect('this');\n\t}", "public function cancelRequest(){\n //the other users Id\n $otherUserId = $_POST[\"otherUserId\"];\n //deletes the record in the database\n $this->individualGroupModel->cancelGroupRequestInvitation($otherUserId); \n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "public function rejectInvite($inviterID) {\n\t\treturn ConnectionFactory::DeleteRowFromTable(\"agencies\", array('user_one_id'=>$inviterID, \n\t\t\t\t'user_two_id'=>$this->id));\n\t}", "public function declineMembership(KittyInterface $kitty, UserInterface $user);", "public function rejectTerms(){\n $db = DB::prepare('Delete FROM accept_terms WHERE user_id = ?');//Status 1 == accepted\n return $db->execute(array($this->id));\n }", "private function unsubscribeUser()\n {\n try\n {\n $request = $_POST;\n\n $uid = userid();\n\n if (!$uid)\n throw_error_msg( lang(\"you_not_logged_in\") ) ;\n\n if( !isset($request['subscribed_to']) || $request['subscribed_to']==\"\" )\n throw_error_msg(\"subscribed to not provided\");\n\n if( !is_numeric($request['subscribed_to']) )\n throw_error_msg(\"invalid subscribed to\");\n\n global $userquery;\n $userquery->remove_subscription($request['subscribed_to']);\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'unsubscribed successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function toggleUnVisibleDiscontIdAll()\n {\n $user_id = \\Auth::user()->id;\n $users = User::where('user_id', $user_id)->get();\n foreach($users as $user)\n {\n $user->makeUnVisibleDiscontId();\n\n } \n return redirect()->back();\n \n }", "public function disapprove()\n {\n return $this->approve(false);\n }", "function denyEnrollment($user, $cid)\r\n {\r\n $courseName = $this->getCourseName($cid); //Need course name for email\r\n $this->MB->set_subject(\"Enrollment application for $courseName: Denied\");\r\n $this->MB->set_body(\"We are sorry to inform you that your application to enroll in $courseName\r\n has been rejected. We encourage you to apply at a later time when\r\n you are a more qualified applicant. Thank you.\");\r\n $this->MB->set_sendto($user);\r\n $this->MB->set_sendfrom('admin');\r\n $this->MB->send_mail(); //Sed user an email informing them of their rejection\r\n $this->DB->database_delete('enrollment_requests', array('user' => $user, 'cid' => $cid)); //Delete request from database\r\n }", "public function desactivarCuenta() {\n\n\t/*Recoge el usuario actual*/\n\t$currentuser = $_SESSION[\"currentuser\"];\n\n\t/*Actualiza el estado del usuario a inactivo=0 */\n\t$this->user->updateEstado($currentuser->getEmailU());\n\n\t//mensaje de confirmación y redirige al método login del UsersController.php\n\techo \"<script> alert('Cuenta eliminada correctamente'); </script>\";\n\techo \"<script>window.location.replace('index.php');</script>\";\n\n\t// renderiza la vista (/view/vistas/consultaJprof.php)\n\t$this->view->render(\"vistas\", \"consultaJprof\");\n}", "public function unsubscribed() {\n\t\t$fields_string = \"\";\n\n\t\t//113 - Opt-out Registered Users\n $params = $_POST;\n\t\t\n\t\t$email \t= $params['email'];\t\n\t\t$urlencoded_email = urlencode($email);\n\t\t\n\t\t//set POST variables - activate a user on the opt out list\n\t\t$url = 'https://login8.unsubcentral.com/uc/address_upload.pl?';\n\t\t$fields = array(\n\t\t\t\t\t\t\t\t'login'=>'TotsyAPI',\n\t\t\t\t\t\t\t\t'password'=>'D:hXeM;i',\n\t\t\t\t\t\t\t\t'listID'=>'113',\n\t\t\t\t\t\t\t\t'md5'=>'false',\n\t\t\t\t\t\t\t\t'suppressed_text'=>urlencode($email)\n\t\t\t\t\t\t);\n\t\t\n\t\t//url-ify the data for the POST\n\t\tforeach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }\n\t\trtrim($fields_string,'&amp;');\n\t\t\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch,CURLOPT_URL,$url);\n\t\tcurl_setopt($ch,CURLOPT_POST,count($fields));\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);\n\t\t$result = curl_exec($ch);\n\t\tcurl_close($ch);\t\n\t\t\n\t\t//clear the previous variables\n\t\tunset($fields);\n\t\tunset($fields_string);\n\t\t\n\t\t$date_today = date(\"Y-m-d\");\n\t\t\n\t\t$unsubcentral_filename = \"/tmp/unsubcentral-\".time().\".txt\";\n\t\t$temp_file = file_put_contents($unsubcentral_filename,\"{$email}\\t{$date_today}\\t0\\t\\n\");\n\t\t\n\t\t//deactivate a user on the registered list (116)\n\t\t$url = \"https://login8.unsubcentral.com/uc/add_remove_address.pl?\";\n\t\t$fields = array(\n\t\t\t\t\t\t\t\t'login'=>'TotsyAPI',\n\t\t\t\t\t\t\t\t'password'=>urlencode('D:hXeM;i'),\n\t\t\t\t\t\t\t\t'listID'=>'116',\n\t\t\t\t\t\t\t\t'file'=>\"@{$unsubcentral_filename}\",\n\t\t\t\t\t\t\t\t'email_col'=>\"0\",\n\t\t\t\t\t\t\t\t'action_col'=>\"2\",\n\t\t\t\t\t\t\t\t'date_col'=>\"1\"\n\t\t\t\t\t\t);\n\t\t\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch,CURLOPT_URL,$url);\n\t\tcurl_setopt($ch,CURLOPT_POST,TRUE);\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$fields);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE); \n\t\t$result = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\t//remove the unsubcentral upload file after it is used for upload\n\t\tunlink($unsubcentral_filename);\n \t}", "public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}", "public function decline() {\n header('Content-type: application/json');\n $requestId = input(\"requestid\");\n Database::table(\"requests\")->where(\"id\", $requestId)->update(array(\"status\" => \"Declined\"));\n $request = Database::table(\"requests\")->where(\"id\", $requestId)->first();\n $sender = Database::table(\"users\")->where(\"id\", $request->sender)->first();\n $documentLink = env(\"APP_URL\").\"/document/\".$request->document;\n $send = Mail::send(\n $sender->email, \"Signing invitation declined by \".$request->email,\n array(\n \"title\" => \"Signing invitation declined.\",\n \"subtitle\" => \"Click the link below to view document.\",\n \"buttonText\" => \"View Document\",\n \"buttonLink\" => $documentLink,\n \"message\" => $request->email.\" has declined the signing invitation you had sent. Click the link above to view the document.<br><br>Thank you<br>\".env(\"APP_NAME\").\" Team\"\n ),\n \"withbutton\"\n );\n $actionTakenBy = escape($request->email);\n /*\n * Check, whether IP address register is allowed in .env\n * If yes, then capture the user's IP address\n */\n if (env('REGISTER_IP_ADDRESS_IN_HISTORY') == 'Enabled') {\n $actionTakenBy .= ' ['.getUserIpAddr().']';\n }\n $activity = '<span class=\"text-primary\">'.$actionTakenBy.'</span> declined a signing invitation of this document.';\n Signer::keephistory($request->document, $activity, \"default\");\n $notification = '<span class=\"text-primary\">'.escape($request->email).'</span> declined a signing invitation of this <a href=\"'.url(\"Document@open\").$request->document.'\">document</a>.';\n Signer::notification($sender->id, $notification, \"decline\");\n if (!$send) { exit(json_encode(responder(\"error\", \"Oops!\", $send->ErrorInfo))); }\n exit(json_encode(responder(\"success\", \"Declined!\", \"Request declined and sender notified.\",\"reload()\")));\n }", "public function test_user_can_view_invites_no_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n\n $this->actingAs($user);\n\n $response = $this->get('/invites');\n\n $response->assertStatus(200);\n }", "function del_access_grant_to_invited_group($event, $type, $object) {\n\tif ($object->relationship == 'invited') {\n\t\tremove_entity_relationship($object->guid_one, 'access_grant', $object->guid_two);\n\t}\n}", "function unsubscribe($entity){\n\t\tif($entity instanceof ElggUser){\n\t\t\treturn $entity->setMetaData('isSubscribedNewsletter',false);\n\t\t}else{\n\t\t\tregister_error(elgg_echo('vazco_newsletter:notanuser'));\n\t\t\treturn false;\n\t\t}\n\t}", "public function decline(User $user, TeamInvitation $invitation)\n {\n return $user->tokenCan('invitations.update')\n && $invitation->email === $user->email;\n }", "function inviteUser($user_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$result = $ilDB->queryF(\"SELECT user_fi FROM svy_inv_usr WHERE user_fi = %s AND survey_fi = %s\",\n\t\t\tarray('integer','integer'),\n\t\t\tarray($user_id, $this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows() < 1)\n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_inv_usr');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_inv_usr (invited_user_id, survey_fi, user_fi, tstamp) \" .\n\t\t\t\t\"VALUES (%s, %s, %s, %s)\",\n\t\t\t\tarray('integer','integer','integer','integer'),\n\t\t\t\tarray($next_id, $this->getSurveyId(), $user_id, time())\n\t\t\t);\n\t\t}\n\t\tif ($this->getInvitation() == self::INVITATION_ON)\n\t\t{\n\t\t\tinclude_once './Services/User/classes/class.ilObjUser.php';\n\t\t\tilObjUser::_addDesktopItem($user_id, $this->getRefId(), \"svy\");\n\t\t}\n\t}", "private static function reject($args, $invite, $auth) {\n $values = array(\n 'id'=>$invite['id'],\n 'deleted' => 't'\n );\n $s = submission_builder::build_submission($values, array('model' => 'group_invitation'));\n $r = data_entry_helper::forward_post_to('group_invitation', $s, $auth['write_tokens']);\n hostsite_show_message(lang::get(\"OK, thanks anyway. We've removed your invitation to join this group.\"));\n hostsite_goto_page($args['groups_page_path']);\n return '';\n }" ]
[ "0.6958361", "0.6199614", "0.60990644", "0.6021027", "0.60147977", "0.6003235", "0.5991632", "0.5945393", "0.5889275", "0.58515745", "0.5833426", "0.5778013", "0.57663304", "0.5746187", "0.57067835", "0.56786126", "0.5671597", "0.5662577", "0.5651808", "0.5616774", "0.5606871", "0.5603447", "0.5588277", "0.55825007", "0.55740994", "0.5554375", "0.5554267", "0.5543216", "0.5521477", "0.5472298" ]
0.7105687
0
Invites a user to a survey
function inviteUser($user_id) { global $ilDB; $result = $ilDB->queryF("SELECT user_fi FROM svy_inv_usr WHERE user_fi = %s AND survey_fi = %s", array('integer','integer'), array($user_id, $this->getSurveyId()) ); if ($result->numRows() < 1) { $next_id = $ilDB->nextId('svy_inv_usr'); $affectedRows = $ilDB->manipulateF("INSERT INTO svy_inv_usr (invited_user_id, survey_fi, user_fi, tstamp) " . "VALUES (%s, %s, %s, %s)", array('integer','integer','integer','integer'), array($next_id, $this->getSurveyId(), $user_id, time()) ); } if ($this->getInvitation() == self::INVITATION_ON) { include_once './Services/User/classes/class.ilObjUser.php'; ilObjUser::_addDesktopItem($user_id, $this->getRefId(), "svy"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function inviteAction()\n\t{\n\t\t$user = new Default_Model_User();\n\t\t$resultRow = $user->getUserByEmail($this->loggedEmail);\n\t\t\n\t\t$loggedHandle = $resultRow->handle;\n\t\t$loggedId = $resultRow->id;\n\t\t\n\t\t$handle = $this->_request->getParam('handle');\n\t\t$resultRow = $user->getUserByHandle($handle);\n\t\t$handleId = $resultRow->id;\n\n\t\t$invite = new Default_Model_Invitation();\n\t\tif($invite->createInvitation($loggedId, $handleId)){\n\t\t\t$this->view->success = 1;\n\t\t} else{\n\t\t\t$this->view->success = 0;\n\t\t}\n\t}", "public function invite_action($user_id)\n {\n if (OrganizerInvite::canInvite()) {\n OrganizerInvite::invite($user_id);\n }\n $this->redirect('show/index');\n }", "function invite()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tlogout_invalid_user($this);\n\t\t\n\t\t# user has submitted the invitation\n\t\tif(!empty($_POST)){\n\t\t\t$response = $this->_tender->invite($_POST);\n\t\t\t$msg = (!empty($response) && $response['boolean'])? 'The Invitation for Bids/Quotations has been sent.' :'ERROR: The Invitation for Bids/Quotations could not be sent.';\n\t\t\t\n\t\t\t$this->native_session->set('__msg',$msg);\n\t\t}\n\t\telse if(!empty($data['a'])){\n\t\t\t$data['msg'] = $this->native_session->get('__msg');\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t\t$this->load->view('addons/basic_addons', $data);\n\t\t}\n\t\telse {\n\t\t\t$data['tender'] = $this->_tender->details($data['d']);\n\t\t\t$data['invited'] = $this->_tender->invitations($data['d']);\n\t\t\t$this->load->view('tenders/invite', $data);\n\t\t}\n\t}", "public function inviteAction()\n {\n \t$roomId = $this->_getRoomId();\n \t$userDto = Zend_Registry::get('api_user');\n \t$nickname = $this->_getParam('nick_name');\n \t$invited = $this->getMultiUser($this->_getParam('user_list'));\n \t\n \t$result = $this->getBusiness()->invite($roomId, $userDto, $invited, $nickname);\n \t$this->fromArray($result);\n }", "public function saveAction()\n {\n $user = Mage::getSingleton('admin/session')->getUser(); \n $post_data = $this->getRequest()->getPost();\n\n try {\n $survey = Mage::getModel('client/survey')->loadSurveyByEmail($user->getEmail());\n if ($survey->getId()) $post_data['id'] = $survey->getId();\n\n $survey->setData($post_data);\n $survey->setName($user->getName());\n $survey->setEmail($user->getEmail());\n\n $survey->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('client')->__('Survey was successfully saved. Thank you!'));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*/');\n }", "public function accept_action($user_id)\n {\n if (!OrganizerSettings::get()->locked && !OrganizerGroup::findGroup($user_id)->hasMaxTeamSize()) {\n OrganizerInvite::accept($user_id);\n }\n\n // Remove existing invites\n OrganizerInvite::cancel($user_id, User::findCurrent()->id);\n $this->redirect('show/index');\n }", "public function inviteUser()\r\n {\r\n Invite::instance()->from(Yii::$app->user->getIdentity())->about($this)->sendBulk($this->participantUsers);\r\n }", "public function assignUser()\n {\n $user = User::find(request()['user_id']);\n\n $user->survey_id = request()['survey_id'];\n\n $user->save();\n\n return ['message' => 'survey assigned succefully'];\n }", "public function invites();", "function invi_accept() {\n if(isset($_GET['room_id'], $_GET['user_id'], $_GET['invi_id'])) {\n $data = $this->mod_user->md_acceptInvi($_GET['room_id'], $_GET['user_id'], $_GET['invi_id']);\n } else {\n die();\n }\n }", "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "public function invite(){\n $this->validate(request(),[\n 'task_id' => 'required',\n 'user_id'=> 'required'\n ]);\n $task=Task::find(request('task_id'));\n\n $user=User::find(request('user_id'));\n if (\\Gate::denies('taskOwner', $task)) {\n return response()->json(\"Task doesn't Belong To you\");\n }\n \\Mail::to($user)->send(new TaskInvitation($user,$task));\n return response()->json(\"Invitation Mail Sent Successfully\");\n }", "function startSurvey($respondent = null) {\n $this->autoRender = false; // turn off autoRender because we need total control over what view to render here\n $this->__clearEditSession(CLEAR_SURVEY); // clear any previous session variables\n $this->Session->write('Survey.type', 'user'); // write the survey type to the session\n $this->redirect(array('action' => 'runSurvey', 'respondentGUID' => $respondent)); // send to the main survey routine\n }", "public function acceptInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->is_accepted = true;\n $invite->save();\n return redirect()->back();\n }", "public function invite() {\n\t\tif (!$this->get_settings()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ($this->settings['mbd.active'] != 'true') {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$group = $this->Group->find('first', array(\n\t\t\t'fields' => array('Group.id'),\n\t\t\t'conditions' => array(\n\t\t\t\t'Group.key' => 'mbd'\n\t\t\t)\n\t\t));\n\t\t\n\t\t$project = $this->Project->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Project.status' => PROJECT_STATUS_OPEN,\n\t\t\t\t'Project.active' => true,\n\t\t\t\t'Project.group_id' => $group['Group']['id']\n\t\t\t),\n\t\t\t'order' => 'Project.id DESC'\n\t\t));\n\t\tif (!$project) {\n\t\t\treturn;\n\t\t}\n\n\t\t// so we can capture the output of the view into a string to write\n\t\t$this->autoRender = false;\n\t\n\t\t$survey_subject = empty($project['Project']['description']) ? 'Exciting Survey Opportunity - Act now!': $project['Project']['description'];\n\t\t$survey_award = $project['Project']['award'];\n\t\t$survey_length = $project['Project']['est_length'];\n\t\n\t\t$is_desktop = $project['Project']['desktop'];\n\t\t$is_mobile = $project['Project']['mobile'];\n\t\t$is_tablet = $project['Project']['tablet'];\n\t\t$survey_id = $project['Project']['id'];\n\n\t\t// grab the email template\n\t\tApp::uses('Controller', 'Controller');\n\t\tApp::uses('View', 'View');\n\t\t\n $controller = new Controller();\n\t\t$view = new View($controller, false);\n\t\t$view->layout = 'Emails/html/default';\n\t\t$nonce = '{{nonce}}';\n\t\t$survey_url = '{{survey_url}}';\n\t\t$unsubscribe_link = '{{unsubscribe_link}}';\n\t\t$view->set(compact('nonce', 'survey_url', 'unsubscribe_link', 'survey_award', 'survey_length', 'is_desktop', 'is_mobile', 'is_tablet', 'survey_id'));\n\t\t$view->viewPath = 'Emails/html';\n\t\t$email_body = $view->render('survey');\n\t\t$this->autoRender = true;\n\t\t\n\t\t// grab users\n\t\t$http = new HttpSocket(array(\n\t\t\t'timeout' => 15,\n\t\t\t'ssl_verify_host' => false // PHP does not seem to check SANs for CNs\n\t\t));\n\t\t$results = $http->get($this->settings['hostname.mbd'].'/ignite/getinvites?X-ApiKey='.$this->settings['mbd.api_key'], $this->options);\t\t\n\t\t$results = json_decode($results, true);\n\t\tif (empty($results)) {\n\t\t\t$this->out('API call failed');\n\t\t\tCakeLog::write('mbd.invite', 'API call failed');\n\t\t\treturn;\n\t\t} \n\t\t\n\t\t$this->out('Sending to '.count($results).' panelists');\n\t\tCakeLog::write('mbd.invite', 'Sending to '.count($results).' panelists');\n\t\t$total = count($results); \n\t\t\n\t\t$i = 0; \n\t\t$success = 0;\n\t\t$queued_emails = array();\n\t\tforeach ($results as $result) {\n\t\t\t$i++;\n\t\t\t$user = $this->User->find('first', array(\n\t\t\t\t'fields' => array('User.id', 'User.last_touched', 'User.ref_id', 'User.email', 'User.send_survey_email', 'User.send_email'),\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'User.id' => $result['panelistId'],\n\t\t\t\t\t'User.hellbanned' => false\n\t\t\t\t),\n\t\t\t\t'recursive' => -1\n\t\t\t));\n\t\t\tif (!$user) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$active = $http->get($result['url'].'&test=true',\n\t\t\t\tarray(),\n\t\t\t\tarray('header' => array(\n\t\t\t\t\t'Accept' => 'application/json',\n\t\t\t\t\t'Content-Type' => 'application/json; charset=UTF-8'\n\t\t\t\t))\n\t\t\t);\n\t\t\tif ($active['body'] == 'False') {\n\t\t\t\t$this->out($i.'/'.$total.' Email not send to '.$user['User']['id'].' because they have opted out of emails'); \n\t\t\t\tCakeLog::write('mbd.invite', $i.'/'.$total.' Email not send to '.$user['User']['id'].' because they have opted out of emails');\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// bypass the sending of email if user has opted out\n\t\t\tif (!$user['User']['send_survey_email'] || !$user['User']['send_email']) {\n\t\t\t\t$this->out($i.'/'.$total.' Email not send to '.$user['User']['id'].' because they have opted out of emails'); \n\t\t\t\tCakeLog::write('mbd.invite', $i.'/'.$total.' Email not send to '.$user['User']['id'].' because they have opted out of emails');\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$user_option = $this->UserOption->find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'UserOption.user_id' => $user['User']['id'],\n\t\t\t\t\t'UserOption.name' => 'mbd.last.invited'\n\t\t\t\t)\n\t\t\t)); \n\t\t\tif ($user_option && strtotime('-24 hours') <= strtotime($user_option['UserOption']['value'])) {\n\t\t\t\t$this->out($i.'/'.$total.' Skipped '.$user['User']['id'].' as they were emailed recently ('.$user_option['UserOption']['value'].')');\n\t\t\t\tCakeLog::write('mbd.invite', $i.'/'.$total.' Skipped '.$user['User']['id'].' as they were emailed recently ('.$user_option['UserOption']['value'].')');\n\t\t\t\tcontinue;\n\t\t\t} \n\t\t\t\n\t\t\t// MBD can send dupe invites\n\t\t\tif (in_array($user['User']['email'], $queued_emails)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$queued_emails[] = $user['User']['email']; \n\t\t\t\n\t\t\t// generate the email\n\t\t\t$nonce = substr($user['User']['ref_id'], 0, 21).'-'.substr(Utils::rand(10), 0, 10);\n\t\t\t$survey_url = HOSTNAME_WWW.'/surveys/pre/'.$project['Project']['id'].'/?nonce='.$nonce . '&from=email'.(!empty($project['Project']['code']) ? '&key='.$project['Project']['code'] : '');\n\t\t\t$unsubscribe_link = HOSTNAME_WWW.'/users/emails/'.$user['User']['ref_id'];\n\t\t\t\n\t\t\t$customized_email_body = str_replace(array(\n\t\t\t\t'{{nonce}}',\n\t\t\t\t'{{unsubscribe_link}}', \n\t\t\t\t'{{survey_url}}',\n\t\t\t\t'{{user_id}}'\n\t\t\t), array(\n\t\t\t\t$nonce,\n\t\t\t\t$unsubscribe_link, \n\t\t\t\t$survey_url,\n\t\t\t\t$user['User']['id']\n\t\t\t), $email_body);\n\t\t\t\n\t\t\t// create the one-time nonce\n\t\t\t$this->Nonce->create();\n\t\t\t$this->Nonce->save(array('Nonce' => array(\n\t\t\t\t'item_id' => $project['Project']['id'],\n\t\t\t\t'item_type' => 'survey',\n\t\t\t\t'user_id' => $user['User']['id'],\n\t\t\t\t'nonce' => $nonce\n\t\t\t)), false);\n\t\t\n\t\t\t$this->MailQueue->create();\n\t\t\t$this->MailQueue->save(array('MailQueue' => array(\n\t\t\t\t'user_id' => $user['User']['id'],\n\t\t\t\t'email' => $user['User']['email'],\n\t\t\t\t'subject' => $survey_subject,\n\t\t\t\t'project_id' => $project['Project']['id'],\n\t\t\t\t'body' => $customized_email_body,\n\t\t\t\t'status' => 'Queued'\n\t\t\t)));\n\t\t\t\n\t\t\t$success++;\n\t\t\t$this->out($i.'/'.$total.' Queued (#'.$user['User']['id'].': '.$user['User']['email'].')'); \n\t\t\tCakeLog::write('mbd.invite', $i.'/'.$total.' Queued (#'.$user['User']['id'].': '.$user['User']['email'].')');\n\t\t\t\n\t\t\tif (!$user_option) {\n\t\t\t\t$this->UserOption->create();\n\t\t\t\t$this->UserOption->save(array('UserOption' => array(\n\t\t\t\t\t'user_id' => $user['User']['id'],\n\t\t\t\t\t'name' => 'mbd.last.invited',\n\t\t\t\t\t'value' => date(DB_DATETIME)\n\t\t\t\t)));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->UserOption->create();\n\t\t\t\t$this->UserOption->save(array('UserOption' => array(\n\t\t\t\t\t'id' => $user_option['UserOption']['id'],\n\t\t\t\t\t'value' => date(DB_DATETIME)\n\t\t\t\t)), true, array('value'));\n\t\t\t}\n\t\t}\n\t\t$this->out('Emails successfully sent out to '.$success); \n\t\tCakeLog::write('mbd.invite', 'Emails successfully sent out to '.$success);\n\t}", "function emailforsurveyresult($survey) {\n\n global $wpdb;\n $id = $survey->id;\n $user_id = $survey->user_id;\n $user = get_user_by('id', $user_id);\n\n $mentor_id = $survey->mentor_id;\n $mentor = get_user_by('id', $mentor_id);\n\n\n $form = $wpdb->get_row\n (\n $wpdb->prepare\n (\n \"SELECT * FROM \" . survey_forms() . \" \"\n . \"WHERE id = %d\", $survey->survey_id\n )\n );\n\n $slug = PAGE_SLUG;\n $url = site_url() . \"/$slug?survey=\" . $id . \"&guid=\" . $survey->guid;\n $btnaccept = \"<a href='\" . $url . \"'>Click Here To Check Your Survey</a> <br/><br/>\";\n\n $date = date(\"Y-m-d H:i:s\");\n $site_name = TR_SITE_NAME;\n $admin_email = get_option('admin_email');\n $headers = 'From: ' . $admin_email . \"\\r\\n\" .\n 'Reply-To: ' . $admin_email . \"\\r\\n\" .\n 'MIME-Version: 1.0' . \"\\r\\n\" .\n 'Content-type: text/html; charset=iso-8859-1' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n\n /* for user */\n\n $template = tt_get_template(\"survey_result_user\");\n $subj = $template->subject;\n\n $msg = $template->content;\n $msg = str_replace(array('{{username}}', '{{survey_title}}', '{{mentor_name}}', '{{url}}', '{{site_name}}'), array($user->data->display_name, $form->title, $mentor->data->display_nam, $url, $site_name), $msg);\n\n custom_mail($user->data->user_email, $subj, $msg, EMAIL_TYPE, \"\");\n\n\n /* for mentor */\n\n $url = site_url() . \"/wp-admin/admin.php?page=survey_result&survey_id=\" . $id;\n\n $template = tt_get_template(\"survey_result_mentor\");\n $subj = $template->subject;\n\n $msg = $template->content;\n $msg = str_replace(array('{{username}}', '{{survey_user}}', '{{survey_title}}', '{{url}}', '{{site_name}}'), array($mentor->data->display_name, $user->data->display_name, $form->title, $url, $site_name), $msg);\n\n custom_mail($mentor->data->user_email, $subj, $msg, EMAIL_TYPE, \"\");\n}", "public function urenInvullen(\\WebGuy $I) {\n\t\t$I->amOnPage('/login');\n\t\t$I->see('Uren');\n\t\t$I->fillField('Username', 'student');\n\t\t$I->fillField('Password', 'student');\n\t\t$I->click('Login');\n\t\t$I->amOnPage('/student/1');\n\t\t$I->see('Student Page');\n\t\t$I->amOnPage('/student/1/uren/add');\n\t\t$I->submitForm('#ureninvullen', array(\n\t\t\t'cursus' => 'SOP',\n\t\t\t'onderdeel' => '1',\n\t\t\t'date' => '19-01-2014',\n\t\t\t'studielast', '1000',\n\t\t\t));\n\t}", "public function activateOfficialsSurvey()\n {\n return $this->mailer->activateOfficialsSurvey($this->data);\n }", "public function payForInvitedUsers(){\n \n $userService = parent::getService('user','user');\n \n $refererUsers = $userService->getUsersWithRefererNotPaid();\n foreach($refererUsers as $user):\n // if created at least 30 days ago\n if(strtotime($user['created_at'])>strtotime('-30 days')){\n continue;\n }\n // if logged within last 5 days ago\n if(!(strtotime($user['last_active'])>strtotime('-7 days'))){\n $user->referer_not_active = 1;\n $user->save();\n continue;\n }\n \n $values = array();\n $values['description'] = 'Referencing FastRally to user '.$user['username'];\n $values['income'] = 1;\n \n \n if($user['gold_member_expire']!=null){\n $amount = 100;\n }\n else{\n $amount = 10;\n }\n \n \n $userService->addPremium($user['referer'],$amount,$values);\n $user->referer_paid = 1;\n $user->save();\n endforeach;\n echo \"done\";exit;\n }", "function acceptInvite($invite_id,$user_id,$status)\n\t\t{\t\n\t\t\t$where_cond = array(\"status\"=>$status);\n\t\t\t$this->db->where('id',$invite_id);\n\t\t\tif($this->db->update('da_invite_hygiene_investigation',$where_cond))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t}", "public function acceptAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n \n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Accept Page Invitation');\n $form->setDescription('Would you like to accept page invitation for this page?');\n $form->submit->setLabel('Accept Page Invitation');\n\n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\t//SET THE REQUEST AS HANDLED\n\t\t$notification = Engine_Api::_()->getDbtable('notifications', 'activity')->getNotificationByObjectAndType($viewer, $sitepage, 'sitepagemember_invite');\n\t\tif( $notification ) {\n\t\t\t$notification->mitigated = true;\n\t\t\t$notification->save();\n\t\t}\n\n\t\t//GET VALUE FROM THE FORM.\n\t\t$values = $this->getRequest()->getPost();\n\t\t\n\t\t//ADD ACTIVITY\n\t\t$action = Engine_Api::_()->getDbtable('actions', 'activity')->addActivity($viewer, $sitepage, 'sitepage_join');\n\t\tif ( $action ) {\n Engine_Api::_()->getDbtable('actions', 'activity')->attachActivity( $action , $sitepage ) ;\n }\n\t\tEngine_Api::_()->getApi('subCore', 'sitepage')->deleteFeedStream($action,true);\n\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->update(array('active'=> '1', 'user_approved' => '1'), array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t\n\t\t//MEMBER COUNT INCREASE WHEN MEMBER JOIN THE PAGE.\n\t\t$sitepage->member_count++;\n\t\t$sitepage->save();\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n\n $message = Zend_Registry::get('Zend_Translate')->_('You have accepted the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n 'parentRefresh' => true,\n ));\n }\n }", "public function invitAction($userId)\n {\n $request = $this->get('request');\n $em = $this->getDoctrine()->getEntityManager();\n $currentUser = $this->getUser();\n $user = $this->getDoctrine()->getRepository('KibokoSocialNetworkBundle:User')->find($userId);\n if (!$user->hasRole('ROLE_ADMIN')\n && !$user->hasRole('ROLE_SUPER_ADMIN')\n && !$user->hasRole('ROLE_GHOST')\n && !$this->getDoctrine()->getRepository('KibokoSocialNetworkBundle:UserFriendship')->areFriends($currentUser, $user)\n ) {\n $friendship = new UserFriendship();\n $friendship->setUserSrc($currentUser);\n $friendship->setUserTgt($user);\n $friendship->setStatus(UserFriendship::PENDING_STATUS);\n $em->persist($friendship);\n $friendship2 = new UserFriendship();\n $friendship2->setUserSrc($user);\n $friendship2->setUserTgt($currentUser);\n $friendship2->setStatus(UserFriendship::ASKING_STATUS);\n $em->persist($friendship2);\n $em->flush();\n }\n if ($request->headers->get('referer') !== '') {\n return $this->redirect($request->headers->get('referer'));\n }\n\n return $this->redirect($this->generateUrl('kiboko_social_network_friendship_list'));\n }", "public function SendInvite(){\n\t\t\tinclude 'dbconnect.php';\n\t\t\t$link = \"getInvite.php?adminID=\" .$this->getAdminID() .\"&userId=\" .$this->getInvitedID();\n\t\t\t$flag = 0;\n\t\t\t$Sql = $Connection->prepare(\"INSERT INTO InviteLinks(AdminID,userID,RoomID,link,flag) VALUES(:tempAdminID,:tempInVitee,:tempRoomId,:link,:flag)\");\n\t\t\t$Sql->execute(array('tempAdminID' => $this->getAdminID(),'tempInVitee' => $this->getInvitedID(),'tempRoomId' => $this->getRoomID(),'link' => $link, 'flag' => $flag));\n\t\t\t$Connection = null;\n\t\t\techo \"Invitation succesfully sent\";\n\t\t\theader(\"Refresh:5; url=Welcome.php\",true, 303);\n\n\t\t}", "public function accept()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['agree'] = '1';\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/dashboard','refresh');\n\n }", "public function testInvite()\n {\n $this->browse(function (Browser $first, Browser $second) {\n $first->loginAs($this->user_1)\n ->visit('/employees')\n ->press('Получить ссылку приглашения');\n\n $link = $first->text('#link');\n\n $second->loginAs($this->user_2)\n ->visit('/teams')\n ->assertDontSee($this->team->name)\n ->visit($link)\n ->assertSee($this->team->name);\n });\n }", "public function optInAction()\n {\n\n $tokenYes = preg_replace('/[^a-zA-Z0-9]/', '', ($this->request->hasArgument('token_yes') ? $this->request->getArgument('token_yes') : ''));\n $tokenNo = preg_replace('/[^a-zA-Z0-9]/', '', ($this->request->hasArgument('token_no') ? $this->request->getArgument('token_no') : ''));\n $userSha1 = preg_replace('/[^a-zA-Z0-9]/', '', $this->request->getArgument('user'));\n\n /** @var \\RKW\\RkwRegistration\\Tools\\Registration $register */\n $register = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('RKW\\\\RkwRegistration\\\\Tools\\\\Registration');\n $check = $register->checkTokens($tokenYes, $tokenNo, $userSha1, $this->request, $data);\n\n // set hash value for changing subscriptions without login\n $hash = '';\n if ($check == 1) {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.message.subscriptionSaved',\n 'rkw_newsletter'\n )\n );\n\n if (\n ($data['frontendUser'])\n && ($frontendUser = $data['frontendUser'])\n && ($frontendUser instanceof \\RKW\\RkwRegistration\\Domain\\Model\\FrontendUser)\n && ($frontendUser = $this->frontendUserRepository->findByIdentifier($frontendUser->getUid()))\n ) {\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\FrontendUser $frontendUser */\n if (!$frontendUser->getTxRkwnewsletterHash()) {\n $hash = sha1($frontendUser->getUid() . $frontendUser->getEmail() . rand());\n $frontendUser->setTxRkwnewsletterHash($hash);\n $this->frontendUserRepository->update($frontendUser);\n\n } else {\n $hash = $frontendUser->getTxRkwnewsletterHash();\n }\n }\n\n\n } elseif ($check == 2) {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.message.subscriptionCanceled',\n 'rkw_newsletter'\n )\n );\n\n if (\n ($data['frontendUser'])\n && ($frontendUser = $data['frontendUser'])\n && ($frontendUser instanceof \\RKW\\RkwRegistration\\Domain\\Model\\FrontendUser)\n && ($frontendUser = $this->frontendUserRepository->findByIdentifier($frontendUser->getUid()))\n ) {\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\FrontendUser $frontendUser */\n $hash = $frontendUser->getTxRkwnewsletterHash();\n }\n\n } else {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.error.subscriptionError',\n 'rkw_newsletter'\n ),\n '',\n \\TYPO3\\CMS\\Core\\Messaging\\AbstractMessage::ERROR\n );\n }\n\n $this->redirect('message', null, null, array('hash' => $hash));\n //===\n }", "public function sendGroupInvite(){\n //Gets the other users id\n $otherUserId = $_POST[\"otherUserId\"];\n //Gets the other users information\n $userInfo = $this->individualGroupModel->getUserInfo($otherUserId);\n //Gets the group information\n $groupInfo = $this->individualGroupModel->getGroupInformation($_SESSION['current_group']); \n //Sets the group name\n $groupName = $groupInfo->Group_Name;\n //creates the group request in the table\n $this->individualGroupModel->SendGroupInviteRecord($otherUserId, $userInfo, $groupName);\n\n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n\n }", "#[Route('/{id}/invit-email', name: 'app_invit_verify_email', methods: 'GET')]\n function inviteEmail(Request $request, User $user, TranslatorInterface $translator): Response\n {\n\n $message = $translator->trans('Your user account has been successfully created and we thank you :-)');\n\n $resent = $request->get('resent');\n if ($resent) {\n $message = $translator->trans('Your request has been taken into account.');\n }\n\n if (null === ($resetToken = $this->getTokenObjectFromSession())) {\n $resetToken = $this->resetPasswordHelper->generateFakeResetToken();\n }\n\n return $this->render('security/verify_email/invit_email.html.twig', [\n 'user_email' => $user->getEmail(),\n 'resetToken' => $resetToken,\n 'message' => $message,\n ]);\n }", "public function acceptQuest($questid, $userid, $date)\n {\n if (!$this->playerQuest($questid, $userid))\n {\n $query = $this->dbh->prepare('INSERT INTO `playerquests` (`questid`,`userid`,`dateStarted`) VALUES (?,?,?)');\n $query->execute(array($questid, $userid, $date));\n }\n }", "public function acceptInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$room_name = $this->request->data['roomName'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 1;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}" ]
[ "0.66259074", "0.64742255", "0.6182954", "0.61603934", "0.6123737", "0.61127615", "0.6019289", "0.6002534", "0.59278774", "0.58638126", "0.58344823", "0.5741644", "0.564059", "0.56321335", "0.56109196", "0.5580345", "0.555683", "0.5523142", "0.54770166", "0.5470818", "0.5470052", "0.54302716", "0.541262", "0.5412475", "0.5405314", "0.5405021", "0.5387537", "0.5385388", "0.537125", "0.53430307" ]
0.66598016
0
Invites a role to a survey
function inviteRole($role_id) { global $rbacreview; global $ilAccess; $invited = 0; $members = $rbacreview->assignedUsers($role_id); foreach ($members as $user_id) { if ($ilAccess->checkAccessOfUser($user_id, "read", "", $this->getRefId(), "svy", $this->getId())) { $this->inviteUser($user_id); if ($this->getInvitation() == self::INVITATION_ON) { include_once './Services/User/classes/class.ilObjUser.php'; ilObjUser::_addDesktopItem($user_id, $this->getRefId(), "svy"); } } } return $invited; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toggleRole($request);", "function add_access_grant_to_invited_group($event, $type, $object) {\n\tif ($object->relationship == 'invited') {\n\t\tadd_entity_relationship($object->guid_one, 'access_grant', $object->guid_two);\n\t}\n}", "public function putSelectRole()\n {\n $client = $this->getEActivitiesClientEnsureSignedIn();\n if ($client instanceof Response) {\n return $client;\n }\n\n $role_id = (int) Input::get('role_id');\n $roles = $client->getCurrentAndOtherRoles();\n\n if (isset($roles['others'][$role_id])) {\n $client->changeRole($role_id);\n $roles = $client->getCurrentAndOtherRoles();\n return Redirect::action('Admin\\UsersEActivitiesController@getRoles')\n ->with('success', 'Successfully changed role and society to '.$roles['current']);\n } else {\n return Redirect::action('Admin\\UsersEActivitiesController@getRoles')\n ->with('danger', 'Cannot change role');\n }\n }", "public function inviteAction()\n {\n \t$roomId = $this->_getRoomId();\n \t$userDto = Zend_Registry::get('api_user');\n \t$nickname = $this->_getParam('nick_name');\n \t$invited = $this->getMultiUser($this->_getParam('user_list'));\n \t\n \t$result = $this->getBusiness()->invite($roomId, $userDto, $invited, $nickname);\n \t$this->fromArray($result);\n }", "public function actionRole()\n {\n foreach (USER::getRoleOptions() as $key => $val) {\n\n self::log(\"\\n\" . $val . ' Role-id is ' . $key . \"\\n\");\n }\n\n if (is_null($this->email)) {\n\n self::log('Email required ! (Hint -e=)');\n\n return ExitCode::DATAERR;\n }\n\n $model = User::findOne([\n 'email' => $this->email\n ]);\n\n if (is_null($model)) {\n\n self::log('User not found');\n\n return ExitCode::NOUSER;\n }\n\n if (is_null($this->role_id)) {\n\n self::log('Current Role Id is ' . $model->role_id . \"\\n\");\n self::log('Add correct Role id (Hint -r=)');\n\n return ExitCode::DATAERR;\n }\n\n if (is_null(ArrayHelper::getValue(USER::getRoleOptions(), $this->role_id))) {\n\n self::log('Please enter correct role id :');\n\n return ExitCode::DATAERR;\n }\n\n $model->role_id = $this->role_id;\n\n if (! $model->save()) {\n\n self::log('Please enter valid Role Id ');\n\n return ExitCode::DATAERR;\n }\n\n self::log($this->email . ' = Role Id successfully Updated !');\n\n return ExitCode::OK;\n }", "public function test_all_questions_and_answers_route_when_questioner_has_sitewide_role() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n $roleid = $DB->get_field('role', 'id', array('shortname' => 'manager'));\n $this->getDataGenerator()->role_assign($roleid, $user->id);\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $now = time();\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $now, $now + 1, 2, 'dummy text')\n )\n )));\n\n $this->setUser($user);\n $client = new Client($this->_app);\n $client->request('GET', '/api/v1/' . $videoquanda->id . '/questions');\n $json = $client->getResponse()->getContent();\n $this->assertEquals(200, $client->getResponse()->getStatusCode());\n $array = (array) json_decode($json);\n $this->assertCount(1, $array);\n }", "public function inviteAction()\n\t{\n\t\t$user = new Default_Model_User();\n\t\t$resultRow = $user->getUserByEmail($this->loggedEmail);\n\t\t\n\t\t$loggedHandle = $resultRow->handle;\n\t\t$loggedId = $resultRow->id;\n\t\t\n\t\t$handle = $this->_request->getParam('handle');\n\t\t$resultRow = $user->getUserByHandle($handle);\n\t\t$handleId = $resultRow->id;\n\n\t\t$invite = new Default_Model_Invitation();\n\t\tif($invite->createInvitation($loggedId, $handleId)){\n\t\t\t$this->view->success = 1;\n\t\t} else{\n\t\t\t$this->view->success = 0;\n\t\t}\n\t}", "public function invites();", "function add_user_role_leadership(){\r\n\tif(isset($_GET['addrole']) && ($_GET['addrole'] == 'do')){\r\n\t\tadd_role( 'quote_manager', 'Quote Manager', array( 'read' => true, 'level_2' => true ) );\r\n\r\n//\t\tremove_role( 'tow_company' );\r\n\t}\r\n}", "public function attachRole($role);", "public function attachRole($role);", "function lb_subscription_grant_role($account, $subscription) {\n user_multiple_role_edit(array($account->uid), 'add_role', $subscription->field_assign_role[LANGUAGE_NONE][0]['rid']);\n}", "public function assignRole ($name);", "function invite()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tlogout_invalid_user($this);\n\t\t\n\t\t# user has submitted the invitation\n\t\tif(!empty($_POST)){\n\t\t\t$response = $this->_tender->invite($_POST);\n\t\t\t$msg = (!empty($response) && $response['boolean'])? 'The Invitation for Bids/Quotations has been sent.' :'ERROR: The Invitation for Bids/Quotations could not be sent.';\n\t\t\t\n\t\t\t$this->native_session->set('__msg',$msg);\n\t\t}\n\t\telse if(!empty($data['a'])){\n\t\t\t$data['msg'] = $this->native_session->get('__msg');\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t\t$this->load->view('addons/basic_addons', $data);\n\t\t}\n\t\telse {\n\t\t\t$data['tender'] = $this->_tender->details($data['d']);\n\t\t\t$data['invited'] = $this->_tender->invitations($data['d']);\n\t\t\t$this->load->view('tenders/invite', $data);\n\t\t}\n\t}", "public function assignUser()\n {\n $user = User::find(request()['user_id']);\n\n $user->survey_id = request()['survey_id'];\n\n $user->save();\n\n return ['message' => 'survey assigned succefully'];\n }", "function add_role($role, $display_name, $capabilities = array())\n {\n }", "public function acceptMentorshipSession($mentorshipSessionId, $role, $id, $email) {\n $statusToSet = -1;\n $invitedPerson = null;\n $mentorshipSession = $this->getMentorshipSession($mentorshipSessionId);\n if($role === 'mentee') {\n $invitedPerson = $mentorshipSession->mentee;\n // this is the case when the mentee is available\n if($mentorshipSession->status_id === MentorshipSessionStatuses::$statuses['introduction_sent'])\n $statusToSet = MentorshipSessionStatuses::$statuses['available_mentee'];\n\n } else if($role === 'mentor') {\n $invitedPerson = $mentorshipSession->mentor;\n // this is the case when mentor is available\n if($mentorshipSession->status_id === MentorshipSessionStatuses::$statuses['available_mentee'])\n $statusToSet = MentorshipSessionStatuses::$statuses['available_mentor'];\n }\n if($statusToSet !== -1 && $invitedPerson->id == $id && $invitedPerson->email === $email) {\n $this->editMentorshipSession([\n 'status_id' => $statusToSet, 'mentorship_session_id' => $mentorshipSessionId\n ]);\n return true;\n } else {\n return false;\n }\n }", "public function acceptMentorshipSession($mentorshipSessionId, $role, $id, $email) {\n $statusToSet = -1;\n $invitedPerson = null;\n $mentorshipSession = $this->getMentorshipSession($mentorshipSessionId);\n if($role === 'mentee') {\n $invitedPerson = $mentorshipSession->mentee;\n // this is the case when the mentee is available\n if($mentorshipSession->status_id === MentorshipSessionStatuses::$statuses['introduction_sent'])\n $statusToSet = MentorshipSessionStatuses::$statuses['available_mentee'];\n\n } else if($role === 'mentor') {\n $invitedPerson = $mentorshipSession->mentor;\n // this is the case when mentor is available\n if($mentorshipSession->status_id === MentorshipSessionStatuses::$statuses['available_mentee'])\n $statusToSet = MentorshipSessionStatuses::$statuses['available_mentor'];\n }\n if($statusToSet !== -1 && $invitedPerson->id == $id && $invitedPerson->email === $email) {\n $this->editMentorshipSession([\n 'status_id' => $statusToSet, 'mentorship_session_id' => $mentorshipSessionId\n ]);\n return true;\n } else {\n return false;\n }\n }", "public function test_user_can_decline_their_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n factory(Box::class, 3)->create();\n\n $invite = Invite::create([\n 'email' => $user->email,\n 'box_id' => 1, //Box doesn't matter\n 'role' => 'coach',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 2,\n 'role' => 'owner',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $this->actingAs($user);\n\n $response = $this->post(route('frontend.invites.decline', $invite));\n\n $response->assertStatus(200);\n\n $invites = $user->invites();\n\n $this->assertEquals(2, $invites->count());\n\n }", "public function invite($user, $role) {\n\t\t$invitation = new Invitation();\n\t\t$invitation->setUsername($user->getName());\n\t\t$invitation->setEventId($this->event->getId());\n\t\t$invitation->setRole($role);\n\n\t\t$this->event->addInvitation($invitation);\n\t\t$this->event->save();\n\t}", "public function invite_action($user_id)\n {\n if (OrganizerInvite::canInvite()) {\n OrganizerInvite::invite($user_id);\n }\n $this->redirect('show/index');\n }", "public function test_user_can_accept_their_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n factory(Box::class, 3)->create();\n\n $invite = Invite::create([\n 'email' => $user->email,\n 'box_id' => 1, //Box doesn't matter\n 'role' => 'coach',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 2,\n 'role' => 'owner',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $this->actingAs($user);\n\n $response = $this->post(route('frontend.invites.accept', $invite));\n\n $response->assertStatus(200);\n\n $invites = $user->invites();\n\n $this->assertEquals(2, $invites->count());\n\n }", "public function saveAction()\n {\n $user = Mage::getSingleton('admin/session')->getUser(); \n $post_data = $this->getRequest()->getPost();\n\n try {\n $survey = Mage::getModel('client/survey')->loadSurveyByEmail($user->getEmail());\n if ($survey->getId()) $post_data['id'] = $survey->getId();\n\n $survey->setData($post_data);\n $survey->setName($user->getName());\n $survey->setEmail($user->getEmail());\n\n $survey->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('client')->__('Survey was successfully saved. Thank you!'));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*/');\n }", "public function approveInvitation() {\n $this->autoRender = false;\n $communityId = $this->request->data['communityId'];\n $community = $this->Community->findById($communityId);\n if (!empty($community)) {\n $userId = $this->Auth->user('id');\n $this->CommunityMember->approve($communityId, $userId);\n\t\t\t//Community follow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId,\n\t\t\t\t'notification' => FollowingPage::NOTIFICATION_ON\n\t\t\t);\n\t\t\t$this->FollowingPage->followPage($followCommunityData);\n\t\t\t\n $this->Session->setFlash(__('You are now a member of this community.'), 'success');\n } else {\n $this->Session->setFlash(__($this->invalidMessage), 'error');\n }\n }", "public function testUpdateRole()\n {\n }", "public function testUpdateRole()\n {\n }", "public function inviteUser()\r\n {\r\n Invite::instance()->from(Yii::$app->user->getIdentity())->about($this)->sendBulk($this->participantUsers);\r\n }", "public function test_user_cant_decline_not_their_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n factory(Box::class, 3)->create();\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 1, //Box doesn't matter\n 'role' => 'coach',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 2,\n 'role' => 'owner',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $invite = Invite::create([\n 'email' => \"[email protected]\",\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $this->actingAs($user);\n\n $response = $this->post(route('frontend.invites.decline', $invite));\n\n $response->assertStatus(302);\n\n $invites = $user->invites();\n\n $this->assertEquals(3, $invites->count());\n\n }", "public function setRole($role);", "public function setRole() {\n\n $res= $_POST['link']->query(\"SELECT t2.perm_name FROM role_perm as t1\n JOIN permissions as t2 ON t1.perm_id = t2.perm_id\n WHERE t1.role_id = $this->rol_id\");\n\n\n foreach($res as $item)\n $this->role_perm[]= $item['perm_name'];\n }" ]
[ "0.57561857", "0.57446307", "0.5615651", "0.54823786", "0.5481489", "0.5472063", "0.5465033", "0.5449939", "0.54238605", "0.53691775", "0.53691775", "0.53241235", "0.5298588", "0.5284737", "0.5282281", "0.5277075", "0.5253628", "0.5253628", "0.5229261", "0.5229117", "0.5210581", "0.5184523", "0.5179465", "0.51755655", "0.51436836", "0.51436836", "0.51401204", "0.5137852", "0.5121096", "0.50970566" ]
0.6120595
0
Returns a list of all invited users in a survey
function &getInvitedUsers() { global $ilDB; $result_array = array(); $result = $ilDB->queryF("SELECT user_fi FROM svy_inv_usr WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); while ($row = $ilDB->fetchAssoc($result)) { array_push($result_array, $row["user_fi"]); } return $result_array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_invited_users( $subscription_id ){\n return pms_get_member_subscription_meta( $subscription_id, 'pms_gm_invited_emails' );\n }", "public function getUserslistToInvite()\n\t{\n\t\t//get current login user session\n\t\t$results = array();\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t//get allsection setting sections for same course\n\t\t$sections_list = $this->__allSections();\n\t\t$options = array('course'=>$course_name,'section'=>$sections_list,'userName !='=>$user);\n\t\t$results = $this->PleUser->find('all',array('conditions'=>$options,'fields'=>array('userName','name'),'order' => array('PleUser.name ASC')));\n\t\tif ($results) {\n\t\t\treturn $results;\n\t\t}\n\t\treturn $results;\n\t}", "public function invites()\n {\n return $this->get('/user/invites');\n }", "public function invitations() {\n\n return DB::table('invitation')\n ->where('recepteur_id', Auth::User()->id)\n ->where('status', 0)\n ->get();\n }", "public function getInvitationsByUserId($id) {\n\t\tglobal $db;\n\n\t\t$invitations = $db->query(\"SELECT * FROM invites WHERE PersonID = $id\");\n\t\treturn $invitations;\n\t}", "public function invitations()\n {\n return $this->belongsToMany('App\\User', 'invitations');\n }", "public function invitations()\n {\n return $this->belongsToMany('App\\User')->active();\n }", "public function getInvitations ()\n {\n return $this->invitations;\n }", "public function sentInvitations(){\n return $this->belongsToMany('App\\User', 'invitations');\n }", "function get_survey_ids_by_user($email) {\n\t$mysql = new mysqli ( 'localhost', 'root', 'stu.fudan2013', 'EasyPolling' ) or die ( 'Cannot connect to Database' );\n\t$query = \"SELECT * from Poll where Creator='\" . $email . \"'\";\n\t$result = mysqli_query ( $mysql, $query );\n\t\n\t$returned = array ();\n\twhile ( $row = mysqli_fetch_array ( $result ) ) {\n\t\t$id = $row ['ID'];\n\t\t$survey = get_survey_by_id ( $id );\n\t\tarray_push ( $returned, array (\n\t\t\t\t'id' => $id,\n\t\t\t\t'survey' => $survey \n\t\t) );\n\t}\n\tmysqli_close ( $mysql );\n\t\n\treturn $returned;\n}", "function invitations()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tlogout_invalid_user($this);\n\t\t$data['tender'] = $this->_tender->details($data['d']);\n\t\t$data['invited'] = $this->_tender->invitations($data['d']);\n\t\t\n\t\tif(empty($data['invited'])) $data['msg'] = \"ERROR: No invitations can be resolved.\";\n\t\t$this->load->view('tenders/invitations', $data);\n\t}", "public function getAllUserAvailableSurveys(){\n // $takenSurveys = \\App\\TakenSurvey::where('user_id', \\Auth::user()->id);\n $result = \\DB::table('surveys')->\n whereRaw('id not in (select distinct survey_id from taken_surveys where user_id = ?)', [\\Auth::user()->id])->get();\n // $surveys = \\App\\Survey::\n\n // dd($result);\n echo $result;\n }", "function getTeamsUserInvitedIn($user_email)\n{\n try {\n $conection = Database::connect();\n if (!$conection) {\n die('Error: in connection Team');\n }\n\n $query = \"select teams_team_id from invitedUsers where user_email='$email'\";\n $result = mysqli_query($conection, $query);\n $a = array();\n while ($row = mysqli_fetch_assoc($result)) {\n $a[] = $row;\n }\n return $a;\n\n \n } catch (Exception $e) {\n echo $e->getMessage();\n }\t\n }", "public function sentInvites()\n {\n return $this->hasMany('App\\Invite', 'sender_id');\n }", "public function getMyNoticesUsers()\n {\n\t\t// Get my related departments\n\t\t$related_departments = [];\n\n $c_related = $this->getRelatedDepartments();\n\n if (!$c_related) return [];\n\n foreach ($c_related as $rel){\n\t\t\t$related_departments [] = $rel->id;\n\t\t}\n\n\n\t\t/*\n\t\t *\tGet related Departamental users from my related departments\n\t\t *\n\t\t * Conditions:\n\t\t * - agent ticketit_department in related_departments\n\t\t * - agent person in related_departments\n\t\t*/\n\t\t$related_users = \\PanicHDMember::where('id','!=',$this->id)\n\t\t\t->whereIn('ticketit_department', $related_departments);\n\n\t\t// Get users that are visible by all departments\n\t\t$all_dept_users = \\PanicHDMember::where('ticketit_department','0');\n\n\t\tif (version_compare(app()->version(), '5.3.0', '>=')) {\n\t\t\t$related_users = $related_users->pluck('id')->toArray();\n\t\t\t$related_users = array_unique(array_merge($related_users, $all_dept_users->pluck('id')->toArray()));\n\t\t}else{\n\t\t\t$related_users = $related_users->lists('id')->toArray();\n\t\t\t$related_users = array_unique(array_merge($related_users, $all_dept_users->lists('id')->toArray()));\n\t\t}\n\n\t\treturn $related_users;\n\t}", "public function inviteUser()\r\n {\r\n Invite::instance()->from(Yii::$app->user->getIdentity())->about($this)->sendBulk($this->participantUsers);\r\n }", "public function getParticipantUsers()\r\n {\r\n return $this->hasMany(User::class, ['id' => 'user_id'])->via('participants');\r\n }", "public function invites();", "public function index(User $user)\n {\n $invitations = Invitation::where('contact_id', $user->id)->where('viewed', false)->get();\n return $invitations;\n }", "public function actionSendInvitation() {\n\n $dbusers = Yii::app()->db->createCommand()\n ->select('user_name,user_email,user_id')\n ->from(\"user\")\n ->where(\"source='outside'\")\n ->queryAll();\n\n $users = array_chunk($dbusers, 15, true);\n\n $this->render(\"send_invitation\", array(\"users\" => $users));\n }", "public function getInvites(Request $request)\n {\n $meeting = Meeting::find($request->id);\n\n if ($meeting) {\n return json_encode(['success' => true, 'data' => $meeting->invites ? explode(',', $meeting->invites) : []]);\n }\n\n return json_encode(['success' => false]);\n }", "function getInvites() {\n $invites = $this->carddavBackend->getInvites($this->addressBookInfo['id']);\n\n $invites[] = new \\Sabre\\DAV\\Xml\\Element\\Sharee([\n 'href' => \\Sabre\\HTTP\\encodePath($this->getOwner()),\n 'access' => $this->getShareAccess(),\n 'inviteStatus' => SPlugin::INVITE_ACCEPTED,\n 'properties' => [],\n 'principal' => $this->getOwner()\n ]);\n\n return $invites;\n }", "public function invigilators()\n {\n return $this->belongsToMany(Professor::class, 'timetable_schedule_invigilators', 'timetable_schedule_id', 'invigilator_id');\n }", "public function invites()\n {\n return $this->hasMany(Invite::class);\n }", "public function invitations()\n {\n return $this->hasMany(Invitation::class);\n }", "function get_voted_surveys_by_user($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n // query to get all vote survey_ids for user\r\n $sql = \"SELECT survey_id\r\n FROM votes\r\n WHERE is_active='1' AND user_id='$user_id'\";\r\n\r\n $votes_data = array();\r\n $votes_survey = array();\r\n $votes_survey_unique = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $votes_data[$key] = $value;\r\n foreach ($votes_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $votes_survey[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n $votes_survey_unique = array_unique($votes_survey);\r\n\r\n return $votes_survey_unique;\r\n}", "public function getAllUsers(){\n $stmt = $this->databaseConnection->prepare(\"SELECT users.login, users.phone, users.invite, cities.city_name, invites.date_status_\n FROM users\n LEFT JOIN cities ON users.id_city = cities.id_city\n LEFT JOIN invites ON users.invite = invites.invite\");\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }", "public function all($account)\n {\n return $this->requestGet(\n sprintf('users/%s/invitations', $account)\n );\n }", "public function get_issuers() {\n\t\treturn $this->issuers;\n\t}", "static function getInvitations($data){\n $list=MedicalGroupInvitation::find_by_sql(\"SELECT gr.name, gr.image, gri.id, gri.medical_group_id, gri.user_id, gri.email, gri.status, gri.active, gri.created_by, gri.created_on, gri.secret FROM `medical_group_invitations` gri left join medical_groups gr on gri.medical_group_id=gr.id where gri.user_id=\".$data[\"user_id\"].\" and gri.status='\".$data[\"status\"].\"'\");\n $invitation_list=array();\n if(!empty($list)){\n foreach($list as $li){\n $invitation_list[]=array(\n \"id\"=>$li->id,\n \"name\"=>$li->name,\n \"image\"=>$li->image,\n \"status\"=>$li->status,\n \"secret\"=>$li->secret\n );\n }\n }\n return $invitation_list;\n }" ]
[ "0.65762496", "0.637841", "0.6375574", "0.624361", "0.6211922", "0.62026507", "0.61637163", "0.61040336", "0.59692955", "0.5915579", "0.5905201", "0.58193666", "0.5797444", "0.5784785", "0.5780078", "0.5774793", "0.57690275", "0.57168305", "0.57062966", "0.57038146", "0.56960547", "0.5693165", "0.5663516", "0.5635097", "0.56196016", "0.5618162", "0.5613922", "0.5576279", "0.5519845", "0.5491918" ]
0.78613234
0
Deletes the working data of a question in the database
function deleteWorkingData($question_id, $active_id) { global $ilDB; $affectedRows = $ilDB->manipulateF("DELETE FROM svy_answer WHERE question_fi = %s AND active_fi = %s", array('integer','integer'), array($question_id, $active_id) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "function editCleanUp($question_id)\r\n {\r\n \t\t$this->query('DELETE FROM questions WHERE id='.$question_id);\r\n\t\t$this->query('DELETE FROM responses WHERE question_id='.$question_id);\r\n\t\t$this->query('DELETE FROM survey_questions WHERE question_id='.$question_id);\r\n }", "function ipal_clear_question(){\r\n\tglobal $ipal;\r\n\tglobal $DB;\r\n\t\r\n\t if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\n\t $mybool=$DB->delete_records('ipal_active_questions', array('ipal_id'=>$ipal->id));\r\n\t }\r\n}", "public function deleteDatabaseStructure( );", "public function delete()\n {\n $query = $this->db->getQuery(true);\n\n $query\n ->delete($this->db->quoteName(\"#__crowdf_intentions\"))\n ->where($this->db->quoteName(\"id\") .\"=\". (int)$this->id);\n\n $this->db->setQuery($query);\n $this->db->execute();\n\n $this->reset();\n }", "public function delete_question(){\n $question_id = $this->input->post('question_id');\n $challenge_id = $this->input->post('challenge_id');\n\n $question = new stdClass();\n\n if($this->questionlib->isSafeToDelete($question_id) === true){\n $question->question_id = $question_id;\n\n $this->question_model->delete($question);\n $this->challenge_question_model->delete($challenge_id, $question_id);\n $out['deleted'] = true;\n }else{\n $out['message'] = \"Question have associate data, it can't be deleted\";\n }\n $this->output->set_output(json_encode($out));\n\n }", "function delete()\r\n\t{\r\n\t\tglobal $debug;\r\n\t\t$dbh = getOpenedConnection();\r\n\r\n\t\t// Delete current item\r\n\t\t$sql = \"delete from tbl_Pistol_CompetitionDay\r\n\t\t\twhere Id = $pid;\r\n\t\t\";\r\n\r\n\t\t\r\n\t\tif ($debug)\r\n\t\t\tprint_r(\"SQL: \" . $sql);\r\n\t\t\t\r\n\t\tmysqli_query($dbh,$sql);\r\n\t\tif (mysqli_errno($dbh)!=0) {\r\n\t\t\tprint_r(mysqli_error($dbh));\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$this->clear(); // Clear current object\r\n\r\n\t}", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function deleteAnswer()\n {\n $this->is_answer = false;\n $this->topic->is_answered = false;\n $post = $this;\n\n Db::transaction(function() use ($post)\n {\n $post->topic->save();\n $post->save();\n });\n }", "function delete_question($id){\n $this->db->where('question_id', $id);\n $this->db->delete('questions');\n }", "public function deleted(InterviewQuestion $interviewQuestion): void\n {\n //\n }", "public function tearDown() {\n\t\t$sql = \"DELETE FROM solrexample WHERE 1=1\";\n\t\tExampleSolrActiveRecord::model()->getDbConnection()->createCommand($sql)->execute();\n\t}", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n\n /* Get a lecture that this subtask is related to. */\n $lectureBean = new LectureBean ($this->id, $this->_smarty, \"\", \"\");\n $lectureBean->assignSingle();\n }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "private function clear_dummy_data()\n {\n $this->adapter->query('DELETE FROM ' . RUCKUSING_TS_SCHEMA_TBL_NAME);\n }", "public function eraseData()\n {\n $s = 'DELETE FROM `commitMessage` WHERE `user`=\"%s\"';\n $params = array($this->vcsLogin);\n $this->conn->query($s, $params);\n\n $s = 'DELETE FROM `work` WHERE `userID`=%d';\n $params = array($this->userID);\n $this->conn->query($s, $params);\n\n $s = 'DELETE FROM `patches` WHERE `userID`=%d';\n $params = array($this->userID);\n $this->conn->query($s, $params);\n\n $s = 'DELETE FROM `users` WHERE `userID`=%d';\n $params = array($this->userID);\n $this->conn->query($s, $params);\n }", "public function delete() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"DELETE FROM \".$this->getTableName();\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function delete()\n\t{\n\t\t$transaction = $this->dbConnection->beginTransaction();\n\t\ttry {\n\t\t\tforeach ($this->previnterventions as $prev) {\n\t\t\t\t$prev->delete();\n\t\t\t}\n\t\t\tforeach ($this->relevantinterventions as $relv) {\n\t\t\t\t$relv->delete();\n\t\t\t}\n\t\t\tforeach ($this->deviationreasons as $devr) {\n\t\t\t\t$devr->delete();\n\t\t\t}\n\t\t\tforeach ($this->filecollection_assignments as $fca) {\n\t\t\t\t$fca->delete();\n\t\t\t}\n\t\t\tif (parent::delete()) {\n\t\t\t\t$transaction->commit();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new Exception('unable to delete');\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$transaction->rollback();\n\t\t\tthrow $e;\n\t\t}\n\n\t}", "function erase() {\n //delete * from database\n }", "function delete_question($questionid) {\n global $DB;\n $DB->delete_records(\"question_calculated\", array(\"question\" => $questionid));\n $DB->delete_records(\"question_numerical_units\", array(\"question\" => $questionid));\n if ($datasets = $DB->get_records('question_datasets', array('question' => $questionid))) {\n foreach ($datasets as $dataset) {\n if (!$DB->get_records_select(\n 'question_datasets',\n \"question != ?\n AND datasetdefinition = ?;\", array($questionid, $dataset->datasetdefinition))){\n $DB->delete_records('question_dataset_definitions', array('id' => $dataset->datasetdefinition));\n $DB->delete_records('question_dataset_items', array('definition' => $dataset->datasetdefinition));\n }\n }\n }\n $DB->delete_records(\"question_datasets\", array(\"question\" => $questionid));\n return true;\n }", "function pubf_DeleteSingleAnswer(){\n //delete all relations from table actividadrespuesta\n $DeleteSingleAnswer=$this->prepare(\"DELETE FROM actividadrespuesta WHERE idRespuesta = :idRespuesta\");\n $DeleteSingleAnswer->bindParam(':idRespuesta' , $this->idRespuesta);\n $this->executeQueryPrepare($DeleteSingleAnswer);\n $DeleteRelatedAnswer=$this->prepare(\"DELETE FROM respuesta WHERE idRespuesta = :idRespuesta\");\n $DeleteRelatedAnswer->bindParam(':idRespuesta' , $this->idRespuesta);\n $this->executeQueryPrepare($DeleteRelatedAnswer);\n }", "public function tearDown()\n {\n $sqlBuilder = new \\Apps\\Database\\Delete();\n $sql = $sqlBuilder->delete()->from('Shows')->where('Country = :country')->result();\n $pdo = array('country' => 'UnitTest');\n $this->database->run($sql, $pdo);\n\n $sql = $sqlBuilder->delete()->from('Songs')->where('Title LIKE :title')->result();\n $pdo = array('title' => 'UnitTest%');\n $this->database->run($sql, $pdo);\n\n $sql = $sqlBuilder->delete()->from('People')->where('Name LIKE :name')->result();\n $pdo = array('name' => 'UnitTest%');\n $this->database->run($sql, $pdo);\n\n $this->database->close();\n }", "public function test_deleting_question() {\n global $DB;\n\n // create a user\n $user = $this->getDataGenerator()->create_user();\n\n // create a course\n $course = $this->getDataGenerator()->create_course();\n\n // create a course module\n $videoquanda = $this->getDataGenerator()->create_module('videoquanda', array(\n 'course' => $course->id\n ));\n\n $now = time();\n\n $this->loadDataSet($this->createArrayDataSet(array(\n 'videoquanda_questions' => array(\n array('id', 'instanceid', 'userid', 'timecreated', 'timemodified' ,'seconds', 'text'),\n array(1, $videoquanda->id, $user->id, $now, $now + 1, 2, 'dummy text')\n )\n )));\n\n // enrol the user on the course\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $DB->get_field('role', 'id', array(\n 'shortname' => 'student',\n )));\n\n // login the user\n $this->setUser($user);\n\n $client = new Client($this->_app);\n $client->request('DELETE', '/api/v1/' . $videoquanda->id . '/questions/1');\n\n $this->assertEquals(204, $client->getResponse()->getStatusCode());\n $this->assertFalse($DB->record_exists('videoquanda_questions', array('instanceid' => $videoquanda->id)));\n }", "function deleteSurveyRecord()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy WHERE survey_id = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\n\t\t$result = $ilDB->queryF(\"SELECT questionblock_fi FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$questionblocks = array();\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tarray_push($questionblocks, $row[\"questionblock_fi\"]);\n\t\t}\n\t\tif (count($questionblocks))\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulate(\"DELETE FROM svy_qblk WHERE \" . $ilDB->in('questionblock_id', $questionblocks, false, 'integer'));\n\t\t}\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_qblk_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t$this->deleteAllUserData();\n\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_anonymous WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t\n\t\t// delete export files\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\t$directory = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tif (is_dir($directory))\n\t\t{\n\t\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t\tilUtil::delDir($directory);\n\t\t}\n\n\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t$mobs = ilObjMediaObject::_getMobsOfObject(\"svy:html\", $this->getId());\n\t\t// remaining usages are not in text anymore -> delete them\n\t\t// and media objects (note: delete method of ilObjMediaObject\n\t\t// checks whether object is used in another context; if yes,\n\t\t// the object is not deleted!)\n\t\tforeach($mobs as $mob)\n\t\t{\n\t\t\tilObjMediaObject::_removeUsage($mob, \"svy:html\", $this->getId());\n\t\t\t$mob_obj =& new ilObjMediaObject($mob);\n\t\t\t$mob_obj->delete();\n\t\t}\n\t}", "function delete_question($objet) {\n\t\t$sql = \"DELETE FROM \n\t\t\t\t\tquestions\n\t\t\t\tWHERE\n\t\t\t\t\tid = \".$objet['id'];\n\t\t// return $sql;\n\t\t$result = $this -> query($sql);\n\t\t\n\t\treturn $result;\n\t}", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "function deleteProblem() {\n /*\n * 1. Delete problem from table problem\n * 2. Delete all records about problem from table problemsolve\n */\n global $con;\n\n // (1 start)\n $statement = $con -> prepare(\"DELETE FROM problem\n WHERE problemid=?\");\n if(!$statement) {\n showFrame(\"Příklad se <b>nepodařilo odstranit</b>: \" . $con->error, false);\n return;\n }\n\n $ok = $statement -> bind_param(\"i\", $_POST[\"problemid\"]);\n if(!$ok) {\n showFrame(\"Příklad se <b>nepodařilo odstranit</b>: \" . $con->error, false);\n return;\n }\n \n $ok = $statement -> execute();\n if(!$ok) {\n showFrame(\"Příklad se <b>nepodařilo odstranit</b>: \" . $con->error, false);\n return;\n }\n // (1 end)\n\n // (2 start)\n $statement = $con -> prepare(\"DELETE FROM problemsolve\n WHERE problemid=?\");\n if(!$statement) {\n showFrame(\"Příklad se <b>nepodařilo odstranit</b>: \" . $con->error, false);\n return;\n }\n\n $ok = $statement -> bind_param(\"i\", $_POST[\"problemid\"]);\n if(!$ok) {\n showFrame(\"Příklad se <b>nepodařilo odstranit</b>: \" . $con->error, false);\n return;\n }\n\n $ok = $statement -> execute();\n if(!$ok) {\n showFrame(\"Příklad se <b>nepodařilo odstranit</b>: \" . $con->error, false);\n return;\n }\n // (2 end)\n\n showFrame(\"Příklad byl <b>úspěšně odstraněn</b>!\", true);\n}" ]
[ "0.69567966", "0.6898568", "0.66847533", "0.6651861", "0.66191804", "0.6539403", "0.6509638", "0.6497958", "0.6489918", "0.6462393", "0.6458469", "0.640661", "0.63950545", "0.63786817", "0.63769126", "0.6362017", "0.6351692", "0.6338108", "0.6329177", "0.632271", "0.6321172", "0.6313583", "0.6305089", "0.6299416", "0.62927204", "0.6291303", "0.62909824", "0.6286984", "0.6286221", "0.62791187" ]
0.72457767
0
Fills a survey randomly with data for a given user.
function fillSurveyForUser($user_id = ANONYMOUS_USER_ID) { global $ilDB; // create an anonymous key $anonymous_id = $this->createNewAccessCode(); $this->saveUserAccessCode($user_id, $anonymous_id); // create the survey_finished dataset and set the survey finished already $active_id = $ilDB->nextId('svy_finished'); $affectedRows = $ilDB->manipulateF("INSERT INTO svy_finished (finished_id, survey_fi, user_fi, anonymous_id, state, tstamp) ". "VALUES (%s, %s, %s, %s, %s, %s)", array('integer','integer','integer','text','text','integer'), array($active_id, $this->getSurveyId(), $user_id, $anonymous_id, 1, time()) ); // fill the questions randomly $pages =& $this->getSurveyPages(); foreach ($pages as $key => $question_array) { foreach ($question_array as $question) { // instanciate question require_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php"; $question =& SurveyQuestion::_instanciateQuestion($question["question_id"]); $question->saveRandomData($active_id); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillQuestion($data)\r\n {\r\n\tfor( $i=0; $i<$data['count']; $i++ ){\r\n\t\t$data[$i]['Question'] = $this->findAll($conditions='id='.$data[$i]['SurveyQuestion']['question_id'], $fields=\"prompt, type\");\r\n\t\t$data[$i]['Question'] = $data[$i]['Question'][0]['Question'];\r\n\t\t$data[$i]['Question']['number'] = $data[$i]['SurveyQuestion']['number'];\r\n\t\t$data[$i]['Question']['id'] = $data[$i]['SurveyQuestion']['question_id'];\r\n\t\t$data[$i]['Question']['sq_id'] = $data[$i]['SurveyQuestion']['id'];\r\n\t\tunset($data[$i]['SurveyQuestion']);\r\n\t}\r\n\r\n\treturn $data;\r\n }", "public function randomQuestionWithNoUser(): void\n {\n QuestionUserHelper::removeAllQuestionsForUser($this->user);\n QuestionHelper::newQuestion();\n\n $questionsList = User::randomQuestions();\n\n $this->assertFalse($this->user->questions()->get()->contains($questionsList));\n }", "public function randomQuestionWithUserInStormMode(): void\n {\n QuestionUserHelper::removeAllQuestionsForUser($this->user);\n QuestionHelper::newQuestion();\n\n $questionsList = User::randomQuestions('storm', [], Question_user::DEFAULT_BAG_LIMIT ,$this->user);\n\n $this->assertFalse($this->user->questions()->get()->contains($questionsList));\n }", "public function run()\n {\n \\App\\Models\\User::factory(5)->create()->each(function($user){\n $user->questions()->saveMany(\n \\App\\Models\\Question::factory(rand(1, 5))->create()->make()\n )->each(function($q){\n $q->answers()->saveMany(factory(App\\Models\\Answer::class, rand(1, 5))->make());\n });\n });\n }", "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "public function randomQuestionWithSelfsameBag(): void\n {\n $unexpectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $unexpectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', [$unexpectedQuestion1->id, $unexpectedQuestion2->id]);\n\n $this->assertFalse($questionsList->contains($questionsList));\n $this->assertEmpty($questionsList);\n }", "protected function createSurveysForUser($count = 1)\n {\n // Create surveys\n $surveys = $this->user->surveys()->saveMany(factory(Survey::class, $count)->make());\n\n // Add 5 questions to each survey\n $surveys->each(function ($survey) {\n $survey->questions()->saveMany(factory(\\App\\Question::class, 5)->make());\n });\n\n // then return surveys\n return $surveys;\n }", "public function randomQuestion(): void\n {\n $expectedQuestion = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $randomQuestions = $this->user->randomUserQuestion();\n\n $this->assertTrue($randomQuestions->contains($expectedQuestion));\n }", "private function createQuestionForUser(User $mainUser)\n {\n for ($questionIndex = 0; $questionIndex < random_int(1, 20); $questionIndex += 1) {\n QuestionUserHelper::createIncomingQuestionForUser($mainUser);\n }\n\n for ($questionIndex = 0; $questionIndex < random_int(1, 20); $questionIndex += 1) {\n $questionUser = QuestionUserHelper::createScheduledQuestionForUser($mainUser);\n QuestionUserHelper::createMnemonicForQuestionUser($questionUser);\n }\n\n for ($questionIndex = 0; $questionIndex < random_int(1, 20); $questionIndex += 1) {\n QuestionUserHelper::createMemorizedQuestionsForUser($mainUser);\n }\n\n for ($questionIndex = 0; $questionIndex < random_int(1, 20); $questionIndex += 1) {\n QuestionUserHelper::createNotInitiatedQuestionForUser($mainUser);\n }\n }", "function assign_random_domain($user_id)\n{\n\t$user_domains = TaskBuffer::where('user_id', $user_id)->lists('domain_id');\n\t$all_domains = Domain::all()->lists('id');\n\t$diff = array_diff($all_domains, $user_domains);\n\t$diff = array_values($diff);\n\n\tif (sizeof($diff) > 0)\n\t{\n\t\t$domain_id = select_domain($diff);\n\t\tif (create_task_buffer($domain_id, $user_id))\n\t\t\t$response_array = array(\"status\" => \"success\");\n\t\telse\n\t\t\t// echo \"assigning random domain failed\";\n\t\t\t$response_array = array(\"status\" => \"fail\");\n\t}\n\telse\n\t\t$response_array = array(\"status\" => \"done\");\n\treturn $response_array;\n}", "public function run()\n {\n foreach (User::all() as $user) {\n foreach (District::all() as $district) {\n factory(Respondent::class, rand(3, 10))->create([\n 'district_id' => $district->id\n ]);\n\n foreach (Respondent::where('district_id', $district->id)->get() as $respondent) {\n //get any 2 random groups that belong to the user and pluck their id into an array\n $groups = $user->groups()->inRandomOrder()->limit(2)->get()->pluck('id')->toArray();\n\n //add the respondent to the groups from the previous step\n $respondent->groups()->attach($groups);\n }\n }\n }\n }", "public function enqueueRandom($user_id = 0) {\n\t\t$this->Track->contain();\n\t\t$track = $this->Track->find('all', array(\"order\" => \"RAND()\", \"limit\"=>1));\n\n\t\t$data = $this->create(array(\n\t\t\t\"track_id\" => $track[0][\"Track\"][\"id\"],\n\t\t\t\"user_id\" => $user_id, \n\t\t\t\"played\" => 0\n\t\t));\n\t\t\n\t\treturn $this->save($data);\n\t\t\n\t}", "public function seed()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n if($this->request->server['REMOTE_ADDR'] != '127.0.0.1' && $this->request->server['REMOTE_ADDR'] != '::1')\n return 403;\n\n $matcher = new SurveyMatcher();\n $matcher->seed((isset($this->request->get['limit']) ? $this->request->get['limit'] : 150));\n\n $this->response->write('OK');\n }", "public function run()\n {\n factory(Question::class, mt_rand(50, 80))\n ->make()\n ->each(function (Question $question) {\n $question->user_id = $this->getUserId();\n\n $question->save();\n\n $question->categories()->sync($this->getCategories());\n\n $this->makeAnswers($question);\n });\n }", "public function randomQuestionWithEmptyBag(): void\n {\n $expectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $expectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', []);\n\n $this->assertTrue($questionsList->contains($expectedQuestion1));\n $this->assertTrue($questionsList->contains($expectedQuestion2));\n }", "public function randomQuestionWithNonEmptyBag(): void\n {\n $expectedQuestion1 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $expectedQuestion2 = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $unexpectedQuestion = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n\n $questionsList = $this->user->randomUserQuestion('soft', [$unexpectedQuestion->id]);\n\n $this->assertTrue($questionsList->contains($expectedQuestion1));\n $this->assertTrue($questionsList->contains($expectedQuestion2));\n\n $this->assertFalse($questionsList->contains($unexpectedQuestion));\n }", "public function run() {\n DB::table('answers')->truncate();\n $completedSurveys = CompletedSurvey::all();\n foreach ($completedSurveys as $completedSurvey) {\n $questions = DB::table('question_survey')\n ->join('questions', 'question_survey.question_id', '=', 'questions.id')\n ->where('question_survey.survey_id', '=', $completedSurvey['survey_id'])\n ->get();\n foreach ($questions as $question) {\n $value = rand(1, $question->max_rate);\n Answer::create([\n 'completed_survey_id' => $completedSurvey['id'],\n 'question_id' => $question->id, \n 'value' => $value,\n ]);\n }\n }\n }", "public function run(Faker\\Generator $faker)\n\t{\n\t\t$userJSON = File::get(storage_path('data/choices.json'));\n\t\t$datas = json_decode($userJSON);\n\n\t\tfor ($i = 0; $i < 10; $i++)\n\t\t{\n\t\t\t$date = $faker->dateTimeBetween('-1 year');\n\t\t\t$question = App\\Question::create([\n\t\t\t\t'title'\t\t\t=> 'Exo-'.$i,\n\t\t\t\t'content'\t\t=> $faker->realText(50),\n\t\t\t\t'class_level'\t=> array_rand(['first_class' => '0', 'final_class' => '0']),\n\t\t\t\t'published'\t\t=> 1,\n\t\t\t\t'created_at' \t=> $date\n\t\t\t]);\n\n\t\t\tfor ($j=0; $j < rand(3,7); $j++) { \n\t\t\t\t$choice = array_rand($datas);\n\t\t\t\tApp\\Choice::create([\n\t\t\t\t\t'question_id' \t=> $question->id,\n\t\t\t\t\t'content' \t\t=> $datas[$choice]->content,\n\t\t\t\t\t'answer' \t\t=> $datas[$choice]->answer,\n\t\t\t\t\t'created_at' \t=> $date\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t$students = App\\User::select('id')->where('level', $question->class_level)->get();\n\t\t\tif (count($students) > 0) \n\t\t\t{\n\t\t\t\tforeach ($students as $student)\n\t\t\t\t{ \n\t\t\t\t\t# Insère les données de score pour chaque étudiant\n\t\t\t\t\tApp\\Score::create([\n\t\t\t\t\t\t'user_id' => $student->id,\n\t\t\t\t\t\t'question_id' => $question->id,\n\t\t\t\t\t\t'done' => false,\n\t\t\t\t\t\t'created_at' => $date\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function createRandomUsers() {\n\n $faker = Faker\\Factory::create();\n\n $Equipos = Equipos::all(); \n\n for($i=0; $i < 4; $i++) {\n User::create([\n 'name' => $faker->firstName,\n 'puntaje' => rand(1,30),\n 'lastname' => $faker->lastName,\n 'nacimiento' => Carbon::now(),\n 'fecha_visita'=> Carbon::now(),\n 'email' => $faker->email,\n 'equipo_id' => $Equipos->random(1)->id,\n 'password' => Hash::make('12345678'), //Vital guardar la contraseña encriptada o no nos vamos a poder autenticar!\n ]); \n }\n }", "function set_up_question($question_ID)\r\n{\r\n\tglobal $mydb, $question, $answers, $correct_answer, $is_question, $is_random_question;\r\n\t\r\n\t// set the is question global variable\r\n\t$is_question = true;\r\n\r\n\tif (($question_ID == \"random\") || !$question_ID)\r\n\t{\r\n\t\t$is_random_question = true;\r\n\t\t$question = get_question_random();\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$is_random_question = false;\r\n\t\t$question = get_question_from_ID($question_ID);\r\n\r\n\t}\r\n\t\r\n\t// get random answers\r\n\t$answers = $question->get_Answers();\r\n\t\r\n\t// get the correct answer and remember it\r\n\tforeach ($answers as $answer)\r\n\t{\r\n\t\tif ($answer->is_correct())\r\n\t\t{\r\n\t\t\t$correct_answer = $answer;\r\n\t\t}\r\n\t}\r\n}", "private function example_of_user() {\n $data = array();\n $randomString = \\App\\Helpers::generateRandomString(1);\n //$data['name'] = 'User' . $randomString;\n $data['name'] = '';\n $data['phone'] = '';\n $data['email'] = 'user' . $randomString . '@gmail.com';\n $data['password'] = '1234';\n $data['password'] = '1234';\n\n return $data;\n }", "public function fill($user)\n {\n $this->id = $user['id'];\n $this->attributes = $user['attributes'];\n\n return $this;\n }", "function fill( &$questionArray )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $this->ID =& $questionArray[$db->fieldName( \"ID\" )];\r\n $this->Name =& $questionArray[$db->fieldName( \"Name\" )];\r\n $this->Description =& $questionArray[$db->fieldName( \"Description\" )];\r\n $this->Game = new eZQuizGame( $questionArray[$db->fieldName( \"GameID\" )] );\r\n }", "public function run()\n {\n DB::table('votables')->where('votable_type','App\\Question')->delete();\n\n $users=\\App\\User::all();\n $numberOfUsers=$users->count();\n $votes=[-1,1];\n\n foreach (\\App\\Question::all() as $question) {\n for ($i=0; $i< rand(0,$numberOfUsers);$i++){\n $user=$users[$i];\n $user->voteQuestion($question,$votes[rand(0,1)]);\n }\n }\n\n }", "function distributeInitialCards($userId) {\n\t$gameId = getGameOf($userId);\n\t$options = getUnusedCards($gameId);\n\t$hand = array();\n\n\tfor ($i = 0; $i < 7; $i++) {\n\t\t$chosen = array_rand($options); // index, not the card\n\n\t\t$sql = \"insert into decks (user_id, card_name) values ($userId, '$options[$chosen]')\";\n\t\tSQLInsert($sql);\n\t\tarray_push($hand, $options[$chosen]);\n\n\t\tarray_splice($options, $chosen, 1); // avoids calling getUnusedCards again\n\t}\n}", "public function fillQuestion(array $question)\n\t{\n\t\t[$inputMode, $inputExpectation, $notUseful, $from] = explode('_', $question['type']);\n\n\t\tvar_dump($inputMode, $inputExpectation, $notUseful, $from);\n\t\t//var_dump($question['function']['name']);\n\n\t\tif($inputMode == 'type')\n\t\t{\n\t\t\t$question['text'] .= $question['function'][$from] . ' ?';\n\t\t\t$question['answer_text'] = $question['function'][$inputExpectation];\n\t\t}\n\n\t\telseif($inputMode == 'choose')\n\t\t{\n\t\t\t$question['answer_text'] = $question['function'][$inputExpectation];\n\n\t\t\tif($from == 'name')\n\t\t\t{\n\t\t\t\t$question['text'] .= $question['function']['name'] . '() ?';\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$question['text'] .= $question['function'][$from] . ' ?';\n\t\t\t}\n\n\t\t\t$question['choices'] = $this->generateChoices($question);\n\n\t\t\t//put correct answer in (by clobbering one of generated choices)\n\t\t\t$randomChoice = array_rand($question['choices']);\n\n\t\t\t$question['choices'][$randomChoice] = $question['answer_text'];\n\t\t\t$question['answer_index'] = $randomChoice;\n\t\t}\n\n\t\t\n\n\t\treturn $question;\n\t}", "public function run()\n {\n User::factory()\n ->times(100)\n ->create()\n ->each(function ($user) {\n Hobby::factory()\n ->times(rand(1, 8))\n ->create([\n 'user_id' =>$user->id\n ])\n ->each(function ($hobby) {\n $tag_ids = range(1, 8);\n\n shuffle($tag_ids);\n\n $assignments = array_slice($tag_ids, 0, rand(0, 8));\n\n foreach($assignments as $tag_id) {\n // we use DB::table when we don't have a defined model in App\\Models\n DB::table('hobby_tag')\n ->insert([\n 'hobby_id' => $hobby->id,\n 'tag_id' => $tag_id,\n 'created_at' => now(),\n 'updated_at' => now()\n ]);\n }\n });\n });\n }", "function get_available_by_user_surveys($user_id) {\r\n // get available by time\r\n $available_by_time_surveys = array();\r\n if (get_available_by_time_surveys()) {\r\n $available_by_time_surveys = get_available_by_time_surveys();\r\n }\r\n\r\n // get user groups\r\n $user_staff_groups = get_user_staff_groups($user_id);\r\n $user_student_groups = get_user_student_groups($user_id);\r\n $user_local_groups = get_user_local_groups($user_id);\r\n\r\n // set available_by_user_surveys\r\n $available_by_user_surveys = array();\r\n foreach ($available_by_time_surveys as $survey_id) {\r\n // check whether is already voted\r\n // get survey groups\r\n $survey_staff_groups = get_survey_staff_groups($survey_id);\r\n $survey_student_groups = get_survey_student_groups($survey_id);\r\n $survey_local_groups = get_survey_local_groups($survey_id);\r\n\r\n // get common groups\r\n $staff_groups = array_intersect($user_staff_groups, $survey_staff_groups);\r\n $student_groups = array_intersect($user_student_groups, $survey_student_groups);\r\n $local_groups = array_intersect($user_local_groups, $survey_local_groups);\r\n\r\n // get all available surveys\r\n if (!empty($staff_groups) || !empty($student_groups) || !empty($local_groups)) {\r\n array_push($available_by_user_surveys, $survey_id);\r\n }\r\n }\r\n\r\n return $available_by_user_surveys;\r\n}", "private function getInitialData($userid) {\r\n\t\t// get trials for this researcher\r\n\t\t$returnArray = array();\r\n\t\t$researcher = $trials = $trialList = array();\r\n\t\t$result = getData(\"t,r|t->rt(trialid)->r(researcherid)|researcherid={$userid}\");\r\n\t\t// \"t,r|t->rt(trialid)->r(researcherid)|researcherid={$userid}\"\r\n\t\t$sql = \"SELECT t.*, r.*\r\n\t\t\tFROM trial t\r\n\t\t\tINNER JOIN researcher_trial_bridge rt ON rt.trialid = t.trialid\r\n\t\t\tINNER JOIN researcher r ON r.researcherid = rt.researcherid\r\n\t\t\tWHERE t.active = 1 AND r.active = 1 AND r.researcherid = {$userid}\";\r\n\t\t$result = $db->query($sql);\r\n\t\tif($result && count($result)) {\r\n\t\t\tforeach($result as $row) {\r\n\t\t\t\t$trialid = $row['trialid'];\r\n\t\t\t\tif(!in_array($trialid, $trialList)) $trialList[] = $row['trialid'];\r\n\t\t\t\tif(!array_key_exists($trialid, $trials)) {\r\n\t\t\t\t\t$trials[$trialid] = array(\r\n\t\t\t\t\t\t\"trial_name\" => $row['trial_name'],\r\n\t\t\t\t\t\t\"purpose\" => $row['purpose'],\r\n\t\t\t\t\t\t\"creation_date\" => $row['creation_date']\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tif(!count(array_keys($researcher))) {\r\n\t\t\t\t\t$researcher = array(\r\n\t\t\t\t\t\t\"prefix\" => $row['prefix'],\r\n\t\t\t\t\t\t\"first_name\" => $row['first_name'],\r\n\t\t\t\t\t\t\"last_name\" => $row['last_name'],\r\n\t\t\t\t\t\t\"suffix\" => $row['suffix'],\r\n\t\t\t\t\t\t\"affiliation\" => $row['affiliation']\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(count($trialList) == 1) {\r\n\t\t\t// given the selected trial, acquire the next batch of data\r\n\r\n\t\t} else if(count($trialList) > 1) {\r\n\t\t\t// this is all the data that's needed for now; after researcher selects a trial, the next batch will be acquired\r\n\t\t\t$returnArray = array(\"researcher\" => $researcher, \"trials\" => $trials, \"trialList\" => $trialList);\r\n\t\t}\r\n\t}", "public function run()\n {\n DB::table('surveys')->truncate();\n\n foreach (range(1, 3) as $value)\n {\n $answers = [];\n\n foreach (range(1, 32) as $index)\n {\n $answers[] = ['yes', 'no'][mt_rand(0, 1)];\n }\n\n Survey::create([\n 'uuid' => Str::uuid(),\n 'name' => ['John', 'William', 'Tim', 'Dirk'][mt_rand(0, 3)],\n 'age' => mt_rand(20, 60),\n 'gender' => ['male', 'female'][mt_rand(0, 1)],\n 'answers' => json_encode($answers),\n ]);\n }\n\n }" ]
[ "0.6117004", "0.5981043", "0.5835476", "0.570479", "0.5660205", "0.56394047", "0.56210417", "0.55576503", "0.5463925", "0.54251826", "0.54230016", "0.5416017", "0.5406107", "0.53853905", "0.538141", "0.52993417", "0.52614343", "0.52566254", "0.5168657", "0.51340044", "0.51329553", "0.513137", "0.51088226", "0.5095676", "0.50891834", "0.5088288", "0.50783235", "0.5074232", "0.5054124", "0.5046678" ]
0.80236334
0
Checks if a user is allowed to take multiple survey
function isAllowedToTakeMultipleSurveys($userid = "") { // #7927: special users are deprecated return false; /* $result = FALSE; if ($this->getAnonymize()) { if ($this->isAccessibleWithoutCode()) { if (strlen($username) == 0) { global $ilUser; $userid = $ilUser->getId(); } global $ilSetting; $surveysetting = new ilSetting("survey"); $allowedUsers = strlen($surveysetting->get("multiple_survey_users")) ? explode(",",$surveysetting->get("multiple_survey_users")) : array(); if (in_array($userid, $allowedUsers)) { $result = TRUE; } } } return $result; */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function acceptsMultipleAnswers() {\n\t\treturn ($this->getMultipleAnswer() == 1);\n\t}", "public function isAllowMultiple()\n {\n return $this->allowMultiple ? true : false;\n }", "public function getAllowsMultipleAnswers(): bool\n {\n return $this->allowsMultipleAnswers;\n }", "private function is_multiple_choice($questions) {\n $is_multiple_choice = true;\n \n foreach ($questions->options->anwsers as $answer) {\n if ($answer->fraction == 1) {\n $is_multiple_choice = false;\n break;\n }\n }\n\n return $is_multiple_choice;\n }", "function check_user_has_data_access($survey_id,$user_id)\n\t{\n\t\t$requests=$this->get_user_study_n_collection_requests($survey_id,$user_id);\n\t\t\t\n\t\t\tforeach($requests as $request)\n\t\t\t{\n\t\t\t\tif ($request['status']=='APPROVED')\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\treturn FALSE;\n\t}", "function can_do_updatemultiple() {\n $id = $this->required_param('id');\n return cmclasspage::_has_capability('block/curr_admin:track:enrol', $id);\n }", "public function allowMultiple() {\n return false;\n }", "public function hasSecretQuestion()\n {\n return Mage::getResourceModel('twofactorauth/user_question')->hasQuestions($this->getUser());\n }", "public function check_selection(){\n if (count($this->input->post())!==5){\n $this->form_validation->set_message('check_selection');\n $this->session->set_flashdata('error_msg', 'You must select not More or Less than 3 Additional Subjects');\n redirect('exam/content/question/subject/4/JAMB?simulator=simulator');\n return FALSE;\n }else{\n $this->set_jamb_in_session();\n return TRUE;\n }\n }", "public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function getIsMultiple();", "public function hasMultipleAccounts();", "function is_multiple($name)\n\t{\n\t\treturn $this->allow_multiple_values && in_array($this->customfields[$name]['type'],array('select','select-account')) &&\n\t\t\t$this->customfields[$name]['rows'] > 1;\n\t}", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "public function instance_allow_multiple() {\n //allow more than one instance on a page\n return false;\n }", "public function areMultipleExecutionsAllowed() {}", "public function partOfMultiplePayment() {\n\t\t// not 100% correct: What is all payments are form the same sale... should check how many distinct sales there are. Later.\n\t\tif($account = $this->getAccount()->one()) {\n\t\t\treturn $account->getPayments()->count() > 1;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }", "public function canBeManagedForCareerSubjectAllowed()\n {\n return $this->countCareerStudents() > 0;\n\n }", "public function user_is_allowed()\n {\n //check if the record exist\n if (! $this->record) {\n $this->build_error('These record does not exist or it may not belong to you',404);\n }\n\n //check if the user is the owner of the entry\n if(!isOwner($this->record)) {\n $this->build_error('you are not the owner of this task');\n }\n\n //check if the incomming entries type is Array\n if (!is_array($this->request->entries)) {\n $this->build_error('Please the entries must be an Array');\n }\n }", "public function authorize()\n {\n// $assistant=DB::select('select * from course_ta where course_id=? and section=? and student_id=?',array(Input::get('courseId'),Input::get('sectionId'),Input::get('taId')));\n// $count=count($assistant);\n// if($count>0){\n// return false;\n// }\n return true;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function instance_allow_multiple() {\n return false;\n }", "public function loginUserConditionMatchesMultipleLoggedInUsers() {}", "public function loginUserConditionMatchesMultipleLoggedInUsers() {}", "function can_submit_brief_research_proposal(ResearchRequest $researchRequest)\n {\n return in_array(auth()->user()->id, $researchRequest->researchRequestReceivers->pluck('to')->toArray());\n }", "function instance_allow_multiple() {\n return false;\n }" ]
[ "0.65196043", "0.63791376", "0.6346387", "0.60389185", "0.5952733", "0.589998", "0.58644927", "0.58225065", "0.5797057", "0.57842803", "0.57757056", "0.5741318", "0.569559", "0.5667588", "0.5665545", "0.5597468", "0.557101", "0.55476344", "0.5537596", "0.5523697", "0.54969805", "0.54825336", "0.54825336", "0.54825336", "0.54825336", "0.54825336", "0.5476291", "0.5475731", "0.54579467", "0.5433117" ]
0.70676714
0
Checks if a user already started a survey
function isSurveyStarted($user_id, $anonymize_id, $appr_id = 0) { global $ilDB; // #15031 - should not matter if code was used by registered or anonymous (each code must be unique) if($anonymize_id) { $result = $ilDB->queryF("SELECT * FROM svy_finished". " WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s", array('integer','text','integer'), array($this->getSurveyId(), $anonymize_id, $appr_id) ); } else { $result = $ilDB->queryF("SELECT * FROM svy_finished". " WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s", array('integer','integer','integer'), array($this->getSurveyId(), $user_id, $appr_id) ); } if ($result->numRows() == 0) { return false; } else { $row = $ilDB->fetchAssoc($result); // yes, we are doing it this way $_SESSION["finished_id"][$this->getId()] = $row["finished_id"]; return (int)$row["state"]; } /* if ($this->getAnonymize()) { if ((($user_id != ANONYMOUS_USER_ID) && sizeof($anonymize_id)) && (!($this->isAccessibleWithoutCode() && $this->isAllowedToTakeMultipleSurveys()))) { $result = $ilDB->queryF("SELECT * FROM svy_finished". " WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s", array('integer','integer','integer'), array($this->getSurveyId(), $user_id, $appr_id) ); } else { $result = $ilDB->queryF("SELECT * FROM svy_finished". " WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s", array('integer','text','integer'), array($this->getSurveyId(), $anonymize_id, $appr_id) ); } } else { $result = $ilDB->queryF("SELECT * FROM svy_finished". " WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s", array('integer','integer','integer'), array($this->getSurveyId(), $user_id, $appr_id) ); } if ($result->numRows() == 0) { return false; } else { $row = $ilDB->fetchAssoc($result); $_SESSION["finished_id"][$this->getId()] = $row["finished_id"]; return (int)$row["state"]; } */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runSurvey() {\n $this->autoRender = false; // turn off autoRender\n $this->response->disableCache(); // do not cache the page\n $type = $this->Session->read('Survey.type');\n switch ($type) {\n case 'user':\n if (array_key_exists('respondentGUID', $this->request->named)) { // check to see if this is a new survey\n $respondentGUID = $this->request->named['respondentGUID'];\n if (!$this->Session->check('Survey.progress')) {\n $respondentId = $this->Survey->Respondent->getIdByGuid($respondentGUID);\n $i = $this->Survey->Respondent->Response->find('count', array('conditions' => array('respondent_id' => $respondentId))); // check to see if a responds has already been provided\n if ($i > 0) {\n $currentResults = $this->Survey->Respondent->Response->getLatestResponse($respondentId);\n if (isset($currentResults['Hierarchy'])) {\n $this->Session->write('Survey.hierarcy', $currentResults['Hierarchy']);\n }\n if (isset($currentResults['Response']['maingoal'])) {\n $this->Session->write('Survey.mainGoal', $currentResults['Response']['maingoal']);\n }\n if (isset($currentResults['Answer'])) {\n $this->Session->write('Survey.answers', $currentResults['Answer']);\n }\n }\n $this->Session->write('Survey.type', 'user');\n $this->Session->write('Survey.started', date(\"Y-m-d H:i:s\"));\n // need to read the user information here, verify that it is a valid user for this survey, and add the info to the session\n $this->request->data = $this->Survey->Respondent->read(null, $respondentId); // read the respondent\n $id = $this->request->data['Respondent']['survey_id']; // get the ID of the survey being taken\n $this->Session->write('Survey.respondent', $respondentId);\n // id will only be set when a survey is just starting, so check for id\n $this->Survey->contain(array('Question' => 'Choice'));\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($id));\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $id); // set the survey id\n }\n }\n break;\n case 'test':\n if ($this->Session->check('Auth.User')) {\n if (array_key_exists('surveyId', $this->request->named)) { // check to see if this is a new survey\n $surveyId = $this->request->named['surveyId'];\n if (!is_null($surveyId) && !$this->Session->check('Survey.progress')) {\n $this->Survey->contain(array('Question' => 'Choice')); // get the survey data\n $this->Session->write('Survey.original', $this->Survey->getFullSurvey($surveyId)); // write the survey data to the session\n $this->Session->write('Survey.progress', INTRO); // set the initial progress phase here\n $this->Session->write('Survey.id', $surveyId); // set the survey id in the session\n }\n }\n break;\n }\n default:\n die('Error - survey type not in session. Session may have timed out. Reuse your original link to start a new session.');\n break;\n }\n if (!$this->Session->check('Survey.progress')) { // check the current survey progress\n //make sure the correct session variables are present in order to continue\n $this->Session->setFlash(__('Error with survey', true, null, \"warning\")); // send a warning\n if ($this->referer() != '/') {\n // if we have a reference that isn't root\n $this->redirect($this->referer()); // go to that original page\n } else {\n $this->redirect(array('action' => 'index')); // otherwise go back to the survey index\n }\n }\n $progress = $this->Session->read('Survey.progress'); // get the current progress from the session\n // direct to the correct step based on the progress variable in the session\n switch ($progress) {\n case INTRO:\n array_key_exists('intropage', $this->request->named) ? $introstep = $this->request->named['intropage'] : $introstep = 0;\n if ($introstep < 4) {\n $introstep++;\n $this->layout = 'intro'; // use the intro layout\n $this->set('intropage', $introstep);\n $this->render('/Elements/intro');\n break;\n }\n case RIGHTS:\n $this->layout = 'rights'; // use the rights layout\n $id = $this->Session->read('Survey.id'); // get the survey id the session\n $consent = $this->Survey->field('consent', array('id' => $id)); // retrieve the informed consent information\n $this->set('consent', $consent); // send the custome consent form to the view\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('controller' => 'surveys', 'action' => 'answerQuestions')); // send to the question action\n break;\n case GDTA_ENTRY:\n $this->redirect(array('action' => 'enterGdta')); // send to the GDTA portion\n break;\n case SUMMARY:\n $this->redirect(array('action' => 'createSvgResult')); // send to the GDTA summary\n break;\n }\n }", "protected function is_first_time()\n\t{\n\t\tif ( !get_site_option( 'cur_from' ) && !get_site_option( 'confirm-user-registration' ) ) :\n\t\t\treturn TRUE;\n\t\telse :\n\t\t\treturn FALSE;\n\t\tendif;\n\t}", "protected function hasStarted()\r\n {\r\n return isset($this->_session[$this->_stepsKey]);\r\n }", "public function isRequiresQuestionId();", "public function isStarted(){\n\t\t\treturn isset( $_SESSION );\n\t\t}", "public function create(User $user)\n {\n return $this->isAllowed($user, 'survey_sent', 'can_add');\n }", "function startSurvey($respondent = null) {\n $this->autoRender = false; // turn off autoRender because we need total control over what view to render here\n $this->__clearEditSession(CLEAR_SURVEY); // clear any previous session variables\n $this->Session->write('Survey.type', 'user'); // write the survey type to the session\n $this->redirect(array('action' => 'runSurvey', 'respondentGUID' => $respondent)); // send to the main survey routine\n }", "function ipal_check_active_question(){\r\n global $DB;\r\n global $ipal;\r\n if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\nreturn(1);\r\n }\r\n else\r\n {\r\n return(0);\r\n }\r\n}", "function startSurvey($user_id, $anonymous_id, $appraisee_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif ($this->getAnonymize() && (strlen($anonymous_id) == 0)) return;\n\n\t\tif (strcmp($user_id, \"\") == 0)\n\t\t{\n\t\t\tif ($user_id == ANONYMOUS_USER_ID)\n\t\t\t{\n\t\t\t\t$user_id = 0;\n\t\t\t}\n\t\t}\n\t\t$next_id = $ilDB->nextId('svy_finished');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_finished (finished_id, survey_fi, user_fi, anonymous_id, state, tstamp, appr_id) \".\n\t\t\t\"VALUES (%s, %s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','integer','integer','text','text','integer','integer'),\n\t\t\tarray($next_id, $this->getSurveyId(), $user_id, $anonymous_id, 0, time(), $appraisee_id)\n\t\t);\n\t\treturn $next_id;\n\t}", "function check_user_has_data_access($survey_id,$user_id)\n\t{\n\t\t$requests=$this->get_user_study_n_collection_requests($survey_id,$user_id);\n\t\t\t\n\t\t\tforeach($requests as $request)\n\t\t\t{\n\t\t\t\tif ($request['status']=='APPROVED')\n\t\t\t\t{\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\treturn FALSE;\n\t}", "public function isParticipating($id_user, $id_event) {\n \t//$participants = Participant::where('id_user', '=', $id_user, 'AND', 'id_event', '=', $id_event)->get();\n $participants = Participant::whereRaw('id_user =' . $id_user . ' and id_event=' . $id_event)->get();\n\n \treturn count($participants) >= 1;\n }", "protected function isFirstTimeSetup() {\n // If there are any auth providers, this isn't first time setup, even if\n // we don't have accounts.\n if (PhabricatorAuthProvider::getAllEnabledProviders()) {\n return false;\n }\n\n // Otherwise, check if there are any user accounts. If not, we're in first\n // time setup.\n $any_users = id(new PhabricatorPeopleQuery())\n ->setViewer(PhabricatorUser::getOmnipotentUser())\n ->setLimit(1)\n ->execute();\n\n return !$any_users;\n }", "public function hasSecretQuestion()\n {\n return Mage::getResourceModel('twofactorauth/user_question')->hasQuestions($this->getUser());\n }", "function UserIsClear()\n {\n StartSession();\n $isClear = isset($_SESSION[GetExamIdentifier()]);\n \n return $isClear;\n }", "public function isCurrentUserPrepared()\n {\n if ($this->isCompletedByCurrentUser()) {\n return true;\n }\n\n foreach ($this->getPrerequisites() as $p) {\n if (!$p->isCompletedByCurrentUser()) {\n return false;\n }\n }\n\n return true;\n }", "public function dailyQuestionReturnsQuestion(): void\n {\n $expectedQuestion = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $dailyQuestions = $this->user->dailyQuestions()->get();\n\n $this->assertTrue($dailyQuestions->contains($expectedQuestion));\n }", "public function setUp(User $user)\n {\n return $user->hasAccess('set-up-conference-permission');\n }", "private function check_exam_and_user(int $_user_id, int $_exam_id)\n {\n return true;\n }", "public function startquiz()\n\t{\n\t\tif(!S::may())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t/*\n\t\t * First we want to check is there an quiz session what the user have lost?\n\t\t */\n\t\tif($session = $this->model->getExsistingSession($_GET['qid']))\n\t\t{\n\t\t\t// if yes reinitiate the running quiz session\n\t\t\tS::set('quiz-id', (int)$_GET['qid']);\n\t\t\tS::set('quiz-questions', $session['quiz_questions']);\n\t\t\tS::set('quiz-index', $session['quiz_index']);\n\t\t\tS::set('quiz-session', $session['id']);\n\t\t\t$easymode = false;\n\t\t\tif ($session['easymode'] == 1 && (int)$_GET['qid'] == 1)\n\t\t\t{\n\t\t\t\t$easymode = true;\n\t\t\t}\n\t\t\tS::set('quiz-easymode', $easymode);\n\t\t\t\n\t\t\t/*\n\t\t\t * Make a little output that the user can continue the quiz\n\t\t\t */\n\t\t\t$dia = new XhrDialog();\n\t\t\t\n\t\t\t$dia->setTitle('Quiz fortführen');\n\t\t\t\n\t\t\t$dia->addContent( '<h1>Du hast Dein Quiz nicht beendet</h1><p>Aber keine Sorge Du kannst einfach jetzt das Quiz zum Ende bringen.</p><p>Also viel Spaß beim weiterquizzen.</p>');\n\t\t\t$dia->addButton('Quiz fortführen', 'ajreq(\\'next\\',{app:\\'quiz\\'});');\n\t\t\t$return = $dia->xhrout();\n\t\t\t\n\t\t\t$return['script'] .= $this->abortOrOpenDialog($session['id']);\n\t\t\t\n\t\t\treturn $return;\n\t\t\t\n\t\t}\n\t\t/*\n\t\t * Otherwiser we start a new quiz session\n\t\t */\n\t\telse if($quiz = $this->model->getQuiz($_GET['qid']))\n\t\t{\n\t\t\t\n\t\t\t/*\n\t\t\t * if foodsaver quiz user can choose between easy and quick mode\n\t\t\t*/\n\t\t\t\n\t\t\tif($_GET['qid'] == 1 && isset($_GET['easymode']) && $_GET['easymode'] == 1)\n\t\t\t{\n\t\t\t\tS::set('quiz-easymode', true);\n\t\t\t\t$quiz['questcount'] = 20;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tS::set('quiz-easymode', false);\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * first get random sorted quiz questions\n\t\t\t */\n\t\t\tif($questions = $this->getRandomQuestions($_GET['qid'],$quiz['questcount']))\n\t\t\t{\n\t\t\t\t//Get the description how the quiz works\n\t\t\t\t$content = $this->model->getContent(17);\n\t\t\t\t\n\t\t\t\t// for safety check if there are not to many questions\n\t\t\t\t$questions = array_slice($questions, 0, (int)$quiz['questcount']);\n\t\t\t\t\n\t\t\t\t// check for double question (bugfix)\n\t\t\t\t$questions = $this->replaceDoubles($questions);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * Store quiz data in the users session\n\t\t\t\t */\n\t\t\t\tS::set('quiz-id', (int)$_GET['qid']);\n\t\t\t\tS::set('quiz-questions', $questions);\n\t\t\t\tS::set('quiz-index', 0);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * Make a litte output for the user that he/she cat just start the quiz now\n\t\t\t\t */\n\t\t\t\t$dia = new XhrDialog();\n\t\t\t\t$dia->addOpt('width', 600);\n\t\t\t\t$dia->setTitle($quiz['name'].'-Quiz');\n\t\t\t\t$dia->addContent($this->view->initQuiz($quiz,$content));\n\t\t\t\t$dia->addAbortButton();\n\t\t\t\t$dia->addButton('Quiz Starten', 'ajreq(\\'next\\',{app:\\'quiz\\'});$(\\'#'.$dia->getId().'\\').dialog(\\'close\\');');\n\t\t\t\t\n\t\t\t\t$return = $dia->xhrout();\n\t\t\t\t\n\t\t\t\t$return['script'] .= $this->abortOrOpenDialog($session['id']);\n\t\t\t\t\n\t\t\t\treturn $return;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t/*\n\t\t * If we cant get an quiz from the db send an error\n\t\t */\n\t\treturn array(\n\t\t\t'status' => 1,\n\t\t\t'script' => 'pulseError(\"Quiz konnte nicht gestartet werden...\");'\n\t\t);\n\t}", "public function viewSetUp(User $user)\n {\n return $user->hasAccess('view-set-up-conference-permission');\n }", "public function isSponsorOf() {\n\n\t\t$email = $this->customer()->first()->email;\n\n\t\t$box_question = BoxQuestion::where('slug', '=', 'sponsor')->first();\n\n\t\tif ($box_question === NULL)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\treturn UserAnswer::where('box_question_id', '=', $box_question->id)->where('slug', '=', Str::slug($email))->count();\n\n\t}", "public function open() {\n $user = Auth::user();\n // check authority\n if (!$user->operation(16)) {\n return false;\n }\n\n // change question status\n $this->status = 1;\n $this->save();\n\n return true;\n }", "function canStartSurvey($anonymous_id = NULL, $a_no_rbac = false)\n\t{\n\t\tglobal $ilAccess;\n\t\t\n\t\t$result = TRUE;\n\t\t$messages = array();\n\t\t$edit_settings = false;\n\t\t// check start date\t\t\n\t\tif (preg_match(\"/(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/\", $this->getStartDate(), $matches))\n\t\t{\t\t\t\n\t\t\t$epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);\t\t\n\t\t\t$now = mktime();\n\t\t\tif ($now < $epoch_time) \n\t\t\t{\t\t\n\t\t\t\tarray_push($messages,$this->lng->txt('start_date_not_reached').' ('.\n\t\t\t\t\tilDatePresentation::formatDate(new ilDateTime($this->getStartDate(), IL_CAL_TIMESTAMP)). \")\");\n\t\t\t\t$result = FALSE;\n\t\t\t\t$edit_settings = true;\n\t\t\t}\n\t\t}\t\t\t\t\n\t\t// check end date\t\t\n\t\tif (preg_match(\"/(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})/\", $this->getEndDate(), $matches))\n\t\t{\n\t\t\t$epoch_time = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);\n\t\t\t$now = mktime();\n\t\t\tif ($now > $epoch_time) \n\t\t\t{\n\t\t\t\tarray_push($messages,$this->lng->txt('end_date_reached').' ('.\n\t\t\t\t\tilDatePresentation::formatDate(new ilDateTime($this->getEndDate(), IL_CAL_TIMESTAMP)). \")\");\n\t\t\t\t$result = FALSE;\n\t\t\t\t$edit_settings = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check online status\n\t\tif ($this->getStatus() == self::STATUS_OFFLINE)\n\t\t{\n\t\t\tarray_push($messages, $this->lng->txt(\"survey_is_offline\"));\n\t\t\t$result = FALSE;\n\t\t\t$edit_settings = true;\n\t\t}\n\t\t// check rbac permissions\n\t\tif (!$a_no_rbac && !$ilAccess->checkAccess(\"read\", \"\", $this->ref_id))\n\t\t{\n\t\t\tarray_push($messages, $this->lng->txt(\"cannot_participate_survey\"));\n\t\t\t$result = FALSE;\n\t\t}\n\t\t/*\n\t\t// 2. check previous access\n\t\tif (!$result[\"error\"])\n\t\t{\n\t\t\tglobal $ilUser;\n\t\t\t$survey_started = $this->isSurveyStarted($ilUser->getId(), $anonymous_id);\n\t\t\tif ($survey_started === 1)\n\t\t\t{\n\t\t\t\tarray_push($messages, $this->lng->txt(\"already_completed_survey\"));\n\t\t\t\t$result = FALSE;\n\t\t\t}\n\t\t}\t\t \n\t\t*/\n\t\treturn array(\n\t\t\t\"result\" => $result,\n\t\t\t\"messages\" => $messages,\n\t\t\t\"edit_settings\" => $edit_settings\n\t\t);\n\t}", "protected function creatingNewUser() {\n return ($this->request_exists('user_choice') && $this->request('user_choice') == 'new' );\n }", "public function randomQuestion(): void\n {\n $expectedQuestion = QuestionUserHelper::createScheduledQuestionForUser($this->user)->question()->first();\n $randomQuestions = $this->user->randomUserQuestion();\n\n $this->assertTrue($randomQuestions->contains($expectedQuestion));\n }", "public function isSupsended($username) {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new SecurityDAO($dbObj);\n return $this->DAO->isSuspended($username);\n }", "public function eventExists()\n {\n return $this->getTalk()->getSpeaker()->exists();\n }", "function is_current_parcours_completed($id_user , $id_episode , $id_parcours) {\n\n\t$completed = false;\n\n\tglobal $wpdb;\n\n\t$episodes = get_field('episodes' , $id_parcours); \n\t$episodes_number = count($episodes); \n\n\t$rowcount = $wpdb->get_var(\"SELECT COUNT(*) FROM tracking WHERE id_user = $id_user AND id_parcours = $id_parcours\");\n\n\tif($rowcount == $episodes_number) $completed = true;\n\n\treturn $completed;\n\n}", "function alreadyAnswered($sender, $questionId) {\r\n\r\n\tglobal $db;\r\n\t$sql = \"SELECT DISTINCT survey_data.id FROM survey_data, (SELECT choices.id AS cid FROM choices WHERE question_id =\".$questionId.\") AS c WHERE survey_data.sms_number = '\".$sender.\"' AND c.cid=survey_data.choice_id\";\r\n\r\n\t// $result = mysql_query($sql);\r\n\tif(!$db) connectDb();\r\n\ttry {\r\n\t\t$result = $db->query($sql)->fetch(PDO::FETCH_OBJ);\r\n\t}\r\n\tcatch (PDOException $e) {\r\n\t\t$error = $e->getMessage();\r\n\t}\r\n\r\n\tif($result) \r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n}", "private function surveyExists($survey_id){\n return sizeof(DB::table('survey')->select('id', 'name')->where('id', $survey_id)->get()) > 0;\n }" ]
[ "0.5998697", "0.58317494", "0.5826005", "0.57909954", "0.5722252", "0.5718991", "0.5659469", "0.559987", "0.55695426", "0.5566195", "0.55600834", "0.55588466", "0.5548661", "0.5479806", "0.5479151", "0.5467313", "0.54515946", "0.5450956", "0.54029715", "0.54000753", "0.53924227", "0.53854984", "0.5361619", "0.5355395", "0.5339571", "0.53080964", "0.53040993", "0.5301661", "0.5296203", "0.5283113" ]
0.63965607
0
Get the finished id's of all survey participants
function &getSurveyFinishedIds() { global $ilDB, $ilLog; $users = array(); $result = $ilDB->queryF("SELECT * FROM svy_finished WHERE survey_fi = %s", array('integer'), array($this->getSurveyId()) ); if ($result->numRows()) { while ($row = $ilDB->fetchAssoc($result)) { array_push($users, $row["finished_id"]); } } return $users; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getNrOfParticipants($survey_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($survey_id)\n\t\t);\n\t\treturn $result->numRows();\n\t}", "public function getResponsesId()\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\t\t$query = \"\n\t\t\t\tSELECT id\n\t\t\t\tFROM {$prefix}surveys_response\n\t\t\t\tWHERE\n\t\t\t\t\tsurveys_id = {$this->id}\n\t\t\t\tORDER BY\n\t\t\t\t\tid\n\t\t\t\t;\";\n\n\t\t$result = $this->Db->Query($query);\n\n\t\t$return = array();\n\t\t$counter = 1;\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$return[$counter] = $row['id'];\n\t\t\t$counter++;\n\t\t}\n\n\t\t// get a list of responses\n\t\treturn $return;\n\t}", "public function participants() {\n $ids = array();\n $ids[] = $this->sender_id;\n\n foreach ($this->recipientIds as $id) {\n $ids[] = $id;\n }\n return $ids;\n }", "public static function winnersIds()\n {\n return DB::table('competitionentries')->where('winner', '=', 1)->get();\n }", "function &getUserSpecificResults($finished_ids)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$evaluation = array();\n\t\t$questions =& $this->getSurveyQuestions();\n\t\tforeach ($questions as $question_id => $question_data)\n\t\t{\n\t\t\tinclude_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t\t$question_type = SurveyQuestion::_getQuestionType($question_id);\n\t\t\tSurveyQuestion::_includeClass($question_type);\n\t\t\t$question = new $question_type();\n\t\t\t$question->loadFromDb($question_id);\n\t\t\t$data =& $question->getUserAnswers($this->getSurveyId(), $finished_ids);\n\t\t\t$evaluation[$question_id] = $data;\n\t\t}\n\t\treturn $evaluation;\n\t}", "public function getChallengesByActivity(){\n $query = '\n SELECT tc.id\n FROM `hotornot-dev`.tblChallenges as tc\n JOIN `hotornot-dev`.tblChallengeVotes as tcv\n ON tc.id = tcv.challenge_id\n WHERE is_verify != 1\n LIMIT 100\n ';\n $stmt = $this->prepareAndExecute( $query );\n $ids = $stmt->fetchAll( PDO::FETCH_OBJ );\n foreach( $ids as &$id ){\n $id = $id->id;\n }\n $ids = array_unique($ids);\n return $ids;\n\n }", "public function get_completed_interstitials() {\n\t\treturn $this->data['completed'];\n\t}", "public function getQuestionIds(){\n\t\treturn array('todo'); // This will be moved to QuestionTemplate\n\t}", "function etherpadlite_get_participants($etherpadliteid) {\n return false;\n}", "public function GetMeetingIDArray()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_meeting_id_array;\n }", "function getCumulatedResults(&$question, $finished_ids)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif(!$finished_ids)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished WHERE survey_fi = %s\",\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\t$nr_of_users = $result->numRows();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nr_of_users = sizeof($finished_ids);\n\t\t}\n\t\t\n\t\t$result_array =& $question->getCumulatedResults($this->getSurveyId(), $nr_of_users, $finished_ids);\n\t\treturn $result_array;\n\t}", "function &getExistingQuestions() \n\t{\n\t\tglobal $ilDB;\n\t\t$existing_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_question.original_id FROM svy_question, svy_svy_qst WHERE \" .\n\t\t\t\"svy_svy_qst.survey_fi = %s AND svy_svy_qst.question_fi = svy_question.question_id\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\twhile ($data = $ilDB->fetchAssoc($result)) \n\t\t{\n\t\t\tif($data[\"original_id\"])\n\t\t\t{\n\t\t\t\tarray_push($existing_questions, $data[\"original_id\"]);\n\t\t\t}\n\t\t}\n\t\treturn $existing_questions;\n\t}", "public function getQuestionIds()\r\n{\r\n $query_string = \"SELECT questionid FROM questions \";\r\n $query_string .= \"WHERE question = :question AND questionid != :questionid\";\r\n\r\n return $query_string;\r\n}", "function getUserIds() {\n\t\t$charIds = $this->getCharIds();\n\t\t$idsToReturn = array();\n\t\tforeach ($charIds as $id) {\n\t\t\n\t\t\t$idsToReturn[] = getOneThing(\"playedby\", \"gamestate_characters\", \"id=$id and gameid=$this->gameId\");\n\t\t\n\t\t}\n\t\tdbug(\"getUserIds is about to return \".implode(\", \", $idsToReturn));\n\t\treturn $idsToReturn;\n\t}", "function get_video_course_ids () {\n\t$ids = array();\n\t$courses = get_user_paid_orders(); // Get paid courses IDs (products)\n\t\n\tif ( !empty($courses) ) { // If user have purchased courses\n\t\tforeach ($courses as $j => $product_id) {\n\t\t\tif (have_rows('lesson', $product_id)) {\n\t\t\t\t$i = 1; // Inner counter from 1 because haven't free lesson\n\t\t\t\twhile (have_rows('lesson', $product_id)) {\n\t\t\t\t\tthe_row();\n\t\t\t\t\t$ids[\"courseVideo_$j\" . \"_$i\"] = get_sub_field('video_id');\n\t\t\t\t\t$i += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn $ids;\n}", "function vitero_get_participants($viteroid) {\n return false;\n}", "public function getGameIds() {\n if (empty($this->gameIds)) {\n foreach ($this->getTournaments() as $tourney) {\n $this->gameIds = array_merge($this->gameIds, $tourney->getGameIds());\n }\n\n }\n return $this->gameIds;\n }", "function lightboxgallery_get_participants($galleryid) {\n global $DB, $CFG;\n\n return $DB->get_records_sql(\"SELECT DISTINCT u.id, u.id\n FROM {$CFG->prefix}user u,\n {$CFG->prefix}lightboxgallery_comments c\n WHERE c.gallery = $galleryid AND u.id = c.userid\");\n}", "public function getIdPROVEEDORES(){\n return $this->idPROVEEDORES;\n }", "function _tsuiseki_tracking_get_partner_id_names() {\n return array(\n 'ref',\n 'quelle',\n );\n}", "public function getPracticeSkillIds()\n {\n $ids = array();\n foreach ($this->practice_skills as $skill) {\n $ids[] = $skill->id;\n }\n \n return $ids;\n }", "function get_video_ids() {\n\t$user_id = get_current_user_id();\n\t$ids = array();\n\t\n\tif (have_rows('events_access', 'user_' . $user_id)) { // If user have events\n\t\t$j = 0; // Outer counter\n\t\twhile (have_rows('events_access', 'user_' . $user_id)) {\n\t\t\tthe_row();\n\t\t\t$event_id = get_sub_field('event')[0];\n\t\t\t$event_access = get_sub_field('access');\n\t\t\t\n\t\t\t$free_lesson = get_field('free_lesson', $event_id);\n\t\t\tif ($free_lesson) { // If event have free lesson\n\t\t\t\t$ids[\"eventVideo_$j\" . \"_0\"] = $free_lesson['video_id'];\n\t\t\t}\n\t\t\t\n\t\t\tif ($event_access) { // If user have access to event\n\t\t\t\tif (have_rows('lessons', $event_id)) {\n\t\t\t\t\t$i = 1; // Inner counter\n\t\t\t\t\twhile (have_rows('lessons', $event_id)) {\n\t\t\t\t\t\tthe_row();\n\t\t\t\t\t\t$ids[\"eventVideo_$j\" . \"_$i\"] = get_sub_field('video_id');\n\t\t\t\t\t\t$i += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$j += 1;\n\t\t}\n\t}\n\t\n\treturn $ids;\n}", "public function completedQuestionSetsArray() {\n return array_map('intval', array_keys(json_decode($this->question_sets_completed, true)));\n }", "public function sigLeadershipsIds()\n {\n return $this->sigs()->where('main', 1)->lists('id')->toArray();\n }", "public function getIds();", "public function getIds();", "private function myQid(){\r\n\t\t$this->db->where('uid', $this->uid);\r\n\t\t$this->db->select('id');\r\n\t\t$this->db->from('wen_answer');\r\n\t\t$tmp = $this->db->get()->result_array();\r\n\t\t$return = array();\r\n\t\tforeach($tmp as $r){\r\n\t\t\t$return[$r['id']] = 1;\r\n\t\t}\r\n\t\treturn $return;\r\n\t}", "function get_survey_ids_by_user($email) {\n\t$mysql = new mysqli ( 'localhost', 'root', 'stu.fudan2013', 'EasyPolling' ) or die ( 'Cannot connect to Database' );\n\t$query = \"SELECT * from Poll where Creator='\" . $email . \"'\";\n\t$result = mysqli_query ( $mysql, $query );\n\t\n\t$returned = array ();\n\twhile ( $row = mysqli_fetch_array ( $result ) ) {\n\t\t$id = $row ['ID'];\n\t\t$survey = get_survey_by_id ( $id );\n\t\tarray_push ( $returned, array (\n\t\t\t\t'id' => $id,\n\t\t\t\t'survey' => $survey \n\t\t) );\n\t}\n\tmysqli_close ( $mysql );\n\t\n\treturn $returned;\n}", "public function get_member_ids() {\n return array_values($this->redscores);\n }", "public function participants()\n { \n // $date = explode(\" \", $this->created_at)[0];\n $date = $this->created_at;\n $matches = Match::whereDate('created_at', $date )\n ->where('location_id', $this->location_id)->get();\n $participants = collect([]);\n foreach ($matches as $m) {\n $participants->push($m->user);\n }\n return $participants;\n }" ]
[ "0.65759104", "0.633437", "0.62046564", "0.59811234", "0.5751627", "0.57190806", "0.5621342", "0.56071985", "0.5598874", "0.5558601", "0.5552382", "0.5541523", "0.553686", "0.5524496", "0.5504525", "0.54820067", "0.5441959", "0.54348487", "0.5422082", "0.5410063", "0.54030514", "0.5383274", "0.5369321", "0.5364451", "0.53429806", "0.53429806", "0.53238994", "0.5316634", "0.5310531", "0.52955735" ]
0.77039707
0
Returns the user information from an active_id (survey_finished.finished_id)
function getUserDataFromActiveId($active_id) { global $ilDB; $surveySetting = new ilSetting("survey"); $use_anonymous_id = array_key_exists("use_anonymous_id", $_GET) ? $_GET["use_anonymous_id"] : $surveySetting->get("use_anonymous_id"); $result = $ilDB->queryF("SELECT * FROM svy_finished WHERE finished_id = %s", array('integer'), array($active_id) ); $row = array(); $foundrows = $result->numRows(); if ($foundrows) { $row = $ilDB->fetchAssoc($result); } $name = ($use_anonymous_id) ? $row["anonymous_id"] : $this->lng->txt("anonymous"); $userdata = array( "fullname" => $name, "sortname" => $name, "firstname" => "", "lastname" => "", "login" => "", "gender" => "", "active_id" => "$active_id" ); if ($foundrows) { if (($row["user_fi"] > 0) && ($row["user_fi"] != ANONYMOUS_USER_ID) && !$this->hasAnonymizedResults() && !$this->get360Mode()) // 360° uses ANONYMIZE_CODE_ALL which is wrong - see ilObjSurveyGUI::afterSave() { include_once './Services/User/classes/class.ilObjUser.php'; if (strlen(ilObjUser::_lookupLogin($row["user_fi"])) == 0) { $userdata["fullname"] = $userdata["sortname"] = $this->lng->txt("deleted_user"); } else { $user = new ilObjUser($row["user_fi"]); $userdata["fullname"] = $user->getFullname(); $gender = $user->getGender(); if (strlen($gender) == 1) $gender = $this->lng->txt("gender_$gender"); $userdata["gender"] = $gender; $userdata["firstname"] = $user->getFirstname(); $userdata["lastname"] = $user->getLastname(); $userdata["sortname"] = $user->getLastname() . ", " . $user->getFirstname(); $userdata["login"] = $user->getLogin(); } } } return $userdata; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getActiveID($user_id, $anonymize_id, $appr_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t// see self::isSurveyStarted()\n\t\t\n\t\t// #15031 - should not matter if code was used by registered or anonymous (each code must be unique)\n\t\tif($anonymize_id)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','text','integer'),\n\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\t\t\t\n\t\t\treturn $row[\"finished_id\"];\n\t\t}\t\n\n\t\t/*\n\t\tif ($this->getAnonymize())\n\t\t{\n\t\t\tif ((($user_id != ANONYMOUS_USER_ID) && (strlen($anonymize_id) == 0)) && (!($this->isAccessibleWithoutCode() && $this->isAllowedToTakeMultipleSurveys())))\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','text','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\treturn $row[\"finished_id\"];\n\t\t}\t\t \n\t\t*/\n\t}", "public function UserDetails($user_id=\"\"){\n\t\t\t$broker_userdet = $this->db->prepare(\"SELECT * FROM users WHERE status = :status AND id =:id \");\n\t\t\t$broker_userdet->execute(array(\"status\"=>1,\"id\"=>$user_id));\n\t\t\t$row = $broker_userdet->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row; \n\t\t}", "public function getUserQuestionResult($active_id, $pass)\n\t{\n\t\t/** @var ilDB $ilDB */\n\t\tglobal $ilDB;\n\t\t$result = new ilUserQuestionResult($this, $active_id, $pass);\n\n\t\t$data = $ilDB->queryF(\n\t\t\t\"SELECT value1 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s AND step = (\n\t\t\t\tSELECT MAX(step) FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s\n\t\t\t) ORDER BY solution_id\",\n\t\t\tarray(\"integer\", \"integer\", \"integer\",\"integer\", \"integer\", \"integer\"),\n\t\t\tarray($active_id, $pass, $this->getId(), $active_id, $pass, $this->getId())\n\t\t);\n\n\t\tfor($index = 1; $index <= $ilDB->numRows($data); ++$index)\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($data);\n\t\t\t$result->addKeyValue($index, $row[\"value1\"]);\n\t\t}\n\n\t\t$points = $this->calculateReachedPoints($active_id, $pass);\n\t\t$max_points = $this->getMaximumPoints();\n\n\t\t$result->setReachedPercentage(($points/$max_points) * 100);\n\n\t\treturn $result;\n\t}", "function getUser(){\n\t\t\tglobal $db;\n\t\t\tglobal $json;\n\n\t\t\tif($this->id != 0){\n\t\t\t\t$query = $db->prepare('SELECT * FROM user WHERE Id= :id');\n\t\t\t\t$query->bindParam(':id', $this->id);\n\t\t\t}\n\t\t\telse if($this->username != null){\n\t\t\t\t$query = $db->prepare('SELECT * FROM user WHERE Username= :id');\n\t\t\t\t$query->bindParam(':id', $this->username);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$json->invalidRequest();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$query->execute();\n\t\t\t\t\n\t\t\t\n\t\t\tif($query->rowCount() > 0){\n\t\t\t\n\t\t\t\tforeach($query as $row) {\n\t\t\t\t\t$this->id = $row['Id'];\n\t\t\t\t\t$this->username = $row['Username'];\n\t\t\t\t\t$this->subject = $row['Subject'];\n\t\t\t\t\t$this->admin = $row['Admin'];\n\t\t\t\t\t$this->key = $row['ApiKey'];\n\t\t\t\t\t\n\t\t\t\t\t$result = '{ \"User\" : { \"Id\" : ' . $row['Id'] . ', \"Username\" : \"' . $row['Username'] . '\", \"Subject\" : '.$row['Subject'].', \"Admin\" : ' . $row['Admin'] . ', \"ApiKey\" : \"' . $row['ApiKey'] . '\", '; \n\t\t\t\t\n\t\t\t\t\t$result = $result . \"\" . $this->getAssignedSurveys() . \"} }\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$json->notFound(\"User\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function getUserById($user_id)\n\t{\n\t\t$user_info = false;\n\t\t\n\t\tif (is_numeric($user_id) && $user_id>0) {\n\t\t\t$this->db->where(array( 'id' => $user_id, 'activated' => 1));\n\t\t\t$query = $this->db->get($this->table_name);\n\t\t\t$num_rows = $query->num_rows();\n\t\t\tif ($num_rows == 1) {\n\t\t\t\t$users_info = $query->result();\n\t\t\t\t$user_info = $users_info[0];\n\n\t\t\t} elseif ($num_rows > 2) {\n\t\t\t\t// ---------------------------------------- \n\t\t\t\t// @TODO mandar un correo de aviso.\n\t\t\t\t// ----------------------------------------\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $user_info;\n\t}", "public function getInfoProfile(){\n return $this->get_user_by_id($this->getAccountID());\n }", "public function getUserInfo()\n {\n $CI = &get_instance();\n if (!$this->loggedIn()) {\n return null;\n } else {\n $id = $CI->session->userdata('user_id');\n return $CI->user_model->get($id);\n }\n }", "public function getUserInfo($id)\n {\n return $this->_dbTable->getUserInfo($id);\n }", "function getUserDetails(){\n if(empty($this->userid)){\n return null;\n } \n $userDetailsQuery = \"SELECT * FROM da_userMaster WHERE da_userMaster.username = '$this->userid'\"; \n $dbqry = new dbquery($userDetailsQuery, $this->connid);\n $user = $dbqry->getrowassocarray();\n return $user;\n }", "public function getDetails()\n {\n if($user = $this->loadUser())\n \treturn $user;\n }", "public function getUserInfo()\n {\n return $this->_process('user/info')->user;\n }", "public function getUserActivated($id) {\n $sql = \"select * from infos_contributeur where id_user = $id and activation='oui'\";\n $result = $this->db->fetchAll($sql);\n\n return $result;\n }", "public function UserDetails($user_id)\r\n {\r\n $query = $this->db->prepare(\"SELECT id, name, email, phone, pin FROM users_2fa_sms WHERE id=:user_id\");\r\n $query->bindParam(\"user_id\", $user_id, PDO::PARAM_STR);\r\n $query->execute();\r\n if ($query->rowCount() > 0) {\r\n return $query->fetch(PDO::FETCH_OBJ);\r\n }\r\n }", "function getUserInfo($user_id) {\n jincimport('utility.servicelocator');\n $servicelocator = ServiceLocator::getInstance();\n $logger = $servicelocator->getLogger();\n \n $query = 'SELECT id, username, name, email FROM #__users ' .\n 'WHERE id = ' . (int) $user_id;\n $dbo =& JFactory::getDBO();\n $dbo->setQuery($query);\n $logger->debug('JINCJoomlaHelper: executing query: ' . $query);\n $infos = array();\n if ($user_info = $dbo->loadObjectList()) {\n if (! empty ($user_info)) {\n $user = $user_info[0]; \n $infos['user_id'] = $user->id;\n $infos['username'] = $user->username;\n $infos['name'] = $user->name;\n $infos['email'] = $user->email;\n }\n return $infos;\n }\n return $infos;\n }", "function getUserInfo() {\n\t$page = $this -> get('http://vk.com/al_profile.php') -> body;\n\n\t$pattern = '/\"user_id\":([0-9]*),\"loc\":([\"a-z0-9_-]*),\"back\":\"([\\W ]*|[\\w ]*)\",.*,\"post_hash\":\"([a-z0-9]*)\",.*,\"info_hash\":\"([a-z0-9]*)\"/';\n\tpreg_match($pattern, $page, $matches);\n\tarray_shift($matches);\n\t\n\t$this -> user['id'] = $matches[0];\n\t$this -> user['alias'] = $matches[1];\n\t$this -> user['name'] = $matches[2];\n\t$this -> user['post_hash'] = $matches[3];\n\t$this -> user['info_hash'] = $matches[4];\n\n\treturn $this -> user;\n\t}", "public function getUserID () {\n return $this->id;\n }", "public function getMyAccountInfo()\n {\n $ajax_data = array();\n $user_id = $this->user_session->getUserId();\n\n if ($user_id) {\n $user = $this->user_logic->getUserById($user_id);\n if ($user !== false) {\n if (! empty($user) AND is_array($user)) {\n $user = array_pop($user);\n $ajax_data['code'] = 0;\n $ajax_data['data']['user'] = $user;\n $ajax_data['message'] = 'Successfully retrieved user info';\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'User does not exist'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Failed to get user info'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Invalid user id';\n }\n \n $this->ajax_respond($ajax_data);\n }", "function get_user_details_by_id( $userid ) {\r\n\r\n\t$ci = & get_instance();\r\n\r\n\t$query = $ci->db->select('userid, username, displayname, firstname, lastname, mobile, email, rwaid, profilephoto')\r\n\r\n\t\t->from('cs_userdetails')\r\n\r\n\t\t->where(array('userid' => $userid))\r\n\r\n\t\t->get();\r\n\r\n\t\t$ci->db->last_query();\r\n\r\n\treturn $query->row_array();\r\n\r\n}", "public function get_user_details() {\n $user_id = intval($this->input->post('user_id'));\n if (!$user_id) {\n return $this->send_error('INVALID_INPUT');\n }\n $fields = array(\n 'id',\n 'first_name',\n 'prefix',\n 'last_name',\n 'image',\n 'cover_image',\n 'ranking'\n );\n if ($details = $this->users_model->fields($fields)->get($user_id)) {\n $this->load->model('blog_posts_model');\n $details['blog_posts'] = $this->blog_posts_model->order_by('created_at', 'desc')->get_all(array('user_id' => $user_id));\n $details['ranking'] = unserialize($details['ranking']);\n $this->event_log();\n $this->send_response($details);\n } else {\n return $this->send_error('ERROR');\n }\n }", "function get_user () {\n\t\treturn $this->user_id;\n\t}", "public function getUserProfile() {\n global $user, $db;\n\n $userID = $user->getId();\n\n $sql = 'SELECT p.firstName, p.lastName, p.dob, p.addressFirst, p.addressSecond, p.city, p.postcode, p.mobile, p.bio\n FROM users AS u\n JOIN profiles AS p ON p.userId = u.id\n WHERE u.id = ?';\n\n $stmt = $db->get()->prepare($sql);\n\n if ($stmt) {\n $stmt->execute([$userID]);\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }\n }", "public function userdetails($id){\n $sql = \"SELECT * FROM user WHERE user_id = '\".$id.\"' \";\n $values = $this->con->query($sql);\n $values = $values->fetch_assoc();\n return $array = Array(\n \"user_name\" => $values['user_name'],\n \"email\" => $values['email'],\n \"plan\" => $values['plan'],\n \"total\" => $values['total_earning'],\n \"withdrawn\" => $values[\"withdrawn_earning\"],\n \"question\" => $values['question']\n );\n }", "public function BrokerUserDetails($user_id=\"\"){\n\t\t\t$broker_userdet = $this->db->prepare(\"SELECT * FROM users WHERE status = :status AND id =:id \");\n\t\t\t$broker_userdet->execute(array(\"status\"=>1,\"id\"=>$user_id));\n\t\t\t$row = $broker_userdet->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row; \n\t\t}", "function auth_getUserInfo($id)\n {\n $auth = _cfg('auth');\n $table = db_table($auth['table']);\n $fieldId = $auth['fields']['id'];\n\n return db_select($table)\n ->where()->condition($fieldId, $id)\n ->getSingleResult();\n }", "public function getUser($id);", "public function getUser($id){\n $user = Api::get($this->getSlug());\n \n if($user){\n return $user;\n }\n\n return 'error';\n\n }", "public function userProfile() {\n\t\t\t$request = $this->api(\"GET\", \"/me\");\n\t\t\t\n\t\t\t$request->execute();\n\t\t\t$response = $request->responseObject();\n\t\t\t$response->id = $response->ID;\n\t\t\treturn $response;\n\t\t}", "public function user_info() {\n if ($this->rails_cookie_value() == NULL) {\n return null;\n }\n if (!self::$user_info && !self::$user_info_called) {\n $json_data = $this->api_request(\"user/\" . $this->rails_cookie_value());\n self::$user_info = $json_data->{'user'};\n self::$user_info_called = true;\n }\n return self::$user_info;\n }", "public static function get_user($user_id);", "function isSurveyStarted($user_id, $anonymize_id, $appr_id = 0)\n\t{\n\t\tglobal $ilDB;\n\n\t\t// #15031 - should not matter if code was used by registered or anonymous (each code must be unique)\n\t\tif($anonymize_id)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','text','integer'),\n\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t\n\t\t\t// yes, we are doing it this way\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\t\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\n\n\t\t/*\n\t\tif ($this->getAnonymize())\n\t\t{\n\t\t\tif ((($user_id != ANONYMOUS_USER_ID) && sizeof($anonymize_id)) && (!($this->isAccessibleWithoutCode() && $this->isAllowedToTakeMultipleSurveys())))\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','text','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t$_SESSION[\"finished_id\"][$this->getId()] = $row[\"finished_id\"];\n\t\t\treturn (int)$row[\"state\"];\n\t\t}\t\t\n\t\t*/\n\t}" ]
[ "0.6257469", "0.59168535", "0.58916605", "0.58847946", "0.5879727", "0.5860177", "0.58238316", "0.578886", "0.57326496", "0.57319146", "0.57246745", "0.56944853", "0.56801003", "0.5637042", "0.56290275", "0.5617939", "0.5611024", "0.56001365", "0.55926645", "0.5589806", "0.5584143", "0.5577791", "0.55765915", "0.55619293", "0.5549795", "0.5549337", "0.55425024", "0.5519607", "0.5518259", "0.55156314" ]
0.73753065
0
Returns the number of participants for a survey
function _getNrOfParticipants($survey_id) { global $ilDB; $result = $ilDB->queryF("SELECT finished_id FROM svy_finished WHERE survey_fi = %s", array('integer'), array($survey_id) ); return $result->numRows(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAnswerCount();", "public function getQuestionsCount() : int;", "public function getNbParticipants()\n {\n return $this->nbParticipants;\n }", "public function getCurrentQuestionCount();", "public function countRespondents()\n {\n $result = $this->client->run('MATCH (n:Person) RETURN COUNT(n) AS respondents;');\n\n return (int) $result->getRecord()->get('respondents');\n }", "public function numeroInscripciones()\n {\n $socio = Auth()->user()->socio->id;\n $res = Inscription::where('partners_id', $socio)->count();\n return $res;\n }", "function getSurveyCodesCount()\n\t{\n\t\tglobal $ilDB;\n\n\t\t$result = $ilDB->queryF(\"SELECT anonymous_id FROM svy_anonymous WHERE survey_fi = %s AND user_key IS NULL\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\treturn $result->numRows();\n\t}", "function getAnswerCount()\n\t{\n\t\treturn count($this->answers);\n\t}", "public function getQuestionCount() {\r\n\t\treturn $this->questionCount;\r\n\t}", "public function getTotalAnswerCount() {\n\t\treturn $this->countSurveyAnswers();\n\t}", "public function GetPatientsCount();", "function numQuestions(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT question_id FROM q_questions WHERE fk_quiz_id = %d\", GetSQLValueString($this->quiz_id, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn mysql_num_rows($getQuery);\n\t}", "public function getNumberOfRecords ()\n {\n // hydrate\n if ( is_null ( $this->studentsCount ) )\n {\n $this->studentsCount = count ( $this->getStudents () );\n }\n \n return $this->studentsCount;\n }", "public function hasNumberOfParticipants() {\n return $this->_has(6);\n }", "public function getNumberOfStudents()\n {\n return count($this->students);\n }", "public static function responseCount($SurveyID)\n\t{\n\t\t$SurveyID = (int)$SurveyID; //cast to integer\n\t\tif($SurveyID > 0)\n\t\t{//now no SQL if number not above zero\n\t\t\t$iConn = IDB::conn(); \n\t\t\t$rowsql = \"select count(*) as numrows from \" . PREFIX . \"responses where SurveyID=\" . $SurveyID;\n\t\t\t$result = mysqli_query($iConn,$rowsql) or die(trigger_error(mysqli_error($iConn), E_USER_ERROR));\n\t\t\t$row = mysqli_fetch_assoc($result) or die(trigger_error(mysqli_error($iConn), E_USER_ERROR));\n\t\t\t$numrows = $row['numrows'];\n\t\t\t$sql = \"update \" . PREFIX . \"surveys set TotalResponses=\" . $numrows . \" where SurveyID=\" . $SurveyID;\n\t\t\tmysqli_query($iConn,$sql) or die(trigger_error(mysqli_error($iConn), E_USER_ERROR));\n\t\t}\n\t}", "public function findAnswerCount($choice) {\n\t\t$return = 0;\n\t\t$query\t= $this->createQuery();\n\n\t\tif($choice instanceof \\Qinx\\Qxsurvey\\Domain\\Model\\Choice) {\n\t\t\t$choice = $choice->getUid();\n\t\t}\n\n// kann vorerst nicht mehr in TYPO3 7 verwendet werden\n//\t\t$statement = 'SELECT COUNT(a.uid) as total FROM tx_qxsurvey_domain_model_answer AS a\n//\t\t\tWHERE a.choice = ?\n//\t\t\t\tAND a.pid IN ?' . $this->getEnabledFieldString('tx_qxsurvey_domain_model_answer', 'a');\n//\n//\t\t$result = $query\n//\t\t\t->statement($statement, array(1))\n//\t\t\t->execute(true);\n\n\t\t$statement = $GLOBALS['TYPO3_DB']->prepare_SELECTquery(\n\t\t\t'COUNT(a.uid) as total',\n\t\t\t'tx_qxsurvey_domain_model_answer AS a',\n\t\t\t'a.choice = :uid AND a.pid IN (:pid)' . $this->getEnabledFieldString('tx_qxsurvey_domain_model_answer', 'a'));\n\t\t$statement->execute(array(':uid' => $choice, ':pid' => implode(',', $query->getQuerySettings()->getStoragePageIds())));\n\n\t\t$result = $statement->fetch();\n\n\t\tif(isset($result['total']) === true) {\n\t\t\t$return = (int) $result['total'];\n\t\t}\n\n\t\treturn $return;\n\t}", "public function getTalksCount()\n {\n return $this->count(self::TALKS);\n }", "public function getRecordCount(){\n $records = $this->statement(\"SELECT count(*) AS total_records FROM `voters`\");\n return $records[0]['total_records'];\n }", "function GetSubmissionsCount () {\n return @mysql_result (@mysql_query (\"SELECT COUNT(*) AS `num` FROM `hunt_submissions` WHERE `submission_hunt` = '\".$this->hunt_id.\"'\", $this->ka_db), 0, \"num\");\n }", "static function questionCount($exam_id){\n return DB::table('questions')->where('examination_id',$exam_id)->count();\n }", "function get_variable_count()\n\t{\t\t\n\t\t$this->db->select('count(surveys.id) as total');\n\t\t$this->db->join('variables v', 'surveys.id= v.sid','inner');\n\t\t$this->db->where('surveys.published',1);\n\t\t$query=$this->db->get('surveys')->row_array();\n\t\t\n\t\tif ($query){\n\t\t\treturn $query['total'];\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "public function ask_get_nb_questions()\n\t{\n\t\t$sql = \"SELECT COUNT(*) AS nb_quest\n\t\t\t\tFROM \".$this->table_ask.\"\n\t\t\t\tWHERE id_quest = -1\";\n\t\t$query = $this->db->query($sql);\n\t\tif( $query->row() != NULL )\n\t\t\treturn $query->row()->nb_quest;\n\t\telse\n\t\t\treturn 0;\n\t}", "public function countResponses() {\n\t\t\n\t\ttry {\n\t\t\t$select = $this->pdo->select(['id'])->count('*', 'num_ids')->from('posts_'.$this->board)->where('thread', '=', $this->tId);\n\t\t\t$stmt = $select->execute();\n\t\t\t$num_responses = $stmt->fetchColumn(1);\n\t\t\t\n\t\t} catch(\\Exception $e) {\n\t\t\t$this->app->error($e);\n\t\t}\n\t\t\n\t\treturn $num_responses;\n\t}", "private function json_totalSurveys()\n {\n $query = \"SELECT COUNT(surveyID) as totalSurveys FROM Surveys;\";\n $params = [];\n\n $nextpage = null;\n\n // This decodes the JSON encoded by getJSONRecordSet() from an associative array\n $res = json_decode($this->recordset->getJSONRecordSet($query, $params), true);\n\n $res['status'] = 200;\n $res['message'] = \"ok\";\n $res['next_page'] = $nextpage;\n return json_encode($res);\n }", "public function getT_NoOfStudent()\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql=\"select count(*) from student\";\n\t\t\t\t\t\n\t\t\t\t\t\t$this->openDB();\n\t\t\t\t\t\t$this->prepareQuery($sql);\n\t\t\t\t\t\t$result=$this->executeQuery();\n\t\t\t\t\t\treturn ($result[0][0]);\n\t\t\t\t\t}", "private function parse_participants_sex_count(){\n\n\t\t$this->female_count = 0;\n\t\t$this->male_count = 0;\n\t\tforeach($this->participants as $participant){\n\t\t\tif($participant->sex === 'female'){\n\t\t\t\t$this->female_count = $this->female_count + 1;\n\t\t\t}\n\t\t\telse if($participant->sex === 'male'){\n\t\t\t\t$this->male_count = $this->male_count + 1;\n\t\t\t}\n\t\t}\n\n\t}", "public function count()\n {\n return count($this->getResults());\n }", "public function hasNumberOfParticipants() {\n return $this->_has(13);\n }", "public function GetNumberOfResultsInThisPage()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n $ret = 0;\n \n if ($this->_search_results instanceof c_comdef_meetings) {\n $ret = $this->_search_results->GetNumMeetings();\n }\n\n return $ret;\n }" ]
[ "0.7106288", "0.6802367", "0.65914136", "0.65820074", "0.6547102", "0.65068424", "0.6494498", "0.6484496", "0.64626884", "0.6364279", "0.63580644", "0.63182724", "0.6266135", "0.6256406", "0.6226868", "0.6192228", "0.6154281", "0.6152744", "0.61506253", "0.6112515", "0.6110771", "0.6102572", "0.60920763", "0.6091338", "0.60584146", "0.60422724", "0.6027098", "0.60241", "0.6016551", "0.59888554" ]
0.7613982
0
Returns a QTI xml representation of the survey
function toXML() { include_once("./Services/Xml/classes/class.ilXmlWriter.php"); $a_xml_writer = new ilXmlWriter; // set xml header $a_xml_writer->xmlHeader(); $attrs = array( "xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance", "xsi:noNamespaceSchemaLocation" => "http://www.ilias.de/download/xsd/ilias_survey_4_2.xsd" ); $a_xml_writer->xmlStartTag("surveyobject", $attrs); $attrs = array( "id" => $this->getSurveyId(), "title" => $this->getTitle() ); $a_xml_writer->xmlStartTag("survey", $attrs); $a_xml_writer->xmlElement("description", NULL, $this->getDescription()); $a_xml_writer->xmlElement("author", NULL, $this->getAuthor()); $a_xml_writer->xmlStartTag("objectives"); $attrs = array( "label" => "introduction" ); $this->addMaterialTag($a_xml_writer, $this->getIntroduction(), TRUE, TRUE, $attrs); $attrs = array( "label" => "outro" ); $this->addMaterialTag($a_xml_writer, $this->getOutro(), TRUE, TRUE, $attrs); $a_xml_writer->xmlEndTag("objectives"); if ($this->getAnonymize()) { $attribs = array("enabled" => "1"); } else { $attribs = array("enabled" => "0"); } $a_xml_writer->xmlElement("anonymisation", $attribs); $a_xml_writer->xmlStartTag("restrictions"); if ($this->getAnonymize() == 2) { $attribs = array("type" => "free"); } else { $attribs = array("type" => "restricted"); } $a_xml_writer->xmlElement("access", $attribs); if ($this->getStartDate()) { $attrs = array("type" => "date"); preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getStartDate(), $matches); $a_xml_writer->xmlElement("startingtime", $attrs, sprintf("%04d-%02d-%02dT%02d:%02d:00", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6])); } if ($this->getEndDate()) { $attrs = array("type" => "date"); preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $this->getEndDate(), $matches); $a_xml_writer->xmlElement("endingtime", $attrs, sprintf("%04d-%02d-%02dT%02d:%02d:00", $matches[1], $matches[2], $matches[3], $matches[4], $matches[5], $matches[6])); } $a_xml_writer->xmlEndTag("restrictions"); // constraints $pages =& $this->getSurveyPages(); $hasconstraints = FALSE; foreach ($pages as $question_array) { foreach ($question_array as $question) { if (count($question["constraints"])) { $hasconstraints = TRUE; } } } if ($hasconstraints) { $a_xml_writer->xmlStartTag("constraints"); foreach ($pages as $question_array) { foreach ($question_array as $question) { if (count($question["constraints"])) { // found constraints foreach ($question["constraints"] as $constraint) { $attribs = array( "sourceref" => $question["question_id"], "destref" => $constraint["question"], "relation" => $constraint["short"], "value" => $constraint["value"], "conjunction" => $constraint["conjunction"] ); $a_xml_writer->xmlElement("constraint", $attribs); } } } } $a_xml_writer->xmlEndTag("constraints"); } // add the rest of the preferences in qtimetadata tags, because there is no correspondent definition in QTI $a_xml_writer->xmlStartTag("metadata"); $custom_properties = array(); $custom_properties["evaluation_access"] = $this->getEvaluationAccess(); $custom_properties["status"] = $this->getStatus(); $custom_properties["display_question_titles"] = $this->getShowQuestionTitles(); $custom_properties["pool_usage"] = (int)$this->getPoolUsage(); $custom_properties["own_results_view"] = (int)$this->hasViewOwnResults(); $custom_properties["own_results_mail"] = (int)$this->hasMailOwnResults(); $custom_properties["mode_360"] = (int)$this->get360Mode(); $custom_properties["mode_360_self_eval"] = (int)$this->get360SelfEvaluation(); $custom_properties["mode_360_self_rate"] = (int)$this->get360SelfRaters(); $custom_properties["mode_360_self_appr"] = (int)$this->get360SelfAppraisee(); $custom_properties["mode_360_results"] = $this->get360Results(); $custom_properties["mode_360_skill_service"] = (int)$this->get360SkillService(); // :TODO: skills? // reminder/tutor notification are (currently?) not exportable foreach($custom_properties as $label => $value) { $a_xml_writer->xmlStartTag("metadatafield"); $a_xml_writer->xmlElement("fieldlabel", NULL, $label); $a_xml_writer->xmlElement("fieldentry", NULL, $value); $a_xml_writer->xmlEndTag("metadatafield"); } $a_xml_writer->xmlStartTag("metadatafield"); $a_xml_writer->xmlElement("fieldlabel", NULL, "SCORM"); include_once "./Services/MetaData/classes/class.ilMD.php"; $md = new ilMD($this->getId(),0, $this->getType()); $writer = new ilXmlWriter(); $md->toXml($writer); $metadata = $writer->xmlDumpMem(); $a_xml_writer->xmlElement("fieldentry", NULL, $metadata); $a_xml_writer->xmlEndTag("metadatafield"); $a_xml_writer->xmlEndTag("metadata"); $a_xml_writer->xmlEndTag("survey"); $attribs = array("id" => $this->getId()); $a_xml_writer->xmlStartTag("surveyquestions", $attribs); // add questionblock descriptions $obligatory_states =& $this->getObligatoryStates(); foreach ($pages as $question_array) { if (count($question_array) > 1) { $attribs = array("id" => $question_array[0]["question_id"]); $attribs = array("showQuestiontext" => $question_array[0]["questionblock_show_questiontext"], "showBlocktitle" => $question_array[0]["questionblock_show_blocktitle"]); $a_xml_writer->xmlStartTag("questionblock", $attribs); if (strlen($question_array[0]["questionblock_title"])) { $a_xml_writer->xmlElement("questionblocktitle", NULL, $question_array[0]["questionblock_title"]); } } foreach ($question_array as $question) { if (strlen($question["heading"])) { $a_xml_writer->xmlElement("textblock", NULL, $question["heading"]); } $questionObject =& $this->_instanciateQuestion($question["question_id"]); if ($questionObject !== FALSE) $questionObject->insertXML($a_xml_writer, FALSE, $obligatory_states[$question["question_id"]]); } if (count($question_array) > 1) { $a_xml_writer->xmlEndTag("questionblock"); } } $a_xml_writer->xmlEndTag("surveyquestions"); $a_xml_writer->xmlEndTag("surveyobject"); $xml = $a_xml_writer->xmlDumpMem(FALSE); return $xml; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writequestion( $question ) {\n\t // question reflects database fields for general question and specific to type\n\t\n\t // initial string;\n\t $expout = \"\";\n\t\n\t // add comment\n\t $expout .= \"// question: $question->id \\n\";\n\n\t if ($question->id_category != \"\"){\n\t $expout .= \"\\$CATEGORY:$question->id_category\\n\";\n\t }\n\t\t\n\t // get question text format\n\t /*$textformat = $question->textformat;\n\t $question->text = \"\";\n\t if ($textformat!=FORMAT_MOODLE) {\n\t $question->text = text_format_name( (int)$textformat );\n\t $question->text = \"[$question->text]\";\n\t }*/\n\t $qtext_format = \"[\".$question->qtype.\"]\";\n\t // output depends on question type\n\t switch($question->qtype) {\n\t\t\tcase 'category' : {\n\t\t\t\t// not a real question, used to insert category switch\n\t\t\t\t$expout .= \"\\$CATEGORY: $question->category\\n\"; \n\t\t\t};break;\n\t\t\tcase 'title' : {\n\t\t\t\tif($question->prompt != '') $expout .= '::'.$this->repchar($question->prompt).'::';\n\t\t\t\t$expout .= $qtext_format;\n\t\t\t\t$expout .= $this->repchar( $question->quest_text);\n\t\t\t};break;\n\t\t case 'extended_text' : {\n\t\t $expout .= '::'.$this->repchar($question->prompt).'::';\n\t\t $expout .= $qtext_format;\n\t\t $expout .= $this->repchar( $question->quest_text);\n\t\t $expout .= \"{}\\n\";\n\t\t };break;\n\t\t case 'truefalse' : {/*\n\t\t $trueanswer = $question->options->answers[$question->options->trueanswer];\n\t\t $falseanswer = $question->options->answers[$question->options->falseanswer];\n\t\t if ($trueanswer->fraction == 1) {\n\t\t $answertext = 'TRUE';\n\t\t $right_feedback = $trueanswer->feedback;\n\t\t $wrong_feedback = $falseanswer->feedback;\n\t\t } else {\n\t\t $answertext = 'FALSE';\n\t\t $right_feedback = $falseanswer->feedback;\n\t\t $wrong_feedback = $trueanswer->feedback;\n\t\t }\n\t\t\n\t\t $wrong_feedback = $this->repchar($wrong_feedback);\n\t\t $right_feedback = $this->repchar($right_feedback);\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\".$this->repchar( $answertext );\n\t\t if ($wrong_feedback) {\n\t\t $expout .= \"#\" . $wrong_feedback;\n\t\t } else if ($right_feedback) {\n\t\t $expout .= \"#\";\n\t\t }\n\t\t if ($right_feedback) {\n\t\t $expout .= \"#\" . $right_feedback;\n\t\t }\n\t\t $expout .= \"}\\n\";*/\n\t\t }//;break;\n\t\t \n\t\t case 'shortanswer' : {/*\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t foreach($question->options->answers as $answer) {\n\t\t $weight = 100 * $answer->score_correct;\n\t\t $expout .= \"\\t=%\".$weight.\"%\".$this->repchar( $answer->text ).\"#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t }\n\t\t $expout .= \"}\\n\";*/\n\t\t }//;break;\n\t\t\tcase 'choice' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\t\n\t\t\t\tforeach($question->answers as $answer) {\n\t\t\t\t\tif (($answer->score_correct == 1) || ($answer->score_correct == 0 && $answer->is_correct == 1) ) {\n\t\t\t\t\t\t$answertext = '=';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct > 1) {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"=%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct==0) {\n\t\t\t\t\t\t$answertext = '~';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"~%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\t\".$answertext.$this->repchar( $answer->text );\n\t\t\t\t\tif ($answer->comment!=\"\") {\n\t\t\t\t\t\t$expout .= \"#\".$this->repchar( $answer->comment );\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t\t};break;\n\t\t\tcase 'choice_multiple' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\t\n\t\t\t\tforeach($question->answers as $answer) {\n\t\t\t\t\tif ($answer->score_correct==1) {\n\t\t\t\t\t\t$answertext = '=';\n\t\t\t\t\t}\n\t\t\t\t\telseif ($answer->score_correct==0) {\n\t\t\t\t\t\t$answertext = '~';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$export_weight = $answer->score_correct*100;\n\t\t\t\t\t\t$answertext = \"~%$export_weight%\";\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\t\".$answertext.$this->repchar( $answer->text );\n\t\t\t\t\tif ($answer->comment!=\"\") {\n\t\t\t\t\t\t$expout .= \"#\".$this->repchar( $answer->comment );\n\t\t\t\t\t}\n\t\t\t\t\t$expout .= \"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t\t};break;\n\t\t case 'associate' : {\n\t\t\t\t$expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{\\n\";\n\t\t\t\tforeach($question->answers as $i => $subquestion) {\n\t\t\t\t\t$expout .= \"\\t=\".$this->repchar( $subquestion->text ).\" -> \".$this->repchar( $question->extra_info[$i]->text ).\"\\n\";\n\t\t\t\t}\n\t\t\t\t$expout .= \"}\\n\";\n\t\t };break;\n\t\t case NUMERICAL:\n\t\t $expout .= \"::\".$this->repchar($question->prompt).\"::\".$qtext_format.$this->repchar( $question->quest_text ).\"{#\\n\";\n\t\t foreach ($question->options->answers as $answer) {\n\t\t if ($answer->text != '') {\n\t\t $percentage = '';\n\t\t if ($answer->score_correct < 1) {\n\t\t $pval = $answer->score_correct * 100;\n\t\t $percentage = \"%$pval%\";\n\t\t }\n\t\t $expout .= \"\\t=$percentage\".$answer->text.\":\".(float)$answer->tolerance.\"#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t } else {\n\t\t $expout .= \"\\t~#\".$this->repchar( $answer->comment ).\"\\n\";\n\t\t }\n\t\t }\n\t\t $expout .= \"}\\n\";\n\t\t break;\n\t\t case DESCRIPTION:\n\t\t $expout .= \"// DESCRIPTION type is not supported\\n\";\n\t\t break;\n\t\t case MULTIANSWER:\n\t\t $expout .= \"// CLOZE type is not supported\\n\";\n\t\t break;\n\t\t default:\n\t\t \n\t\t\t\treturn false;\n\t\t}\n\t // add empty line to delimit questions\n\t $expout .= \"\\n\";\n\t return $expout;\n\t}", "private function question()\n\t{\n\t\t$this->qns['questionnaire']['questionnairecategories_id'] = $this->allinputs['questioncat'];\n\t\t$this->qns['questionnaire']['questionnairesubcategories_id'] = $this->allinputs['questionsubcat'];\n\t\t$this->qns['questionnaire']['label'] = $this->allinputs['question_label'];\n\n\n\t\t$this->qns['questionnaire']['question'] = $this->allinputs['question'];\n\t\t$this->qns['questionnaire']['has_sub_question'] = $this->allinputs['subquestion'];\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 )\n\t\t{\n\t\t\t$this->qns['answers']['answer_type'] = $this->allinputs['optiontype'];\n\t\t}\n\n\t\t$this->qns['questionnaire']['active'] = 1;\n\n\t\tif( $this->qns['questionnaire']['has_sub_question'] == 0 ){\n\t\t\t//This code must be skipped if sub_question is 1\n\t\t\t$optionCounter = 0;\n\t\t\tforeach ($this->allinputs as $key => $value) {\n\n\t\t\t\tif( str_is('option_*', $key) ){\n\t\t\t\t\t$optionCounter++;\n\t\t\t\t\t$this->qns['answers'][$optionCounter] = ( $this->qns['answers']['answer_type'] == 'opentext' ) ? 'Offered answer text' : $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function GetSoapComplexTypeXml() {\n\t\t\t$strToReturn = '<complexType name=\"StrategyQuestionConditional\"><sequence>';\n\t\t\t$strToReturn .= '<element name=\"Id\" type=\"xsd:int\"/>';\n\t\t\t$strToReturn .= '<element name=\"Question\" type=\"xsd1:TenPQuestions\"/>';\n\t\t\t$strToReturn .= '<element name=\"Strategy\" type=\"xsd1:CannedStrategy\"/>';\n\t\t\t$strToReturn .= '<element name=\"ConditionalType\" type=\"xsd:int\"/>';\n\t\t\t$strToReturn .= '<element name=\"__blnRestored\" type=\"xsd:boolean\"/>';\n\t\t\t$strToReturn .= '</sequence></complexType>';\n\t\t\treturn $strToReturn;\n\t\t}", "public function __toString() {\n\t\treturn \"A question was asked. This is the question: \" . $this->getQuestionText();\n\t}", "public function generateQuestion()\n\t{\n\t\treturn sprintf('<span class=\"captcha_text%s\">%s</span>',\n\t\t\t\t\t\t(($this->strClass != '') ? ' ' . $this->strClass : ''),\n\t\t\t\t\t\t$this->getQuestion());\n\t}", "function ipal_create_genericq($courseid){\r\n global $DB;\r\n global $USER;\r\n global $COURSE;\r\n $contextid = $DB->get_record('context', array('instanceid'=>\"$courseid\",'contextlevel'=>'50'));\r\n $contextID = $contextid->id;\r\n $categories = $DB->get_records_menu('question_categories',array('contextid'=>\"$contextID\"));\r\n $categoryid = 0;\r\n foreach ($categories as $key => $value){\r\n if(preg_match(\"/Default\\ for/\",$value)){\r\n if(($value == \"Default for \".$COURSE->shortname) or ($categoryid == 0)){$categoryid = $key;}\r\n }\r\n }\r\n if(!($categoryid > 0)){\r\n echo \"\\n<br />Error obtaining categoryid\\n<br />\";\r\n return false;\r\n }\r\n $qmultichoicecheckid = $DB->count_records('question', array('category'=>\"$categoryid\",'name'=>'Generic multichoice question (1-8)'));\r\n $qessaycheckid = $DB->count_records('question', array('category'=>\"$categoryid\",'name'=>'Generic essay question'));\r\n if(($qmultichoicecheckid>0) and ($qessaycheckid > 0)){\r\n return true;\r\n }\r\n $hostname = 'unknownhost';\r\n if (!empty($_SERVER['HTTP_HOST'])) {\r\n $hostname = $_SERVER['HTTP_HOST'];\r\n } else if (!empty($_ENV['HTTP_HOST'])) {\r\n $hostname = $_ENV['HTTP_HOST'];\r\n } else if (!empty($_SERVER['SERVER_NAME'])) {\r\n $hostname = $_SERVER['SERVER_NAME'];\r\n } else if (!empty($_ENV['SERVER_NAME'])) {\r\n $hostname = $_ENV['SERVER_NAME'];\r\n }\r\n $date = gmdate(\"ymdHis\");\r\n $stamp = $hostname .'+'. $date .'+'.ipal_random_string(6);\r\n $version = $hostname .'+'. $date .'+'.ipal_random_string(6);\r\n $questionFieldArray=array('category','parent','name','questiontext','questiontextformat','generalfeedback','generalfeedbackformat','defaultgrade','penalty','qtype','length','stamp','version','hidden','timecreated','timemodified','createdby','modifiedby');\r\n $questionNotNullArray=array('name','questiontext','generalfeedback');\r\n\t$questioninsert = new stdClass();\r\n\t$date = gmdate(\"ymdHis\");\r\n\t$stamp = $hostname .'+'. $date .'+'.ipal_random_string(6);\r\n\t$version = $hostname .'+'. $date .'+'.ipal_random_string(6);\r\n\t$questioninsert -> category = $categoryid;\r\n\t$questioninsert -> parent = 0;\r\n\t$questioninsert ->questiontextformat = 1;\r\n\t$questioninsert ->generalfeedback = ' ';\r\n\t$questioninsert ->generalfeedbackformat = 1;\r\n\t$questioninsert ->defaultgrade = 1;\r\n\t$questioninsert ->penalty = 0;\r\n\t$questioninsert ->length = 1;\r\n\t$questioninsert->stamp = $stamp;\r\n\t$questioninsert->version = $version;\r\n\t$questioninsert ->hidden = 0;\r\n\t$questioninsert->timecreated = time();\r\n\t$questioninsert->timemodified = time();\r\n\t$questioninsert->createdby = $USER -> id;\r\n\t$questioninsert->modifiedby =$USER -> id;\r\n if ($qmultichoicecheckid == 0){\r\n \t$questioninsert ->name = 'Generic multichoice question (1-8)';//$title;\r\n \t$questioninsert ->questiontext = 'Please select an answer.';//.$text;\r\n \t$questioninsert ->qtype = 'multichoice';\r\n \t$lastinsertid = $DB->insert_record('question', $questioninsert);\r\n $answerFieldArray=array('answer','answerformat','fraction','feedback','feedbackformat');\r\n $answerNotNullArray =array('answer','feedback');\r\n if(!($lastinsertid > 0)){\r\n echo \"\\n<br />Error creating Generic multichoice question\\n<br />\";\r\n return false;\r\n }\r\n\t\tfor($n=1;$n<9;$n++){\r\n\t\t\t$answerInsert = new stdClass();\r\n\t\t\t$answerInsert->answer = $n;\r\n\t\t\t$answerInsert->question = $lastinsertid;\r\n\t\t\t$answerInsert ->format = 1;\r\n\t\t\t$answerInsert ->fraction = 1;\r\n\t\t\t$answerInsert ->feedback = ' ';\r\n\t\t\t$answerInsert ->feedbackformat = 1;\r\n\t\t\t$lastAnswerinsertid[$n] = $DB->insert_record('question_answers',$answerInsert);\r\n\t\t\tif(!($lastAnswerinsertid[$n] > 0)){\r\n\t\t\t\techo \"\\n<br />Error inserting answer $n for Generic multichoice question (1-8)\\n<br />\";\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$multichoiceFieldArray = array('question','layout','answers','single','shuffleanswers','correctfeedback','correctfeedbackformat','partiallycorrectfeedback','partiallycorrectfeedbackformat','incorrectfeedback','incorrectfeedbackformat','answernumbering');\r\n\t\t$multichoiceNotNullArray = array('correctfeedback','partiallycorrectfeedback','incorrectfeedback');\r\n\t\t$qtypeInsert = new stdClass();\r\n\t\t$qtypeInsert->answers = join(',',$lastAnswerinsertid);\r\n\t\t$qtypeInsert->single = 1;\r\n\t\t$qtypeInsert->correctfeedbackformat = 1;\r\n\t\t$qtypeInsert->partiallycorrectfeedbackformat = 1;\r\n\t\t$qtypeInsert->incorrectfeedbackformat = 1;\r\n\t\t$qtypeInsert->correctfeedback = ' ';\r\n\t\t$qtypeInsert->partiallycorrectfeedback = ' ';\r\n\t\t$qtypeInsert->incorrectfeedback = ' ';\r\n\t\t$qtypeInsert->answernumbering = '123';\r\n\t\t$qtypeInsert->question = $lastinsertid;\r\n\t\t$qtypeTable = 'question_'.$questioninsert->qtype;\r\n\t\t$qtypeInsert->shuffleanswers = '0';\r\n\t\t$qtypeinsertid = $DB->insert_record($qtypeTable, $qtypeInsert);\r\n\t}\r\n\tif ($qessaycheckid == 0){\r\n \t$questioninsert ->name = 'Generic essay question';//$title;\r\n \t$questioninsert ->questiontext = 'Please answer the question in the space provided.';//.$text;\r\n \t$questioninsert ->qtype = 'essay';\r\n \t$lastinsertid = $DB->insert_record('question', $questioninsert);\r\n\t\t$essayoptions = new stdClass;\r\n\t\t$essayoptions->questionid = $lastinsertid;\r\n\t\t$essayoptions->responsefieldlines = 3;\r\n\t\t$essayoptionsid = $DB->insert_record('qtype_essay_options',$essayoptions);\r\n }\r\n return true; \r\n}", "function getQuestionType()\n\t{\n\t\treturn \"assTextSubset\";\n\t}", "public function generateQuestion()\n\t{\n\t\t//get random question type\n\t\t$type = $this->questionTypes[array_rand($this->questionTypes)];\n\n\t\t//get random section\n\t\t$section = $this->getRandomSection();\n\n\t\t//get random function (within the above section)\n\t\t$function = $this->getRandomFunction($section);\n\n\t\t$question = [];\n\t\t$question['type'] = $type;\n\t\t$question['section'] = $section;\n\t\t$question['function'] = $function;\n\t\t$question['text'] = \"{$section} now, {$this->questionTextPerType[$type]}\";\n\t\t$question['choices'] = [];\n\t\t$question['answer_text'] = '';\n\t\t$question['answer_index'] = '';\t//in ['choices'] array\n\n\n\t\treturn $this->fillQuestion($question);\n\t}", "public function getTypeQuestion()\n {\n return $this->typeQuestion;\n }", "function getQuestionType()\n\t{\n\t\treturn $this->getPlugin()->getQuestionType();\n\t}", "function getQuestionType() {\n\t\treturn 'extended_text';\n\t}", "public function test_export_shortanswer() {\n $qdata = new stdClass();\n $qdata->id = 123;\n $qdata->contextid = 0;\n $qdata->qtype = 'shortanswer';\n $qdata->name = 'Short answer question';\n $qdata->questiontext = 'Fill in the gap in this sequence: Alpha, ________, Gamma.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'The answer is Beta.';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 1;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->hidden = 0;\n \n $qdata->options = new stdClass();\n $qdata->options->usecase = 0;\n \n $qdata->options->answers = array(\n 13 => new question_answer(13, 'Beta', 1, 'Well done!', FORMAT_HTML),\n 14 => new question_answer(14, '*', 0, 'Doh!', FORMAT_HTML),\n 15 => new question_answer(15, 'Gamma', 1, 'Well done!', FORMAT_HTML),\n 16 => new question_answer(16, 'Delta', 1, 'Doh!', FORMAT_HTML),\n 17 => new question_answer(17, 'Epsilon', 1, 'Well done!', FORMAT_HTML),\n 18 => new question_answer(18, 'Tetha', 1, 'Doh!', FORMAT_HTML),\n );\n \n $qdata->hints = array(\n new question_hint(0, 'Hint 1', FORMAT_HTML),\n new question_hint(0, 'Hint 2', FORMAT_HTML),\n );\n \n // Export the question.\n $exporter = new qformat_smart();\n $questions = array($qdata);\n $zipcontent = $exporter->export_questions($questions);\n \n // Open exported question as import_data.\n $import_data = $this->zip_to_import_data($zipcontent);\n \n /*\n * Test content of imsmanifest.xml\n */\n \n $imsmanifest = $import_data->imsmanifest;\n \n $expected = '<resource identifier=\"group0_pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[0]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n $expected = '<resource identifier=\"pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[1]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n /*\n * Test content of page.\n */\n \n // Test number of pages.\n $this->assertCount(1, $import_data->pages);\n \n $page = $import_data->pages[0];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata = '<votemetadata><questiontext format=\"short-answer\" labelstyle=\"\" correct=\"Beta Gamma Delta Epsilon\" points=\"1\" tags=\"\" explanation=\"The answer is Beta.\" mathgradingoption=\"\" likert=\"\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '1';\n $questionnumber = strip_tags($question->text[0]->asXML());\n $this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Fill in the gap in this sequence: Alpha, ________, Gamma.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertEquals($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(0, $choices);\n }", "protected function getQuestionAttribute()\n {\n return $this->is_organizational ? $this->organization_goal->question : $this->custom_question;\n }", "private function createInput($question)\n\t{\n\t\tswitch($question->InputType)\n\t\t{\n\t\t\tcase \"radio\":\n\t\t\tcase \"checkbox\":\n\t\t\t\tprint \"<b>\" . $question->Number . \") \";\n\t\t\t\tprint $question->Text . \"</b> \";\n\t\t\t\tprint '<em>(' . $question->Description . ')</em><br />';\n\t\t\t\tforeach($question->aAnswer as $answer)\n\t\t\t\t{//print data for each\n\t\t\t\t\tprint '<input type=\"' . $question->InputType . '\" name=\"q_' . $question->QuestionID . '[]\" value=\"' . $answer->AnswerID . '\" > ';\n\t\t\t\t\tprint $answer->Text . \" \";\n\t\t\t\t\tif($answer->Description != \"\")\n\t\t\t\t\t{//only print description if not empty\n\t\t\t\t\t\tprint \"<em>(\" . $answer->Description . \")</em>\";\n\t\t\t\t\t}\n\t\t\t\t\tprint '<br />';\t\n\t\t\t\t}\n\t\t\t\tbreak;\t\n\t\t\n\t\t\tcase \"select\":\n\t\t\t\tprint \"<b>\" . $question->Number . \") \";\n\t\t\t\tprint $question->Text . \"</b> \";\n\t\t\t\tprint '<em>(' . $question->Description . ')</em><br />';\n\t\t\t\tprint '<select name=\"q_' . $question->QuestionID . '\">';\n\t\t\t\tforeach($question->aAnswer as $answer)\n\t\t\t\t{//print data for each\n\t\t\t\t\tprint '<option value=\"' . $answer->AnswerID . '\" >' . $answer->Text;\n\t\t\t\t\tif($answer->Description != \"\")\n\t\t\t\t\t{//only print description if not empty\n\t\t\t\t\t\tprint \" <em>(\" . $answer->Description . \")</em>\";\n\t\t\t\t\t}\n\t\t\t\t\tprint '</option>';\t\n\t\t\t\t}\n\t\t\t\tprint '</select><br />';\n\t\t\t\tbreak;\n\t\t}\t\t\t\t\n\t}", "public function toXML();", "public function test_export_multichoice_1() {\n $qdata = new stdClass();\n $qdata->id = 123;\n $qdata->contextid = 0;\n $qdata->qtype = 'multichoice';\n $qdata->name = 'Multiple choice question';\n $qdata->questiontext = 'Questiontext of muliple choice question.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'General feedback';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 23;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->hidden = 0;\n \n $qdata->options = new stdClass();\n $qdata->options->single = 0;\n $qdata->options->shuffleanswers = 0;\n $qdata->options->answernumbering = 'abc';\n $qdata->options->correctfeedback = '<p>Your answer is correct.</p>';\n $qdata->options->correctfeedbackformat = FORMAT_HTML;\n $qdata->options->partiallycorrectfeedback = '<p>Your answer is partially correct.</p>';\n $qdata->options->partiallycorrectfeedbackformat = FORMAT_HTML;\n $qdata->options->shownumcorrect = 1;\n $qdata->options->incorrectfeedback = '<p>Your answer is incorrect.</p>';\n $qdata->options->incorrectfeedbackformat = FORMAT_HTML;\n \n $qdata->options->answers = array(\n 13 => new question_answer(13, 'answer 1', 0, '', FORMAT_HTML),\n 14 => new question_answer(14, 'answer 2', 1, '', FORMAT_HTML),\n 15 => new question_answer(15, 'answer 3', 0, '', FORMAT_HTML),\n 16 => new question_answer(16, 'answer 4', 0, '', FORMAT_HTML),\n );\n \n $qdata->hints = array(\n new question_hint_with_parts(0, 'Hint 1.', FORMAT_HTML, false, false),\n new question_hint_with_parts(0, 'Hint 2.', FORMAT_HTML, false, false),\n );\n \n \n // Export the question.\n $exporter = new qformat_smart();\n $questions = array($qdata);\n $zipcontent = $exporter->export_questions($questions);\n \n // Open exported question as import_data.\n $import_data = $this->zip_to_import_data($zipcontent);\n \n /*\n * Test content of imsmanifest.xml\n */\n \n $imsmanifest = $import_data->imsmanifest;\n \n $expected = '<resource identifier=\"group0_pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[0]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n $expected = '<resource identifier=\"pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[1]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n /*\n * Test content of page.\n */\n \n // Test number of pages.\n $this->assertCount(1, $import_data->pages);\n \n $page = $import_data->pages[0];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata = '<votemetadata><questiontext format=\"choice\" labelstyle=\"upper-alpha\" correct=\"2\" points=\"23\" tags=\"\" explanation=\"General feedback\" mathgradingoption=\"\" likert=\"false\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '1';\n $questionnumber = strip_tags($question->text[0]->asXML());\n $this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Questiontext of muliple choice question.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertEquals($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(4, $choices);\n \n // Test the 1. choice element.\n $choice = $choices[0];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"1\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'A';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 1';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 2. choice element.\n $choice = $choices[1];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"2\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'B';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 2';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 3. choice element.\n $choice = $choices[2];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"3\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'C';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 3';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 4. choice element.\n $choice = $choices[3];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"4\" format=\"choice\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'D';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 4';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function getQntd()\n {\n return $this->qntd;\n }", "public function test_export_multichoice_2() {\n $qdata = new stdClass();\n $qdata->id = 123;\n $qdata->contextid = 0;\n $qdata->qtype = 'multichoice';\n $qdata->name = 'Multiple choice question';\n $qdata->questiontext = 'Questiontext of muliple choice question.';\n $qdata->questiontextformat = FORMAT_HTML;\n $qdata->generalfeedback = 'General feedback';\n $qdata->generalfeedbackformat = FORMAT_HTML;\n $qdata->defaultmark = 23;\n $qdata->length = 1;\n $qdata->penalty = 0.3333333;\n $qdata->hidden = 0;\n \n $qdata->options = new stdClass();\n $qdata->options->single = 0;\n $qdata->options->shuffleanswers = 0;\n $qdata->options->answernumbering = 'abc';\n $qdata->options->correctfeedback = '<p>Your answer is correct.</p>';\n $qdata->options->correctfeedbackformat = FORMAT_HTML;\n $qdata->options->partiallycorrectfeedback = '<p>Your answer is partially correct.</p>';\n $qdata->options->partiallycorrectfeedbackformat = FORMAT_HTML;\n $qdata->options->shownumcorrect = 1;\n $qdata->options->incorrectfeedback = '<p>Your answer is incorrect.</p>';\n $qdata->options->incorrectfeedbackformat = FORMAT_HTML;\n \n $qdata->options->answers = array(\n 13 => new question_answer(13, 'answer 1', 0, '', FORMAT_HTML),\n 14 => new question_answer(14, 'answer 2', 1, '', FORMAT_HTML),\n 15 => new question_answer(15, 'answer 3', 0, '', FORMAT_HTML),\n 16 => new question_answer(16, 'answer 4', 1, '', FORMAT_HTML),\n );\n \n $qdata->hints = array(\n new question_hint_with_parts(0, 'Hint 1.', FORMAT_HTML, false, false),\n new question_hint_with_parts(0, 'Hint 2.', FORMAT_HTML, false, false),\n );\n \n \n // Export the question.\n $exporter = new qformat_smart();\n $questions = array($qdata);\n $zipcontent = $exporter->export_questions($questions);\n \n // Open exported question as import_data.\n $import_data = $this->zip_to_import_data($zipcontent);\n \n /*\n * Test content of imsmanifest.xml\n */\n \n $imsmanifest = $import_data->imsmanifest;\n \n $expected = '<resource identifier=\"group0_pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[0]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n $expected = '<resource identifier=\"pages\" href=\"page0.svg\" type=\"webcontent\" adlcp:scormType=\"asset\"><file href=\"page0.svg\"/></resource>';\n $actual = $imsmanifest->resources->resource[1]->asXML();\n $this->assert_same_xml($expected, $actual);\n \n /*\n * Test content of page.\n */\n \n // Test number of pages.\n $this->assertCount(1, $import_data->pages);\n \n $page = $import_data->pages[0];\n \n // Test the number of question elements.\n $questions = $page->xpath('//g[@class=\"question\"]');\n $this->assertCount(1, $questions);\n \n // Test the question element.\n $question = $questions[0];\n $expectedvotemetadata = '<votemetadata><questiontext format=\"selection\" labelstyle=\"upper-alpha\" correct=\"2 4\" points=\"23\" tags=\"\" explanation=\"General feedback\" mathgradingoption=\"\" likert=\"\"/></votemetadata>';\n $votemetadata = $question->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the question number.\n $expectedquestionnumber = '1';\n $questionnumber = strip_tags($question->text[0]->asXML());\n $this->assertEquals($expectedquestionnumber, $questionnumber);\n \n // Test the question text without formattings.\n $expectedquestiontext = 'Questiontext of muliple choice question.';\n $questiontext = strip_tags($question->text[1]->asXML());\n $this->assertEquals($expectedquestiontext, $questiontext);\n \n // Test the number of choices.\n $choices = $page->xpath('//g[@class=\"questionchoice\"]');\n $this->assertCount(4, $choices);\n \n // Test the 1. choice element.\n $choice = $choices[0];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"1\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'A';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 1';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 2. choice element.\n $choice = $choices[1];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"2\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'B';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 2';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 3. choice element.\n $choice = $choices[2];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"3\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'C';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 3';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the 4. choice element.\n $choice = $choices[3];\n $expectedvotemetadata = '<votemetadata><choicetext label=\"4\" format=\"selection\"/></votemetadata>';\n $votemetadata = $choice->votemetadata->asXML();\n $this->assert_same_xml($expectedvotemetadata, $votemetadata);\n \n // Test the numbering of the choice text without formattings.\n $expectedchoicetext = 'D';\n $choicetext = strip_tags($choice->text[0]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n \n // Test the choice text without formattings.\n $expectedchoicetext = 'answer 4';\n $choicetext = strip_tags($choice->text[1]->asXML());\n $this->assertEquals($expectedchoicetext, $choicetext);\n }", "public function __toString() {\n\t\treturn $this->xml_definition->asXML();\n\t}", "function toString() {\n\t\t$out = '';\n\t\tif(!empty($this->cats)) {\n\t\t\t$str = implode('>', $this->cats);\n\t\t\t$out = '(' . $str . ') ';\n\t\t}\n\t\t$out .= $this->question . \"?\";\n\t\treturn $out;\n\t}", "public function get_stats_questions_schema() {\n\t\t\t$schema = array(\n\t\t\t\t'$schema' => 'http://json-schema.org/draft-04/schema#',\n\t\t\t\t'title' => 'quiz-statistics-questions',\n\t\t\t\t'parent' => 'quiz-statistics',\n\t\t\t\t'type' => 'object',\n\t\t\t\t'properties' => array(\n\t\t\t\t\t'id' => array(\n\t\t\t\t\t\t'description' => __( 'Unique ID for Statistics Question.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'statistic' => array(\n\t\t\t\t\t\t'description' => __( 'Statistics Ref ID.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'quiz' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Quiz.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID',\n\t\t\t\t\t\t\t\t'placeholder: Quiz',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'quiz' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'question' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s ID',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'question_type' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'%s Type',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t'context' => array( 'embed', 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'points_scored' => array(\n\t\t\t\t\t\t'description' => esc_html__( 'Points scored.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'points_total' => array(\n\t\t\t\t\t\t'description' => esc_html__( 'Points total.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'answers' => array(\n\t\t\t\t\t\t'description' => sprintf(\n\t\t\t\t\t\t\t// translators: placeholder: Question.\n\t\t\t\t\t\t\tesc_html_x(\n\t\t\t\t\t\t\t\t'The collection of %s answers.',\n\t\t\t\t\t\t\t\t'placeholder: Question',\n\t\t\t\t\t\t\t\t'learndash'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tLearnDash_Custom_Label::get_label( 'question' )\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'student' => array(\n\t\t\t\t\t\t'description' => __( 'The collection of student submitted answers.', 'learndash' ),\n\t\t\t\t\t\t'type' => 'object',\n\t\t\t\t\t\t'context' => array( 'view' ),\n\t\t\t\t\t\t'readonly' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t);\n\n\t\t\treturn $schema;\n\t\t}", "public function __toString()\n {\n return $this->asXML();\n }", "public function getSurveyNodes()\n {\n return $this->hasMany(SurveyTemplateQuestionNodes::ClassName(), ['survey_template_question_id' => 'id']);\n }", "private function generate_question() {\n\n require_once(__DIR__ . '/csv_gd.class.php');\n $csv_filename = $this->configuration['base_data_dir'] . '/csv/' . $this->configuration['csv_input'];\n\n $data_quiz_src_obj = new csv_gd($csv_filename);\n $data_quiz_src_orig = $data_quiz_src_obj->csv_to_array();\n\n\n\n // filter unwanted question (tags, diff level, void )\n $data_quiz_src_filtered = $this->quiz_filter($data_quiz_src_orig, $this->configuration['tags'], $this->configuration['min_diffucult_level'], $this->configuration['max_diffucult_level']);\n\n\n // reverse question with_answer\n if ($this->configuration['reverse_question'] == TRUE) {\n $data_quiz_src_filtered = $this->quiz_switch_question_with_answer($data_quiz_src_filtered);\n }\n\n\n // generate question and answer\n $data_quiz_src = $this->quiz_generate($data_quiz_src_filtered);\n\n\n // randomize quiz \n if ($this->configuration['randomize_question'] == TRUE) {\n shuffle($data_quiz_src);\n }\n\n\n // restrict the maxium number of question\n if ($this->configuration['max_question_total'] > 0) {\n $this->configuration['max_question_total'] = min(count($data_quiz_src), $this->configuration['max_question_total']);\n } else {\n $this->configuration['max_question_total'] = count($data_quiz_src);\n }\n $this->question = array_slice($data_quiz_src, 0, $this->configuration['max_question_total']);\n\n $this->configuration['debug']=$this->debug;\n\n // return $this->quiz_questions;\n }", "public function toXML() {\n\t\t$xml = '<' . $this->type . '>' . PHP_EOL;\n\t\t$xml .= ' <ids>' . PHP_EOL;\n\t\tforeach ($this->ids as $id) {\n\t\t\t$xml .= ' <id>' . $id . '</id>' . PHP_EOL;\n\t\t}\n\t\t$xml .= ' </ids>' . PHP_EOL;\n\t\t$xml .= '</' . $this->type . '>' . PHP_EOL;\n\t\treturn $xml;\n\t}", "public function export_to_xml($question, qformat_xml $format, $extra=null) {\n $expout = '';\n\n $expout .= question_type::export_to_xml($question, $format);\n\n $expout .= $format->write_combined_feedback($question->options,\n $question->id,\n $question->contextid);\n\n $unitfields = array('unitgradingtype', 'unitpenalty', 'showunits', 'unitsleft');\n foreach ($unitfields as $field) {\n if (isset($question->options->$field)) {\n $expout .= \" <{$field}>\" .\n $question->options->$field . \"</{$field}>\\n\";\n }\n }\n\n if (isset($question->options->instructionsformat)) {\n $files = $fs->get_area_files($contextid, $component,\n 'instruction', $question->id);\n $expout .= \" <instructions \" .\n $this->format($question->options->instructionsformat) . \">\\n\";\n $expout .= $format->writetext($question->options->instructions, 3);\n $expout .= $format->write_files($files);\n $expout .= \" </instructions>\\n\";\n }\n\n if (isset($question->options->units)) {\n $units = $question->options->units;\n if (count($units)) {\n $expout .= \"<units>\\n\";\n foreach ($units as $unit) {\n $expout .= \" <unit>\\n\";\n $expout .= \" <multiplier>{$unit->multiplier}</multiplier>\\n\";\n $expout .= \" <unit_name>{$unit->unit}</unit_name>\\n\";\n $expout .= \" </unit>\\n\";\n }\n $expout .= \"</units>\\n\";\n }\n }\n\n // The tag $question->export_process has been set so we get all the\n // data items in the database from the function\n // qtype_calculated::get_question_options calculatedsimple defaults\n // to calculated.\n if (isset($question->options->datasets) && count($question->options->datasets)) {\n $expout .= \"<dataset_definitions>\\n\";\n foreach ($question->options->datasets as $def) {\n $expout .= \"<dataset_definition>\\n\";\n $expout .= \" <status>\".$format->writetext($def->status).\"</status>\\n\";\n $expout .= \" <name>\".$format->writetext($def->name).\"</name>\\n\";\n $expout .= \" <type>calculatedformat</type>\\n\";\n $expout .= \" <distribution>\" . $format->writetext($def->distribution) .\n \"</distribution>\\n\";\n $expout .= \" <minimum>\" . $format->writetext($def->minimum) .\n \"</minimum>\\n\";\n $expout .= \" <maximum>\" . $format->writetext($def->maximum) .\n \"</maximum>\\n\";\n $expout .= \" <decimals>\" . $format->writetext($def->decimals) .\n \"</decimals>\\n\";\n $expout .= \" <itemcount>$def->itemcount</itemcount>\\n\";\n if ($def->itemcount > 0) {\n $expout .= \" <dataset_items>\\n\";\n foreach ($def->items as $item) {\n $expout .= \" <dataset_item>\\n\";\n $expout .= \" <number>\".$item->itemnumber.\"</number>\\n\";\n $expout .= \" <value>\".$item->value.\"</value>\\n\";\n $expout .= \" </dataset_item>\\n\";\n }\n $expout .= \" </dataset_items>\\n\";\n $expout .= \" <number_of_items>\" . $def->number_of_items .\n \"</number_of_items>\\n\";\n }\n $expout .= \"</dataset_definition>\\n\";\n }\n $expout .= \"</dataset_definitions>\\n\";\n }\n\n return $expout;\n }", "public function question_type()\n {\n return $this->belongsTo(\\App\\Models\\QuestionType::class);\n }", "public function questions()\n {\n return $this->hasMany('App\\\\SurveyQuestion','survey_id');\n }" ]
[ "0.548619", "0.54643166", "0.5423348", "0.53893405", "0.5284722", "0.52270424", "0.52092797", "0.5198433", "0.5193515", "0.5188486", "0.5176122", "0.51624703", "0.51584643", "0.5153919", "0.51498234", "0.5145992", "0.5131096", "0.5131096", "0.5095637", "0.50889325", "0.5085448", "0.5005433", "0.50039005", "0.4996749", "0.49920794", "0.49834946", "0.49803874", "0.49727756", "0.497103", "0.49635825" ]
0.65091777
0
Creates an instance of a question with a given question id
function &_instanciateQuestion($question_id) { if ($question_id < 1) return FALSE; include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php"; $question_type = SurveyQuestion::_getQuestionType($question_id); if (strlen($question_type) == 0) return FALSE; SurveyQuestion::_includeClass($question_type); $question = new $question_type(); $question->loadFromDb($question_id); return $question; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function question($id)\n {\n return $this->create($id);\n }", "public function createQuestionAction(int $id) : object\n {\n $page = $this->di->get(\"page\");\n $form = new CreateQuestionForm($this->di, $id);\n $form->check();\n\n $page->add(\"questions/crud/create-question\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Create a question\",\n ]);\n }", "public function actionCreate($question_id)\n {\n $model = new QuestionAnswer();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['question/view', 'id' => $question_id]);\n }\n return $this->render('create', [\n 'model' => $model,\n 'question' => $this->findQuestionModel($question_id)\n ]);\n }", "public function create(\\FanFerret\\QuestionBundle\\Entity\\Question $question);", "public function create($id)\n {\n // Get the question from the database\n $question = Helpers\\getQuestionByID($id);\n // Get the respondent's individual repondent_id\n $respondent_id = Helpers\\getRespondentID($question);\n // Returns the show view for the question with the contents of the $question and $respondent_id variables (to populate the page)\n return view('public.question.show', ['question' => $question, 'respondent_id' => $respondent_id]);\n }", "function questionnaire_add_instance($questionnaire) {\n // (defined by the form in mod.html) this function\n // will create a new instance and return the id number\n // of the new instance.\n global $COURSE, $DB, $CFG;\n require_once($CFG->dirroot.'/mod/questionnaire/questionnaire.class.php');\n require_once($CFG->dirroot.'/mod/questionnaire/locallib.php');\n\n // Check the realm and set it to the survey if it's set.\n\n if (empty($questionnaire->sid)) {\n // Create a new survey.\n $cm = new Object();\n $qobject = new questionnaire(0, $questionnaire, $COURSE, $cm);\n\n if ($questionnaire->create == 'new-0') {\n $sdata = new Object();\n $sdata->name = $questionnaire->name;\n $sdata->realm = 'private';\n $sdata->title = $questionnaire->name;\n $sdata->subtitle = '';\n $sdata->info = '';\n $sdata->theme = ''; // Theme is deprecated.\n $sdata->thanks_page = '';\n $sdata->thank_head = '';\n $sdata->thank_body = '';\n $sdata->email = '';\n $sdata->owner = $COURSE->id;\n if (!($sid = $qobject->survey_update($sdata))) {\n print_error('couldnotcreatenewsurvey', 'questionnaire');\n }\n } else {\n $copyid = explode('-', $questionnaire->create);\n $copyrealm = $copyid[0];\n $copyid = $copyid[1];\n if (empty($qobject->survey)) {\n $qobject->add_survey($copyid);\n $qobject->add_questions($copyid);\n }\n // New questionnaires created as \"use public\" should not create a new survey instance.\n if ($copyrealm == 'public') {\n $sid = $copyid;\n } else {\n $sid = $qobject->sid = $qobject->survey_copy($COURSE->id);\n // All new questionnaires should be created as \"private\".\n // Even if they are *copies* of public or template questionnaires.\n $DB->set_field('questionnaire_survey', 'realm', 'private', array('id' => $sid));\n }\n }\n $questionnaire->sid = $sid;\n }\n\n $questionnaire->timemodified = time();\n\n // May have to add extra stuff in here.\n if (empty($questionnaire->useopendate)) {\n $questionnaire->opendate = 0;\n }\n if (empty($questionnaire->useclosedate)) {\n $questionnaire->closedate = 0;\n }\n\n if ($questionnaire->resume == '1') {\n $questionnaire->resume = 1;\n } else {\n $questionnaire->resume = 0;\n }\n\n // Field questionnaire->navigate used for branching questionnaires. Starting with version 2.5.5.\n /* if ($questionnaire->navigate == '1') {\n $questionnaire->navigate = 1;\n } else {\n $questionnaire->navigate = 0;\n } */\n\n if (!$questionnaire->id = $DB->insert_record(\"questionnaire\", $questionnaire)) {\n return false;\n }\n\n questionnaire_set_events($questionnaire);\n\n return $questionnaire->id;\n}", "public function createAction(Request $request, $id)\n {\n $entity = new Question();\n $form = $this->createForm(new QuestionType(), $entity);\n $form->bind($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n // On r�cup�re l'entit� questionnaire correspondant � l'id $id\n //$questionnaire = $em->getRepository('QuizmooQuestionnaireBundle:Questionnaire')->find($id);\n //$questionnaire->addQuestion($entity);\n $em->persist($entity);\n $em->flush();\n\n // return $this->redirect($this->generateUrl('question_show', array('id' => $entity->getId())));\n return $this->redirect($this->generateUrl('quizmoo_questionnaire_modifier', array('id' => $id)));\n }\n\n return $this->render('QuizmooQuestionnaireBundle:Question:new.'.$this->get('session')->get('whichTwig','').'html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create($question, $type = ObjectFactory::TEXT_QUESTION)\n\t{\n\t\t// echo $type;\n\t\t$newQuestion = $this->objectFactory->createQuestion($type);\n\t\t// if ($type == ObjectFactory::SINGLE_CHOICE_QUESTION) echo \"single\";\n\t\t// echo $question;\n\t\t$newQuestion->setQuestion($question);\n\t\t$this->questions[$newQuestion->getId()] = $newQuestion;\n\t\treturn $newQuestion;\n\t}", "public static function factory( $id );", "public function create($id)\n {\n $input = [\n 'exam_id' => $id\n ];\n\n return view('admin.examQuestions.create',$input);\n }", "public function create($question, $type = ObjectFactory::TEXT_QUESTION) {\n $questionObj = $this->objectFactory->createQuestion($type);\n $questionObj->setQuestion($question);\n $this->poll->addItem($questionObj);\n return $questionObj;\n\t}", "public function create($id = null)\n {\n $category = $this->category->all();\n return view('certification.question.create')\n ->with(['category' => $category, 'id' => $id]);\n }", "public function actionCreate($question_id, $survey_id)\n //$survey_id ist notwendig, um auf die Survey zurückzukommen, für die man die Answer erstellt hat.\n {\n $model = new Answer();\n\n //Die Question holen, die im survey/view erstellungsformular erstellt wurde.\n $question = Question::find()->where(['id'=>$question_id]);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $model->link('questions', $question->one());\n return $this->redirect(['survey/view/', 'id' => $survey_id]);\n\n } else {\n return $this->render('create', ['id'=>$question_id,\n 'model' => $model,\n ]);\n }\n\n }", "public function create($id)\n {\n }", "public function newAction($id)\n {\n $entity = new Question();\n $form = $this->createForm(new QuestionType(), $entity);\n\n return $this->render('QuizmooQuestionnaireBundle:Question:new.'.$this->get('session')->get('whichTwig','').'html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'id_questionnaire' =>$id\n ));\n }", "public function createQuestion($examID, $text){\n \n $data = array(\n 'examID' => $examID,\n 'text' => $text\n );\n \n return $this->insert($data);\n }", "public static function create($id = NULL) { return new self($id); }", "public function add_question($id)\n {\n $this->question_ids[] = $id;\n }", "public static function instance(string $id);", "public function create($id)\n {\n $id=$examen->id;\n return view('questions.create');\n }", "public function set_id_question($id_question) \n\t{\n\t\t$this->id_question = $id_question;\n\t\treturn $this;\n\t}", "public function create($id)\n {\n \n }", "public function create($id)\n {\n\n }", "public function create($id)\n {\n\n }", "public static function create_question($question, $answer)\n {\n global $DB;\n $params = self::validate_parameters(self::create_question_parameters(), array('question' => $question, 'answer' => $answer));\n if ($DB->record_exists('quiz', array('id' => $question[0]['quizid'])) == false && $question[0]['quizid'] != 0) {\n print_error('quiz does not exist', 'quiz', null, null, 'choose correct quiz id');\n } elseif ($DB->record_exists('question_categories', array('id' => $question[0]['question_category'])) == false && $question[0]['question_category']) {\n print_error('categorydoesnotexist', 'question', null, null, 'choose correct category id');\n }\n\n $questionBuilder = new QuestionBuilder();\n $__question = $questionBuilder->questionMaker($question);\n $answerBuilder = new AnswerBuilder($__question);\n\n $answerBuilder->answerMaker($answer);\n\n return $__question;\n }", "public static function create_from_id($id) {\n global $DB;\n\n // Rename the data field question_id to questionid to conform with code conventions. Eventually, data table should be\n // changed.\n if ($record = $DB->get_record(self::tablename(), ['id' => $id], 'id,question_id as questionid,content,value')) {\n return new choice($id, $record->questionid, $record->content, $record->value);\n } else {\n return new choice();\n }\n }", "public function constructQuestionFromGUID($guid, $questionId = null, $responseId = null)\n {\n $this->loadQuestionObjects();\n if (isset($this->guidToQuestion[$guid]))\n {\n $questionClass = $this->guidToQuestion[$guid]['class'];\n $questionObject = new $questionClass($this->loadPlugin($this->guidToQuestion[$guid]['plugin']), $this->api, $questionId, $responseId);\n return $questionObject;\n }\n }", "private function getQuestion($id){\n $q = new Question();\n return $q->find($id);\n }", "public static function factory($id)\n {\n return static::$_instance->create($id);\n }", "public function create($id)\n {\n //\n\n }" ]
[ "0.7629338", "0.71683115", "0.6906799", "0.6760966", "0.6723291", "0.6566401", "0.653367", "0.6386355", "0.63219315", "0.6259094", "0.62467915", "0.6246044", "0.62237406", "0.6208069", "0.6206992", "0.61948353", "0.6160527", "0.61558574", "0.612326", "0.61190206", "0.61132467", "0.6095333", "0.6089533", "0.6089533", "0.60791224", "0.60742766", "0.603893", "0.603723", "0.6025243", "0.60232687" ]
0.76062125
1
Locates the import directory and the xml file in a directory with an unzipped import file
function locateImportFiles($a_dir) { if (!is_dir($a_dir) || is_int(strpos($a_dir, ".."))) { return; } $importDirectory = ""; $xmlFile = ""; $current_dir = opendir($a_dir); $files = array(); while($entryname = readdir($current_dir)) { $files[] = $entryname; } foreach($files as $file) { if(is_dir($a_dir."/".$file) and ($file != "." and $file!="..")) { // found directory created by zip $importDirectory = $a_dir."/".$file; } } closedir($current_dir); if (strlen($importDirectory)) { // find the xml file $current_dir = opendir($importDirectory); $files = array(); while($entryname = readdir($current_dir)) { $files[] = $entryname; } foreach($files as $file) { if(@is_file($importDirectory."/".$file) && ($file != "." && $file!="..") && (ereg("^[0-9]{10}_{2}[0-9]+_{2}(svy_)*[0-9]+\.[a-z]{1,3}\$", $file) || ereg("^[0-9]{10}_{2}[0-9]+_{2}(survey__)*[0-9]+\.[a-z]{1,3}\$", $file))) { // found xml file $xmlFile = $importDirectory."/".$file; } } } return array("dir" => $importDirectory, "xml" => $xmlFile); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function import($files) {\n\t\tforeach ($files as $file) {\n\t\t\t$dest_dir = $this->destDir($file);\n\t\t\t$src_path = JOURNALS_FILES . $file;\n\t\t\t$dest_path = DOWNLOAD_PATH . $this->destDir($file);\n\t\t\t$this->unzip($src_path, $dest_path);\n\t\t\t$res[] = $dest_path . \"/journals.xml\";\n\t\t}\n\t\treturn $res;\n\t}", "function getImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$import_dir = ilUtil::getDataDir().\"/svy_data\".\n\t\t\t\"/svy_\".$this->getId().\"/import\";\n\t\tif (!is_dir($import_dir))\n\t\t{\n\t\t\tilUtil::makeDirParents($import_dir);\n\t\t}\n\t\tif(@is_dir($import_dir))\n\t\t{\n\t\t\treturn $import_dir;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function wp_import_file() {\n\t \n\t $zip = new ZipArchive;\n\n\t $zip->open($this->_file_destination);\n\t $zip->extractTo('.');\n\t $zip->close();\n\n\t return TRUE;\n\t}", "public function extract() {\n $this->fileInfo();\n\n $zip = new ZipArchive;\n $res = $zip->open($this->filePath);\n\n if ($res === TRUE) {\n // Extract the file.\n $zip->extractTo($this->extractPath);\n $zip->close();\n $this->path = $this->extractPath;\n }\n else {\n // couldn't extract the zip file, display an error message and watchdog.\n $params = array(\n '@file' => $this->filePath,\n '@path' => $this->extractPath,\n );\n\n $message = t('Unable to extract @file to @path', $params);\n watchdog('subtheme', $message);\n drupal_set_message($message, 'error');\n }\n }", "function _fillDirectories($importDirectory)\n\t{\n\t\t\n\t\t@set_time_limit(60);\n\t\t\n\t\t$weDirectory = ereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . \"/webEdition\";\n\t\tif ($importDirectory == $weDirectory) { // we do not import stuff from the webEdition home dir\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// go throuh all files of the directory\n\t\t$d = dir($importDirectory);\n\t\twhile (false !== ($entry = $d->read())) {\n\t\t\tif ($entry == '.' || $entry == '..' || ((strlen($entry) >= 2) && substr($entry, 0, 2) == \"._\"))\n\t\t\t\tcontinue;\n\t\t\t\t// now we have to check if the file should be imported\n\t\t\t$PathOfEntry = $importDirectory . $this->_slash . $entry;\n\t\t\tif (!is_dir($PathOfEntry) && ($this->maxSize && (filesize($PathOfEntry) > (abs($this->maxSize) * 1024 * 1024))))\n\t\t\t\tcontinue;\n\t\t\t$contentType = getContentTypeFromFile($PathOfEntry);\n\t\t\t$importIt = false;\n\t\t\t\n\t\t\tswitch ($contentType) {\n\t\t\t\tcase \"image/*\" :\n\t\t\t\t\tif ($this->images) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/html\" :\n\t\t\t\t\tif ($this->htmlPages) {\n\t\t\t\t\t\tif ($this->createWePages) {\n\t\t\t\t\t\t\t$contentType = \"text/webedition\";\n\t\t\t\t\t\t\t// webEdition files needs to be post processed (external links => internal links)\n\t\t\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t\t\t$this->_postProcess, \n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\t\t\t\"contentType\" => \"post/process\", \n\t\t\t\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\t\t\t\"destDirID\" => $this->to\n\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"application/x-shockwave-flash\" :\n\t\t\t\t\tif ($this->flashmovies) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"video/quicktime\" :\n\t\t\t\t\tif ($this->quicktime) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/js\" :\n\t\t\t\t\tif ($this->js) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/plain\" :\n\t\t\t\t\tif ($this->text) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"text/css\" :\n\t\t\t\t\tif ($this->css) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"folder\" :\n\t\t\t\t\t$importIt = false;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault :\n\t\t\t\t\tif ($this->other) {\n\t\t\t\t\t\t$importIt = true;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif ($importIt) {\n\t\t\t\tarray_push(\n\t\t\t\t\t\t$this->_files, \n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\"contentType\" => $contentType, \n\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\"destDirID\" => $this->to, \n\t\t\t\t\t\t\t\t\"sameName\" => $this->sameName, \n\t\t\t\t\t\t\t\t\"thumbs\" => $this->thumbs, \n\t\t\t\t\t\t\t\t\"width\" => $this->width, \n\t\t\t\t\t\t\t\t\"height\" => $this->height, \n\t\t\t\t\t\t\t\t\"widthSelect\" => $this->widthSelect, \n\t\t\t\t\t\t\t\t\"heightSelect\" => $this->heightSelect, \n\t\t\t\t\t\t\t\t\"keepRatio\" => $this->keepRatio, \n\t\t\t\t\t\t\t\t\"quality\" => $this->quality, \n\t\t\t\t\t\t\t\t\"degrees\" => $this->degrees, \n\t\t\t\t\t\t\t\t\"importMetadata\" => $this->importMetadata\n\t\t\t\t\t\t));\n\t\t\t}\n\t\t\tif ($contentType == \"folder\") {\n\t\t\t\tif (($this->depth == -1) || (abs($this->depth) > $this->_depth)) {\n\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t$this->_files, \n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\"path\" => $PathOfEntry, \n\t\t\t\t\t\t\t\t\t\"contentType\" => $contentType, \n\t\t\t\t\t\t\t\t\t\"sourceDir\" => $this->from, \n\t\t\t\t\t\t\t\t\t\"destDirID\" => $this->to, \n\t\t\t\t\t\t\t\t\t\"sameName\" => $this->sameName, \n\t\t\t\t\t\t\t\t\t\"thumbs\" => \"\", \n\t\t\t\t\t\t\t\t\t\"width\" => \"\", \n\t\t\t\t\t\t\t\t\t\"height\" => \"\", \n\t\t\t\t\t\t\t\t\t\"widthSelect\" => \"\", \n\t\t\t\t\t\t\t\t\t\"heightSelect\" => \"\", \n\t\t\t\t\t\t\t\t\t\"keepRatio\" => \"\", \n\t\t\t\t\t\t\t\t\t\"quality\" => \"\", \n\t\t\t\t\t\t\t\t\t\"degrees\" => \"\", \n\t\t\t\t\t\t\t\t\t\"importMetadata\" => 0\n\t\t\t\t\t\t\t));\n\t\t\t\t\t$this->_depth++;\n\t\t\t\t\t$this->_fillDirectories($PathOfEntry);\n\t\t\t\t\t$this->_depth--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$d->close();\n\t}", "function _manually_load_importer() {\n\tif ( ! class_exists( 'WP_Import' ) ) {\n\t\trequire dirname( dirname( __FILE__ ) ) . '/src/wordpress-importer.php';\n\t}\n}", "private function extract(): void\n {\n if (file_exists($this->tmpDir) && is_dir($this->tmpDir)) {\n $this->rrmdir($this->tmpDir);\n }\n\n mkdir($this->tmpDir);\n\n $this->zipClass->open($this->path);\n $this->zipClass->extractTo($this->tmpDir);\n\n $index = 1;\n while (false !== $this->zipClass->locateName($this->getHeaderName($index))) {\n $this->tempDocumentHeaders[$index] = $this->readPartWithRels($this->getHeaderName($index));\n $index++;\n }\n $index = 1;\n while (false !== $this->zipClass->locateName($this->getFooterName($index))) {\n $this->tempDocumentFooters[$index] = $this->readPartWithRels($this->getFooterName($index));\n $index++;\n }\n\n $this->tempDocumentMainPart = $this->readPartWithRels($this->getMainPartName());\n\n $this->tempDocumentContentTypes = $this->zipClass->getFromName($this->getDocumentContentTypesName());\n\n $this->document = file_get_contents(sprintf('%s%sword%sdocument.xml', $this->tmpDir, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR));\n }", "function _import()\n\t{\n\t\t$title=get_page_title('IMPORT');\n\n\t\t$xml=post_param('xml');\n\n\t\t$ops=import_from_xml($xml);\n\n\t\t$ops_nice=array();\n\t\tforeach ($ops as $op)\n\t\t{\n\t\t\t$ops_nice[]=array('OP'=>$op[0],'PARAM_A'=>$op[1],'PARAM_B'=>array_key_exists(2,$op)?$op[2]:'');\n\t\t}\n\n\t\t// Clear some cacheing\n\t\trequire_code('view_modes');\n\t\trequire_code('zones2');\n\t\trequire_code('zones3');\n\t\terase_comcode_page_cache();\n\t\trequire_code('view_modes');\n\t\terase_tempcode_cache();\n\t\tpersistant_cache_empty();\n\n\t\tbreadcrumb_set_self(do_lang_tempcode('_RESULTS'));\n\t\tbreadcrumb_set_parents(array(array('_SELF:_SELF:misc',do_lang_tempcode('XML_DATA_MANAGEMENT'))));\n\n\t\treturn do_template('XML_STORAGE_IMPORT_RESULTS_SCREEN',array('TITLE'=>$title,'OPS'=>$ops_nice));\n\t}", "public function import(string $filePath);", "function skudo_autoimport($url, $demo) {\n\t\t\n\t\t$os = ((strpos(strtolower(PHP_OS), 'win') === 0) || (strpos(strtolower(PHP_OS), 'cygwin') !== false)) ? 'win' : 'other';\n\t\tif (!function_exists('WP_Filesystem')){\n\t\t\t$abspath = ($os === \"win\") ? \"\\wp-admin\\includes\\file.php\" : \"/wp-admin/includes/file.php\";\n\t\t\trequire_once(ABSPATH.$abspath);\n\t\t}\n\t\tWP_Filesystem();\n\t\tglobal $wpdb, $wp_filesystem;\n\t\t\n\t // get the file\n\t require_once get_template_directory() . '/lib/classes/upper-content-import.php';\n\t\n\t if ( ! class_exists( 'skudo_Auto_Importer' ) )\n\t die( 'skudo_Auto_Importer not found' );\n\t\n\t // call the function\n\t\t$upload_dir = wp_upload_dir();\n\t\t$demo_file = $url.$demo.\"/contents.xml\";\n\t\t$tempfile = $upload_dir['basedir'] . '/temp.xml' ;\n\t\t$data = $wp_filesystem->get_contents($demo_file);\n\t\tif (!$data) $data = wp_remote_fopen($demo_file);\n\t\t$result = $wp_filesystem->put_contents($tempfile, $data, FS_CHMOD_FILE);\n\t\t\n\t\tif ($result){\n\t\t\t$args = array(\n\t 'file' => $tempfile,\n\t 'map_user_id' => 0\n\t );\n\t skudo_auto_import( $args );\n\t\t}\n\t\n\t}", "function import()\n\t{\n\t\t$this->ipsclass->admin->page_detail = \"Эта секция позволяет вам импортировать XML-файлы содержащие языковые настройки.\";\n\t\t$this->ipsclass->admin->page_title = \"Импорт языка\";\n\t\t$this->ipsclass->admin->nav[] \t\t= array( '', 'Import Language Pack' );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'doimport' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'lang' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'MAX_FILE_SIZE' , '10000000000' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section' , $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) , \"uploadform\", \" enctype='multipart/form-data'\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"50%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"50%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Импортирование XML-файла\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Загрузка XML-архива с языковыми настройками</b><div style='color:gray'>Выберите файл для загрузки с вашего компьютера. Выбранный файл должен начинаться с 'ipb_language' и заканчиваться либо '.xml', либо '.xml.gz'.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_upload( )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b><u>ИЛИ</u> введите название XML-архива</b><div style='color:gray'>Этот файл должен быть загружен в основную директорию форума.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_input( 'lang_location', 'ipb_language.xml.gz' )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Введите название для новых языковых настроек</b><div style='color:gray'>Например: Русский, RU, English, US...</div>\" ,\n\t\t\t\t\t\t\t\t\t\t \t\t\t\t $this->ipsclass->adskin->form_input( 'lang_name', '' )\n\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Импортирование XML-файла\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->output();\n\n\n\t}", "final function getDirectory () { return $this->xml_dir->path; }", "public function importDebbComponentsXmlAction(Request $request)\r\n {\r\n $form = $this->createForm(new \\Debb\\ConfigBundle\\Form\\ImportDebbComponentsXmlType());\r\n if ($request->getMethod() == 'POST')\r\n {\r\n $form->submit($request);\r\n\r\n if ($form->isValid())\r\n {\r\n /* @var $file \\Debb\\ManagementBundle\\Entity\\File */\r\n $file = $form['ziparchive']->getData();\r\n if($file->getMimeType() == 'application/zip' || $file->getMimeType() == 'application/octet-stream')\r\n {\r\n /* Temp directory creation */\r\n $dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . rand(11111, 99999) . 'debb';\r\n mkdir($dir);\r\n\r\n /* Open the uploaded zip archive */\r\n $zip = new \\ZipArchive;\r\n $res = $zip->open($file->getFullPath());\r\n if ($res === TRUE)\r\n {\r\n /* Extract $zip to $dir */\r\n $zip->extractTo($dir);\r\n $zip->close();\r\n /* Remove $file / $zip */\r\n\t unlink($file->getFullPath());\r\n unset($file);\r\n unset($zip);\r\n /* Import each xml file */\r\n foreach (glob($dir . DIRECTORY_SEPARATOR . '*.xml') as $file)\r\n {\r\n $this->importDebbComponentsComponent(new \\SimpleXMLElement(file_get_contents($file)), $file);\r\n }\r\n }\r\n\r\n self::rmfdir($dir);\r\n $this->addSuccessMsg('localdev_admin.messages.saved');\r\n }\r\n else\r\n {\r\n $this->addErrorMsg('localdev_admin.messages.wrongfile');\r\n }\r\n }\r\n }\r\n\r\n return array(\r\n 'form' => $form->createView()\r\n );\r\n }", "public function import_xml(){\n $this->load->model('extension/module/export_yml');\n $this->load->language('extension/module/export_yml');\n $json = array();\n // Check user has permission\n if (!$this->user->hasPermission('modify', 'extension/module/export_yml')) {\n $json['error'] = $this->language->get('error_permission');\n }\n\n if ($_POST[\"xml_url\"]){\n// $xml_url = $_POST[\"xml_url\"];\n// $xml = simplexml_load_file($xml_url) or die(\"feed not loading\");\n\n $this->parseCategoriesCsv('/home/h63053/data/www/optovik.shop/admin/controller/extension/module/groups.csv');\n $this->parseProductsCsv('/home/h63053/data/www/optovik.shop/admin/controller/extension/module/products.csv');\n// $this->parseCategories($xml);\n// $this->parseProducts($xml);\n }\n if (!$json) {\n $json['success'] = $this->language->get('text_import_success');\n }\n $this->response->addHeader('Content-Type: application/json');\n $this->response->setOutput(json_encode($json));\n $this->session->data['success'] = $this->language->get('text_success');\n }", "abstract protected function extract($file, $path);", "function processInstallation($pkg, $atts, $file, $tmp_path, $layer = null)\n {\n if (!$this->_setup['locationconfig']) {\n return false;\n }\n if ($this->_setup['honorsbaseinstall']) {\n $dest_dir = $save_destdir = $this->config->get($this->_setup['locationconfig'], $layer,\n $pkg->getChannel());\n if (!empty($atts['baseinstalldir'])) {\n $dest_dir .= DIRECTORY_SEPARATOR . $atts['baseinstalldir'];\n }\n } elseif ($this->_setup['unusualbaseinstall']) {\n $dest_dir = $save_destdir = $this->config->get($this->_setup['locationconfig'],\n null, $pkg->getChannel()) . DIRECTORY_SEPARATOR . $pkg->getPackage();\n if (!empty($atts['baseinstalldir'])) {\n $dest_dir .= DIRECTORY_SEPARATOR . $atts['baseinstalldir'];\n }\n } else {\n $dest_dir = $save_destdir = $this->config->get($this->_setup['locationconfig'],\n null, $pkg->getChannel()) . DIRECTORY_SEPARATOR . $pkg->getPackage();\n }\n if (dirname($file) != '.' && empty($atts['install-as'])) {\n $dest_dir .= DIRECTORY_SEPARATOR . dirname($file);\n }\n if (empty($atts['install-as'])) {\n $dest_file = $dest_dir . DIRECTORY_SEPARATOR . basename($file);\n } else {\n $dest_file = $dest_dir . DIRECTORY_SEPARATOR . $atts['install-as'];\n }\n $orig_file = $tmp_path . DIRECTORY_SEPARATOR . $file;\n\n // Clean up the DIRECTORY_SEPARATOR mess\n $ds2 = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR;\n \n list($dest_dir, $dest_file, $orig_file) = preg_replace(array('!\\\\\\\\+!', '!/!', \"!$ds2+!\"),\n array(DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR,\n DIRECTORY_SEPARATOR),\n array($dest_dir, $dest_file, $orig_file));\n return array($save_destdir, $dest_dir, $dest_file, $orig_file);\n }", "private function prepareFiles() {\n $zip = new ZipArchive;\n if ($zip->open(self::PARSE_DIR . '/' . self::ARCHIVE_FILENAME) === TRUE) {\n $zip->extractTo($this->tmpFolder);\n $zip->close();\n } else {\n $this->errors[] = 'Невозможно распаковать архив!';\n }\n }", "function __construct($xml_dir = '.') {\r\n\t\t\r\n\t\t$this->xml_dir = dir($xml_dir);\r\n\t}", "function findImport($url) {\n\t\tforeach ((array)$this->importDir as $dir) {\n\t\t\t$full = $dir.(substr($dir, -1) != '/' ? '/' : '').$url;\n\t\t\tif ($this->fileExists($file = $full.'.less') || $this->fileExists($file = $full)) {\n\t\t\t\treturn $file;\n\t\t\t}\n\n\t\t\t// Check whether the file is a CSS file\n\t\t\t$ch = curl_init(CC_STORE_URL.'/'.$url);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\tcurl_exec($ch);\n\t\t\tif (strpos(curl_getinfo($ch, CURLINFO_CONTENT_TYPE), 'text/css') !== false) return CC_STORE_URL.'/'.$url;\n\t\t\tcurl_close($ch);\n\t\t}\n\n\t\treturn null;\n\t}", "protected function initializeImport() {}", "function getXMLdata($fileandpath, $filename){\n global $jlistConfig;\n jimport( 'joomla.filesystem.archive' );\n jimport('joomla.filesystem.folder');\n jimport('joomla.filesystem.file'); \n $files_list = array();\n $xml_files = array();\n $xmltags = array();\n $path_parts = pathinfo($fileandpath);\n $destination_dir = JPATH_ROOT.DS.$jlistConfig['files.uploaddir'].DS.'tempzipfiles'.DS.$path_parts['filename'];\n if ($ok = JFolder::create($destination_dir.DS)){\n if(JArchive::extract($fileandpath, $destination_dir.DS)){\n // get files list\n $xml_files = scan_dir($destination_dir.DS, $type=array('.xml','.XML'), $only=false, $allFiles=false, $recursive=TRUE, $onlyDir=\"\", $files_list);\n if ($xml_files){\n foreach($xml_files as $key => $array2) {\n $filepath[] = $xml_files[$key]['path'].DS.$xml_files[$key]['file'];\n }\n $xml_file = usort($filepath, \"cmp_str\"); \n foreach($filepath as $fpath){\n $xmltags = use_xml($fpath);\n // get xml file tags\n if ($xmltags[name] != ''){\n delete_dir_and_allfiles($destination_dir.DS);\n return $xmltags;\n break; \n } \n }\n } \n }\n // delete all unzipped files and folder\n delete_dir_and_allfiles($destination_dir.DS);\n } \n return false; \n}", "public function import()\n {\n // Reorder importers\n usort($this->entityImporterMappings, function ($a, $b) {\n return $a[ORDER] <=> $b[ORDER];\n });\n\n // Import each entity type in turn\n foreach ($this->entityImporterMappings as $entityImporterMapping) {\n $files = $this->directoryReader->getFileNameMappings($entityImporterMapping[self::DIRECTORY]);\n foreach ($files as $filename => $slug) {\n $fileContents = file_get_contents($filename);\n $entityData = json_decode($fileContents, true);\n $entityImporterMapping[self::IMPORTER]->importEntity($slug, $entityData);\n }\n }\n }", "function xml_import ($xml) {\r\n $xml = html_entity_decode($xml);\r\n\t\tif (!stristr($xml,'<?xml')) {\r\n\t\t\t\t$xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>'.$xml;\r\n\t\t}\r\n $data = XML_unserialize($xml);\r\n\t\tif ($data === NULL) {\r\n\t\t\treturn 0;\r\n\t\t} else {\r\n\t\t return $data;\r\n\t\t}\r\n\t}", "public function upload_xml()\n {\n $this->upload_xml_file();\n }", "function createImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\t\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create test directory (data_dir/svy_data/svy_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create import subdirectory (data_dir/svy_data/svy_<id>/import)\n\t\t$import_dir = $svy_dir.\"/import\";\n\t\tilUtil::makeDir($import_dir);\n\t\tif(!@is_dir($import_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Import Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}", "public function register_importers() {\n include_once ( 'includes/wf_api_manager/wf-api-manager-config.php' );\n register_importer('woocommerce_wf_import_order_xml', 'WooCommerce Order XML', __('Import <strong>Orders</strong> details to your store via a xml file.', 'wf_order_import_export'), 'OrderImpExpXML_Importer::order_importer');\n register_importer('woocommerce_wf_import_order_xml_cron', 'WooCommerce Order XML Cron', __('Cron Import <strong>Orders</strong> details to your store via a xml file.', 'wf_order_import_export'), 'WF_OrderImpExpXML_ImportCron::orderxml_importer');\n }", "static public function import($dir)\n\t{\n\t\t$dh = opendir($dir);\n\t\twhile (false !== ($file = readdir($dh)))\n\t\t{\n\t\t\t$tmp = explode('.', $file);\n\t\t\tif (end($tmp) == 'php')\n\t\t\t{\n\t\t\t\trequire_once $dir . '/' . $file;\n\t\t\t}\n\t\t}\n\t\treturn closedir($dh); \n\t}", "function _wsdl_docs_service_import($name) {\n // Get existing service ID.\n $service_id = _wsdl_docs_get_service_id($name);\n if (is_numeric($service_id)) {\n // Load existing service.\n $service = entity_load_single('wsclient_service', $service_id);\n }\n else {\n return 'No service found with this name.';\n }\n // Create $_FILES['files'] from array of file information provided by REST request.\n $_FILES['files'] = array();\n foreach ($_FILES['soap_api_definition'] as $file_key => $values) {\n foreach ($values as $key => $value) {\n $_FILES['files'][$key][$file_key] = $value;\n }\n }\n // Confirm imported file(s) are of correct extension(s).\n foreach ($_FILES['files'] as $key => $file) {\n $ext = pathinfo($file['name'], PATHINFO_EXTENSION);\n if (!in_array($ext, array('xsd', 'wsdl'))) {\n return t('incorrect file format');\n }\n }\n // Prepare to save file(s) to selected directory.\n $directory = WSDL_DIRECTORY;\n file_prepare_directory($directory, FILE_CREATE_DIRECTORY);\n $multiple_files = (count($_FILES['files']) > 1);\n // Prepare to zip up multiple files for download from admin/content/wsdl_docs.\n if ($multiple_files) {\n $zip = new ZipArchive();\n $zip_filename = $service->name . '-' . $service->id . '.zip';\n $path = drupal_realpath($directory) . '/' . $zip_filename;\n fopen(drupal_realpath($zip_filename), 'w');\n $zip->open($path, ZipArchive::CREATE);\n }\n // Save individual file(s) as well as add to zip if multiple files imported.\n $i = 0;\n foreach ($_FILES['files'] as $key => $file) {\n $wsdl = file_get_contents($file['tmp_name']);\n // Perform basic XML validation.\n $DOMDocument = _wsdl_docs_validate_xml($wsdl);\n if ($DOMDocument) {\n $tmp_filename = WSDL_DIRECTORY . $file['name'];\n }\n else {\n return 'Invalid XML.';\n }\n // For the main WSDL/XSD file that refers to other files, name it\n // [service name]-[service id].wsdl or .xsd, depending on file's extension.\n // We are assuming this file has been provided first in the list of files to import.\n if ($i == 0) {\n $ext = pathinfo($file['name'], PATHINFO_EXTENSION);\n $tmp_filename = WSDL_DIRECTORY . $service->name . '-' . $service->id . '.' . $ext;\n $main_filename = $tmp_filename;\n }\n // For any additional files, keep the name the same so references from\n // the main file still work.\n else {\n // Confirm file name isn't a path to some other directory/file elsewhere in the system.\n if (strpos($file['name'], '/')) {\n return 'Not a valid file name.';\n }\n }\n file_unmanaged_save_data($wsdl, $tmp_filename, FILE_EXISTS_REPLACE);\n // For multiple files, add this file to the zip.\n if ($multiple_files) {\n $zip->addFromString($file['name'], $wsdl);\n }\n // Increment counter as we only rename the first file passed in the request.\n $i++;\n }\n // Validate main WSDL after saving file(s). If not valid, delete.\n // Additional wsdl files won't validate if they require the main file.\n _wsdl_docs_validate_wsdl_file($main_filename);\n // Save path of main/single file to existing WSDL service entity.\n if (isset($main_filename)) {\n $service->url = $main_filename;\n $service->save();\n $wsdl = file_get_contents($main_filename);\n $DOMDocument = new DOMDocument();\n $loaded = $DOMDocument->loadXML($wsdl);\n if ($loaded) {\n // Update existing service with new specs per file upload.\n wsdl_docs_update_wsclient_service($service, $DOMDocument);\n }\n else {\n return 'Invalid XML.';\n }\n }\n else {\n return 'Error importing files.';\n }\n return \"WSDL Doc: $name, id: $service_id updated.\";\n}", "protected function getGXMLImportStep2(){\n\t\t$parts = array();\n\t\t$hdns = \"\\n\";\n\t\t$v = we_base_request::_(we_base_request::STRING, 'v');\n\t\t$upload_error = false;\n\n\t\tif($v['rdofloc'] === 'lLocal'){\n\t\t\tif((!$v['import_from'] = $this->fileUploader->commitUploadedFile())){\n\t\t\t\t$upload_error = $this->fileUploader->getError();\n\t\t\t}\n\t\t}\n\n\t\t$vars = array('rdofloc', 'fserver', 'flocal', 'importDataType', 'docCategories', 'objCategories', 'store_to_id', 'is_dynamic', 'import_from', 'docType',\n\t\t\t'we_TemplateName', 'we_TemplateID', 'store_to_path', 'we_Extension', 'import_type', 'classID', 'sct_node', 'rcd', 'from_elem', 'to_elem', 'collision');\n\t\tforeach($vars as $var){\n\t\t\t$hdns.= we_html_element::htmlHidden('v[' . $var . ']', (isset($v[$var])) ? $v[$var] : '');\n\t\t}\n\t\t$hdns.= we_html_element::htmlHiddens(array(\n\t\t\t\t'v[mode]' => 0,\n\t\t\t\t'v[cid]', 'value' => -2));\n\n\t\tif((file_exists($_SERVER['DOCUMENT_ROOT'] . $v['import_from']) && is_readable($_SERVER['DOCUMENT_ROOT'] . $v['import_from']))){\n\t\t\t$xp = new we_xml_parser($_SERVER['DOCUMENT_ROOT'] . $v['import_from']);\n\t\t\t$xmlWellFormed = ($xp->parseError === '') ? true : false;\n\n\t\t\tif($xmlWellFormed){\n\t\t\t\t// Node-set with paths to the child nodes.\n\t\t\t\t$node_set = $xp->evaluate('*/child::*');\n\t\t\t\t$children = $xp->nodes[$xp->root]['children'];\n\n\t\t\t\t$recs = array();\n\t\t\t\tforeach($children as $key => $value){\n\t\t\t\t\t$flag = true;\n\t\t\t\t\tfor($k = 1; $k < ($value + 1); $k++){\n\t\t\t\t\t\tif(!$xp->hasChildNodes($xp->root . '/' . $key . '[' . $k . ']')){\n\t\t\t\t\t\t\t$flag = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($flag){\n\t\t\t\t\t\t$recs[$key] = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$isSingleNode = (count($recs) == 1);\n\t\t\t\t$hasChildNode = (!empty($recs));\n\t\t\t}\n\t\t\tif($xmlWellFormed && $hasChildNode){\n\t\t\t\t$rcdSelect = new we_html_select(array(\n\t\t\t\t\t'name' => 'we_select',\n\t\t\t\t\t'class' => 'weSelect',\n\t\t\t\t\t(($isSingleNode) ? 'disabled' : 'style') => '',\n\t\t\t\t\t'onchange' => \"this.form.elements['v[to_iElem]'].value=this.options[this.selectedIndex].value; this.form.elements['v[from_iElem]'].value=1;this.form.elements['v[sct_node]'].value=this.options[this.selectedIndex].text;\" .\n\t\t\t\t\t\"if(this.options[this.selectedIndex].value==1) {this.form.elements['v[from_iElem]'].disabled=true;this.form.elements['v[to_iElem]'].disabled=true;} else {this.form.elements['v[from_iElem]'].disabled=false;this.form.elements['v[to_iElem]'].disabled=false;}\")\n\t\t\t\t);\n\t\t\t\t$optid = 0;\n\t\t\t\tforeach($recs as $value => $text){\n\t\t\t\t\tif($optid == 0){\n\t\t\t\t\t\t$firstOptVal = $text;\n\t\t\t\t\t}\n\t\t\t\t\t$rcdSelect->addOption($text, $value);\n\t\t\t\t\tif(isset($v['rcd'])){\n\t\t\t\t\t\tif($text == $v['rcd']){\n\t\t\t\t\t\t\t$rcdSelect->selectOption($value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$optid++;\n\t\t\t\t}\n\n\t\t\t\t$tblSelect = new we_html_table(array(), 1, 7);\n\t\t\t\t$tblSelect->setCol(0, 1, array(), $rcdSelect->getHtml());\n\t\t\t\t$tblSelect->setCol(0, 2, array('width' => 20));\n\t\t\t\t$tblSelect->setCol(0, 3, array('class' => 'defaultfont'), g_l('import', '[num_data_sets]'));\n\t\t\t\t$tblSelect->setCol(0, 4, array(), we_html_tools::htmlTextInput('v[from_iElem]', 4, 1, 5, 'align=right', 'text', 50, '', '', ($isSingleNode && ($firstOptVal == 1)) ? 1 : 0));\n\t\t\t\t$tblSelect->setCol(0, 5, array('class' => 'defaultfont'), g_l('import', '[to]'));\n\t\t\t\t$tblSelect->setCol(0, 6, array(), we_html_tools::htmlTextInput('v[to_iElem]', 4, $firstOptVal, 5, 'align=right', 'text', 50, '', '', ($isSingleNode && ($firstOptVal == 1)) ? 1 : 0));\n\n\t\t\t\t$tblFrame = new we_html_table(array(), 3, 2);\n\t\t\t\t$tblFrame->setCol(0, 0, array('colspan' => 2, 'class' => 'defaultfont'), ($isSingleNode) ? we_html_tools::htmlAlertAttentionBox(g_l('import', '[well_formed]') . ' ' . g_l('import', '[select_elements]'), we_html_tools::TYPE_INFO, 530) :\n\t\t\t\t\t\twe_html_tools::htmlAlertAttentionBox(g_l('import', '[xml_valid_1]') . ' ' . $optid . ' ' . g_l('import', '[xml_valid_m2]'), we_html_tools::TYPE_INFO, 530));\n\t\t\t\t$tblFrame->setCol(1, 0, array('colspan' => 2));\n\t\t\t\t$tblFrame->setCol(2, 1, array(), $tblSelect->getHtml());\n\n\t\t\t\t$parts[] = array('html' => $tblFrame->getHtml(), 'noline' => 1);\n\t\t\t} else {\n\t\t\t\t$parts[] = array('html' => we_html_tools::htmlAlertAttentionBox(g_l('import', (!$xmlWellFormed ? '[not_well_formed]' : '[missing_child_node]')), we_html_tools::TYPE_ALERT, 530), 'noline' => 1);\n\t\t\t}\n\t\t} else {\n\t\t\t$xmlWellFormed = $hasChildNode = false;\n\n\t\t\tif($upload_error){ // uploaded file nok: get error from uploader\n\t\t\t\t$parts[] = array('html' => we_html_tools::htmlAlertAttentionBox($upload_error, we_html_tools::TYPE_ALERT, 530), 'noline' => 1);\n\t\t\t} else { // file from server nok\n\t\t\t\tif(!file_exists($_SERVER['DOCUMENT_ROOT'] . $v['import_from'])){\n\t\t\t\t\t$parts[] = array('html' => we_html_tools::htmlAlertAttentionBox(g_l('import', '[file_exists]') . $_SERVER['DOCUMENT_ROOT'] . $v['import_from'], we_html_tools::TYPE_ALERT, 530), 'noline' => 1);\n\t\t\t\t} elseif(!is_readable($_SERVER['DOCUMENT_ROOT'] . $v['import_from'])){\n\t\t\t\t\t$parts[] = array('html' => we_html_tools::htmlAlertAttentionBox(g_l('import', '[file_readable]'), we_html_tools::TYPE_ALERT, 530), 'noline' => 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$functions = \"\nfunction set_button_state() {\n\ttop.wizbusy.back_enabled=WE().layout.button.switch_button_state(top.wizbusy.document, 'back','enabled');\n\ttop.wizbusy.next_enabled=WE().layout.button.switch_button_state(top.wizbusy.document, 'next','\" . (($xmlWellFormed && $hasChildNode) ? \"enabled\" : \"disabled\") . \"');\n}\nfunction we_submit_form(f, target, url) {\n\tf.target = target;\n\tf.action = url;\n\tf.method = 'post';\n\tf.submit();\n}\nfunction handle_event(evt) {\n\tvar f = self.document.we_form;\n\tswitch(evt) {\n\tcase 'previous':\n\t\tf.step.value = 1;\n\t\twe_submit_form(f, 'wizbody', '\" . $this->path . \"');\n\t\tbreak;\n\tcase 'next':\n\t\tf.elements['v[from_elem]'].value = f.elements['v[from_iElem]'].value;\n\t\tf.elements['v[to_elem]'].value = f.elements['v[to_iElem]'].value;\n\t\tiStart = isNaN(parseInt(f.elements['v[from_iElem]'].value))? 0 : f.elements['v[from_iElem]'].value;\n\t\tiEnd = isNaN(parseInt(f.elements['v[to_iElem]'].value))? 0 : f.elements['v[to_iElem]'].value;\n\t\tiElements = parseInt(f.elements.we_select.options[f.elements.we_select.selectedIndex].value);\n\t\tif ((iStart < 1) || (iStart > iElements) || (iEnd < 1) || (iEnd > iElements)) {\n\t\t\tmsg = \\\"\" . g_l('import', '[num_elements]') . \"\\\" +iElements;\" .\n\t\t\twe_message_reporting::getShowMessageCall(\"msg\", we_message_reporting::WE_MESSAGE_ERROR, true) . \"\n\t\t} else {\n\t\t\tf.elements['v[rcd]'].value = f.we_select.options[f.we_select.selectedIndex].text;\n\t\t\tf.step.value = 3;\n\t\t\twe_submit_form(f, 'wizbody', '\" . $this->path . \"');\n\t\t}\n\t\tbreak;\n\tcase 'cancel':\n\t\ttop.close();\n\t\tbreak;\n\t}\n}\";\n\n\t\t$wepos = weGetCookieVariable('but_xml');\n\t\t$znr = -1;\n\n\t\t$content = $hdns .\n\t\t\twe_html_multiIconBox::getJS() .\n\t\t\twe_html_multiIconBox::getHTML('xml', $parts, 30, '', $znr, g_l('weClass', '[moreProps]'), g_l('weClass', '[lessProps]'), ($wepos === 'down'), g_l('import', '[select_data_set]'));\n\n\t\treturn array($functions, $content);\n\t}", "public function generateXmlFiles()\n\t{\n\t\t// Sitemaps\n\t\t$this->generateSitemap();\n\n\t\t// HOOK: add custom jobs\n\t\tif (isset($GLOBALS['TL_HOOKS']['generateXmlFiles']) && is_array($GLOBALS['TL_HOOKS']['generateXmlFiles']))\n\t\t{\n\t\t\tforeach ($GLOBALS['TL_HOOKS']['generateXmlFiles'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$this->{$callback[0]}->{$callback[1]}();\n\t\t\t}\n\t\t}\n\n\t\t// Also empty the page cache so there are no links to deleted files\n\t\t$this->purgePageCache();\n\n\t\t// Add a log entry\n\t\t$this->log('Regenerated the XML files', __METHOD__, TL_CRON);\n\t}" ]
[ "0.57650524", "0.57103163", "0.5626483", "0.54553306", "0.54436076", "0.54125714", "0.537808", "0.51884687", "0.5078346", "0.4995721", "0.49652877", "0.4942878", "0.4926776", "0.49262822", "0.49251845", "0.49192584", "0.48871225", "0.48844695", "0.48754483", "0.48654085", "0.48601255", "0.4859887", "0.48507017", "0.48434433", "0.48397323", "0.48352036", "0.4832461", "0.4830024", "0.48160043", "0.48095852" ]
0.7055536
0
Clones the textblocks of survey questions
function cloneTextblocks($mapping) { foreach ($mapping as $original_id => $new_id) { $textblock = $this->getTextblock($original_id); include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php"; $this->saveHeading(ilUtil::stripSlashes($textblock, TRUE, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("survey")), $new_id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeCloneQuestion ($id, $cloneTargetID, $questions, $label, $message, $branchExit) {\n\tglobal $varchars;\n\techo '<script>\n\t\t\tjQuery(function($) {\n\t\t\t\t$(\"#'.$cloneTargetID.'\").cloneya();\n\t\t\t});\n\t\t\t</script>';\n\tif (!empty($branchExit)) {\n\t\techo '<div class=\"step\" data-state=\"'.$branchExit.'\">';\n\t}\n\telse {\n\t\techo '<div class=\"step\" id=\"'.$id.'\">';\n\t}\n\techo '<div class=\"section\">\n\t\t\t<div class=\"card-header m-b-0\">\n\t\t\t<label for=\"'.$id.'\">'.$label.'</label>\n\t\t\t\t<p>'.$message.'</p>\n\t\t\t\t<hr class=\"card-line\" align=\"left\">\n\t\t\t</div>\n\t\t\t<div class=\"card-body m-b-30\" id=\"'.$cloneTargetID.'\">';\n\t\t\techo '<div class=\"row\">';\n\t\t\t//put the labels in their own row, requires a loop through because it needs to both: go outside the clone block and involve the qestion specific classes\n\t\t\tforeach ($questions as $question) {\n\t\t\t\techo '<div class=\"'.$question['class'].'\">\n\t\t\t\t\t\t<p><small>'.$question['placeholder'].'</small></p>\n\t\t\t\t\t</div>';\n\t\t\t\t//if there was a previously entered data set for the clone question, try to parse it into a usable format to recreate the number of rows created with the clone input\n\t\t\t\tif (isset($varchars[$question['name']])) {\n\t\t\t\t\t$cloneExp = explode(',', $varchars[$question['name']]);\n\t\t\t\t\t$i=0;\n\t\t\t\t\tforeach ($cloneExp as $v) {\n\t\t\t\t\t\t$cloneRow[$i][$question['name']] = $v;\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//if the result of this was nothing because there was no data stored previously, just set up an empty array to actually kick the next foreach\n\t\t\t\tif (empty($cloneRow)) {\n\t\t\t\t\t$cloneRow[0] = array('' => '');\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '</div>';\n\t\t\tforeach ($cloneRow as $row) {\n\t\t\t\techo '<div class=\"toclone clone-block\">\n \t\t\t\t<div class=\"form-row\">';\n\t\t\tforeach ($questions as $question) {\n\t\t\t\techo '<div class=\"form-group '.$question['class'].'\">';\n\t\t\t\t\tif (isset($question['fieldLabel']) && isset($question['icon'])) {\n\t\t\t\t\t\techo '<div class=\"input-group mb-3\">';\n\t\t\t\t\t\tif ($question['fieldLabel'] == 'input-group-prepend') {\n\t\t\t\t\t\t\techo '<div class=\"'.$question['fieldLabel'].'\">\n\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\"><i class=\"'.$question['icon'].'\"></i></span>\n\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t}\t \t\n\t\t\t\t\t}\n \t\t\t\t\t//holy shit this might be a dumpster - sorry future pete and ben\n\t\t\t\t\t\t//first go through the row for each individual stored value, to be used later \n \t\t\t\t\tforeach ($row as $rkey => $rvalue) {\n \t\t\t\t\t\t//start with any questions that are select inputs, they needs special handling to select the appropriate value. also match that the question name is the appropriate loop of the row\n \t\t\t\t\t\tif ($question['type'] == 'select' && $rkey == $question['name']) {\n\t\t\t\t\t\t\t\techo '<select name=\"'.$question['name'].'[]\" id=\"'.$question['id'].'\" class=\"form-control\">';\n\t\t\t\t\t\t\t\t//loop through the available options provided in the question function\n\t\t\t\t\t\t\t\tforeach ($question['options'] as $key => $option) {\n\t\t\t\t\t\t\t\t\t//if we find a match between the option and the stored value, write selected to the HTML option\n\t\t\t\t\t\t\t\t\tif ($option == $rvalue) {\n\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$option.'\" selected>'.ucwords(str_replace('_', ' ', $option)).'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\techo '<option value=\"'.$option.'\">'.ucwords(str_replace('_', ' ', $option)).'</option>';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\techo '</select>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//if this is a normal input, match on the question name and write the input with values\n \t\t\t\t\t\telse if ($rkey == $question['name']) {\n\t \t\t\t\t\t\tif (isset($rkey) && !empty($rvalue)) {\n\t \t\t\t\t\t\t\techo '<input type=\"'.$question['type'].'\" name=\"'.$question['name'].'[]\" id=\"'.$question['id'].'\" class=\"form-control\" value=\"'.$rvalue.'\">';\n\t\t \t\t\t\t\t}\n\t\t \t\t\t\t\t//if the stored values exist, but at empty, dont write values\n\t\t \t\t\t\t\telse {\n\t\t \t\t\t\t\t\techo '<input type=\"'.$question['type'].'\" name=\"'.$question['name'].'[]\" id=\"'.$question['id'].'\" class=\"form-control\">';\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\tif (isset($question['fieldLabel']) && isset($question['icon'])) {\n\t\t\t\t\t\tif ($question['fieldLabel'] == 'input-group-append') {\n\t\t\t\t\t\t\techo '<div class=\"'.$question['fieldLabel'].'\">\n\t\t\t\t\t\t\t\t\t<span class=\"input-group-text\"><i class=\"'.$question['icon'].'\"></i></span>\n\t\t\t\t\t\t\t\t</div>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo '</div>';//end input group\n\t\t\t\t\t}\n \t\t\t\techo '</div>';//end form group\n\t\t\t}\n\t\t\t\t\n\t\t\t\techo '</div>\n\t\t \t<a href=\"#\" class=\"clone btn btn-success\"><i class=\"fa fa-plus\"></i></a>\n\t \t\t\t<a href=\"#\" class=\"delete btn btn-success\"><i class=\"fa fa-minus\"></i></a>\n\t \t</div>';//end clone-block\n\t }//end number of rows loop\n\t echo '</div>\n </div>\n </div>';\n}", "public function postClone() {\n\t\t// Clone common parent objects.\n\t\tparent::postClone();\n\n\t\t$tempQuestions = new ArrayCollection();\n\t\tforeach ($this->questions as $question) {\n\t\t\t$newQuestion = clone $question;\n\t\t\t$newQuestion->postClone();\n\t\t\t$newQuestion->setExercise($this);\n\t\t\t$tempQuestions->add($newQuestion);\n\t\t}\n\t\t$this->questions = $tempQuestions;\n\t}", "public function run()\n {\n DB::table('survey_questions')->insert([\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de patiënt:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Leeftijd:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'textarea',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Onderliggend lijden welk invloed kan hebben op de wondgenezing: (indien niet aanwezig gelieve n.v.t te vermelden).',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Informatie over de wond',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['Nieuwe wond', 'Bestaande wond']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Sinds wanneer?',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 6,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => null,\n 'required' => true,\n 'options' => json_encode(['dag(en)', 'week/weken']),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Welke verband is het meest recentelijk op deze wond aangebracht?',\n 'required' => true,\n 'options' => json_encode([\n ['Fiberverbanden met hoog absorptievermogen of alginaten, gelieve de naam van het product te vermelden:'],\n ['Schuimverband, gelieve de naam van het product te vermelden:'],\n ['Zilververband, gelieve de naam van het product te vermelden:'],\n ['Superabsorberend, gelieve de naam van het product te vermelden:'],\n ['Hydrocolloïde, gelieve de naam van het product te vermelden:'],\n ['Ander(e) type(n), gelieve de naam van het product te vermelden:'],\n 'Geen',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Acute wond',\n 'Chronische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Geïnfecteerd?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere acute wond, namelijk:',\n 'text' => '(Indien acute wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Traumatische wond (oppervlakkige schaafwond, laceratie, flyctenen, oppervlakkige snijwonden en huidscheuren)',\n 'Tweedegraads brandwond',\n 'Dermabrasie / Ontvelling',\n 'Chirurgische wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Andere chronische wond, namelijk',\n 'text' => '(Indien chronische wond aangevinkt) het gaat in het bijzonder om een …',\n 'required' => true,\n 'options' => json_encode([\n 'Decubitus wond',\n 'Ulcus Cruris beenwond',\n 'Diabetische voetwond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Wat is de hoeveelheid wondvocht?',\n 'required' => true,\n 'options' => json_encode([\n 'Droog',\n 'Vochtig',\n 'Nat',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Locatie van het wondbed',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Necrotisch (zwart)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Granulerend (rood)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => '% Beslag (geel)',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => 14,\n 'survey_id' => 1,\n 'type' => 'text',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Anders, namelijk',\n 'required' => false,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Toestand van de huid rondom de wond:',\n 'required' => true,\n 'options' => json_encode([\n 'Gezond',\n 'Geïrriteerd/rood',\n 'Droog/eczematisch',\n 'Gemacereerd',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'heading',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'D0 – 1e toepassing van AQUACEL Foam of Foam Lite™ ConvaTec:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'date',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Datum (D0):',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Type verband:',\n 'required' => true,\n 'options' => json_encode([\n 'AQUACEL Foam',\n 'AQUACEL Ag Foam',\n 'Foam Lite ConvaTec',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'label',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Afmeting verbandkeuze:',\n 'required' => true,\n 'options' => null,\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – plakkend',\n 'required' => true,\n 'options' => json_encode([\n '8 x 8 cm',\n '10 x 10 cm',\n '12,5 x 12,5 cm',\n '17,5 x 17,5 cm',\n '21 x 21 cm',\n '25 x 30 cm',\n '8 x 13 cm',\n '10 x 20 cm',\n '10 x 25 cm',\n '10 x 30 cm',\n '19,8 x 14 cm',\n '20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam - zonder kleefrand',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '10 x 10 cm',\n '15 x 15 cm',\n '10 x 20 cm',\n '15 x 20 cm',\n '20 x 20 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'AQUACEL Foam – anatomische vormen',\n 'required' => true,\n 'options' => json_encode([\n 'Allround 19,8 x 14 cm',\n 'Sacrum 20 x 16,9 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Foam Lite™ ConvaTec',\n 'required' => true,\n 'options' => json_encode([\n '5 x 5 cm',\n '8 x 8 cm',\n '10 x 10 cm',\n '10 x 20 cm',\n '15 x 15 cm',\n '5,5 x 12 cm',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => 'Secundair verband, gelieve het primaire verband te vermelden:',\n 'text' => 'Op welke wijze gebruikt u het gekozen verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Primair verband',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Waarom heeft u voor dit specifieke verband gekozen? (Meerdere antwoorden zijn mogelijk)',\n 'required' => true,\n 'options' => json_encode([\n 'Vormbaar, zacht, comfortabel voor de patiënt',\n 'Vochtig wondmilieu met Hydrofiber',\n 'Bescherming van de wondranden (verticale absorptie)',\n 'Vasthouden van wondvocht en bacteriën (retentie)',\n 'Verbetering/ verkleining van de wond',\n 'Minder verbandwissels en/of draagtijd verlengd',\n 'Eenvoudig te gebruiken',\n 'Goede kennis van en ervaringen met schuimverbanden',\n 'Goede kennis van en ervaringen met Hydrofiber-verbanden',\n 'Type wond en hoeveelheid wondvocht',\n 'Fase van de wond',\n 'Locatie van de wond',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'checkbox',\n 'other' => true,\n 'other_label' => null,\n 'text' => 'Hoe ervaart u het aanbrengen van het verband?',\n 'required' => true,\n 'options' => json_encode([\n 'Gemakkelijk',\n ['Redelijk gemakkelijk (omschrijf)'],\n ['Niet gemakkelijk (omschrijf)'],\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Kleeft het verband bij het aanbrengen aan de handschoenen of aan zichzelf?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n [\n 'parent_id' => null,\n 'survey_id' => 1,\n 'type' => 'radio',\n 'other' => false,\n 'other_label' => null,\n 'text' => 'Zo ja, is het herpositioneerbaar?',\n 'required' => true,\n 'options' => json_encode([\n 'Ja',\n 'Nee',\n ]),\n 'created_at' => new \\Carbon\\Carbon(),\n 'updated_at' => new \\Carbon\\Carbon(),\n ],\n ]);\n }", "function readquestion($lines) {\n \t// converts it into a question object suitable for processing and insertion.\n\n $question = $this->defaultquestion();\n $comment = NULL;\n \n // define replaced by simple assignment, stop redefine notices\n $gift_answerweight_regex = \"^%\\-*([0-9]{1,2})\\.?([0-9]*)%\"; \n\n // REMOVED COMMENTED LINES and IMPLODE\n foreach ($lines as $key => $line) {\n $line = trim($line);\n if (substr($line, 0, 2) == \"//\") {\n $lines[$key] = \" \";\n }\n }\n\n $text = trim(implode(\" \", $lines));\n\n if ($text == \"\") {\n return false;\n }\n\n // Substitute escaped control characters with placeholders\n $text = $this->escapedchar_pre($text);\n\n // Look for category modifier ---------------------------------------------------------\n if (ereg( '^\\$CATEGORY:', $text)) {\n // $newcategory = $matches[1];\n $newcategory = trim(substr( $text, 10 ));\n $newcategory = trim(substr( $newcategory, 0, strpos($newcategory, \"::\")));\n\t\t\t\n $question->setCategoryFromName($newcategory);\n $text = trim(substr($text, 10+strlen($newcategory)));\n \n // build fake question to contain category\n \n \t// XXX: create a category !\n //return true;\n }\n \n // QUESTION NAME parser --------------------------------------------------------------\n if (substr($text, 0, 2) == \"::\") {\n $text = substr($text, 2);\n\n $namefinish = strpos($text, \"::\");\n if ($namefinish === false) {\n $question->prompt = false;\n // name will be assigned after processing question text below\n } else {\n $questionname = substr($text, 0, $namefinish);\n $question->prompt = addslashes(trim($this->escapedchar_post($questionname)));\n $text = trim(substr($text, $namefinish+2)); // Remove name from text\n }\n } else {\n $question->prompt = false;\n }\n\n\n // FIND ANSWER section -----------------------------------------------------------------\n // no answer means its a description\n $answerstart = strpos($text, \"{\");\n $answerfinish = strpos($text, \"}\");\n\n $description = false;\n if (($answerstart === false) and ($answerfinish === false)) {\n $description = true;\n $answertext = '';\n $answerlength = 0;\n }\n elseif (!(($answerstart !== false) and ($answerfinish !== false))) {\n //$this->error( get_string( 'braceerror', 'quiz' ), $text );\n return false;\n }\n else {\n $answerlength = $answerfinish - $answerstart;\n $answertext = trim(substr($text, $answerstart + 1, $answerlength - 1));\n }\n\n \n\t\t// Format QUESTION TEXT without answer, inserting \"_____\" as necessary\n if ($description) {\n $text = $text;\n }\n elseif (substr($text, -1) == \"}\") {\n // no blank line if answers follow question, outside of closing punctuation\n $text = substr_replace($text, \"\", $answerstart, $answerlength+1);\n } else {\n // inserts blank line for missing word format\n $text = substr_replace($text, \"_____\", $answerstart, $answerlength+1);\n }\n\n // get text format from text\n $oldtext = $text;\n $textformat = 0;\n if (substr($text,0,1)=='[') {\n $text = substr( $text,1 );\n $rh_brace = strpos( $text, ']' );\n $qtformat= substr( $text, 0, $rh_brace );\n $text = substr( $text, $rh_brace+1 );\n \n }\n // i must find out for what this param is used\n $question->textformat = $textformat;\n \t\t\n \t\t// question text \n $question->quest_text = addslashes(trim($this->escapedchar_post($text)));\n\n // set question name if not already set\n\t\tif ($question->prompt === false) {\n\t\t\t$question->prompt = $question->quest_text;\n\t\t}\n\n // ensure name is not longer than 250 characters\n $question->prompt = $question->prompt ;\n $question->prompt = strip_tags(substr( $question->prompt, 0, 250 ));\n\n // determine QUESTION TYPE -------------------------------------------------------------\n $question->qtype = NULL;\n\n // give plugins first try\n // plugins must promise not to intercept standard qtypes\n // MDL-12346, this could be called from lesson mod which has its own base class =(\n /*\n if (method_exists($this, 'try_importing_using_qtypes') && ($try_question = $this->try_importing_using_qtypes( $lines, $question, $answertext ))) {\n return $try_question;\n }\n\t\t*/\n if ($description) {\n $question->qtype = 'title';\n }\n elseif ($answertext == '') {\n $question->qtype = 'extended_text';\n }\n elseif ($answertext{0} == \"#\"){\n $question->qtype = 'numerical';\n\n\t\t} elseif (strpos($answertext, \"~\") !== false) {\n\t\t\t\n\t\t\t// only Multiplechoice questions contain tilde ~\n\t\t\tif (strpos($answertext,\"=\") === false) {\n\t\t\t\t\n\t\t\t\t// multiple answers are enabled if no single answer is 100% correct\n\t\t\t\t$question->qtype = 'choice_multiple'; \n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// only one answer allowed (the default)\n\t\t\t\t$question->qtype = 'choice';\n\t\t\t}\n }", "function createQuestionblock($title, $show_questiontext, $show_blocktitle, $questions)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// if the selected questions are not in a continous selection, move all questions of the\n\t\t// questionblock at the position of the first selected question\n\t\t$this->moveQuestions($questions, $questions[0], 0);\n\t\t\n\t\t// now save the question block\n\t\tglobal $ilUser;\n\t\t$next_id = $ilDB->nextId('svy_qblk');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk (questionblock_id, title, show_questiontext,\".\n\t\t\t\" show_blocktitle, owner_fi, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text','text','text','integer','integer'),\n\t\t\tarray($next_id, $title, $show_questiontext, $show_blocktitle, $ilUser->getId(), time())\n\t\t);\n\t\tif ($affectedRows)\n\t\t{\n\t\t\t$questionblock_id = $next_id;\n\t\t\tforeach ($questions as $index)\n\t\t\t{\n\t\t\t\t$next_id = $ilDB->nextId('svy_qblk_qst');\n\t\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_qblk_qst (qblk_qst_id, survey_fi, questionblock_fi, \" .\n\t\t\t\t\t\"question_fi) VALUES (%s, %s, %s, %s)\",\n\t\t\t\t\tarray('integer','integer','integer','integer'),\n\t\t\t\t\tarray($next_id, $this->getSurveyId(), $questionblock_id, $index)\n\t\t\t\t);\n\t\t\t\t$this->deleteConstraints($index);\n\t\t\t}\n\t\t}\n\t}", "function resetAnswers() {\n\t\tunset($this->_answers);\n\t\t$this->_answers = array();\n\t}", "public function createSurveyContent($surveyTitle, TableNode $cTable) {\n foreach ($cTable->getHash() as $cHash) {\n $cObj = (object) $cHash;\n\n // get survey\n $survey = $this->groupContext->loadGroupByLabelAndType($surveyTitle, 'mailing_list');\n\n $node = (object) array(\n 'type' => 'content',\n 'body' => $cObj->body,\n 'uid' => $survey->getOwnerId(),\n 'field_answer_format' => $cObj->answer_format\n );\n\n $node_obj = node_load($this->nodeCreate($node)->nid);\n\n // add content to survey\n $survey->addContent($node_obj, 'group_node:' . $node_obj->bundle());\n }\n }", "public static function clear(){\n self::$answers = [];\n }", "public function initAddQuestionAndAnswersForm () {\n global $tpl, $ilCtrl;\n\n $my_tpl = new ilTemplate(\"tpl.question_and_answers.html\", true, true,\n \"Customizing/global/plugins/Services/Repository/RepositoryObject/MobileQuiz\");\n $rtokenFactory = new ilCtrl();\n $my_tpl->setVariable(\"ACTION_URL\",$this->ctrl->getFormAction($this));\n $my_tpl->setVariable(\"SUBMIT_BUTTON\", $this->txt(\"save\"));\n $my_tpl->setVariable(\"NEW_QUESTION\", $this->txt(\"question_add_head\"));\n $my_tpl->setVariable(\"QUESTION\", $this->txt(\"question_add_text\"));\n $my_tpl->setVariable(\"QUESTION_TYPE\", $this->txt(\"question_add_type\"));\n $my_tpl->setVariable(\"CHOICES\", $this->txt(\"choice_add_texts\"));\n $my_tpl->setVariable(\"VAR_1\", \"value1\");\n $my_tpl->setVariable(\"COMMAND\", \"cmd[createQuestionAndAnswers]\");\n $my_tpl->setVariable(\"MINIMUM\", $this->txt(\"choice_add_numeric_minimum\"));\n $my_tpl->setVariable(\"MAXIMUM\", $this->txt(\"choice_add_numeric_maximum\"));\n $my_tpl->setVariable(\"STEP\", $this->txt(\"choice_add_numeric_steprange\"));\n $my_tpl->setVariable(\"CORRECT_VALUE\", $this->txt(\"choice_add_numeric_correctvalue\"));\n $my_tpl->setVariable(\"TOLERANCE_RANGE\", $this->txt(\"choice_add_numeric_tolerenace_range\"));\n $my_tpl->setVariable(\"SELECTED_SINGLE\", 'selected=\"selected\"');\n\n $my_tpl->setVariable(\"HIDE_NUMERIC_BLOCK\", 'style=\"display:none;\"');\n $my_tpl->setVariable(\"HIDE_SINGLE_CHOICE_BLOCK\", 'style=\"display:none;\"');\n\n $html = $my_tpl->get();\n $tpl->setContent($html);\n }", "function kilman_prep_for_questionform($kilman, $qid, $qtype) {\n $context = context_module::instance($kilman->cm->id);\n if ($qid != 0) {\n $question = clone($kilman->questions[$qid]);\n $question->qid = $question->id;\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n $qid, array('subdirs' => true), $question->content);\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n\n if (isset($question->dependencies)) {\n foreach ($question->dependencies as $dependencies) {\n if ($dependencies->dependandor === \"and\") {\n $question->dependquestions_and[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_and[] = $dependencies->dependlogic;\n } else if ($dependencies->dependandor === \"or\") {\n $question->dependquestions_or[] = $dependencies->dependquestionid.','.$dependencies->dependchoiceid;\n $question->dependlogic_or[] = $dependencies->dependlogic;\n }\n }\n }\n } else {\n $question = \\mod_kilman\\question\\base::question_builder($qtype);\n $question->sid = $kilman->survey->id;\n $question->id = $kilman->cm->id;\n $question->type_id = $qtype;\n $question->type = '';\n $draftideditor = file_get_submitted_draft_itemid('question');\n $content = file_prepare_draft_area($draftideditor, $context->id, 'mod_kilman', 'question',\n null, array('subdirs' => true), '');\n $question->content = array('text' => $content, 'format' => FORMAT_HTML, 'itemid' => $draftideditor);\n }\n return $question;\n}", "public function clearQuestionComments()\n\t{\n\t\t$this->collQuestionComments = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function initQuestionComments()\n\t{\n\t\t$this->collQuestionComments = array();\n\t}", "function fillQuestion($data)\r\n {\r\n\tfor( $i=0; $i<$data['count']; $i++ ){\r\n\t\t$data[$i]['Question'] = $this->findAll($conditions='id='.$data[$i]['SurveyQuestion']['question_id'], $fields=\"prompt, type\");\r\n\t\t$data[$i]['Question'] = $data[$i]['Question'][0]['Question'];\r\n\t\t$data[$i]['Question']['number'] = $data[$i]['SurveyQuestion']['number'];\r\n\t\t$data[$i]['Question']['id'] = $data[$i]['SurveyQuestion']['question_id'];\r\n\t\t$data[$i]['Question']['sq_id'] = $data[$i]['SurveyQuestion']['id'];\r\n\t\tunset($data[$i]['SurveyQuestion']);\r\n\t}\r\n\r\n\treturn $data;\r\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function testCreateSurveyQuestion0()\n {\n }", "public function cloneApplicationQuestions()\n {\n $questionListModel = $this->container->factory->model('QuestionLists', array('factoryClass' => 'FOF30\\\\Factory\\\\MagicFactory'));\n\n $questionListModel->cloneQuestionListToForeignModel($this->getQuestionListId(), '#__cajobboard_applications_questions', 'application_id');\n }", "public function make_ccode_question_copyStdin() {\n question_bank::load_question_definition_classes('ccode');\n $ccode = new qtype_ccode_question();\n test_question_maker::initialise_a_question($ccode);\n $ccode->name = 'Function to copy n lines of stdin to stdout';\n $ccode->questiontext = 'Write a function copyLines(n) that reads stdin to stdout';\n $ccode->generalfeedback = 'No feedback available for ccode questions.';\n $ccode->testcases = array(\n (object) array('testcode' => '',\n 'stdin' => '',\n 'output' => '',\n 'display' => 'SHOW',\n 'useasexample' => 0,\n 'hiderestiffail' => 0),\n (object) array('testcode' => '',\n 'stdin' => \"Line1\\n\",\n 'output' => \"Line1\\n\",\n 'display' => 'SHOW',\n 'useasexample' => 0,\n 'hiderestiffail' => 0),\n (object) array('testcode' => '',\n 'stdin' => \"Line1\\nLine2\\n\",\n 'output' => \"Line1\\nLine2\\n\",\n 'display' => 'SHOW',\n 'useasexample' => 0,\n 'hiderestiffail' => 0)\n );\n $ccode->qtype = question_bank::get_qtype('ccode');\n $ccode->unitgradingtype = 0;\n $ccode->unitpenalty = 0.2;\n return $ccode;\n }", "public function initAnswerComments()\n\t{\n\t\t$this->collAnswerComments = array();\n\t}", "function create_mcq($question_set, $question_text, $answer_list, $answer_key) {\n $question = array();\n $question['type'] = '1';\n $question['answer_list'] = $answer_list;\n $question['answer_key'] = $answer_key;\n $question_set['el_set'][] = $question;\n return $question_set;\n}", "public function view() {\n\t\t//Note that we don't call parent::view(), because built-in form block controller doesn't have one(!!)\n\t\t\n\t\t$miniSurvey = new MiniSurvey();\n\t\t$miniSurvey->frontEndMode = true;\n\n\t\t$bID = intval($this->bID);\n\t\t$qsID = intval($this->questionSetId);\n\t\t\n\t\t$formDomId = \"miniSurveyView{$bID}\";\n\t\t$hasFileUpload = false;\n\n\t\t$questionsRS = $miniSurvey->loadQuestions($qsID, $bID);\n\t\t$questions = array();\n\t\twhile ($questionRow = $questionsRS->fetchRow()) {\n\t\t\t$question = $questionRow;\n\t\t\t$question['input'] = $miniSurvey->loadInputType($questionRow, false);\n\t\t\tif ($questionRow['inputType'] == 'fileupload') {\n\t\t\t\t$hasFileUpload = true;\n\t\t\t}\n\t\n\t\t\t//Make type names common-sensical\n\t\t\tif ($questionRow['inputType'] == 'text') {\n\t\t\t\t$question['type'] = 'textarea';\n\t\t\t} else if ($questionRow['inputType'] == 'field') {\n\t\t\t\t$question['type'] = 'text';\n\t\t\t} else {\n\t\t\t\t$question['type'] = $questionRow['inputType'];\n\t\t\t}\n\t\n\t\t\t//Construct label \"for\" (and misc. hackery for checkboxlist / radio lists)\n\t\t\tif ($question['type'] == 'checkboxlist') {\n\t\t\t\t$question['input'] = str_replace('<div class=\"checkboxPair\">', '<div class=\"checkboxPair\"><label>', $question['input']);\n\t\t\t\t$question['input'] = str_replace(\"</div>\\n\", \"</label></div>\\n\", $question['input']); //include linebreak in find/replace string so we don't replace the very last closing </div> (the one that closes the \"checkboxList\" wrapper div that's around this whole question)\n\t\t\t} else if ($question['type'] == 'radios') {\n\t\t\t\t//Put labels around each radio items (super hacky string replacement -- this might break in future versions of C5)\n\t\t\t\t$question['input'] = str_replace('<div class=\"radioPair\">', '<div class=\"radioPair\"><label>', $question['input']);\n\t\t\t\t$question['input'] = str_replace('</div>', '</label></div>', $question['input']);\n\t\t\n\t\t\t\t//Make radioList wrapper consistent with checkboxList wrapper\n\t\t\t\t$question['input'] = \"<div class=\\\"radioList\\\">\\n{$question['input']}\\n</div>\\n\";\n\t\t\t} else {\n\t\t\t\t$question['labelFor'] = 'for=\"Question' . $questionRow['msqID'] . '\"';\n\t\t\t}\n\t\n\t\t\t//Remove hardcoded style on textareas\n\t\t\tif ($question['type'] == 'textarea') {\n\t\t\t\t$question['input'] = str_replace('style=\"width:95%\"', '', $question['input']);\n\t\t\t}\n\t\n\t\t\t//Add placeholder attributes\n\t\t\tif ($this->enablePlaceholders) {\n\t\t\t\t$search = 'id=\"Question';\n\t\t\t\t$replace = 'placeholder=\"' . $question['question'] . ($question['required'] ? ' *' : '') . '\" ' . $search;\n\t\t\t\t$question['input'] = str_replace($search, $replace, $question['input']);\n\t\t\t}\n\t\t\t\n\t\t\t//Hide some field labels if showing placeholders\n\t\t\t$question['labelClasses'] = '';\n\t\t\tif ($this->enablePlaceholders && in_array($question['type'], array('text', 'textarea', 'email', 'telephone', 'url'))) {\n\t\t\t\t$question['labelClasses'] .= ' visuallyhidden';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$questions[] = $question;\n\t\t}\n\n\t\t//Prep thank-you message\n\t\t$success = ($_GET['surveySuccess'] && $_GET['qsid'] == intval($qsID));\n\t\t$thanksMsg = $this->thankyouMsg;\n\n\t\t//Prep error message(s)\n\t\t$errorHeader = $formResponse;\n\t\t$errors = is_array($errors) ? $errors : array();\n\t\tif ($invalidIP) {\n\t\t\t$errors[] = $invalidIP;\n\t\t}\n\n\t\t//Prep captcha\n\t\t$surveyBlockInfo = $miniSurvey->getMiniSurveyBlockInfoByQuestionId($qsID, $bID);\n\t\t$captcha = $surveyBlockInfo['displayCaptcha'] ? Loader::helper('validation/captcha') : false;\n\t\t\n\t\t//Send data to the view\n\t\t$this->set('formDomId', $formDomId);\n\t\t$this->set('hasFileUpload', $hasFileUpload);\n\t\t$this->set('qsID', $qsID);\n\t\t$this->set('pURI', $pURI);\n\t\t$this->set('success', $success);\n\t\t$this->set('thanksMsg', $thanksMsg);\n\t\t$this->set('errorHeader', $errorHeader);\n\t\t$this->set('errors', $errors);\n\t\t$this->set('questions', $questions);\n\t\t$this->set('captcha', $captcha);\n\t\t$this->set('enablePlaceholders', $this->enablePlaceholders);\n\t}", "function answerQuestions() {\n $this->layout = 'survey'; // use the more basic survey layout\n if (!$this->request->is('post')) {\n // if there is no data then show the initial view\n $survey = $this->Session->read('Survey.original'); // get the survey being used\n if (empty($survey['Question'])) { // if there are no questions then we don't need to show the question form at all\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n $questions = $survey['Question'];\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // check to see if there are already answers in the session\n $choices = array(); // gather choices here keyed to each question id\n foreach ($questions as &$q) { // go through each question and look to see if there is an answer for it\n $checkId = $q['id'];\n $choices[$checkId] = array();\n if (isset($q['Choice'])) {\n foreach ($q['Choice'] as $choice) {\n $choices[$checkId][$choice['id']] = $choice['value'];\n }\n }\n foreach ($answers as $a) {\n if ($a['question_id'] == $checkId) {\n if ($q['type'] == MULTI_SELECT) {\n $q['answer'] = Set::extract('/id',$a['answer']);\n } else {\n $q['answer'] = $a['answer'];\n }\n break;\n }\n }\n }\n $this->set('questions', $questions); // send questions to the view\n $this->set('choices', $choices); // send choices for questions to the view, ordered for form elements\n } else { // we have form data so process it here\n if (isset($this->request->data['Answer'])) {\n // make sure we have answers in the data set\n $this->Session->write('Survey.answers', $this->request->data['Answer']); // write the answers to the session\n }\n $this->Session->write('Survey.progress', GDTA_ENTRY); // move progress forward and redirect to the runSurvey action\n $this->redirect(array('action' => 'runSurvey'));\n }\n }", "public function clearAnswerComments()\n\t{\n\t\t$this->collAnswerComments = null; // important to set this to NULL since that means it is uninitialized\n\t}", "private function extractQuestions(){\n $this->selectQuestions();\n $num=mysqli_num_rows($this->arrResultQuestions);\n for($i=0; $i<$num; $i++):\n $row=mysqli_fetch_object($this->arrResultQuestions);\n $misc=new misc();\n $fromWho=$misc->singleSelection('username', 'users', 'user_id', '=', $row->user_id);\n ?>\n <article class=\"homePageQuestions homePageArticle<?php echo $i; ?>\">\n <h3 class=\"homePageQuestionHeading\"><a href=\"?questionBody=<?php echo $row->post_id; ?>\"><?php echo $row->name; ?></a></h3>\n <span class=\"homePageQuestionAddFrom\"><span class=\"glyphicon glyphicon-user\"></span><a href=\"?user=<?php echo $row->user_id; ?>\"><?php echo $fromWho; ?></a></span>\n <span class=\"homePageQuestionAddTime\"><span class=\"glyphicon glyphicon-time\"></span><?php echo date('d.m.Y в H:i', $row->timeadded); ?></span>\n <span class=\"homePageQuestionAddTime\"><span class=\"glyphicon glyphicon-tag\"></span><?php echo $this->selectCategory($row->cat_id); ?></span>\n <span class=\"homePageQuestionVisits\"><?php echo $row->visits ?> Показвания</span>\n <?php\n $this->showingQuestionsFooter($row->lastanswered, $row->lastanswer, $row->post_id);\n ?>\n </article>\n <?php\n endfor;\n }", "public function questions($survey = \"\")\n {\n\n $surveyPrefix = \"\";\n $surveyData = $this->survey_model->getSurveyPrefix($survey);\n $data[\"valid_survey\"] = true;\n $data[\"show_questions\"] = true;\n $data[\"survey_errors\"] = false;\n\n // check if the provided slug was valid\n if($surveyData != null) {\n\n // populate survery information\n $surveyPrefix = $surveyData->prefix;\n $data[\"survey_title\"] = $surveyData->title;\n $data[\"survey_subtitle\"] = $surveyData->subtitle;\n }\n else {\n $data[\"valid_survey\"] = false; // display error\n }\n\n // check if the survey was submitted\n if($_SERVER['REQUEST_METHOD'] == 'POST' && $data[\"valid_survey\"]) {\n $result = $this->survey_model->validateSubmission($surveyPrefix);\n if(array_key_exists(\"errors\", $result)) {\n $data[\"errors\"] = $result[\"errors\"];\n $data[\"survey_errors\"] = true;\n }\n else {\n $data[\"show_questions\"] = false;\n }\n }\n\n // check if the user specified a valid survey\n if(!empty($surveyPrefix)) {\n\n $data[\"questions\"] = $this->survey_model->getSurveyData($surveyPrefix);\n ($data[\"questions\"] === null) ? $data[\"valid_survey\"] = false: \"\";\n }\n\n $data[\"active_surveys\"] = \"\";\n $this->load->view('templates/survey/header', $data);\n $this->load->view('templates/survey/nav');\n $this->load->view('templates/survey/survey', $data);\n $this->load->view('templates/survey/footer');\n }", "public function collectQuestions()\r\n {\r\n if ($this->questionLoadingFailed()) {\r\n die(\"Question is Not Loaded Error!\");\r\n }\r\n\r\n foreach ($this->questionInfo->items as $question) {\r\n\r\n $questionInfo = $this->getSingleQuestionInfo($question);\r\n\r\n $this->fileContent[] = $this->formatOfQuestion($questionInfo);\r\n }\r\n\r\n return $this;\r\n }", "public function getCreateSurveyLinkedList()\n {\n return <<<CQL\nMATCH (s:Survey { id: 1 })\nMATCH (first:Question)\nWHERE NOT (first)<-[:QUESTION]-()\nMATCH (last:Question)\nWHERE NOT (last)-[:QUESTION]->()\nCREATE UNIQUE (last)-[:QUESTION]->(s)-[:QUESTION]->(first)\nCQL;\n }", "public function clearAnswers()\n\t{\n\t\t$this->collAnswers = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function run()\n {\n // Insertion dans la table CHOICES\n DB::table('questions')->insert([\n\n //QCM 1 : 15 questions : Niveau première\n [ \n 'content' => 'Isaac Newton était un savant anglais.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un homme politique américain.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un musicien de jazz.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Isaac Newton était un premier ministre israélien.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 3 premiers ministres.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 5 premiers ministres.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Pendant ses deux septennats, François Mitterrand a nommé 7 premiers ministres.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : L\\'appel du général de Gaulle à ne pas capituler.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : Le débarquement allié en Normandie.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le 6 juin 1944 s\\'est produit : L\\'armistice de la Seconde Guerre mondiale.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1968 par John Kennedy.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1969 par Neil Amstrong.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => '« C\\'est un petit pas pour l\\'homme, mais un bond de géant pour l\\' humanité ». Cette phrase célèbre a été prononcée en 1971 par Martin Luther King.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le président des États-Unis John Kennedy a été mêlé à l\\'affaire dite du Watergate.',\n 'answer' => 'no',\n 'qcm_id' => '1'\n ],\n [ \n 'content' => 'Le président des États-Unis Richard Nixon a été mêlé à l\\'affaire dite du Watergate.',\n 'answer' => 'yes',\n 'qcm_id' => '1'\n ],\n //QCM 2 : 12 questions : Niveau première\n [ \n 'content' => 'La première République française a été proclamée en 1792.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'La première République française a été proclamée en 1789.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'La première République française a été proclamée en 1794.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Louis XVI s\\'est fait arrêter à Versailles par les sans-culotte.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était élu par les députés et sénateurs.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était élu au suffrage universel.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Sous la Quatrième République, le chef de l\\'État était nommé par le Conseil d\\'État.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Louis XIII.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Louis XIV.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'L\\'Académie française a été créée sous Napoléon 1er.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n [\n 'content' => 'Christophe Colomb a découvert l\\'Amérique en 1492.',\n 'answer' => 'yes',\n 'qcm_id' => '2'\n ],\n [ \n 'content' => 'Christophe Colomb a découvert l\\'Amérique en 1515.',\n 'answer' => 'no',\n 'qcm_id' => '2'\n ],\n //QCM 3 : 15 questions : Niveau terminale\n [ \n 'content' => 'Le procès de Nuremberg a eu lieu en 1945.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le procès de Nuremberg a eu lieu en 1948.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'La révocation de l\\'Édit de Nantes a instauré le rattachement de la Vendée à la France.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'La révocation de l\\'Édit de Nantes a instauré l\\'interdiction du protestantisme.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le conflit des Malouines a opposé le Royaume-Uni au Chili.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Le conflit des Malouines a opposé le Royaume-Uni à l\\'Argentine.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Macédoine.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Egypte.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Alexandrie, la ville fondée par Alexandre le Grand se trouvait en Grèce.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Henri IV était issu de la famille des Bourbons.',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Henri IV était issu de la famille des Artois.',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"L\\'éveillé\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Grande âme\".',\n 'answer' => 'yes',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Indépendant\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n [ \n 'content' => 'Mohandas Gandhi, était surnommé Mahatma. Ce surnom signifie \"Sage dans ses paroles\".',\n 'answer' => 'no',\n 'qcm_id' => '3'\n ],\n //QCM 4 : 12 questions : Niveau terminale\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1791.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1789.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'Louis XVI a été arrêté à Varennes alors qu\\'il tentait de fuir la France en 1790.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Afrique.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Amérique du Sud.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'L\\'État du Suriname se trouve en Asie.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1515.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1615.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La bataille de Marignan s\\'est déroulé en 1415.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Noir et Blanc.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Marron.',\n 'answer' => 'no',\n 'qcm_id' => '4'\n ],\n [ \n 'content' => 'La couleur du cheval Blanc d\\'henri IV était : Blanc.',\n 'answer' => 'yes',\n 'qcm_id' => '4'\n ],\n \t]);\n }", "function testSimpleSurvey()\n\t{\n\t\t$this->loadAndCacheFixture();\n\t\t$this->switchUser(FORGE_ADMIN_USERNAME);\n\t\t$this->gotoProject('ProjectA');\n\n\t\t$this->clickAndWait(\"link=Surveys\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\n\t\t// Create some questions\n\t\t$this->clickAndWait(\"link=Add Question\");\n\t\t$this->type(\"question\", \"This is my first question (radio) ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is my second question (text area) ?\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Text Area\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is my third question (yes/no) ?\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Radio Buttons Yes/No\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is a comment line of text\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Comment Only\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"This is a my fifth question (text field) ?\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Text Field\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->select($this->byName(\"question_type\"))->selectOptionByLabel(\"Text Field\");\n\t\t$this->clickAndWait(\"submit\");\n\n\t\t// Create survey\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->type(\"survey_title\", \"My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->clickAndWait(\"to_add[]\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='4']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='2']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='5']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='3']\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->waitForPageToLoad();\n\t\t$this->assertTextPresent(\"This is a my fifth question (text field) ?\");\n\t\t$this->assertTextPresent(\"This is a comment line of text\");\n\t\t$this->assertTextPresent(\"This is my third question (yes/no) ?\");\n\t\t$this->assertTextPresent(\"This is my second question (text area) ?\");\n\t\t$this->clickAndWait(\"//input[@name='_1' and @value='3']\");\n\t\t$this->type(\"_2\", \"hello\");\n\t\t$this->clickAndWait(\"_3\");\n\t\t$this->clickAndWait(\"_5\");\n\t\t$this->type(\"_5\", \"text\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\t\t$this->clickAndWait(\"link=Show Results\");\n\t\t$this->clickAndWait(\"link=My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\t\t$this->waitForPageToLoad();\n\t\t$this->assertTextPresent(\"Warning - you are about to vote a second time on this survey.\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\t\t$this->clickAndWait(\"link=Show Results\");\n\t\t$this->clickAndWait(\"link=Result\");\n\t\t$this->assertTextPresent(\"YES (1)\");\n\t\t$this->assertTextPresent(\"3 (1)\");\n\t\t$this->assertTextPresent(\"1, 2, 3, 4, 5\");\n\t\t// Check that the number of votes is 1\n\t\t$this->assertEquals(\"1\", $this->getText(\"//main[@id='maindiv']/table/tbody/tr/td[5]\"));\n\n\t\t// Now testing by adding new questions to the survey.\n\t\t$this->clickAndWait(\"link=Surveys\");\n\t\t$this->clickAndWait(\"link=Administration\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->clickAndWait(\"link=Add Question\");\n\t\t$this->type(\"question\", \"Another added question ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->clickAndWait(\"link=Edit\");\n\t\t$this->clickAndWait(\"to_add[]\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->type(\"survey_title\", \"Q10 ?\");\n\t\t$this->clickAndWait(\"link=Add Question\");\n\t\t$this->type(\"question\", \"Q8 ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"Q9 ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->type(\"question\", \"Q10 ?\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->clickAndWait(\"link=Add Survey\");\n\t\t$this->clickAndWait(\"link=Edit\");\n\t\t$this->clickAndWait(\"to_add[]\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='8']\");\n\t\t$this->clickAndWait(\"//input[@name='to_add[]' and @value='9']\");\n\t\t$this->clickAndWait(\"submit\");\n\t\t$this->assertTextPresent(\"1, 2, 3, 4, 5, 6, 7, 8, 9\");\n\n\t\t// Check that survey is public.\n\t\t$this->logout();\n\t\t$this->gotoProject('ProjectA');\n\t\t$this->clickAndWait(\"link=Surveys\");\n\t\t$this->assertTextPresent(\"My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\");\n\n//\t\t// Set survey to private\n//\t\t$this->login(FORGE_ADMIN_USERNAME);\n//\n//\t\t$this->open(\"/survey/?group_id=6\");\n//\t\t$this->clickAndWait(\"link=Surveys\");\n//\t\t$this->clickAndWait(\"link=Administration\");\n//\t\t$this->clickAndWait(\"link=Add Survey\");\n//\t\t$this->clickAndWait(\"link=Edit\");\n//\t\t$this->clickAndWait(\"//input[@name='is_public' and @value='0']\");\n//\t\t$this->clickAndWait(\"submit\");\n//\t\t// Log out and check no survey is visible\n//\t\t$this->clickAndWait(\"link=Log Out\");\n//\t\t$this->select($this->byName(\"none\"))->selectOptionByLabel(\"projecta\");\n//\t\t$this->waitForPageToLoad();\n//\t\t$this->clickAndWait(\"link=Surveys\");\n//\t\t$this->assertTextPresent(\"No Survey is found\");\n//\n//\t\t// Check direct access to a survey.\n//\t\t$this->open(\"/survey/survey.php?group_id=6&survey_id=1\");\n//\t\t$this->waitForPageToLoad();\n//\t\t$this->assertFalse($this->isTextPresent(\"My first survey: L'année dernière à Noël, 3 < 4, 中国 \\\" <em>, père & fils\"));\n\t}", "function copyQn( $row )\n\t\t{\n\t\t\tif ( (!isset($row) ) || (!$row['title']) ) \n\t\t\t{\n\t\t\t\treturn 0;\t\n\t\t\t}\n\t\t\t\n\t\t\t$d = date(\"Y/m/d\");\n\t\t\t\n\t\t\t$data = array();\n\t\t\t$data['title'] \t\t\t\t= ucfirst($row['title']);\n\t\t\t$data['per_page'] \t\t\t= $row['per_page'];\t\n\t\t\t$data['min_desc'] \t\t\t= $row['ShortDescription'];\n\t\t\t$data['date'] \t\t\t\t= $d;\n\t\t\t\n\t\t\t$this->db->insert('questionnaires_info', $data );\n\t\t\t$qn_id = $this->db->insert_id();\n\t\t\t\n\t\t\t$old_qn_id\t \t\t\t\t= intval( $row['old_qn_id'] );\n\t\t\t\n\t\t\tif( $old_qn_id > 0)\n\t\t\t{\n\t\t\t\t$this->db->where('questionnaire_id', $old_qn_id );\n\t\t\t\t$this->db->order_by(\"ordering\", \"asc\");\n\t\t\t\t$questions_info = $this->db->get('questions_info')->result();\n\t\t\t\t\t\n\t\t\t\tif ( !empty($questions_info) )\n\t\t\t\t{\n\t\t\t\t\t$this->load->model('Options_model');\n\t\t\t\t\t\n\t\t\t\t\tforeach ($questions_info as $key => $value) \n\t\t\t\t\t{\n\t\t\t\t\t\t$data = array();\n\t\t\t\t\t\t$data['questionnaire_id'] \t= $qn_id;\n\t\t\t\t\t\t$data['question'] \t\t\t= $value->question;\n\t\t\t\t\t\t$data['ordering'] \t\t\t= $value->ordering;\n\t\t\t\t\t\t$data['date'] \t\t\t\t= $d;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->insert('questions_info', $data );\n\t\t\t\t\t\t$quest_id = $this->db->insert_id();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$old_question_id = $value->question_id;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif( $old_question_id > 0 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->db->where('question_id', $old_question_id );\n \t\t\t\t\t\t$options = $this->db->get('question_option_info')->result();\n\t\t\t\t\t\t\tif( $options )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($options as $key2 => $value2) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$row = array();\n\t\t\t\t\t\t\t\t\t$row['question_id'] = (int) $quest_id;\n\t\t\t\t\t\t\t\t\t$row['value'] \t\t= $value2->value;\n\t\t\t\t\t\t\t\t\t$row['text'] \t\t= $value2->text;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this->db->insert('question_option_info', $row);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->db->where('questionnaire_id', $old_qn_id );\n \t\t\t\t\t\t$common_options = $this->db->get('question_option_info')->result();\n\t\t\t\t\t\t\tif( $common_options )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tforeach ($common_options as $key3 => $value3) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$row = array();\n\t\t\t\t\t\t\t\t\t$row['questionnaire_id'] = (int) $qn_id;\n\t\t\t\t\t\t\t\t\t$row['value'] \t\t= $value3->value;\n\t\t\t\t\t\t\t\t\t$row['text'] \t\t= $value3->text;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this->db->insert('question_option_info', $row);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $qn_id;\n\t\t\t \n\t\t\t \n\t\t}" ]
[ "0.58859843", "0.5727313", "0.5520142", "0.54647833", "0.5432125", "0.5415831", "0.5394335", "0.5360847", "0.53435796", "0.52989334", "0.5247571", "0.5245139", "0.52388966", "0.5192101", "0.5192101", "0.5182964", "0.5168886", "0.5161776", "0.5149353", "0.51370937", "0.5131549", "0.5105579", "0.510317", "0.5068871", "0.5044538", "0.5043529", "0.5040081", "0.5030674", "0.5027118", "0.5024514" ]
0.6741744
0
creates data directory for export files (data_dir/svy_data/svy_/export, depending on data directory that is set in ILIAS setup/ini)
function createExportDirectory() { include_once "./Services/Utilities/classes/class.ilUtil.php"; $svy_data_dir = ilUtil::getDataDir()."/svy_data"; ilUtil::makeDir($svy_data_dir); if(!is_writable($svy_data_dir)) { $this->ilias->raiseError("Survey Data Directory (".$svy_data_dir .") not writeable.",$this->ilias->error_obj->FATAL); } // create learning module directory (data_dir/lm_data/lm_<id>) $svy_dir = $svy_data_dir."/svy_".$this->getId(); ilUtil::makeDir($svy_dir); if(!@is_dir($svy_dir)) { $this->ilias->raiseError("Creation of Survey Directory failed.",$this->ilias->error_obj->FATAL); } // create Export subdirectory (data_dir/lm_data/lm_<id>/Export) $export_dir = $svy_dir."/export"; ilUtil::makeDir($export_dir); if(!@is_dir($export_dir)) { $this->ilias->raiseError("Creation of Export Directory failed.",$this->ilias->error_obj->FATAL); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\t\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create test directory (data_dir/svy_data/svy_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create import subdirectory (data_dir/svy_data/svy_<id>/import)\n\t\t$import_dir = $svy_dir.\"/import\";\n\t\tilUtil::makeDir($import_dir);\n\t\tif(!@is_dir($import_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Import Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}", "function createExportDirectory()\n\t{\n\t\tif (!@is_dir($this->getExportDirectory()))\n\t\t{\n\t\t\t$usrf_data_dir = ilUtil::getDataDir().\"/usrf_data\";\n\t\t\tilUtil::makeDir($usrf_data_dir);\n\t\t\tif(!is_writable($usrf_data_dir))\n\t\t\t{\n\t\t\t\t$this->ilias->raiseError(\"Userfolder data directory (\".$usrf_data_dir\n\t\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\t// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)\n\t\t\t$export_dir = $usrf_data_dir.\"/export\";\n\t\t\tilUtil::makeDir($export_dir);\n\t\t\tif(!@is_dir($export_dir))\n\t\t\t{\n\t\t\t\t$this->ilias->raiseError(\"Creation of Userfolder Export Directory failed.\",$this->ilias->error_obj->MESSAGE);\n\t\t\t}\n\t\t}\n\t}", "function getExportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$export_dir = ilUtil::getDataDir().\"/svy_data\".\"/svy_\".$this->getId().\"/export\";\n\n\t\treturn $export_dir;\n\t}", "function createDataPaths() {\n foreach ($this->data_paths as $path) {\n if (!file_exists($this->root . $path)) {\n mkdir($this->root . $path);\n }\n }\n }", "public function generateDataYmlDirectoryPath()\n {\n return self::DATA_CSV_PATH.$this->generateDataSubDirectoryPath();\n }", "function getExportDirectory()\n\t{\n\t\t$export_dir = ilUtil::getDataDir().\"/usrf_data/export\";\n\n\t\treturn $export_dir;\n\t}", "private function create_downloads_dir(){\r\n\t\t$wp_upload_dir = wp_upload_dir();\r\n\r\n\t\t$downloads_dir = $wp_upload_dir['basedir'].'/downloads';\r\n\t\t$archived_dir = $wp_upload_dir['basedir'].'/archived';\r\n\r\n\t\t$reports_dir = $downloads_dir.'/reports';\r\n\t\t$archived_reports_dir = $archived_dir.'/reports';\r\n\r\n\t\tif(!file_exists($downloads_dir)){ mkdir($downloads_dir, 0777); }\r\n\t\tif(!file_exists($archived_dir)){ mkdir($archived_dir, 0777); }\r\n\r\n\t\tif(!file_exists($reports_dir)){ mkdir($reports_dir, 0777); }\r\n\t\tif(!file_exists($archived_reports_dir)){ mkdir($archived_reports_dir, 0777); }\r\n\r\n\t\t$rslt['reports_dir'] = $reports_dir;\r\n\t\t$rslt['archived_reports_dir'] = $archived_reports_dir;\r\n\r\n\t\treturn $rslt;\r\n\t}", "public function generateDataCsvDirectoryPath()\n {\n return $this->generateDataYmlDirectoryPath().$this->config->getEntityName().'/';\n }", "public static function getDataFolder()\n {\n $class = get_called_class();\n $strip = explode('\\\\', $class);\n\n return RELEASE_NAME_DATA . '/' . strtolower(array_pop($strip)) . 's';\n }", "function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}", "public static function getDataDir()\n {\n return self::getDir('getDataHome');\n }", "protected function prepareArchiveDir(): void\n {\n $this->filesystem = new Filesystem();\n $this->archiveDir = FsUtils::tmpDir(self::ARCHIVES_DIR_NAME);\n }", "public function createExportFromScheduleData()\n {\n \t// create the export based on the schedule data\n //include_once( 'extension/ezstaticexport/classes/ezstaticexportexport.php' );\n \n // Total number of nodes to export\n $total = $this->attribute('total');\n \n \t$row = array( 'type' => $this->attribute( 'type' ),\n 'path_string' => $this->attribute( 'path_string' ),\n 'target' => $this->attribute( 'target' ),\n 'schedule_type' => 'scheduled',\n 'status' => eZStaticExport::STATUS_PENDING,\n 'total' => $total,\n \t\t\t\t 'static_resources' => $this->attribute('static_resources'));\n\n $this->export = new eZStaticExportExport( $row );\n $this->export->store();\n }", "abstract function exportData();", "private function writeAppData()\n {\n $fileName = \"{$this->storeDirectory}/appData.json\";\n $data = json_encode([\n 'default-counter' => $this->defaultCounter,\n ]);\n file_put_contents($fileName, $data, JSON_PRETTY_PRINT);\n }", "public function actionGenerateAndDownloadDatasetCreationFile() {\n $fileColumns[] = DatasetController::AGRONOMICAL_OBJECT_URI;\n $fileColumns[] = DatasetController::DATE;\n $variables = Yii::$app->request->post('variables');\n foreach ($variables as $variableAlias) {\n $fileColumns[] = $variableAlias;\n }\n\n $file = fopen('./documents/DatasetFiles/datasetTemplate.csv', 'w');\n fputcsv($file, $fileColumns, $delimiter = \";\"); \n fclose($file);\n }", "function mscaffolding_prepare_directories($name)\n\t{\n\t\tmkdir(\"data/scaffolding/\" . $name);\n\t\tmkdir(\"data/scaffolding/\" . $name . \"/views\");\n\t}", "public function getRelativeDataDir()\n\t{\n\t\treturn 'ash';\n\t}", "private function createFileDir()\n\t{\n\t\t$this->fileDir = IMAGES.'uploads'.DS.$this->model.DS.$this->modelId;\n\t\t$this->imgDir = 'uploads/'.$this->model.'/'.$this->modelId;\n\t}", "private function makeDirectory(): void\n {\n $this->directory = $this->simulation->fileAbsolutePath('correlations/' . $this->id);\n Utils::createDirectory($this->directory);\n }", "protected function assignSeedsDir()\n {\n $this->seeds_dir = '';\n }", "public function createExportFile()\n {\n $this->csvFile = self::tempFile('export.csv');\n $this->photoZip = self::tempFile('photos.zip');\n $this->exportFile = sys_get_temp_dir() . '/' . $this->datestamp . '-marcato.zip';\n\n $this->createCSV();\n $this->createPhotoZipfile();\n\n $zip = new ZipArchive();\n $result = $zip->open($this->exportFile, ZipArchive::CREATE | ZipArchive::OVERWRITE);\n if ($result !== true) {\n throw new RuntimeException(\"Failed to create zip archive result=[$result]\");\n }\n $zip->addFile($this->csvFile, $this->datestamp . '.csv');\n $zip->addFile($this->photoZip, $this->datestamp . '_ranger_photos.zip');\n $zip->close();\n }", "public function getDataDir()\n {\n return (string) $this->file->get(self::SETTING_DATA_DIR);\n }", "public static function getAbsoluteDataDir(){\r\n\t\treturn sfTeraWurflConfig::getDataDir();\r\n\t}", "public function createDirectories()\n {\n self::createDirectory($this->contentDirectoryPath);\n\n if ($this->staticPreviewIsEnabled())\n self::createDirectory($this->cacheDirectoryPath);\n }", "public function create($data) {\n\t\t// Create an ID\n\t\t$id = $this->idCreate();\n\t\t// Write the data file\n\t\tfile_put_contents( $this->init['path']['data'] . $id . $this->init['data']['ext'] );\n\t}", "protected function assignSeedsDir()\n {\n $this->seeds_dir = BLEND_TEST_SEEDS_DIR;\n }", "function export_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->export_data( $sync_tables );\n\t\t$this->db_tools->echo_export_data();\n\t}", "public function export() {\n $folder = $this->config->get('oxygen.mod-import-export.path');\n if(!file_exists($folder)) {\n mkdir($folder);\n }\n $path = $folder . $this->environment;\n if(!file_exists($path)) {\n mkdir($path);\n }\n\n $this->exportStrategy->create($path);\n\n foreach($this->workers as $worker) {\n $files = $worker->export($this->output);\n foreach($files as $localPath => $path) {\n $this->output->writeln('Adding file: ' . $path);\n $this->exportStrategy->addFile($path, $localPath);\n }\n }\n\n $this->exportStrategy->commit();\n\n foreach($this->workers as $worker) {\n $worker->postExport($this->output);\n }\n }", "function buildExportFile($a_mode = \"userfolder_export_excel_x86\", $user_data_filter = FALSE)\n\t{\n\t\tglobal $ilBench;\n\t\tglobal $log;\n\t\tglobal $ilDB;\n\t\tglobal $ilias;\n\t\tglobal $lng;\n\n\t\t//get Log File\n\t\t$expDir = $this->getExportDirectory();\n\t\t//$expLog = &$log;\n\t\t//$expLog->delete();\n\t\t//$expLog->setLogFormat(\"\");\n\t\t//$expLog->write(date(\"[y-m-d H:i:s] \").\"Start export of user data\");\n\n\t\t// create export directory if needed\n\t\t$this->createExportDirectory();\n\n\t\t//get data\n\t\t//$expLog->write(date(\"[y-m-d H:i:s] \").\"User data export: build an array of all user data entries\");\n\t\t$settings =& $this->getExportSettings();\n\t\t\n\t\t// user languages\n\t\t$query = \"SELECT * FROM usr_pref WHERE keyword = \".$ilDB->quote('language','text');\n\t\t$res = $ilDB->query($query);\n\t\t$languages = array();\n\t\twhile($row = $res->fetchRow(DB_FETCHMODE_ASSOC))\n\t\t{\n\t\t\t$languages[$row['usr_id']] = $row['value'];\n\t\t}\n\t\t\n\t\t\n\t\t$data = array();\n\t\t$query = \"SELECT usr_data.* FROM usr_data \".\n\t\t\t\" ORDER BY usr_data.lastname, usr_data.firstname\";\n\t\t$result = $ilDB->query($query);\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\tif(isset($languages[$row['usr_id']]))\n\t\t\t{\n\t\t\t\t$row['language'] = $languages[$row['usr_id']];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$row['language'] = $lng->getDefaultLanguage();\n\t\t\t}\n\t\t\t\n\t\t\tif (is_array($user_data_filter))\n\t\t\t{\n\t\t\t\tif (in_array($row[\"usr_id\"], $user_data_filter)) array_push($data, $row);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tarray_push($data, $row);\n\t\t\t}\n\t\t}\n\t\t//$expLog->write(date(\"[y-m-d H:i:s] \").\"User data export: build an array of all user data entries\");\n\n\t\t$fullname = $expDir.\"/\".$this->getExportFilename($a_mode);\n\t\tswitch ($a_mode)\n\t\t{\n\t\t\tcase \"userfolder_export_excel_x86\":\n\t\t\t\t$this->createExcelExport($settings, $data, $fullname, \"latin1\");\n\t\t\t\tbreak;\n\t\t\tcase \"userfolder_export_csv\":\n\t\t\t\t$this->createCSVExport($settings, $data, $fullname);\n\t\t\t\tbreak;\n\t\t\tcase \"userfolder_export_xml\":\n\t\t\t\t$this->createXMLExport($settings, $data, $fullname);\n\t\t\t\tbreak;\n\t\t}\n\t\t//$expLog->write(date(\"[y-m-d H:i:s] \").\"Finished export of user data\");\n\n\t\treturn $fullname;\n\t}" ]
[ "0.71820086", "0.68952996", "0.6354988", "0.6341787", "0.62416124", "0.59519356", "0.5683535", "0.5632927", "0.55159247", "0.5383979", "0.52955055", "0.52701", "0.5244568", "0.5193181", "0.5189658", "0.5170777", "0.51675797", "0.5120859", "0.50967395", "0.50492907", "0.5046702", "0.5040526", "0.5022452", "0.50174046", "0.49977437", "0.4994698", "0.49905217", "0.49894163", "0.49871197", "0.49212778" ]
0.76543677
0
get export directory of survey
function getExportDirectory() { include_once "./Services/Utilities/classes/class.ilUtil.php"; $export_dir = ilUtil::getDataDir()."/svy_data"."/svy_".$this->getId()."/export"; return $export_dir; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExportDirectory()\n\t{\n\t\t$export_dir = ilUtil::getDataDir().\"/usrf_data/export\";\n\n\t\treturn $export_dir;\n\t}", "function getExportDirectory() {\n\n $upload_dir = wp_upload_dir();\n\n $path = $upload_dir['basedir'] . '/form_entry_exports';\n\n // Create the backups directory if it doesn't exist\n if ( is_writable( dirname( $path ) ) && ! is_dir( $path ) )\n mkdir( $path, 0755 );\n\n // Secure the directory with a .htaccess file\n $htaccess = $path . '/.htaccess';\n\n $contents[]\t= '# ' . sprintf( 'This %s file ensures that other people cannot download your export files' , '.htaccess' );\n $contents[] = '';\n $contents[] = '<IfModule mod_rewrite.c>';\n $contents[] = 'RewriteEngine On';\n $contents[] = 'RewriteCond %{QUERY_STRING} !key=334}gtrte';\n $contents[] = 'RewriteRule (.*) - [F]';\n $contents[] = '</IfModule>';\n $contents[] = '';\n\n if ( ! file_exists( $htaccess ) && is_writable( $path ) && require_once( ABSPATH . '/wp-admin/includes/misc.php' ) )\n insert_with_markers( $htaccess, 'BackUpWordPress', $contents );\n\n return $path;\n }", "function getExportPath() {\n\t\t$exportPath = Config::getVar('files', 'files_dir') . '/' . $this->getPluginSettingsPrefix();\n\t\tif (!file_exists($exportPath)) {\n\t\t\t$fileManager = new FileManager();\n\t\t\t$fileManager->mkdir($exportPath);\n\t\t}\n\t\tif (!is_writable($exportPath)) {\n\t\t\t$errors = array(\n\t\t\t\tarray('plugins.importexport.common.export.error.outputFileNotWritable', $exportPath)\n\t\t\t);\n\t\t\treturn $errors;\n\t\t}\n\t\treturn realpath($exportPath) . '/';\n\t}", "function createExportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t\t\n\t\t// create learning module directory (data_dir/lm_data/lm_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t\t// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)\n\t\t$export_dir = $svy_dir.\"/export\";\n\t\tilUtil::makeDir($export_dir);\n\t\tif(!@is_dir($export_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Export Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}", "protected function generateUploadDir()\n\t{\n\t\treturn self::EXPORT_PATH;\n\t}", "function getDownloadDirectory()\n{\n $settings = getSettings();\n\n return $settings['downloadDirectory'] . '/';\n}", "private function get_reports_dir(Application $app) : string {\n\n\t\t//Generate path directory\n\t\treturn $this->config->item(\"data_directory\").\"reports/\".$app->id.\"/\";\n\n\t}", "public function getOutputDir()\n {\n $folder = str_replace('\\\\', '/', get_called_class());\n $folder = preg_replace('#^PrestaShop/PSTAF/#', '', $folder);\n\n $dir = FS::join('test-results', $folder);\n\n if (!is_dir($dir)) {\n mkdir($dir, 0777, true);\n }\n\n return $dir;\n }", "public function getDirectory()\n {\n return mfConfig::get('mf_sites_dir').\"/\".$this->getSiteName().\"/\".$this->getApplication().\"/view/pictures/\".$this->get('lang');\n }", "private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }", "public function getArtefactsDir()\n {\n $dir = $this->getOutputDir();\n\n if ($this->shortName) {\n $dir = FS::join($dir, $this->shortName);\n if (!is_dir($dir)) {\n mkdir($dir, 0777, true);\n }\n } \n\n return $dir;\n }", "public static function getProductImagesDownloadDirectory()\n\t{\n\n\t\t$downloadPath = SDZeCOM_Library_Helper_Directory::joinPaths(Mage::getBaseDir('media'), 'import');\n\n\t\tif (!file_exists($downloadPath))\n\t\t{\n\t\t\t@mkdir($downloadPath, 0777, true);\n\t\t}\n\n\t\treturn $downloadPath;\n\t}", "protected function outputPath()\n {\n $destination = $this->ask('Where do you want to save the file? (Press enter for the current directory)'); \n $output_path = !is_null($destination) ? $destination : generate_path($this->config('source'));\n \n if (!file_exists($output_path)) {\n mkdir($output_path, 0744, true);\n }\n\n return $output_path;\n }", "public function getFileBaseDir()\n {\n return Mage::getBaseDir('media').DS.'invitationstatus'.DS.'file';\n }", "public function generateDataYmlDirectoryPath()\n {\n return self::DATA_CSV_PATH.$this->generateDataSubDirectoryPath();\n }", "public function pathToStoreFile(){\n return $this->dirFile().DIRECTORY_SEPARATOR.$this->nameReportFile();\n }", "private function getSavePath()\n\t{\n\t\t$todoDir = $this->todoDir;\n\t\t$fileExtendedName = $this->addExtension();\n\t\treturn $todoDir . $fileExtendedName;\n\t}", "public function getDestinationPath()\n {\n return $this->fileSystem\n ->getDirectoryWrite(DirectoryList::MEDIA)\n ->getAbsolutePath('testimonials/');\n }", "public function getDirectorySpool();", "public function reportingDirectory(): string\n {\n return rtrim($this->config['reporting']['directory'], '/') . '/';\n }", "public function path()\n {\n return sprintf('reports/%s.%s', $this->reportname, $this->ext);\n }", "public function getDir() {\n return Yii::getAlias('@static').'/'.$this->module.'/'. $this->parent_id .'/';\n }", "public function getTemporaryFilesPathForExport() {}", "function rlip_get_export_filename($plugin, $tz = 99) {\n global $CFG;\n $tempexportdir = $CFG->dataroot . sprintf(RLIP_EXPORT_TEMPDIR, $plugin);\n $export = basename(get_config($plugin, 'export_file'));\n $timestamp = get_config($plugin, 'export_file_timestamp');\n if (!empty($timestamp)) {\n $timestamp = userdate(time(), get_string('export_file_timestamp',\n $plugin), $tz);\n if (($extpos = strrpos($export, '.')) !== false) {\n $export = substr($export, 0, $extpos) .\n \"_{$timestamp}\" . substr($export, $extpos);\n } else {\n $export .= \"_{$timestamp}.csv\";\n }\n }\n if (!file_exists($tempexportdir) && !@mkdir($tempexportdir, 0777, true)) {\n error_log(\"/blocks/rlip/lib.php::rlip_get_export_filename('{$plugin}', {$tz}) - Error creating directory: '{$tempexportdir}'\");\n }\n return $tempexportdir . $export;\n}", "protected function getUploadRootDir() {\n // guardar los archivos cargados\n return __DIR__ . '/../../../../web/uploads/portafolios/' . $this->getId();\n }", "static public function get_dir() {\n\t\treturn apply_filters( 'themeisle_site_import_uri', trailingslashit( get_template_directory_uri() ) . self::OBOARDING_PATH );\n\t}", "public function getOutputDir ()\n {\n return $this->output;\n }", "public function generateDataCsvDirectoryPath()\n {\n return $this->generateDataYmlDirectoryPath().$this->config->getEntityName().'/';\n }", "protected function destinationUploadDir()\n {\n return public_path(env('UPLOAD_DIR_GALLERY', 'media/images/galleries'));\n }", "static public function getDir(){\n return __DIR__ . '/Adapter/Format/';\n }" ]
[ "0.7563055", "0.7350768", "0.72417456", "0.68773174", "0.6723243", "0.65615475", "0.6561453", "0.6533583", "0.64836156", "0.6386059", "0.6334734", "0.62956005", "0.6295257", "0.6252005", "0.62282467", "0.6226128", "0.6210208", "0.61847746", "0.61835176", "0.616938", "0.61646074", "0.61636174", "0.61246943", "0.6122274", "0.610774", "0.61057055", "0.6094243", "0.6077146", "0.6073427", "0.60733396" ]
0.8160188
0
creates data directory for import files (data_dir/svy_data/svy_/import, depending on data directory that is set in ILIAS setup/ini)
function createImportDirectory() { include_once "./Services/Utilities/classes/class.ilUtil.php"; $svy_data_dir = ilUtil::getDataDir()."/svy_data"; ilUtil::makeDir($svy_data_dir); if(!is_writable($svy_data_dir)) { $this->ilias->raiseError("Survey Data Directory (".$svy_data_dir .") not writeable.",$this->ilias->error_obj->FATAL); } // create test directory (data_dir/svy_data/svy_<id>) $svy_dir = $svy_data_dir."/svy_".$this->getId(); ilUtil::makeDir($svy_dir); if(!@is_dir($svy_dir)) { $this->ilias->raiseError("Creation of Survey Directory failed.",$this->ilias->error_obj->FATAL); } // create import subdirectory (data_dir/svy_data/svy_<id>/import) $import_dir = $svy_dir."/import"; ilUtil::makeDir($import_dir); if(!@is_dir($import_dir)) { $this->ilias->raiseError("Creation of Import Directory failed.",$this->ilias->error_obj->FATAL); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDataPaths() {\n foreach ($this->data_paths as $path) {\n if (!file_exists($this->root . $path)) {\n mkdir($this->root . $path);\n }\n }\n }", "function createExportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t\t\n\t\t// create learning module directory (data_dir/lm_data/lm_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t\t// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)\n\t\t$export_dir = $svy_dir.\"/export\";\n\t\tilUtil::makeDir($export_dir);\n\t\tif(!@is_dir($export_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Export Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}", "function getImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$import_dir = ilUtil::getDataDir().\"/svy_data\".\n\t\t\t\"/svy_\".$this->getId().\"/import\";\n\t\tif (!is_dir($import_dir))\n\t\t{\n\t\t\tilUtil::makeDirParents($import_dir);\n\t\t}\n\t\tif(@is_dir($import_dir))\n\t\t{\n\t\t\treturn $import_dir;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function generateDataYmlDirectoryPath()\n {\n return self::DATA_CSV_PATH.$this->generateDataSubDirectoryPath();\n }", "abstract public function getRelativeDataDir();", "function createDirectory() {\n\t$fmpImporter = new FilemakerProImporter();\n\t$fmpImporter->createDirectory();\n}", "function createExportDirectory()\n\t{\n\t\tif (!@is_dir($this->getExportDirectory()))\n\t\t{\n\t\t\t$usrf_data_dir = ilUtil::getDataDir().\"/usrf_data\";\n\t\t\tilUtil::makeDir($usrf_data_dir);\n\t\t\tif(!is_writable($usrf_data_dir))\n\t\t\t{\n\t\t\t\t$this->ilias->raiseError(\"Userfolder data directory (\".$usrf_data_dir\n\t\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->MESSAGE);\n\t\t\t}\n\n\t\t\t// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)\n\t\t\t$export_dir = $usrf_data_dir.\"/export\";\n\t\t\tilUtil::makeDir($export_dir);\n\t\t\tif(!@is_dir($export_dir))\n\t\t\t{\n\t\t\t\t$this->ilias->raiseError(\"Creation of Userfolder Export Directory failed.\",$this->ilias->error_obj->MESSAGE);\n\t\t\t}\n\t\t}\n\t}", "public function getRelativeDataDir()\n\t{\n\t\treturn 'ash';\n\t}", "protected function init()\n {\n $dir = $this->getDir();\n\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n }", "public function generateDataCsvDirectoryPath()\n {\n return $this->generateDataYmlDirectoryPath().$this->config->getEntityName().'/';\n }", "private function initialiseVariables(): void\n {\n $this->entityInterfaceFqn = $this->namespaceHelper->getEntityInterfaceFromEntityFqn($this->entityFqn);\n list($className, , $subDirs) = $this->namespaceHelper->parseFullyQualifiedName(\n $this->entityFqn,\n $this->srcSubFolderName,\n $this->projectRootNamespace\n );\n\n $this->singularNamespacedName = $this->namespaceHelper->getSingularNamespacedName(\n $this->entityFqn,\n $subDirs\n );\n $this->pluralNamespacedName = $this->namespaceHelper->getPluralNamespacedName(\n $this->entityFqn,\n $subDirs\n );\n $this->setDestinationDirectory(\n $className,\n $subDirs\n );\n $plural = ucfirst(MappingHelper::getPluralForFqn($this->entityFqn));\n $singular = ucfirst(MappingHelper::getSingularForFqn($this->entityFqn));\n $nsNoEntities = implode('\\\\', array_slice($subDirs, 2));\n $this->singularNamespace = ltrim($nsNoEntities . '\\\\' . $singular, '\\\\');\n $this->pluralNamespace = ltrim($nsNoEntities . '\\\\' . $plural, '\\\\');\n $this->dirsToRename = [];\n $this->filesCreated = [];\n }", "function check_and_create_import_dir($unique_code) {\n global $CFG; \n $status = $this->check_dir_exists($CFG->dataroot.\"/temp\",true);\n if ($status) {\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp/webworkquiz_import\",true);\n }\n if ($status) {\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp/webworkquiz_import/\".$unique_code,true);\n }\n return $status;\n }", "function mscaffolding_prepare_directories($name)\n\t{\n\t\tmkdir(\"data/scaffolding/\" . $name);\n\t\tmkdir(\"data/scaffolding/\" . $name . \"/views\");\n\t}", "function check_and_create_import_dir($unique_code) {\n\n global $CFG; \n\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp\",true);\n if ($status) {\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp/webworkquiz_import\",true);\n }\n if ($status) {\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp/webworkquiz_import/\".$unique_code,true);\n }\n \n return $status;\n }", "public static function getDataFolder()\n {\n $class = get_called_class();\n $strip = explode('\\\\', $class);\n\n return RELEASE_NAME_DATA . '/' . strtolower(array_pop($strip)) . 's';\n }", "public function stf_custom_upload_dir( $dir_data ) {\n $custom_dir = 'tar-csv-import';\n return [\n 'path' => $dir_data[ 'basedir' ] . '/' . $custom_dir,\n 'url' => $dir_data[ 'url' ] . '/' . $custom_dir,\n 'subdir' => '/' . $custom_dir,\n 'basedir' => $dir_data[ 'error' ],\n 'error' => $dir_data[ 'error' ],\n ];\n }", "public static function getDataDir()\n {\n return self::getDir('getDataHome');\n }", "protected function assignSeedsDir()\n {\n $this->seeds_dir = '';\n }", "protected function assignSeedsDir()\n {\n $this->seeds_dir = BLEND_TEST_SEEDS_DIR;\n }", "private function createFileDir()\n\t{\n\t\t$this->fileDir = IMAGES.'uploads'.DS.$this->model.DS.$this->modelId;\n\t\t$this->imgDir = 'uploads/'.$this->model.'/'.$this->modelId;\n\t}", "function serendipity_installDatabase() {\n global $serendipity;\n\n $queries = serendipity_parse_sql_tables(S9Y_INCLUDE_PATH . 'sql/db.sql');\n $queries = str_replace('{PREFIX}', $serendipity['dbPrefix'], $queries);\n\n foreach ($queries as $query) {\n serendipity_db_schema_import($query);\n }\n\n if (file_exists(S9Y_INCLUDE_PATH . 'sql/preload.sql')) {\n $queries = serendipity_parse_sql_inserts(S9Y_INCLUDE_PATH . 'sql/preload.sql');\n $queries = str_replace('{PREFIX}', $serendipity['dbPrefix'], $queries);\n foreach ($queries as $query) {\n serendipity_db_schema_import($query);\n }\n }\n}", "protected function initialize() {\n\t\t$this->databasesDir = $this->projectDir . '/var/data/databases';\n\t\t$this->simulatorsDir = $this->projectDir . '/var/data/simulators';\n\t\t$this->publicDir = $this->projectDir . '/' . ($this->getParameter('public_dir') ?? 'public');\n\t\t$this->viewsDir = $this->projectDir . '/templates';\n\t\t$this->pdfFormsDir = $this->projectDir . '/var/data/pdfforms';\n\t}", "protected function importDatabaseData() {}", "function import_data() {\n\t\t$sync_tables = $this->config->item('sync_tables');\n\n\t\t$this->db_tools->import_data( $sync_tables );\n\t\t$this->db_tools->echo_import_data();\n\t}", "private function __construct()\n {\n require_once DATA_DIR . '/system/DataIO.php';\n }", "private function defineDirPainelDLX(): void\n {\n // Previnir que o diretório seja alterado caso alguém tenha setado ele manualmente\n if (empty(self::$dir)) {\n $base_dir = dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR;\n $document_root = $this->request->getServerParams()['DOCUMENT_ROOT'];\n\n // Setar o path do PainelDLX\n self::$dir = trim(str_replace($document_root, '', $base_dir), DIRECTORY_SEPARATOR);\n\n // Garantir que os separadores de diretório estejam padronizados\n self::$dir = str_replace(DIRECTORY_SEPARATOR, '/', self::$dir);\n\n // Adicionar o path do PainelDLX no include_path\n $this->adicionarDiretorioInclusao($base_dir);\n }\n }", "public function setUp()\n {\n $this->data = array(\n 'folder_name_1' => array(\n 'src' => 'source_1',\n 'dst' => 'destination_1',\n ),\n 'folder_name_2' => array(\n 'src' => 'source_2',\n 'dst' => 'destination_2',\n 'client' => 'test'\n )\n );\n }", "protected function createOtherDirs()\n {\n $this->createDir('Database', true);\n $this->createDir('Database/Migrations', true);\n $this->createDir('Database/Seeds', true);\n $this->createDir('Filters', true);\n $this->createDir('Language', true);\n $this->createDir('Validation', true);\n }", "protected function prepareArchiveDir(): void\n {\n $this->filesystem = new Filesystem();\n $this->archiveDir = FsUtils::tmpDir(self::ARCHIVES_DIR_NAME);\n }", "public static function getAbsoluteDataDir(){\r\n\t\treturn sfTeraWurflConfig::getDataDir();\r\n\t}" ]
[ "0.661015", "0.614429", "0.57506263", "0.572122", "0.54660785", "0.54467916", "0.54372424", "0.5290525", "0.5286214", "0.5264288", "0.5234348", "0.52172285", "0.5210664", "0.5180001", "0.51475483", "0.5122455", "0.51067424", "0.50994813", "0.5098831", "0.5071527", "0.5042189", "0.50394803", "0.502077", "0.5015696", "0.5000345", "0.49955392", "0.49910387", "0.49841994", "0.498312", "0.49767894" ]
0.80771524
0
get import directory of survey
function getImportDirectory() { include_once "./Services/Utilities/classes/class.ilUtil.php"; $import_dir = ilUtil::getDataDir()."/svy_data". "/svy_".$this->getId()."/import"; if (!is_dir($import_dir)) { ilUtil::makeDirParents($import_dir); } if(@is_dir($import_dir)) { return $import_dir; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function get_dir() {\n\t\treturn apply_filters( 'themeisle_site_import_uri', trailingslashit( get_template_directory_uri() ) . self::OBOARDING_PATH );\n\t}", "public function getUploadDir()\n {\n return 'import/fichier/licencies';\n }", "function dirPath() { return (\"../\"); }", "public function getModuleDir()\n {\n return dirname(Mage::getModuleDir('etc', 'Ts_Phpids')) . DS;\n }", "public function getLibDir()\n {\n return Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'hycube' . DS . 'geoip';\n }", "static public function getDir(){\n return __DIR__ . '/Adapter/Format/';\n }", "function dirPath() {return (\"../../../../\"); }", "protected function _getSchemaDir()\n\t{\n\t\treturn __DIR__ . DS . '../Xsd/File/';\n\t}", "function dirPath () { return (\"../../\"); }", "function createImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\t\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create test directory (data_dir/svy_data/svy_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create import subdirectory (data_dir/svy_data/svy_<id>/import)\n\t\t$import_dir = $svy_dir.\"/import\";\n\t\tilUtil::makeDir($import_dir);\n\t\tif(!@is_dir($import_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Import Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}", "public function getDir() {\n return Yii::getAlias('@static').'/'.$this->module.'/'. $this->parent_id .'/';\n }", "function uploads_dir() {\n\tglobal $root;\n\treturn $root.Media::instance()->path;\n}", "protected function getDefaultImportExportFolder() {}", "protected function getDefaultImportExportFolder() {}", "public function getDirectory();", "public function getDirectory();", "public static function getModulePath()\n {\n return dirname(__DIR__);\n }", "public function getDirectory()\n {\n return $this->_path['dirname'];\n }", "public function getFileBaseDir()\n {\n return Mage::getBaseDir('media').DS.'invitationstatus'.DS.'file';\n }", "protected function get_dir() {\r\n return dirname( ( new \\ReflectionClass( static::class ) )->getFileName());\r\n }", "public static function get_directory() : string {\r\n\t\treturn Core::get_app_path( self::$directory );\r\n\t}", "protected function getUploadDir()\n {\n // when displaying uploaded doc/image in the view.\n return 'uploads/models';\n }", "public function getDirectorySpool();", "public function getDirectoryRelativePath(): string\n {\n return $this->config->getValue('general/file/import_images_base_dir');\n }", "public function getDirectory()\n {\n return mfConfig::get('mf_sites_dir').\"/\".$this->getSiteName().\"/\".$this->getApplication().\"/view/pictures/\".$this->get('lang');\n }", "public function getRelativePath(){\n\t\treturn 'Less';\n\t}", "public function getDir();", "private function get_base_path() : string {\n return plugin_dir_path( dirname( __FILE__, 2 ) );\n }", "private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }", "public function base_dir(){\n return $this->plugin_dir() . 'base/';\n }" ]
[ "0.65910035", "0.6490277", "0.6426152", "0.6362744", "0.62728024", "0.62516975", "0.62449497", "0.617874", "0.6165781", "0.61322993", "0.6053908", "0.60391194", "0.60345554", "0.60345554", "0.598935", "0.598935", "0.5977004", "0.5976128", "0.5959898", "0.59541905", "0.5941614", "0.59344167", "0.5931392", "0.5929959", "0.59117335", "0.5908803", "0.59034044", "0.5900281", "0.5898419", "0.5885826" ]
0.7160903
0
Returns the number of generated survey codes for the survey
function getSurveyCodesCount() { global $ilDB; $result = $ilDB->queryF("SELECT anonymous_id FROM svy_anonymous WHERE survey_fi = %s AND user_key IS NULL", array('integer'), array($this->getSurveyId()) ); return $result->numRows(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAnswerCount();", "public function getCurrentQuestionCount();", "public function getQuestionsCount() : int;", "function CountCorrectAns(){\n\t\n\t\t\t\tglobal $count;\n\t\t\t\twhile($correct){\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t\treturn $count;\n\t\t\t}", "function getAnswerCount()\n\t{\n\t\treturn count($this->answers);\n\t}", "public static function getCount(){\n \t$sql = \"SELECT COUNT(*) as count FROM yy_hospital\";\n \t$res = self::getDb()->query($sql)->fetchAll();\n \t$count = $res[0]['count'];\n \treturn $count;\n }", "public function get_siswa_numbers() {\n $this->db->select('id');\n $this->db->from('tb_siswa');\n $query = $this->db->get();\n return $query->num_rows();\n }", "function get_students_count(){\n\t\t$div_id = $this->session->userdata(SESSION_CONST_PRE.'division_id');\n\t\t$pattren = ($div_id == '1') ? 'DNS' : 'DIS';\n\t\t//$query = $this->db->query(\"select count(admission_number) as id from students where admission_number like '\".$pattren.\"%'\");\n\t\t$query = $this->db->query(\"select count(admission_number) as id from students\");\n\t\t$result = $query->result();\n\t\t$max_num = $result[0]->id;\n\t\n\t\treturn $max_num;\n\t}", "public function numeroInscripciones()\n {\n $socio = Auth()->user()->socio->id;\n $res = Inscription::where('partners_id', $socio)->count();\n return $res;\n }", "public function getSiswaCount()\n {\n return $this->db->count_all('siswa');\n }", "public function ask_get_nb_questions()\n\t{\n\t\t$sql = \"SELECT COUNT(*) AS nb_quest\n\t\t\t\tFROM \".$this->table_ask.\"\n\t\t\t\tWHERE id_quest = -1\";\n\t\t$query = $this->db->query($sql);\n\t\tif( $query->row() != NULL )\n\t\t\treturn $query->row()->nb_quest;\n\t\telse\n\t\t\treturn 0;\n\t}", "public function getQuestionCount() {\r\n\t\treturn $this->questionCount;\r\n\t}", "public function iN_TotalVerificationRequests() {\n\t\t$q = mysqli_query($this->db, \"SELECT COUNT(*) AS verificationCount FROM i_verification_requests WHERE request_status = '0'\") or die(mysqli_error($this->db));\n\t\t$row = mysqli_fetch_array($q, MYSQLI_ASSOC);\n\t\tif ($row) {\n\t\t\treturn isset($row['verificationCount']) ? $row['verificationCount'] : '0';\n\t\t} else {return 0;}\n\t}", "public function count(): int\n {\n return count($this->testCases);\n }", "function count()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $ret = false;\r\n\r\n $db->query_single( $result, \"SELECT COUNT(ID) as Count FROM eZQuiz_Alternative\" );\r\n $ret = $result[$db->fieldName( \"Count\" )];\r\n return $ret;\r\n }", "protected static function num_code(): mixed\n\t{\n\t\treturn self::$query->num_code;\n\t}", "function getEnrollmentCount()\r\n {\r\n $count = $this->DB->database_count('enrollment_requests');\r\n return $count;\r\n }", "public function get_count_company_invoice_foreigner() {\n $invoice_id = $this->input->post('invoice');\n $subsidy = $this->input->post('subsidy');\n \n $result = $this->classtraineemodel->get_company_invoice_foreigner($invoice_id);\n \n echo count($result);\n }", "static function questionCount($exam_id){\n return DB::table('questions')->where('examination_id',$exam_id)->count();\n }", "public function GetPatientsCount();", "public function get_count_company_invoice_no_subsidy() {\n $invoice_id = $this->input->post('invoice');\n $subsidy = $this->input->post('subsidy');\n if (empty($subsidy)) {\n $result = $this->classtraineemodel->get_company_invoice_no_subsidy($invoice_id);\n } else {\n $result = $this->classtraineemodel->get_company_invoice_subsidy($invoice_id);\n }\n echo count($result);\n }", "public function getT_NoOfStudent()\n\t\t\t\t\t{\n\t\t\t\t\t\t$sql=\"select count(*) from student\";\n\t\t\t\t\t\n\t\t\t\t\t\t$this->openDB();\n\t\t\t\t\t\t$this->prepareQuery($sql);\n\t\t\t\t\t\t$result=$this->executeQuery();\n\t\t\t\t\t\treturn ($result[0][0]);\n\t\t\t\t\t}", "function count()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $ret = false;\r\n\r\n $db->query_single( $result, \"SELECT COUNT(ID) as Count\r\n FROM eZQuiz_Question\" );\r\n $ret = $result[$db->fieldName( \"Count\" )];\r\n return $ret;\r\n }", "function numQuestions(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT question_id FROM q_questions WHERE fk_quiz_id = %d\", GetSQLValueString($this->quiz_id, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn mysql_num_rows($getQuery);\n\t}", "public static function responseCount($SurveyID)\n\t{\n\t\t$SurveyID = (int)$SurveyID; //cast to integer\n\t\tif($SurveyID > 0)\n\t\t{//now no SQL if number not above zero\n\t\t\t$iConn = IDB::conn(); \n\t\t\t$rowsql = \"select count(*) as numrows from \" . PREFIX . \"responses where SurveyID=\" . $SurveyID;\n\t\t\t$result = mysqli_query($iConn,$rowsql) or die(trigger_error(mysqli_error($iConn), E_USER_ERROR));\n\t\t\t$row = mysqli_fetch_assoc($result) or die(trigger_error(mysqli_error($iConn), E_USER_ERROR));\n\t\t\t$numrows = $row['numrows'];\n\t\t\t$sql = \"update \" . PREFIX . \"surveys set TotalResponses=\" . $numrows . \" where SurveyID=\" . $SurveyID;\n\t\t\tmysqli_query($iConn,$sql) or die(trigger_error(mysqli_error($iConn), E_USER_ERROR));\n\t\t}\n\t}", "public function countResponses() {\n\t\t\n\t\ttry {\n\t\t\t$select = $this->pdo->select(['id'])->count('*', 'num_ids')->from('posts_'.$this->board)->where('thread', '=', $this->tId);\n\t\t\t$stmt = $select->execute();\n\t\t\t$num_responses = $stmt->fetchColumn(1);\n\t\t\t\n\t\t} catch(\\Exception $e) {\n\t\t\t$this->app->error($e);\n\t\t}\n\t\t\n\t\treturn $num_responses;\n\t}", "public function findAnswerCount($choice) {\n\t\t$return = 0;\n\t\t$query\t= $this->createQuery();\n\n\t\tif($choice instanceof \\Qinx\\Qxsurvey\\Domain\\Model\\Choice) {\n\t\t\t$choice = $choice->getUid();\n\t\t}\n\n// kann vorerst nicht mehr in TYPO3 7 verwendet werden\n//\t\t$statement = 'SELECT COUNT(a.uid) as total FROM tx_qxsurvey_domain_model_answer AS a\n//\t\t\tWHERE a.choice = ?\n//\t\t\t\tAND a.pid IN ?' . $this->getEnabledFieldString('tx_qxsurvey_domain_model_answer', 'a');\n//\n//\t\t$result = $query\n//\t\t\t->statement($statement, array(1))\n//\t\t\t->execute(true);\n\n\t\t$statement = $GLOBALS['TYPO3_DB']->prepare_SELECTquery(\n\t\t\t'COUNT(a.uid) as total',\n\t\t\t'tx_qxsurvey_domain_model_answer AS a',\n\t\t\t'a.choice = :uid AND a.pid IN (:pid)' . $this->getEnabledFieldString('tx_qxsurvey_domain_model_answer', 'a'));\n\t\t$statement->execute(array(':uid' => $choice, ':pid' => implode(',', $query->getQuerySettings()->getStoragePageIds())));\n\n\t\t$result = $statement->fetch();\n\n\t\tif(isset($result['total']) === true) {\n\t\t\t$return = (int) $result['total'];\n\t\t}\n\n\t\treturn $return;\n\t}", "public function count()\n {\n return $this->client->count($this->compile())['count'];\n }", "function countAlternatives()\r\n {\r\n $returnArray = array();\r\n $db =& eZDB::globalDatabase();\r\n $db->query_single( $result, \"SELECT count( ID ) AS COUNT FROM eZQuiz_Alternative WHERE QuestionID='$this->ID'\" );\r\n\r\n $ret = false;\r\n\r\n if ( is_numeric( $result[$db->fieldName( \"COUNT\" )] ) )\r\n {\r\n $ret = $result[$db->fieldName( \"COUNT\" )];\r\n }\r\n\r\n return $ret;\r\n }", "public function sentCount();" ]
[ "0.6926682", "0.63393015", "0.6271888", "0.6235425", "0.60917884", "0.5988449", "0.59811383", "0.59246165", "0.5907298", "0.58895636", "0.58617824", "0.5845342", "0.5842909", "0.5830281", "0.58008724", "0.5789762", "0.5786591", "0.5777894", "0.5776545", "0.57605547", "0.5753878", "0.5751092", "0.57508874", "0.57382464", "0.5735029", "0.5720403", "0.57119346", "0.5711456", "0.570539", "0.5695531" ]
0.7916477
0
Returns a list of survey codes for file export
function getSurveyCodesForExport(array $a_codes = null, array $a_ids = null) { global $ilDB, $ilUser, $lng; include_once "./Services/Link/classes/class.ilLink.php"; $sql = "SELECT svy_anonymous.*, svy_finished.state". " FROM svy_anonymous". " LEFT JOIN svy_finished ON (svy_anonymous.survey_key = svy_finished.anonymous_id)". " WHERE svy_anonymous.survey_fi = ".$ilDB->quote($this->getSurveyId(), "integer"). " AND svy_anonymous.user_key IS NULL"; if($a_codes) { $sql .= " AND ".$ilDB->in("svy_anonymous.survey_key", $a_codes, "", "text"); } else if($a_ids) { $sql .= " AND ".$ilDB->in("svy_anonymous.anonymous_id", $a_ids, "", "text"); } $export = array(); // #14905 $titles = array(); $titles[] = '"'.$lng->txt("survey_code").'"'; $titles[] = '"'.$lng->txt("email").'"'; $titles[] = '"'.$lng->txt("lastname").'"'; $titles[] = '"'.$lng->txt("firstname").'"'; $titles[] = '"'.$lng->txt("create_date").'"'; $titles[] = '"'.$lng->txt("used").'"'; $titles[] = '"'.$lng->txt("mail_sent_short").'"'; $titles[] = '"'.$lng->txt("survey_code_url").'"'; $export[] = implode(";", $titles); $result = $ilDB->query($sql); $default_lang = $ilUser->getPref("survey_code_language"); while ($row = $ilDB->fetchAssoc($result)) { $item = array(); $item[] = $row["survey_key"]; if($row["externaldata"]) { $ext = unserialize($row["externaldata"]); $item[] = $ext["email"]; $item[] = $ext["lastname"]; $item[] = $ext["firstname"]; } else { $item[] = ""; $item[] = ""; $item[] = ""; } // No relative (today, tomorrow...) dates in export. $date = new ilDateTime($row['tstamp'],IL_CAL_UNIX); $item[] = $date->get(IL_CAL_DATETIME); $item[] = ($this->isSurveyCodeUsed($row["survey_key"])) ? 1 : 0; $item[] = ($row["sent"]) ? 1 : 0; $params = array("accesscode" => $row["survey_key"]); if ($default_lang) { $params["lang"] = $default_lang; } $item[] = ilLink::_getLink($this->getRefId(), "svy", $params); $export[] = '"'.implode('";"', $item).'"'; } return implode("\n", $export); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_survey_licensed_files($surveyid)\n\t{\t\t\n\t\t$where=\" survey_id=$surveyid AND (dctype like '%dat/micro]%' OR dctype like '%dat]%') \";\n\t\t\n\t\t$this->db->select('title,filename,resource_id');\n\t\t$this->db->from('resources');\n\t\t$this->db->select('title,filename,resource_id,changed');\n\t\t$this->db->where($where,NULL,FALSE);\n\t\t$query = $this->db->get();\n\n\t\tif ($query)\n\t\t{\n\t\t\treturn $query->result_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new MY_Exception($this->db->_error_message());\n\t\t}\t\n\t}", "public function getCodes () {\n $list = [\n '' => '全部',\n 'optask' => '任务',\n 'patientrecord' => '运营备注',\n 'patientstage' => '患者阶段',\n 'patientgroup' => '患者分组',\n 'patientremark' => '患者文本备注',\n ];\n\n return $list;\n }", "public function get_codehandin_areas() {// left in case i want to save a error log/output etc\r\n return array(ASSIGNSUBMISSION_CODEHANDIN_FILEAREA => $this->get_name());\r\n }", "public function getSubjectCodes() {\n\t\n\t\t\t$this->valid_subject_codes = array();\n\t\t\t\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\t\t\t$query = \"SELECT Description, ID FROM tblsubject\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\twhile($sql->next_record()) {\n\t\t\t\t\t$key = $sql->Record['Description'];\n\t\t\t\t\t$this->valid_subject_codes[$key] = $sql->Record['ID'];\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function get_licensed_surveys()\n\t{\n\t\t$this->db->select('*');\t\t\n\t\t$this->db->from('lic_requests');\t\t\n\n\t\t$result = $this->db->get()->result_array();\n\t\treturn $result;\n\t}", "function get_request_approved_surveys($request_id)\n\t{\n\t\t$this->db->select('resources.survey_id');\n\t\t$this->db->join('resources', 'lic_file_downloads.fileid= resources.resource_id');\n\t\t$this->db->where('lic_file_downloads.requestid',$request_id);\n\t\t$result=$this->db->get('lic_file_downloads')->result_array();\n\t\t\n\t\tif (!$result)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$output=array();\n\t\tforeach($result as $row)\n\t\t{\n\t\t\t$output[]=$row['survey_id'];\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t}", "function get_export_choices() {\n $export = [];\n\n $settings = FWP()->helper->settings;\n\n foreach ( $settings['facets'] as $facet ) {\n $export['facet-' . $facet['name']] = 'Facet - ' . $facet['label'];\n }\n\n foreach ( $settings['templates'] as $template ) {\n $export['template-' . $template['name']] = 'Template - '. $template['label'];\n }\n\n return $export;\n }", "public function download_codes() {\n\t\tcheck_ajax_referer( 'download_codes' );\n\n\t\t$post = get_post( $_REQUEST['post_id'] );\n\t\tif ( ! $post instanceof WP_Post ) {\n\t\t\thttp_response_code( 404 );\n\t\t\texit;\n\t\t}\n\n\t\tif ( ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\t\thttp_response_code( 403 );\n\t\t\texit;\n\t\t}\n\n\t\t// Set headers\n\t\theader( 'Content-Description: File Transfer' );\n\t\theader( 'Content-type: text/csv' );\n\t\theader( 'Content-Disposition: attachment; filename=' . $post->post_name . '.csv' );\n\t\theader( 'Expires: 0' );\n\t\theader( 'Pragma: public' );\n\n\t\t// Begin CSV output\n\t\t$fh = fopen( 'php://output', 'w' );\n\t\tfputcsv(\n\t\t\t$fh,\n\t\t\tarray(\n\t\t\t\t__( 'Code', 'wp-simple-coupons' ),\n\t\t\t\t__( 'Associated ID', 'wp-simple-coupons' ),\n\t\t\t)\n\t\t);\n\n\t\tglobal $wpdb;\n\n\t\t$table = $this->get_helper()->get_coupon_codes_table();\n\n\t\t$codes = $wpdb->get_results(\n\t\t\t$wpdb->prepare(\n\t\t\t\t\"SELECT code, association_id FROM $table WHERE blog_id = %d AND post_id = %d\",\n\t\t\t\tget_current_blog_id(),\n\t\t\t\t$post->ID\n\t\t\t),\n\t\t\tARRAY_A\n\t\t);\n\n\t\tforeach ( $codes as $code ) {\n\t\t\tfputcsv( $fh, $code );\n\t\t}\n\n\t\tfclose( $fh );\n\t\texit();\n\t}", "function get_all_by_survey($sid)\r\n {\r\n $this->db->select(\"*\");\r\n $this->db->where(\"sid\",$sid);\r\n return $this->db->get(\"data_files\")->result_array();\r\n }", "function get_answer($file){\n include($file);\n $output = array($q, $s);\n\n return $output;\n }", "function get_request_files($surveyid, $requestid)\n\t{\t\n\t\t//get all survey licensed files\n\t\t$files=$this->get_survey_licensed_files($surveyid);\t\t\n\t\t\t\n\t\t//get download options already set\n\t\t$options=$this->get_request_download_options($requestid);\t\t\n\t\t$result=NULL;\t\t\n\t\tif ($files)\n\t\t{\n\t\t\tforeach($files as $file)\n\t\t\t{\n\t\t\t\tif ($options)\n\t\t\t\t{\n\t\t\t\t\tforeach($options as $option)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($file['resource_id']==$option['fileid'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$file['download']=$option;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t$result[]=$file;\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn $result;\n\t}", "function examTypes() {\n return array('General', 'IIT', 'NEET', 'Eamcet', 'NTSE');\n}", "public function list_handled_codes()\n {\n $list = array();\n $list['filedump'] = array(do_lang('CONTENT'), do_lang('filedump:NOTIFICATION_TYPE_filedump'));\n return $list;\n }", "protected function getAllCodes() {\n \t$codes = array();\n \t$config = Mage::getConfig()->getNode('crontab/jobs'); /* @var $config Mage_Core_Model_Config_Element */\n\t\tif ($config instanceof Mage_Core_Model_Config_Element) {\n\t\t\tforeach ($config->children() as $key => $tmp) {\n\t\t\t\tif (!in_array($key, $codes)) {\n\t\t\t\t\t$codes[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($codes);\n \treturn $codes;\n }", "protected function getIsoCodes() {}", "protected function _getExportAttrCodes()\n {\n return [];\n }", "protected function _getExportAttrCodes()\n {\n return [];\n }", "public static function getAutoCodeList()\n {\n $autocodes = array();\n\n $scopes = JFolder::folders(ECRPATH_AUTOCODES);\n\n foreach($scopes as $scope)\n {\n if($scope != 'admin' && $scope != 'site')\n continue;\n\n $names = JFolder::folders(ECRPATH_AUTOCODES.DS.$scope);\n\n foreach($names as $name)\n {\n if($name == 'sql')\n continue;\n\n $types = JFolder::folders(ECRPATH_AUTOCODES.DS.$scope.DS.$name);\n\n foreach($types as $type)\n {\n $path = ECRPATH_AUTOCODES.DS.$scope.DS.$name.DS.$type.DS.'tmpl';\n $files = JFolder::files($path, '.', true, true);\n\n if( ! $files)\n continue;\n\n foreach($files as $file)\n {\n $autocodes[$scope][$name][$type][] = str_replace($path.DS, '', $file);\n }\n }\n }\n }\n\n return $autocodes;\n }", "public function getSurveys() {\n $surveys = array();\n $jsonData = $this->getDataFromDataFolder();\n foreach($jsonData as $surveyData) {\n $surveys[] = $this->serializer->deserialize(\n json_encode($surveyData->survey), Survey::class, 'json'\n );\n }\n $surveys = array_unique($surveys, SORT_REGULAR);\n return $surveys;\n }", "protected function getAllCodes() {\n\t\t$codes = array();\n\t\t$config = Mage::getConfig()->getNode('crontab/jobs'); \n\t\tif ($config instanceof Mage_Core_Model_Config_Element) {\n\t\t\tforeach ($config->children() as $key => $tmp) {\n\t\t\t\tif (!in_array($key, $codes)) {\n\t\t\t\t\t$codes[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$config = Mage::getConfig()->getNode('default/crontab/jobs');\n\t\tif ($config instanceof Mage_Core_Model_Config_Element) {\n\t\t\tforeach ($config->children() as $key => $tmp) {\n\t\t\t\tif (!in_array($key, $codes)) {\n\t\t\t\t\t$codes[] = $key;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($codes);\n\t\treturn $codes;\n\t}", "public function getCodeDataProvider()\n {\n return [\n ['method', 21],\n ['dropoff', 5],\n ['packaging', 7],\n ['containers_filter', 4],\n ['delivery_confirmation_types', 4],\n ['unit_of_measure', 2],\n ];\n }", "function scan()\n {\n $arlines = array();\n exec(\n $this->arfilelocation['iwpriv'] . ' '\n . escapeshellarg($this->interface) . ' get_site_survey',\n $arlines\n );\n\n return $this->parsescan($arlines);\n }", "public function file_extensions_for_case_studies(){\n\t\t$filetype_arr = array();\n\t\t$filetype_arr['ppt'] = \"PowerPoint\";\n\t\t$filetype_arr['pptx'] = \"PowerPoint\";\n\t\t$filetype_arr['pdf'] = \"PDF file\";\n\t\treturn $filetype_arr;\n\t}", "public function getAllCode(){\n return parent::getAll('code_ade');\n }", "protected function getFilesToProcess()\n {\n return array(\n 'custom/modules/Quotes/metadata/detailviewdefs.php',\n );\n }", "function get_survey_citation()\n\t{\n\t\tif (!is_array($this->search_result))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\telse if (count($this->search_result)==0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t//build a list of survey IDs\n\t\tforeach($this->search_result as $row)\n\t\t{\n\t\t\t$survey_id_list[]=$row['id'];\n\t\t}\n\n\t\t$surveys=implode(',',$survey_id_list);\n\t\t$this->ci->db->select('sid,count(sid) as total');\n\t\t$this->ci->db->where(\"sid in ($surveys)\");\n\t\t$this->ci->db->group_by('sid');\n\t\t$query=$this->ci->db->get('survey_citations');\n\n\t\tif ($query)\n\t\t{\n\t\t\t$citation_rows=$query->result_array();\n\n\t\t\t$result=array();\n\n\t\t\tforeach($citation_rows as $row)\n\t\t\t{\n\t\t\t\t$result[$row['sid']]=$row['total'];\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/geshi.php',\n 'sources_custom/geshi/.htaccess',\n 'sources_custom/geshi/index.html',\n 'sources_custom/geshi/4cs.php',\n 'sources_custom/geshi/abap.php',\n 'sources_custom/geshi/actionscript.php',\n 'sources_custom/geshi/actionscript3.php',\n 'sources_custom/geshi/ada.php',\n 'sources_custom/geshi/apache.php',\n 'sources_custom/geshi/applescript.php',\n 'sources_custom/geshi/apt_sources.php',\n 'sources_custom/geshi/asm.php',\n 'sources_custom/geshi/asp.php',\n 'sources_custom/geshi/autohotkey.php',\n 'sources_custom/geshi/autoit.php',\n 'sources_custom/geshi/avisynth.php',\n 'sources_custom/geshi/awk.php',\n 'sources_custom/geshi/bash.php',\n 'sources_custom/geshi/basic4gl.php',\n 'sources_custom/geshi/bf.php',\n 'sources_custom/geshi/bibtex.php',\n 'sources_custom/geshi/blitzbasic.php',\n 'sources_custom/geshi/bnf.php',\n 'sources_custom/geshi/boo.php',\n 'sources_custom/geshi/c.php',\n 'sources_custom/geshi/c_mac.php',\n 'sources_custom/geshi/caddcl.php',\n 'sources_custom/geshi/cadlisp.php',\n 'sources_custom/geshi/cfdg.php',\n 'sources_custom/geshi/cfm.php',\n 'sources_custom/geshi/cil.php',\n 'sources_custom/geshi/clojure.php',\n 'sources_custom/geshi/cmake.php',\n 'sources_custom/geshi/cobol.php',\n 'sources_custom/geshi/cpp-qt.php',\n 'sources_custom/geshi/cpp.php',\n 'sources_custom/geshi/csharp.php',\n 'sources_custom/geshi/css.php',\n 'sources_custom/geshi/cuesheet.php',\n 'sources_custom/geshi/d.php',\n 'sources_custom/geshi/dcs.php',\n 'sources_custom/geshi/delphi.php',\n 'sources_custom/geshi/diff.php',\n 'sources_custom/geshi/div.php',\n 'sources_custom/geshi/dos.php',\n 'sources_custom/geshi/dot.php',\n 'sources_custom/geshi/eiffel.php',\n 'sources_custom/geshi/email.php',\n 'sources_custom/geshi/erlang.php',\n 'sources_custom/geshi/fo.php',\n 'sources_custom/geshi/fortran.php',\n 'sources_custom/geshi/freebasic.php',\n 'sources_custom/geshi/fsharp.php',\n 'sources_custom/geshi/gambas.php',\n 'sources_custom/geshi/gdb.php',\n 'sources_custom/geshi/genero.php',\n 'sources_custom/geshi/gettext.php',\n 'sources_custom/geshi/glsl.php',\n 'sources_custom/geshi/gml.php',\n 'sources_custom/geshi/gnuplot.php',\n 'sources_custom/geshi/groovy.php',\n 'sources_custom/geshi/haskell.php',\n 'sources_custom/geshi/hq9plus.php',\n 'sources_custom/geshi/html4strict.php',\n 'sources_custom/geshi/idl.php',\n 'sources_custom/geshi/ini.php',\n 'sources_custom/geshi/inno.php',\n 'sources_custom/geshi/intercal.php',\n 'sources_custom/geshi/io.php',\n 'sources_custom/geshi/java.php',\n 'sources_custom/geshi/java5.php',\n 'sources_custom/geshi/javascript.php',\n 'sources_custom/geshi/jquery.php',\n 'sources_custom/geshi/kixtart.php',\n 'sources_custom/geshi/klonec.php',\n 'sources_custom/geshi/klonecpp.php',\n 'sources_custom/geshi/latex.php',\n 'sources_custom/geshi/lisp.php',\n 'sources_custom/geshi/locobasic.php',\n 'sources_custom/geshi/logtalk.php',\n 'sources_custom/geshi/lolcode.php',\n 'sources_custom/geshi/lotusformulas.php',\n 'sources_custom/geshi/lotusscript.php',\n 'sources_custom/geshi/lscript.php',\n 'sources_custom/geshi/lsl2.php',\n 'sources_custom/geshi/lua.php',\n 'sources_custom/geshi/m68k.php',\n 'sources_custom/geshi/make.php',\n 'sources_custom/geshi/mapbasic.php',\n 'sources_custom/geshi/matlab.php',\n 'sources_custom/geshi/mirc.php',\n 'sources_custom/geshi/mmix.php',\n 'sources_custom/geshi/modula3.php',\n 'sources_custom/geshi/mpasm.php',\n 'sources_custom/geshi/mxml.php',\n 'sources_custom/geshi/mysql.php',\n 'sources_custom/geshi/newlisp.php',\n 'sources_custom/geshi/nsis.php',\n 'sources_custom/geshi/oberon2.php',\n 'sources_custom/geshi/objc.php',\n 'sources_custom/geshi/ocaml-brief.php',\n 'sources_custom/geshi/ocaml.php',\n 'sources_custom/geshi/oobas.php',\n 'sources_custom/geshi/oracle11.php',\n 'sources_custom/geshi/oracle8.php',\n 'sources_custom/geshi/pascal.php',\n 'sources_custom/geshi/per.php',\n 'sources_custom/geshi/perl.php',\n 'sources_custom/geshi/perl6.php',\n 'sources_custom/geshi/php-brief.php',\n 'sources_custom/geshi/php.php',\n 'sources_custom/geshi/pic16.php',\n 'sources_custom/geshi/pike.php',\n 'sources_custom/geshi/pixelbender.php',\n 'sources_custom/geshi/plsql.php',\n 'sources_custom/geshi/povray.php',\n 'sources_custom/geshi/powerbuilder.php',\n 'sources_custom/geshi/powershell.php',\n 'sources_custom/geshi/progress.php',\n 'sources_custom/geshi/prolog.php',\n 'sources_custom/geshi/properties.php',\n 'sources_custom/geshi/providex.php',\n 'sources_custom/geshi/purebasic.php',\n 'sources_custom/geshi/python.php',\n 'sources_custom/geshi/qbasic.php',\n 'sources_custom/geshi/rails.php',\n 'sources_custom/geshi/rebol.php',\n 'sources_custom/geshi/reg.php',\n 'sources_custom/geshi/robots.php',\n 'sources_custom/geshi/rsplus.php',\n 'sources_custom/geshi/ruby.php',\n 'sources_custom/geshi/sas.php',\n 'sources_custom/geshi/scala.php',\n 'sources_custom/geshi/scheme.php',\n 'sources_custom/geshi/scilab.php',\n 'sources_custom/geshi/sdlbasic.php',\n 'sources_custom/geshi/smalltalk.php',\n 'sources_custom/geshi/smarty.php',\n 'sources_custom/geshi/sql.php',\n 'sources_custom/geshi/systemverilog.php',\n 'sources_custom/geshi/tcl.php',\n 'sources_custom/geshi/teraterm.php',\n 'sources_custom/geshi/text.php',\n 'sources_custom/geshi/thinbasic.php',\n 'sources_custom/geshi/tsql.php',\n 'sources_custom/geshi/typoscript.php',\n 'sources_custom/geshi/vb.php',\n 'sources_custom/geshi/vbnet.php',\n 'sources_custom/geshi/verilog.php',\n 'sources_custom/geshi/vhdl.php',\n 'sources_custom/geshi/vim.php',\n 'sources_custom/geshi/visualfoxpro.php',\n 'sources_custom/geshi/visualprolog.php',\n 'sources_custom/geshi/whitespace.php',\n 'sources_custom/geshi/whois.php',\n 'sources_custom/geshi/winbatch.php',\n 'sources_custom/geshi/xml.php',\n 'sources_custom/geshi/xorg_conf.php',\n 'sources_custom/geshi/xpp.php',\n 'sources_custom/geshi/z80.php',\n 'sources_custom/geshi.php',\n 'sources_custom/geshi/.gitignore',\n 'sources_custom/geshi/6502acme.php',\n 'sources_custom/geshi/6502kickass.php',\n 'sources_custom/geshi/6502tasm.php',\n 'sources_custom/geshi/68000devpac.php',\n 'sources_custom/geshi/aimms.php',\n 'sources_custom/geshi/algol68.php',\n 'sources_custom/geshi/arm.php',\n 'sources_custom/geshi/asymptote.php',\n 'sources_custom/geshi/autoconf.php',\n 'sources_custom/geshi/bascomavr.php',\n 'sources_custom/geshi/c_loadrunner.php',\n 'sources_custom/geshi/c_winapi.php',\n 'sources_custom/geshi/chaiscript.php',\n 'sources_custom/geshi/chapel.php',\n 'sources_custom/geshi/coffeescript.php',\n 'sources_custom/geshi/cpp-winapi.php',\n 'sources_custom/geshi/dart.php',\n 'sources_custom/geshi/dcl.php',\n 'sources_custom/geshi/dcpu16.php',\n 'sources_custom/geshi/e.php',\n 'sources_custom/geshi/ecmascript.php',\n 'sources_custom/geshi/epc.php',\n 'sources_custom/geshi/euphoria.php',\n 'sources_custom/geshi/ezt.php',\n 'sources_custom/geshi/f1.php',\n 'sources_custom/geshi/falcon.php',\n 'sources_custom/geshi/freeswitch.php',\n 'sources_custom/geshi/genie.php',\n 'sources_custom/geshi/go.php',\n 'sources_custom/geshi/gwbasic.php',\n 'sources_custom/geshi/haxe.php',\n 'sources_custom/geshi/hicest.php',\n 'sources_custom/geshi/html5.php',\n 'sources_custom/geshi/icon.php',\n 'sources_custom/geshi/ispfpanel.php',\n 'sources_custom/geshi/j.php',\n 'sources_custom/geshi/jcl.php',\n 'sources_custom/geshi/lb.php',\n 'sources_custom/geshi/ldif.php',\n 'sources_custom/geshi/llvm.php',\n 'sources_custom/geshi/magiksf.php',\n 'sources_custom/geshi/modula2.php',\n 'sources_custom/geshi/nagios.php',\n 'sources_custom/geshi/netrexx.php',\n 'sources_custom/geshi/nginx.php',\n 'sources_custom/geshi/nimrod.php',\n 'sources_custom/geshi/objeck.php',\n 'sources_custom/geshi/octave.php',\n 'sources_custom/geshi/oorexx.php',\n 'sources_custom/geshi/oxygene.php',\n 'sources_custom/geshi/oz.php',\n 'sources_custom/geshi/parasail.php',\n 'sources_custom/geshi/parigp.php',\n 'sources_custom/geshi/pcre.php',\n 'sources_custom/geshi/pf.php',\n 'sources_custom/geshi/pli.php',\n 'sources_custom/geshi/postgresql.php',\n 'sources_custom/geshi/postscript.php',\n 'sources_custom/geshi/proftpd.php',\n 'sources_custom/geshi/pycon.php',\n 'sources_custom/geshi/pys60.php',\n 'sources_custom/geshi/q.php',\n 'sources_custom/geshi/qml.php',\n 'sources_custom/geshi/racket.php',\n 'sources_custom/geshi/rbs.php',\n 'sources_custom/geshi/rexx.php',\n 'sources_custom/geshi/rpmspec.php',\n 'sources_custom/geshi/rust.php',\n 'sources_custom/geshi/scl.php',\n 'sources_custom/geshi/spark.php',\n 'sources_custom/geshi/sparql.php',\n 'sources_custom/geshi/standardml.php',\n 'sources_custom/geshi/stonescript.php',\n 'sources_custom/geshi/unicon.php',\n 'sources_custom/geshi/upc.php',\n 'sources_custom/geshi/urbi.php',\n 'sources_custom/geshi/uscript.php',\n 'sources_custom/geshi/vala.php',\n 'sources_custom/geshi/vbscript.php',\n 'sources_custom/geshi/vedit.php',\n 'sources_custom/geshi/xbasic.php',\n 'sources_custom/geshi/yaml.php',\n 'sources_custom/geshi/zxbasic.php',\n );\n }", "function get_request_downloads_by_study($requestid,$surveyid)\n\t{\t\n\t\t$this->db->select('resources.*');\n\t\t$this->db->from('resources');\n\t\t$this->db->join('lic_file_downloads', 'resources.resource_id = lic_file_downloads.fileid');\n\t\t$this->db->where('resources.survey_id',$surveyid);\n\t\t$this->db->where('requestid',$requestid);\n\t\treturn $this->db->get()->result_array();\n\t}", "function get_study_collections($survey_id)\n\t{\n\t\t$this->db->select('survey_repos.repositoryid');\n\t\t$this->db->join('repositories', 'repositories.repositoryid = survey_repos.repositoryid','INNER');\n\t\t$this->db->where('survey_repos.sid',$survey_id);\n\t\t$this->db->where('repositories.group_da_licensed',1);\n\t\treturn $this->db->get('survey_repos')->result_array();\t\n\t}", "public function codes()\n {\n return $this->codes;\n }" ]
[ "0.59614277", "0.57636464", "0.5717427", "0.56496537", "0.5511665", "0.55101734", "0.5472879", "0.5426335", "0.5366338", "0.53287965", "0.53137535", "0.52982926", "0.527608", "0.5237054", "0.5195886", "0.51892173", "0.51892173", "0.5160485", "0.5155609", "0.5149754", "0.5125877", "0.51107347", "0.5104759", "0.51023734", "0.50371915", "0.503704", "0.5033681", "0.4998773", "0.49628916", "0.49503043" ]
0.65556
0
Deletes a given survey access code
function deleteSurveyCode($survey_code) { global $ilDB; if (strlen($survey_code) > 0) { $affectedRows = $ilDB->manipulateF("DELETE FROM svy_anonymous WHERE survey_fi = %s AND survey_key = %s", array('integer', 'text'), array($this->getSurveyId(), $survey_code) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Access_Code $access_Code)\n {\n //\n }", "public function delete_promocode(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_PATH);\n\t\t}else {\n\t\t\t$promocode_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $promocode_id);\n\t\t\t$this->promocodes_model->commonDelete(PROMOCODES,$condition);\n\t\t\t$this->setErrorMessage('success','Promocode deleted successfully');\n\t\t\tredirect(ADMIN_PATH.'/promocodes/display_promocodes');\n\t\t}\n\t}", "public static function delete($access_id) { \n\n\t\t$sql = \"DELETE FROM `access_list` WHERE `id`='\" . Dba::escape($access_id) . \"'\";\n\t\t$db_results = Dba::query($sql);\n\n\t}", "function deleteAbonne($code) {\n global $serv;\n $req = \"DELETE FROM abonnes WHERE Code = '$code';\";\n $res = db_execSQL($req,$serv);\n }", "public static function deleteSite($code) {\n\t\t\\core\\Core::$db->exec('DELETE FROM \"ark_site\" WHERE si_code=?', array((string)$code));\n\t}", "public function deleteRoleAccess()\n\t{\n\t\t$RoleAccessID = $this->input->post('RoleAccessID');\n\t\t$RoleAccessData = $this->system_structure_m->deleteRoleAccess($RoleAccessID);\n\t\techo $RoleAccessData;\n\t}", "public function deleteFromCode($code)\n {\n return parent::deleteFromCode($code);\n }", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "public function delOrgInfo($code) \n {\n $this->db->where(\"UPPER(toh_org_code) = UPPER('$code')\");\n return $this->db->delete('ims_hris.training_organizer_head');\n }", "function delete($code_zone)\n {\n $req = 'DELETE FROM ' . self::TABLE . ' WHERE ' . self::CODE_ZONE . '= :code_zone';\n $param = Array(\n ':code_zone' => $code_zone\n );\n\n return $this->execute($req, $param);\n }", "public function delete()\n{//delete\n $sql = \"DELETE FROM pefs_database.pef_assessor WHERE ase_id = ?\";\n $this->db->query($sql,array($this->ase_id)); \n}", "public function deleteAnswers($question_id)\n\t{\n\t}", "function delete_question() {\r\n global $db;\r\n\r\n // get global user object\r\n global $user;\r\n\r\n // protect from unauthorized access\r\n if (!isset($user) || (!isset($_SESSION['session_survey']))) {\r\n logout();\r\n die();\r\n }\r\n\r\n $question = new Question();\r\n $question->get_from_db($_GET['question_id']);\r\n $survey = new Survey();\r\n $survey->get_from_db($question->getSurvey());\r\n\r\n if ($survey->getCreatedBy() != $user->getId()) {\r\n if ($user->getAdmin() != 1) {\r\n logout();\r\n die();\r\n }\r\n }\r\n\r\n $question->setIsActive(0);\r\n $question->update_in_db();\r\n\r\n $cookie_key = 'msg';\r\n $cookie_value = 'Вие успешно изтрихте елемент от анкетата!';\r\n setcookie($cookie_key, $cookie_value, time() + 1);\r\n header('Location: ' . ROOT_DIR . '?page=survey_edit');\r\n die();\r\n}", "public function actionDelete($reading_date, $access_code)\n {\n $this->findModel($reading_date, $access_code)->delete();\n\n return $this->redirect(['index']);\n }", "public function EliminarArqueoCaja()\n{\n\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\t$sql = \" delete from arqueocaja where codarqueo = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codarqueo);\n\t\t$codarqueo = base64_decode($_GET[\"codarqueo\"]);\n\t\t$stmt->execute();\n\n\t\theader(\"Location: arqueoscajas?mesage=1\");\n\t\texit;\n\n\t} else {\n\n\t\theader(\"Location: arqueoscajas?mesage=2\");\n\t\texit;\n\t}\n\n}", "public function delete_dyslexia($dyslexia_id)\n\t{\n\t\t$this->db->delete('dyslexia', array('id' => $dyslexia_id));\n\t}", "function delete_permission() {\n\t\t$this->db->where('permission_id', $_POST['id']);\n\t\t$this->db->delete('system_security.permission');\n\t\techo \"{error: '',msg: '\" . sprintf(lang('success_delete'), 'permission') . \"'}\";\n\t\t\n }", "public function deleteAnnonce(){\n $db = $this->getPDO();\n $sql = \"DELETE FROM annonces WHERE id_annonce = ?\";\n\n $stmt = $db->prepare($sql);\n $this->id_annonce = $_GET['id_suppr'];\n $stmt->bindParam(1, $this->id_annonce);\n\n $delete = $stmt->execute();\n\n return $delete;\n }", "public function delete($code)\n {\n $this->_bootstrap();\n \n $resTable = Mage::getSingleton('core/resource')->getTableName('core/resource');\n $read = Mage::getSingleton('core/resource')->getConnection('core_read');\n $write = Mage::getSingleton('core/resource')->getConnection('core_write');\n \n $select = $read->select()->from($resTable, array('code', 'version', 'data_version'));\n $select->where('code = ?', $code);\n $resourceCollection = $read->fetchAll($select);\n if (count($resourceCollection) === 0) {\n throw new Exception(\n \"This resource does not exist in the core_resource table. \n Try running zf show mage-core-resource to find the correct name.\"\n );\n }\n \n $write->delete($resTable, \"code = '{$code}'\");\n $write->closeConnection();\n $this->_response->appendContent(\n \"Core Resource {$code} deleted successfully\",\n array('color' => array('green'))\n );\n }", "public function testDeleteSurvey0()\n {\n }", "public function testDeleteSurvey0()\n {\n }", "public function delete($id)\n {\n $this->db->where('id',$id);\n return $this->db->delete('user_survey_answer');\n }", "public function testDeleteSurvey()\n {\n $survey = Survey::factory()->create();\n $surveyId = $survey->id;\n\n $response = $this->json('DELETE', \"survey/{$surveyId}\");\n\n $response->assertStatus(204);\n $this->assertDatabaseMissing('survey', ['id' => $surveyId]);\n }", "private function deleteProject() {\r\n $this->clientOwnsProject();\r\n\r\n $q = $this->db->select('code')\r\n ->from('landingpage_collection')\r\n ->where('landingpage_collectionid', $this->project)\r\n ->get();\r\n $code = $q->row()->code;\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('mvt_level_to_page');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('mvt_level');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('mvt_factor');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('collection_goals');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('collection_goal_conversions');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('page_group');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('landing_page');\r\n\r\n $this->db->where('landingpage_collectionid', $this->project)\r\n ->delete('landingpage_collection');\r\n\r\n $this->syncCollectionGoals();\r\n $this->optimisation->flushCollectionCacheByCode($code);\r\n return $this->successResponse(200);\r\n }", "public function deleteQuiz($quizname){\n\t\treturn $this->db->deleteQuiz($quizname);\n\t}", "public function delete($positionCode)\n {\n DB::table('position_responsibilities')->where('position_code', $positionCode)->delete();\n }", "public function delete_question(){\n $question_id = $this->input->post('question_id');\n $challenge_id = $this->input->post('challenge_id');\n\n $question = new stdClass();\n\n if($this->questionlib->isSafeToDelete($question_id) === true){\n $question->question_id = $question_id;\n\n $this->question_model->delete($question);\n $this->challenge_question_model->delete($challenge_id, $question_id);\n $out['deleted'] = true;\n }else{\n $out['message'] = \"Question have associate data, it can't be deleted\";\n }\n $this->output->set_output(json_encode($out));\n\n }", "function delete_question($id){\n $this->db->where('question_id', $id);\n $this->db->delete('questions');\n }", "function index_delete() {\n $id_diagnosa = $this->delete('id_diagnosa');\n $this->db->where('id_diagnosa', $id_diagnosa);\n $delete = $this->db->delete('diagnosa');\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }", "public function delete($GUN_BBL_CODE);" ]
[ "0.6809143", "0.65443575", "0.61962664", "0.61593133", "0.61061937", "0.6067653", "0.6018491", "0.5998886", "0.59896755", "0.59327453", "0.5891552", "0.5851584", "0.58498985", "0.58428633", "0.58424604", "0.58258533", "0.57565844", "0.57265663", "0.5723714", "0.5714792", "0.5714792", "0.5675146", "0.56640655", "0.5662639", "0.56555027", "0.56336874", "0.56163746", "0.5607965", "0.5588788", "0.55837005" ]
0.76072896
0
Returns a survey access code that was saved for a registered user
function getUserAccessCode($user_id) { global $ilDB; $access_code = ""; $result = $ilDB->queryF("SELECT survey_key FROM svy_anonymous WHERE survey_fi = %s AND user_key = %s", array('integer','text'), array($this->getSurveyId(), md5($user_id)) ); if ($result->numRows()) { $row = $ilDB->fetchAssoc($result); $access_code = $row["survey_key"]; } return $access_code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveUserAccessCode($user_id, $access_code)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// not really sure what to do about ANONYMOUS_USER_ID\n\t\t\n\t\t$next_id = $ilDB->nextId('svy_anonymous');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_anonymous (anonymous_id, survey_key, survey_fi, user_key, tstamp) \".\n\t\t\t\"VALUES (%s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text', 'integer', 'text', 'integer'),\n\t\t\tarray($next_id, $access_code, $this->getSurveyId(), md5($user_id), time())\n\t\t);\n\t}", "function createNewAccessCode()\n\t{\n\t\t// create a 5 character code\n\t\t$codestring = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\t\tmt_srand();\n\t\t$code = \"\";\n\t\tfor ($i = 1; $i <=5; $i++)\n\t\t{\n\t\t\t$index = mt_rand(0, strlen($codestring)-1);\n\t\t\t$code .= substr($codestring, $index, 1);\n\t\t}\n\t\t// verify it against the database\n\t\twhile (!$this->isSurveyCodeUnique($code))\n\t\t{\n\t\t\t$code = $this->createNewAccessCode();\n\t\t}\n\t\treturn $code;\n\t}", "function saveGeneral($user){\n\t\t$this->db->insert('tbl_complaints_general_examinations', $user);\n\t\treturn $this->db->insert_id();\n\t}", "public function getUserCode()\n {\n return $this->userCode;\n }", "public function getUserCode(){\n\t\t/* return user code */\n\t\treturn $this->_intUserCode;\n\t}", "function getActiveID($user_id, $anonymize_id, $appr_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t// see self::isSurveyStarted()\n\t\t\n\t\t// #15031 - should not matter if code was used by registered or anonymous (each code must be unique)\n\t\tif($anonymize_id)\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','text','integer'),\n\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\t\t\t\n\t\t\treturn $row[\"finished_id\"];\n\t\t}\t\n\n\t\t/*\n\t\tif ($this->getAnonymize())\n\t\t{\n\t\t\tif ((($user_id != ANONYMOUS_USER_ID) && (strlen($anonymize_id) == 0)) && (!($this->isAccessibleWithoutCode() && $this->isAllowedToTakeMultipleSurveys())))\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished\".\n\t\t\t\t\t\" WHERE survey_fi = %s AND anonymous_id = %s AND appr_id = %s\",\n\t\t\t\t\tarray('integer','text','integer'),\n\t\t\t\t\tarray($this->getSurveyId(), $anonymize_id, $appr_id)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT finished_id FROM svy_finished\".\n\t\t\t\t\" WHERE survey_fi = %s AND user_fi = %s AND appr_id = %s\",\n\t\t\t\tarray('integer','integer','integer'),\n\t\t\t\tarray($this->getSurveyId(), $user_id, $appr_id)\n\t\t\t);\n\t\t}\n\t\tif ($result->numRows() == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\treturn $row[\"finished_id\"];\n\t\t}\t\t \n\t\t*/\n\t}", "public function getUsercode()\n {\n return $this->usercode;\n }", "function get_usercode( $partnerUserID ) {\n\t\t$this->request = new Polldaddy_Access( array(\n\t\t\t// 'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( null, array( 'id' => __FUNCTION__ ) ) ) )\n\t\t\t'demands' => new Polldaddy_Demands( array( 'demand' => new Polldaddy_Demand( null, array( 'id' => 'getusercode' ) ) ) )\n\t\t), array(\n\t\t\t'partnerGUID' => $this->partnerGUID,\n\t\t\t'partnerUserID' => $partnerUserID\n\t\t) );\n\t\t$this->send_request();\n\t\tif ( isset( $this->response->userCode ) ) {\n\t\t\treturn $this->response->userCode;\n\t\t}\n\t\treturn false;\n\t}", "public function getAccountCode();", "public function getAccountCode();", "public function getCode()\n {\n if($this->request->getQuery()->offsetExists($this->options->stage1->state->accessKey)) {\n $code = $this->getCodeFromRequest();\n if(is_string($code)) {\n return $code;\n }\n }\n return $this->getCodeFromVendor();\n }", "public function getUserAnswer() : string {\n return $this->_userAnswer;\n }", "public function getCode()\n {\n return $this->isSuccessful() ? $this->data[\"AuthCode\"] : parent::getCode();\n }", "public function assignUser()\n {\n $user = User::find(request()['user_id']);\n\n $user->survey_id = request()['survey_id'];\n\n $user->save();\n\n return ['message' => 'survey assigned succefully'];\n }", "public function code_verification($user_id)\n {\n return view('auth.code_verification')->with('user_id',$user_id);\n }", "protected function getCode()\n {\n return $this->request->input('code');\n }", "protected function getCode()\n {\n return $this->request->input('code');\n }", "public function retrieveUserCode($client_id, $client_secret, $user_code)\n {\n $post_data = array(\n 'client_id' => $client_id,\n 'client_secret' => $client_secret,\n 'user_code' => $user_code\n );\n return $this->startAnonymous()->uri(\"/oauth2/device/user-code\")\n ->bodyHandler(new FormDataBodyHandler($post_data))\n ->get()\n ->go();\n }", "public function oauthGenerateVerificationCode()\n {\n return substr(md5(rand()), 0, 6);\n }", "protected function getAccessCode()\n {\n return $_GET[self::RESPONSE_CODE_PARAM];\n }", "public function saveAction()\n {\n $user = Mage::getSingleton('admin/session')->getUser(); \n $post_data = $this->getRequest()->getPost();\n\n try {\n $survey = Mage::getModel('client/survey')->loadSurveyByEmail($user->getEmail());\n if ($survey->getId()) $post_data['id'] = $survey->getId();\n\n $survey->setData($post_data);\n $survey->setName($user->getName());\n $survey->setEmail($user->getEmail());\n\n $survey->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('client')->__('Survey was successfully saved. Thank you!'));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*/');\n }", "protected function getAuthorizationCode()\n {\n $code = null;\n if ($this->responseMode === 'query' && isset($_GET['code'])) {\n $code = $_GET['code'];\n } else if ($this->responseMode === 'form_post' && isset($_POST['code'])) {\n $code = $_POST['code'];\n }\n\n return $code;\n }", "public function retrieveUserCodeUsingAPIKey($user_code)\n {\n $post_data = array(\n 'user_code' => $user_code\n );\n return $this->startAnonymous()->uri(\"/oauth2/device/user-code\")\n ->bodyHandler(new FormDataBodyHandler($post_data))\n ->get()\n ->go();\n }", "public function getTwoStepVerificationCode();", "public function getOauthCode()\n {\n $date = new \\DateTime();\n return $date->getTimestamp();\n }", "public function getCodeAttribute()\n {\n $auth_user = Auth::user();\n\n return $auth_user && $auth_user->id === $this->seller_id ? decrypt($this->confirmation_code) : null;\n }", "public function getProtectCode();", "public function getUserActivationCode() {\n\t\treturn $this->userActivationCode;\n\t}", "public function getCode()\n {\n return $this->__get(\"code\");\n }", "abstract public function getPaymentAuthorizationCode();" ]
[ "0.6434415", "0.6176998", "0.57541215", "0.56501913", "0.5640144", "0.5596999", "0.55414224", "0.5520321", "0.53998405", "0.53998405", "0.5351253", "0.532095", "0.53086966", "0.52719206", "0.5268595", "0.5239394", "0.5239394", "0.5223659", "0.5220092", "0.52163416", "0.52142906", "0.5142618", "0.5139471", "0.51166946", "0.5075664", "0.50700486", "0.506814", "0.5052341", "0.5040319", "0.503378" ]
0.70388883
0
Saves a survey access code for a registered user to the database
function saveUserAccessCode($user_id, $access_code) { global $ilDB; // not really sure what to do about ANONYMOUS_USER_ID $next_id = $ilDB->nextId('svy_anonymous'); $affectedRows = $ilDB->manipulateF("INSERT INTO svy_anonymous (anonymous_id, survey_key, survey_fi, user_key, tstamp) ". "VALUES (%s, %s, %s, %s, %s)", array('integer','text', 'integer', 'text', 'integer'), array($next_id, $access_code, $this->getSurveyId(), md5($user_id), time()) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveAction()\n {\n $user = Mage::getSingleton('admin/session')->getUser(); \n $post_data = $this->getRequest()->getPost();\n\n try {\n $survey = Mage::getModel('client/survey')->loadSurveyByEmail($user->getEmail());\n if ($survey->getId()) $post_data['id'] = $survey->getId();\n\n $survey->setData($post_data);\n $survey->setName($user->getName());\n $survey->setEmail($user->getEmail());\n\n $survey->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('client')->__('Survey was successfully saved. Thank you!'));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n\n $this->_redirect('*/*/');\n }", "function saveWriterQuiz(){\r\n if (isset($_SESSION['subject']) && isset($_SESSION['quiznum']) && isset($_SESSION['save'])){\r\n $user=$_SESSION['user']; \r\n $quizID=$_SESSION['subject'].$_SESSION['quiznum'] ;\r\n $score=$_SESSION[\"save\"];\r\n $sql=\"UPDATE quiz SET $quizID = $score WHERE uniqueID='\".$user->getUID().\"'\";\r\n write($sql,1);\r\n }\r\n }", "public function assignUser()\n {\n $user = User::find(request()['user_id']);\n\n $user->survey_id = request()['survey_id'];\n\n $user->save();\n\n return ['message' => 'survey assigned succefully'];\n }", "function createNewAccessCode()\n\t{\n\t\t// create a 5 character code\n\t\t$codestring = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\t\tmt_srand();\n\t\t$code = \"\";\n\t\tfor ($i = 1; $i <=5; $i++)\n\t\t{\n\t\t\t$index = mt_rand(0, strlen($codestring)-1);\n\t\t\t$code .= substr($codestring, $index, 1);\n\t\t}\n\t\t// verify it against the database\n\t\twhile (!$this->isSurveyCodeUnique($code))\n\t\t{\n\t\t\t$code = $this->createNewAccessCode();\n\t\t}\n\t\treturn $code;\n\t}", "function saveGeneral($user){\n\t\t$this->db->insert('tbl_complaints_general_examinations', $user);\n\t\treturn $this->db->insert_id();\n\t}", "public function save($name, $code);", "public function saveAction()\n {\n // TODO: Implement saveAction() method.\n\n $code = $this->getRequest()['verify_code'];\n\n var_dump($code);\n var_dump($this->getVerifyProvider()->check($code));\n\n }", "public function save()\n {\n parent::save();\n\n // make sure that we are auditing this phase's survey\n $this->ensure_auditing();\n }", "public function saveAnswerByQuestion($data)\n\t{\n\t\t$this->db->insert('pergunta_jogador', array(\n\t\t\t'id_pergunta' => $data['id_pergunta'],\n\t\t\t'id_resposta' => $data['id_resposta'],\n\t\t\t'id_usuario' => $data['id_usuario'],\n\t\t\t'id_jogo' => $data['id_jogo']\n\t\t));\n\t}", "function saveQRCOdeforUser($clientid,$qrCodeToken)\n{\n\tdate_default_timezone_set('UTC');\n\t$updatedAt=date('Y-m-d H:i:s');\n\t$qry=\"UPDATE entrp_login SET qrCode='\".$qrCodeToken.\"',qrCodeUpdatedDateTime='\".$updatedAt.\"' WHERE clientid=\".$clientid.\" \";\n\tsetData($qry);\n}", "public function store_survey_post()\n\t\t{\n\t\t\t$clickValue = $this->post('clickValue');\n\t\t\t$optionId = $this->post('optionId');\n\t\t\t$uuid = $this->post('uuid');\n\t\t\t$weekSend = $this->post('weekSend');\n\t\t\tif(!empty($clickValue) &&\n\t\t\t\t!empty($optionId) &&\n\t\t\t\t!empty($uuid) &&\n\t\t\t\t!empty($weekSend)\n\t\t\t)\n\t\t\t{\n\t\t\t\t$insertData = array(\n\t\t\t\t\t'tans_opt_id' => $optionId,\n\t\t\t\t\t'tans_uuid' => $uuid,\n\t\t\t\t\t'tans_week' => $weekSend,\n\t\t\t\t\t'trans_survey_value' => $clickValue\n\t\t\t\t);\n\t\t\t\t$tempStatus = $this->Student_survey_model->storeStudentSurvey($insertData);\n\t\t\t\tif($tempStatus)\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('SUCCESS');\n\t\t\t\t\t$data['message'] = $this->lang->line('VALID_TOKEN_MESSAGE');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t\t$data['message'] = $this->lang->line('unable_save_answer');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['status'] = $this->lang->line('FAIL');\n\t\t\t\t$data['message'] = $this->lang->line('please_pass_required');\n\t\t\t}\n\t\t\t$this->response($data , 200);\n\t\t}", "public function store(Request $request)\n {\n $permitted_chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n function generate_string($input, $strength = 16) {\n $input_length = strlen($input);\n $random_string = '';\n for($i = 0; $i < $strength; $i++) {\n $random_character = $input[mt_rand(0, $input_length - 1)];\n $random_string .= $random_character;\n }\n\n return $random_string;\n }\n\n\n $students = Student::all();\n foreach ($students as $student)\n {\n if ($student->debit >= $student->credit)\n {\n $examcode = new ExamCode;\n $examcode->student_id = $student->id;\n $gen_code = generate_string($permitted_chars, 7).date('Y');\n $examcode->code = $gen_code;\n $examcode->save();\n }\n\n }\n\n return redirect('/finance')->with('success', 'Examination codes generated');\n\n }", "function saveMyAnswer($connection,$questionId,$answerIdToSave,$userId,$userRole){\n $query = \"INSERT INTO forum_answer_saves SET q_id='$questionId',ansId='$answerIdToSave', saved_by='$userId',savedByUser='$userRole',date_time=now()\";\n $saveAnswer = $connection->query($query) or die(\"Error in saveing:\".$connection->error);\n if ($saveAnswer){\n return $saveAnswer;\n }\n }", "function save() {\n $data = array(\"soal\" => $this->soal, \"kunci_jawaban\" => $this->kunci_jawaban, \"a\" => $this->a, \"b\" => $this->b, \"c\" => $this->c, \"d\" => $this->d, \"dibuat\" => $this->dibuat, \"id_users\" => $this->id_users, \"id_data\" => $this->id_data);\n return $this->CI->db->insert(\"data_quiz\", $data);\n }", "public function save()\n\t{\n\t\tvalidateToken('admin-ssc');\n\n\t\t$this->adapter->save();\n\t}", "function saveUserSurvey() {\n $result = array(); // an array to hold the survey results\n if (!$this->Session->check('Survey.respondent')) {\n die('No respondent ID');\n } else {\n $respondentid = $this->Session->read('Survey.respondent');\n $i = $this->Survey->Respondent->find('count', array(\n 'conditions' => array('Respondent.id' => $respondentid)\n ));\n if ($i !== 1) {\n die('Respondent not valid'.$i.' rid '.$respondentid);\n }\n }\n $data = array('Response' => array()); // a blank array to build our data for saving\n $answers = ($this->Session->check('Survey.answers')) ? $this->Session->read('Survey.answers') : array(); // get the answers to the questions\n $gdta = ($this->Session->check('Survey.hierarcy')) ? $this->Session->read('Survey.hierarcy') : array(); // the hierarchy from the session\n $mainGoal = ($this->Session->check('Survey.mainGoal')) ? $this->Session->read('Survey.mainGoal') : ''; // the main goal from the session\n $started = ($this->Session->check('Survey.started')) ? $this->Session->read('Survey.started') : ''; // the start time from the session\n $finished = date(\"Y-m-d H:i:s\"); // get the time that the survey was finished in MySQL DATETIME format\n $data['Response']['maingoal'] = $mainGoal;\n $data['Response']['respondent_id'] = $respondentid;\n $data['Response']['started'] = $started;\n $data['Response']['finished'] = $finished;\n $data['Answer'] = $this->Survey->Question->formatAnswersForSave($answers);\n $data['Objective'] = $gdta;\n $this->Survey->Respondent->Response->save($data);\n $data['Response']['id'] = $this->Survey->Respondent->Response->id;\n $this->Survey->Respondent->Response->saveAssociated($data,array('deep' => true));\n $this->__clearEditSession(CLEAR_SURVEY); // delete the temporary session values associated with the survey\n $this->render('/Pages/completed', 'survey');\n }", "function getUserAccessCode($user_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$access_code = \"\";\n\t\t$result = $ilDB->queryF(\"SELECT survey_key FROM svy_anonymous WHERE survey_fi = %s AND user_key = %s\",\n\t\t\tarray('integer','text'),\n\t\t\tarray($this->getSurveyId(), md5($user_id))\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t$access_code = $row[\"survey_key\"];\n\t\t}\n\t\treturn $access_code;\n\t}", "function saveSurveyOneToSession(){\n $_SESSION['fullName'] = $_POST['fullName'];\n $_SESSION['age'] = $_POST['age'];\n $_SESSION['student'] = $_POST['student'];\n}", "public function save()\n {\n $_SESSION['quiz'][$this->_testId] = serialize($this->_answers);\n }", "public function saveCodeToUser($code, $user, $days = 1, \\DateTime $start = null);", "function open_account_correction($data)\n\t{\n\t\t\t$this->db->insert('pamm_accounts_correction',$data);\n\t}", "function save_session_quiz(){\n\t\t\n\t\t$data['pid']\t \t= \t$this->input->post('pid');\n\t\t$data['sid']\t \t= \t$this->input->post('sid');\n\t\t$data['qid']\t \t= \t$this->input->post('qid');\n\t\t$data['tid']\t \t= \t$this->input->post('tid');\n\t\t$data['question_id']\t= \t$this->input->post('question_id');\n\t\t$data['answer']\t \t= \t$this->input->post('question');\n\t\t\n\t\t$result = $this->user_model->save_session_quiz($this->strip_slashes($data));\n\t\t$this->session->set_flashdata('alert_message','<div class=\"alert alert-success\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" style=\"top: 3px;\"><i class=\"icon-remove-sign\"></i></button><strong>Quiz Saved!</strong><br/>Your answers have been successfully saved.</div>');\n\t\tredirect(\"main/user/homeworks/\".$data['pid']);\n\t\n\t}", "public function store()\n\t{\n\n if(! User::isValid(Input::all())){\n return Redirect::to('/failed');\n }\n\n $accesscode = Str::random(60);\n User::create([\n 'email' => Input::get('email'),\n 'password' => Hash::make(Input::get('password')),\n 'gender' => Input::get('gender'),\n 'accesscode' => $accesscode,\n 'verified' => '0'\n ]);\n\n $email_data = array(\n 'recipient' => Input::get('email'),\n 'subject' => 'Share-A-Meal: Verification Code'\n );\n $view_data = [\n 'accesscode' => $accesscode\n ];\n\n Mail::send('emails.verify', $view_data, function($message) use ($email_data) {\n $message->to( $email_data['recipient'] )\n ->subject( $email_data['subject'] );\n });\n\n Session::push('email' , Input::get('email'));\n return Redirect::to('/verify');\n\t}", "public function saveAccreditationAction()\n {\n $site_id = $this->_getParam(\"site_id\");\n $site = \\Fisdap\\EntityUtils::getEntity(\"SiteLegacy\", $site_id);\n $form_data = $this->_getParam(\"form_data\");\n \n $form = new Account_Form_Accreditation($site);\n \n $process_result = $form->process($form_data);\n \n if ($process_result['success'] === true) {\n $success = \"true\";\n $html_res = \"<div class='success'>Your accreditation info has been saved.</div>\";\n } else {\n $errors = $this->formatFormErrors($process_result);\n $success = \"false\";\n $html_res = $errors['html'];\n }\n \n $this->_helper->json(array(\"success\" => $success, \"result\" => $html_res, \"form_elements_with_errors\" => $errors['elements']));\n }", "public function save()\n\t{\n\t\thelper('text');\n\t\t$request = $this->request->getPost();\n\t\t$code = random_string();\n\t\t$this->_slicing($request);\n\n\t\t$data = [\n\t\t\t'code' => $code\n\t\t];\n\t\treturn $this->response->setJSON($data);\n\n\t}", "static function saveAnswer ($form_data, $answer)\n {\n global $core;\n \n /* For now, the answers are serialized under a JSON format, to\n * reduce the amount of rows in the database, we will see later\n * if it is a good idea\n */\n \n $bundle = json_encode($answer);\n\t\t$id = 0;\n\t\t$db =& $core->con;\n\t\t$dataSet = $db->openCursor(DC_DBPREFIX . 'mj_storage');\n\t\t\n\t\t// Look for the last form ID\n\t\t$res = $db->select('SELECT MAX(answer_id) as lastid FROM ' . DC_DBPREFIX . self::$table_name .\n ' WHERE form_id = ' . ((int) $form_data->form_id) . ';');\n\n\t\tif (!$res->isEmpty()) {\n\t\t\t// We use the next id, which should be available\n\t\t\t$id = $res->lastid + 1;\n\t\t}\n\n\t\t$dataSet->form_id = $form_data->form_id;\n\t\t$dataSet->answer_id = $id;\n\t\t$dataSet->answer = $bundle;\n\t\treturn $dataSet->insert();\t\t\n }", "public function save(){\n\t\t// yei bata feri \"index.php\" ma falne jun chai profile ma jancha\n\t\t$req = new Requirement();\n\n\t\tif(isset($_POST['title'])){\n\t\t$req->setTitle($_POST['title']);\n\t\t}else{\n\t\t\t$req->setTitle(\"\");\n\t\t}\n\t\tif(isset($_POST['date'])){\n\n\t\t$req->setDate($_POST['date']);\n\t\t}else{\n\t\t\t$req->setDate(\"01-01-2001\");\n\t\t}\n\t\tif(isset($_POST['details'])){\n\t\t$req->setDescription($_POST['details']);\n\t\t}else{\n\t\t\t$req->setDescription(\"\");\n\t\t}\n\t\t$req->setStatus(1);\n\t\t$req->setOrgname(\"\");\n\t\t$this->requirement_repository->insert($req);\n\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'client_id' => 'required',\n ]);\n\n $date = date('Y-m-d');\n \n if(Access_Code::whereRaw(\"client_id='$request->client_id' AND DATE(expires_at) >= '$date'\")->get()->count() > 0){\n return response()->json([\n 'error' => true,\n 'message' => \"A valid access token exists for this client\"\n ]);\n }\n\n $access_code = new Access_Code();\n\n $access_code->client_id = $request->client_id;\n $access_code->access_code = $this->generateCode(24);\n\n $client = Client::findOrFail($request->client_id);\n $access_code->expires_at = date('Y-m-d', strtotime($client->end_date));\n\n if($access_code->save()){\n return response()->json([\n 'error' => false,\n 'data' => $access_code,\n 'message' => 'Access code generated successfully'\n ]);\n }else{\n return response()->json([\n 'error' => true,\n 'message' => 'Error generating access code'\n ]);\n }\n }", "public function save() {\r\n $data = array(\r\n 'CatagoryName' => $this->CatagoryName,\r\n 'Days' => $this->Days,\r\n 'PaidUnpaid' => $this->PaidUnpaid,\r\n 'ShorfForm' => $this->ShorfForm\r\n ); \r\n $this->db->insert('tbl_leave_catagory', $data);\r\n }", "function save_client(){\n//include connection.php\ninclude \"connection.php\";\t\n\n//fetch the data from the POST (array)\n$rowdata=$_POST['data'];\n$fullname=$rowdata[0]; //fetch index 0\n$phone=$rowdata[1];//fetch index 1\n$address=$rowdata[2];//fetch index 2\n$email=$rowdata[3];//fetch index 3\n$username=$rowdata[4];//fetch index 4\n$password=password_hash($rowdata[5],PASSWORD_DEFAULT);//fetch index 5\n$date=date(\"Y\").\"-\".date(\"m\").\"-\".date(\"d\");\n//create a query\n$query=\"INSERT INTO tblusers(fullname,phoneno,useraddress,\nuseremail,username,userpass,usertype,registereddate)\n VALUES('$fullname','$phone','$address','$email',\n'$username','$password','client','$date')\";\n//execute the query\t\n if(mysqli_query($db,$query)){\n\techo \"Registration Successful\";\t\n }\n else{\n\techo mysqli_error($db); \n }\n}" ]
[ "0.6711799", "0.5975437", "0.59217894", "0.58084315", "0.57464164", "0.5666164", "0.5632636", "0.5584012", "0.5583575", "0.550554", "0.54844666", "0.5476207", "0.54748577", "0.54748034", "0.54588914", "0.54475576", "0.5420501", "0.5398031", "0.5381151", "0.5378758", "0.53730965", "0.5340781", "0.53355974", "0.5258105", "0.52359915", "0.52280164", "0.5224864", "0.52207756", "0.5215123", "0.52136236" ]
0.7443843
0
Returns a new, unused survey access code
function createNewAccessCode() { // create a 5 character code $codestring = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; mt_srand(); $code = ""; for ($i = 1; $i <=5; $i++) { $index = mt_rand(0, strlen($codestring)-1); $code .= substr($codestring, $index, 1); } // verify it against the database while (!$this->isSurveyCodeUnique($code)) { $code = $this->createNewAccessCode(); } return $code; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function createAccessCode($a_ass_id)\n\t{\n\t\tglobal $ilDB;\n\n\t\t$cp_id = self::lookupCertifiedProfessional($a_ass_id);\n\t\t$code = substr(ilUtil::randomhash(), 0, 6);\n\t\twhile (adnAssignment::codeUsed($cp_id, $code))\n\t\t{\n\t\t\t$code = substr(ilUtil::randomhash(), 0, 6);\n\t\t}\n\n\t\t$ilDB->manipulate(\"UPDATE adn_ep_assignment\".\n\t\t\t\" SET access_code = \".$ilDB->quote($code, \"text\").\n\t\t\t\" WHERE id = \".$ilDB->quote($a_ass_id, \"integer\"));\n\t}", "function customcert_generate_code() {\n global $DB;\n\n $uniquecodefound = false;\n $code = random_string(10);\n while (!$uniquecodefound) {\n if (!$DB->record_exists('customcert_issues', array('code' => $code))) {\n $uniquecodefound = true;\n } else {\n $code = random_string(10);\n }\n }\n\n return $code;\n}", "function getUserAccessCode($user_id)\n\t{\n\t\tglobal $ilDB;\n\t\t$access_code = \"\";\n\t\t$result = $ilDB->queryF(\"SELECT survey_key FROM svy_anonymous WHERE survey_fi = %s AND user_key = %s\",\n\t\t\tarray('integer','text'),\n\t\t\tarray($this->getSurveyId(), md5($user_id))\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\t$row = $ilDB->fetchAssoc($result);\n\t\t\t$access_code = $row[\"survey_key\"];\n\t\t}\n\t\treturn $access_code;\n\t}", "private function _getAnonymizationCodeUniversal() {\n if (!Mage::helper('itserv_analytics')->isIpAnonymizationEnabled()) {\n return '';\n }\n return \"ga('set', 'anonymizeIp', true);\";\n }", "function getUnusedCode()\n{\n $newcode = createLuhnCheckedRandomString(10);\n\n// while the new string exists, get a new code\n while (file_exists('results/' . $newcode . '-response.json')) {\n $newcode = createLuhnCheckedRandomString(10);\n }\n\n return $newcode;\n}", "function createCode() {\n\t\t/* New code. */\n\t\t$code = \"\";\n\t\t$codeAlphabet = \"1234567890\";\n\n\t\t$count = strlen($codeAlphabet) - 1;\n\t\t\n\t\tfor($i=0;$i<5;$i++){\n\t\t\t$code .= $codeAlphabet[rand(0,$count)];\n\t\t}\n\t\t/* First check if it exists or not. */\n\t\t$commentCheck = $this->getCode($code);\n\t\t\n\t\tif($commentCheck) {\n\t\t\t/* It exists. check again. */\n\t\t\t$this->createCode();\n\t\t} else {\n\t\t\treturn $code;\n\t\t}\n\t}", "static function getNewCode()\n {\n $code = null;\n while (true) {\n $code = \\User::make_password(8, false);\n if (!self::codeExists($code)) break;\n }\n return $code;\n }", "public function getNewAuthCode()\n {\n // TODO: Implement getNewAuthCode() method.\n }", "protected function _getSharingRandomCode()\n {\n return Mage::helper('core')->uniqHash();\n }", "protected function _defineCode()\n {\n return $this->setCode($this->getPoolModel()->setExcludedIds(self::$_alreadySelectedIds)->shift());\n }", "function secureCode($c = 0)\r\n{\r\n\tglobal $AVE_DB;\r\n\r\n\t$tdel = time() - 1200; // 20 Minuten\r\n\t$AVE_DB->Query(\"DELETE FROM \" . PREFIX . \"_antispam WHERE Ctime < \" . $tdel);\r\n\t$pass = '';\r\n\t$chars = array(\r\n\t\t'2','3','4','5','6','7','8','9',\r\n\t\t'A','B','C','D','E','F','G','H','J','K','M','N',\r\n\t\t'P','Q','R','S','T','U','V','W','X','Y','Z',\r\n\t\t'a','b','c','d','e','f','g','h','j','k','m','n',\r\n\t\t'p','q','r','s','t','u','v','w','x','y','z'\r\n\t);\r\n\t$ch = ($c!=0) ? $c : 7;\r\n\t$count = count($chars) - 1;\r\n\tsrand((double)microtime() * 1000000);\r\n\tfor ($i = 0; $i < $ch; $i++)\r\n\t{\r\n\t\t$pass .= $chars[rand(0, $count)];\r\n\t}\r\n\r\n\t$code = $pass;\r\n\t$sql = $AVE_DB->Query(\"\r\n\t\tINSERT\r\n\t\tINTO \" . PREFIX . \"_antispam\r\n\t\tSET\r\n\t\t\tId = '',\r\n\t\t\tCode = '\" . $code . \"',\r\n\t\t\tCtime = '\" . time() . \"'\r\n\t\");\r\n\t$codeid = $AVE_DB->InsertId();\r\n\r\n\treturn $codeid;\r\n}", "function deleteSurveyCode($survey_code)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif (strlen($survey_code) > 0)\n\t\t{\n\t\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_anonymous WHERE survey_fi = %s AND survey_key = %s\",\n\t\t\t\tarray('integer', 'text'),\n\t\t\t\tarray($this->getSurveyId(), $survey_code)\n\t\t\t);\n\t\t}\n\t}", "function alm_filters_sanitize_license( $new ) {\n \t$old = get_option( 'alm_filters_license_key' );\n \tif( $old && $old != $new ) {\n \t\tdelete_option( 'alm_filters_license_status' ); // new license has been entered, so must reactivate\n \t}\n \treturn $new;\n }", "function csrfCode(/*$forceNew*/ /*$ver_name*/){\n\tstatic $code='';\n\tif($_SESSION['ver']&&$code===$_SESSION['ver'])return $code;\n\t\n\treturn ($code=$_SESSION['ver']=genRandStr());\n}", "private static function generateUniqueCode()\n {\n do {\n $code = str_random(7);\n } while (static::checkCode($code));\n\n return $code;\n }", "function getRandomCode()\n\t\t{\n\t\t\tglobal $wpdb;\n\n\t\t\twhile(empty($code))\n\t\t\t{\n\n\t\t\t\t$scramble = md5(AUTH_KEY . current_time('timestamp') . SECURE_AUTH_KEY);\n\t\t\t\t$code = substr($scramble, 0, 10);\n\t\t\t\t$code = apply_filters(\"pmpro_random_code\", $code, $this);\t//filter\n\t\t\t\t$check = $wpdb->get_var(\"SELECT id FROM $wpdb->pmpro_membership_orders WHERE code = '$code' LIMIT 1\");\n\t\t\t\tif($check || is_numeric($code))\n\t\t\t\t\t$code = NULL;\n\t\t\t}\n\n\t\t\treturn strtoupper($code);\n\t\t}", "public function createVerificationCode()\n {\n return $code = random_int(config('twilio-verify.random_int.initial_value'), config('twilio-verify.random_int.final_value'));\n }", "public function getConsentUnknown()\r\n {\r\n return 'Unknown';\r\n }", "public function getConsentUnknown()\n {\n return 'Unknown';\n }", "function isAccessibleWithoutCode()\n\t{\n\t\treturn ($this->getAnonymize() == self::ANONYMIZE_OFF || \n\t\t\t$this->getAnonymize() == self::ANONYMIZE_FREEACCESS);\t\t\n\t}", "public function generateSharingCode()\n {\n $this->setSharingCode($this->_getSharingRandomCode());\n return $this;\n }", "public function oauthGenerateVerificationCode()\n {\n return substr(md5(rand()), 0, 6);\n }", "function access_denied() {\n\t\tif ( ! php_version_at_least( '4.1.0' ) ) {\n\t\t\tglobal $_SERVER;\n\t\t}\n\n\t\t// Si viene por webservice no necesita estar logueado.\n\t\tif($_POST['code']=='14149989'){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( ! auth_is_user_authenticated() ) {\n\t\t\t$p_return_page = string_url( $_SERVER['REQUEST_URI'] );\n\t\t\tprint_header_redirect( 'index.php?m=webtracking&a=login_page&return=' . $p_return_page );\n\t\t} else {\n\t\t\tglobal $AppUI;\n\t\t\t$AppUI->redirect(\"m=public&a=access_denied\");\n\t\t\t\n\t\t\t/*\n\t\t\tprint '<center>';\n\t\t\tprint '<p>'.error_string(ERROR_ACCESS_DENIED).'</p>';\n\t\t\tprint_bracket_link( 'index.php?m=webtracking&a=main_page', lang_get( 'proceed' ) );\n\t\t\tprint '</center>';*/\n\t\t}\n\t\texit;\n\t}", "function saveUserAccessCode($user_id, $access_code)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// not really sure what to do about ANONYMOUS_USER_ID\n\t\t\n\t\t$next_id = $ilDB->nextId('svy_anonymous');\n\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_anonymous (anonymous_id, survey_key, survey_fi, user_key, tstamp) \".\n\t\t\t\"VALUES (%s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','text', 'integer', 'text', 'integer'),\n\t\t\tarray($next_id, $access_code, $this->getSurveyId(), md5($user_id), time())\n\t\t);\n\t}", "function questionnaire_add_instance($questionnaire) {\n // (defined by the form in mod.html) this function\n // will create a new instance and return the id number\n // of the new instance.\n global $COURSE, $DB, $CFG;\n require_once($CFG->dirroot.'/mod/questionnaire/questionnaire.class.php');\n require_once($CFG->dirroot.'/mod/questionnaire/locallib.php');\n\n // Check the realm and set it to the survey if it's set.\n\n if (empty($questionnaire->sid)) {\n // Create a new survey.\n $cm = new Object();\n $qobject = new questionnaire(0, $questionnaire, $COURSE, $cm);\n\n if ($questionnaire->create == 'new-0') {\n $sdata = new Object();\n $sdata->name = $questionnaire->name;\n $sdata->realm = 'private';\n $sdata->title = $questionnaire->name;\n $sdata->subtitle = '';\n $sdata->info = '';\n $sdata->theme = ''; // Theme is deprecated.\n $sdata->thanks_page = '';\n $sdata->thank_head = '';\n $sdata->thank_body = '';\n $sdata->email = '';\n $sdata->owner = $COURSE->id;\n if (!($sid = $qobject->survey_update($sdata))) {\n print_error('couldnotcreatenewsurvey', 'questionnaire');\n }\n } else {\n $copyid = explode('-', $questionnaire->create);\n $copyrealm = $copyid[0];\n $copyid = $copyid[1];\n if (empty($qobject->survey)) {\n $qobject->add_survey($copyid);\n $qobject->add_questions($copyid);\n }\n // New questionnaires created as \"use public\" should not create a new survey instance.\n if ($copyrealm == 'public') {\n $sid = $copyid;\n } else {\n $sid = $qobject->sid = $qobject->survey_copy($COURSE->id);\n // All new questionnaires should be created as \"private\".\n // Even if they are *copies* of public or template questionnaires.\n $DB->set_field('questionnaire_survey', 'realm', 'private', array('id' => $sid));\n }\n }\n $questionnaire->sid = $sid;\n }\n\n $questionnaire->timemodified = time();\n\n // May have to add extra stuff in here.\n if (empty($questionnaire->useopendate)) {\n $questionnaire->opendate = 0;\n }\n if (empty($questionnaire->useclosedate)) {\n $questionnaire->closedate = 0;\n }\n\n if ($questionnaire->resume == '1') {\n $questionnaire->resume = 1;\n } else {\n $questionnaire->resume = 0;\n }\n\n // Field questionnaire->navigate used for branching questionnaires. Starting with version 2.5.5.\n /* if ($questionnaire->navigate == '1') {\n $questionnaire->navigate = 1;\n } else {\n $questionnaire->navigate = 0;\n } */\n\n if (!$questionnaire->id = $DB->insert_record(\"questionnaire\", $questionnaire)) {\n return false;\n }\n\n questionnaire_set_events($questionnaire);\n\n return $questionnaire->id;\n}", "public function youCantSetAccessCodeManually()\n {\n // Arrange...\n $this->login();\n $lecture = factory(Lecture::class)->make();\n\n // Act...\n $this->json('post', 'lectures', $lecture->toArray() );\n\n // Assert...\n $this->dontSeeJson([\n 'accessCode' => $lecture->access_code\n ]);\n }", "public function CreateAccessCodesShared() {\n $request = array();\n $request['CancelUrl'] = $this->CancelUrl;\n $request['LogoUrl'] = $this->LogoUrl;\n $request['HeaderText'] = $this->HeaderText;\n $request['CustomerReadOnly'] = $this->CustomerReadOnly;\n $request['Customer'] = null;\n $request['ShippingAddress'] = null;\n $request['Customer'] = array(\"TokenCustomerID\" => $this->Cust_TokenCustomerID, \"Reference\" => $this->Cust_Reference, \"Title\" => $this->Cust_Title, \"FirstName\" => $this->Cust_FirstName, \"LastName\" => $this->Cust_LastName, \"CompanyName\" => $this->Cust_CompanyName, \"JobDescription\" => $this->Cust_JobDescription, \"Street1\" => $this->Cust_Street1, \"Street2\" => $this->Cust_Street2, \"City\" => $this->Cust_City, \"State\" => $this->Cust_State, \"PostalCode\" => $this->Cust_PostalCode, \"Country\" => $this->Cust_Country, \"Email\" => $this->Cust_Email, \"Phone\" => $this->Cust_Phone, \"Mobile\" => $this->Cust_Mobile, \"Comments\" => $this->Cust_Comments, \"Fax\" => $this->Cust_Fax, \"Url\" => $this->Cust_Url);\n $request['ShippingAddress'] = array(\"FirstName\" => $this->Ship_add_FirstName, \"LastName\" => $this->Ship_add_LastName, \"Street1\" => $this->Ship_add_Street1, \"Street2\" => $this->Ship_add_Street2, \"City\" => $this->Ship_add_City, \"State\" => $this->Ship_add_State, \"Country\" => $this->Ship_add_Country, \"PostalCode\" => $this->Ship_add_PostalCode, \"Email\" => $this->Ship_add_Email, \"Phone\" => $this->Ship_add_Phone, \"ShippingMethod\" => $this->Ship_add_ShippingMethod);\n $request[\"Items\"] = $this->Items;\n $request[\"Options\"] = $this->Options;\n $request[\"Payment\"] = array(\"TotalAmount\" => $this->TotalAmount, \"InvoiceNumber\" => null, \"InvoiceDescription\" => null, \"InvoiceReference\" => null, \"CurrencyCode\" => $this->CurrencyCode);\n $request[\"RedirectUrl\"] = $this->RedirectUrl;\n $request[\"Method\"] = $this->Method;\n $request[\"TransactionType\"] = $this->TransactionType;\n $request[\"CustomerIP\"] = $this->CustomerIP;\n $request[\"DeviceID\"] = $this->DeviceID;\n //$request['CardDetails'] = array(\"Name\"=>\"Krishna Bhat\", \"Number\"=>\"4444333322221111\", \"ExpiryMonth\"=>\"03\", \"ExpiryYear\"=>\"2016\", \"StartMonth\"=>null, \"StartYear\"=>null, \"IssueNumber\"=>null, \"CVN\"=>\"123\");\n //echo \"<pre>\";print_r($request);echo \"</pre><br /><br />\";die();\n $request = json_encode($request);\n //echo $request;die();\n //$request = '{\"CancelUrl\":\"http:\\/\\/ci.draftserver.com\\/countrytrack\\/rapid-3-1-eway\\/examples\\/ResponsiveSharedPage\\/\",\"LogoUrl\":\"\",\"HeaderText\":\"\",\"CustomerReadOnly\":true,\"Customer\":{\"TokenCustomerID\":null,\"Reference\":null,\"Title\":null,\"FirstName\":null,\"LastName\":null,\"CompanyName\":null,\"JobDescription\":null,\"Street1\":null,\"Street2\":null,\"City\":null,\"State\":null,\"PostalCode\":null,\"Country\":null,\"Email\":null,\"Phone\":null,\"Mobile\":null,\"Comments\":null,\"Fax\":null,\"Url\":null},\"ShippingAddress\":{\"FirstName\":null,\"LastName\":null,\"Street1\":null,\"Street2\":null,\"City\":null,\"State\":null,\"Country\":null,\"PostalCode\":null,\"Email\":null,\"Phone\":null,\"ShippingMethod\":null},\"Items\":null,\"Options\":null,\"Payment\":{\"TotalAmount\":\"100\",\"InvoiceNumber\":null,\"InvoiceDescription\":null,\"InvoiceReference\":null,\"CurrencyCode\":\"AUD\"},\"RedirectUrl\":\"http:\\/\\/ci.draftserver.com\\/countrytrack\\/rapid-3-1-eway\\/examples\\/ResponsiveSharedPage\\/\",\"Method\":\"ProcessPayment\",\"TransactionType\":\"\",\"CustomerIP\":\"202.166.198.119\",\"DeviceID\":null}';\n $response = $this->PostToRapidAPI(\"AccessCodesShared\", $request);\n return json_decode($response);\n }", "static function denied()\n {\n\n }", "public static function createNewAccessCode($request_url, $audience)\n {\n // 1. get current session\n $session_info = self::getSessionSafe();\n\n // 2. update session expire date\n SessionService::updateCurrent();\n\n // 3. create access code\n return AccessTokenService::createAccessCode($session_info[\"ID\"], $request_url, $audience);\n }", "public function getAccessRequestQuestion() {\n //link “this page” to the URL of the “New Project request page” https://view.med.cornell.edu/translational-research/project/new\n $url = $this->container->get('router')->generate(\n 'translationalresearch_project_new_selector',\n array(),\n UrlGeneratorInterface::ABSOLUTE_URL\n );\n $newProjectLink = \"<a href=\" . $url . \">this page</a>\";\n $question = \"Would you like to receive access to this site?\";\n $question = $question . \"<br>\" . \"If you would like to submit a new project request, please visit $newProjectLink.\";\n return $question;\n }" ]
[ "0.5538523", "0.54378104", "0.5339956", "0.52731156", "0.5238235", "0.5195098", "0.5176943", "0.51492286", "0.5143673", "0.5136795", "0.51088417", "0.5106634", "0.5049855", "0.5029207", "0.49380118", "0.49199647", "0.48945823", "0.48816422", "0.48778263", "0.48743397", "0.48650044", "0.48551258", "0.4834268", "0.47970557", "0.47771746", "0.47667873", "0.47493303", "0.47429842", "0.47350183", "0.47221366" ]
0.72000366
0
Convert a print output to XSLFO
function processPrintoutput2FO($print_output) { global $ilLog; if (extension_loaded("tidy")) { $config = array( "indent" => false, "output-xml" => true, "numeric-entities" => true ); $tidy = new tidy(); $tidy->parseString($print_output, $config, 'utf8'); $tidy->cleanRepair(); $print_output = tidy_get_output($tidy); $print_output = preg_replace("/^.*?(<html)/", "\\1", $print_output); } else { $print_output = str_replace("&nbsp;", "&#160;", $print_output); $print_output = str_replace("&otimes;", "X", $print_output); // #17680 - metric questions use &#160; in print view $print_output = str_replace("&gt;", ">", $print_output); $print_output = str_replace("&lt;", "<", $print_output); $print_output = str_replace("&#160;", "~|nbsp|~", $print_output); $print_output = preg_replace('/&(?!amp)/', '&amp;', $print_output); $print_output = str_replace("~|nbsp|~", "&#160;", $print_output); } $xsl = file_get_contents("./Modules/Survey/xml/question2fo.xsl"); // additional font support $xsl = str_replace( 'font-family="Helvetica, unifont"', 'font-family="'.$GLOBALS['ilSetting']->get('rpc_pdf_font','Helvetica, unifont').'"', $xsl ); $args = array( '/_xml' => $print_output, '/_xsl' => $xsl ); $xh = xslt_create(); $params = array(); $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params); xslt_error($xh); xslt_free($xh); $ilLog->write($output); return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function printXmlToStdout(){\n\t\tif(self::$xml)\n\t\t\techo xmlwriter_output_memory(self::$xml);\n\t}", "private function _print_xml()\n\t{\n\t\n\t}", "public function printXML()\n {\n @header('Content-type: text/xml');\n\n $dom = new DOMDocument();\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n $dom->loadXML($this->getXML()->asXML());\n\n return $dom->saveXML();\n }", "public function dump()\n {\n $this->_domDocument->formatOutput = true;\n echo $this->_domDocument->saveXML();\n }", "public function output() {\n header('Content-Type: application/xml');\n $dom = new \\DOMDocument('1.0');\n $dom->preserveWhiteSpace = false;\n $dom->formatOutput = true;\n $dom->loadXML($this->xml->asXML());\n echo $dom->saveXML();\n }", "public function outputAsXML($print = true) {\r\n\t\t$output = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\r\n\t\t$output .= \"<?xml-stylesheet type=\\\"text/xsl\\\" href=\\\"resmon.xsl\\\"?>\\n\";\r\n\t\t$output .= \"<ResmonResults>\\n\";\r\n\t\t\r\n\t\tforeach ( $this->data as $module => $services ) {\r\n\t\t\tforeach ( $services as $service => $serviceData ) {\r\n\t\t\t\t$output .= sprintf ( \"\\t<ResmonResult module=\\\"%s\\\" service=\\\"%s\\\">\\n\", htmlentities ( $module ), htmlentities ( $service ) );\r\n\t\t\t\t$output .= sprintf ( \"\\t\\t<last_update>%d</last_update>\\n\", time () );\r\n\t\t\t\t\r\n\t\t\t\tif (is_array ( $serviceData ['metrics'] )) {\r\n\t\t\t\t\tforeach ( $serviceData ['metrics'] as $metric ) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tswitch ($metric ['type']) {\r\n\t\t\t\t\t\t\tcase self::TYPE_FLOAT :\r\n\t\t\t\t\t\t\t\t$value = sprintf ( '%f', $metric ['value'] );\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase self::TYPE_INT :\r\n\t\t\t\t\t\t\tcase self::TYPE_LONGINT :\r\n\t\t\t\t\t\t\tcase self::TYPE_UNSIGNED_INT :\r\n\t\t\t\t\t\t\tcase self::TYPE_UNSIGNED_LONGINT :\r\n\t\t\t\t\t\t\t\t$value = sprintf ( '%d', $metric ['value'] );\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tdefault :\r\n\t\t\t\t\t\t\t\t$value = sprintf ( '%s', $metric ['value'] );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$output .= sprintf ( \"\\t\\t<metric name=\\\"%s\\\" type=\\\"%s\\\">%s</metric>\\n\", htmlentities ( $metric ['name'] ), $metric ['type'], htmlentities ( $value ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$output .= sprintf ( \"\\t\\t<state>%s</state>\\n\\t</ResmonResult>\\n\", empty ( $serviceData ['state'] ) ? self::STATE_OK : $serviceData ['state'] );\r\n\t\t\t}\r\n\t\t}\r\n\t\t$output .= \"</ResmonResults>\\n\";\r\n\t\t\r\n\t\tif ($print) {\r\n\t\t\theader ( \"Content-Type: text/xml; encoding=UTF-8\" );\r\n\t\t\techo $output;\r\n\t\t}\r\n\t\t\r\n\t\treturn $output;\r\n\t}", "public function toXObject(\\SetaPDF_Core_Document $document) {}", "public function toXObject(\\SetaPDF_Core_Document $document) {}", "public function toXObject(\\SetaPDF_Core_Document $document) {}", "public function toXObject(\\SetaPDF_Core_Document $document) {}", "public function toXObject(\\SetaPDF_Core_Document $document) {}", "function toScreen(){\n\t\t\tif($content = $this->process()){\n\t\t\t\techo \"<pre>\";\n\t\t\t\techo nl2br(htmlspecialchars($content));\n\t\t\t\techo \"</pre>\";\n\t\t\t\t\n\t\t\t\techo $content;\n\t\t\t}else{\n\t\t\t\ttrigger_error(\"An error occured during XML Data generation\",1);\n\t\t\t}\n\t\t}", "public function output(){\n header('Content-type: text/xml');\n echo $this->getDocument();\n }", "abstract public function toXObject(\\SetaPDF_Core_Document $document);", "function exportFO(&$a_xml_writer)\n\t{\n\t\tglobal $ilBench;\n\n\t\t//$expLog->write(date(\"[y-m-d H:i:s] \").\"Structure Object \".$this->getId());\n\n\t\t// fo:block (complete)\n\t\t$attrs = array();\n\t\t$attrs[\"font-family\"] = \"Times\";\n\t\t$attrs[\"font-size\"] = \"14pt\";\n\t\t$a_xml_writer->xmlElement(\"fo:block\", $attrs, $this->getTitle());\n\n\t\t// page objects\n\t\t//$ilBench->start(\"ContentObjectExport\", \"exportStructureObject_exportPageObjects\");\n\t\t$this->exportFOPageObjects($a_xml_writer);\n\t\t//$ilBench->stop(\"ContentObjectExport\", \"exportStructureObject_exportPageObjects\");\n\n\t\t// structure objects\n\t\t//$this->exportFOStructureObjects($a_xml_writer);\n\n\t}", "function printResults($us) \r\n{\r\n \theader('Content-type:text/xml;charset=\"utf-8\"');\r\n \t$xmlDoc = new MiniXMLDoc();\r\n \t$xmlRoot =& $xmlDoc->getRoot();\r\n \t$resultadosGenerales =& $xmlRoot->createChild('resultadosGenerales');\r\n\t$resultadosGenerales->attribute('resultado', 1); \r\n\t\r\n\t$op_tipo =& $resultadosGenerales->createChild('tipo');\r\n\t$op_tipo->text($us->getTipo());\r\n\t\r\n\t$op_usuario =& $resultadosGenerales->createChild('usuario');\r\n\t$op_usuario->text($us->getUsuario());\r\n\t\r\n\t$op_clave =& $resultadosGenerales->createChild('clave');\r\n\t$op_clave->text($us->getClave());\r\n\t\r\n\tprint html_entity_decode($xmlDoc->toString(MINIXML_NOWHITESPACES));\r\n}", "static function output(LK_PDF $pdf){\n drupal_get_messages();\n ob_clean();\n $pdf->Output();\n drupal_exit(); \n }", "function presave_process( $content ) {\r\n\r\n // add the xml headers and footers\r\n $content = \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\" .\r\n \"<referentiel>\\n\" .\r\n $content .\r\n \"</referentiel>\\n\\n\";\r\n\r\n // make the xml look nice\r\n $content = $this->xmltidy( $content );\r\n\r\n return $content;\r\n }", "private static function __print_xml_header(){\r\n\theader('Content-Type: text/xml');\r\n }", "function tf_print($value, $die = false) {\r\n static $first_time = true;\r\n\r\n if ($first_time) {\r\n ob_start();\r\n ?><style type=\"text/css\">\r\n div.tf_print_r {\r\n max-height: 500px;\r\n overflow-y: scroll;\r\n background: #111;\r\n margin: 10px 30px;\r\n padding: 0;\r\n border: 1px solid #F5F5F5;\r\n position: relative;\r\n z-index: 10;\r\n }\r\n\r\n div.tf_print_r pre {\r\n color: #47EE47;\r\n text-shadow: 1px 1px 0 #000;\r\n font-family: Consolas, monospace;\r\n font-size: 12px;\r\n margin: 0;\r\n padding: 5px;\r\n display: block;\r\n line-height: 16px;\r\n text-align: left;\r\n }\r\n </style><?php\r\n echo str_replace(array(' ', \"\\n\"), '', ob_get_clean());\r\n }\r\n\r\n ?><div class=\"tf_print_r\"><pre><?php print htmlspecialchars(tf_print_r($value, true), null, 'UTF-8'); ?></pre></div><?php\r\n\r\n $first_time = false;\r\n\r\n if ($die) die();\r\n }", "function deliverPDFfromFO($fo)\n\t{\n\t\tglobal $ilLog;\n\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$fo_file = ilUtil::ilTempnam() . \".fo\";\n\t\t$fp = fopen($fo_file, \"w\"); fwrite($fp, $fo); fclose($fp);\n\n\t\tinclude_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php';\n\t\ttry\n\t\t{\n\t\t\t$pdf_base64 = ilRpcClientFactory::factory('RPCTransformationHandler')->ilFO2PDF($fo);\n\t\t\tilUtil::deliverData($pdf_base64->scalar, ilUtil::getASCIIFilename($this->getTitle()) . \".pdf\", \"application/pdf\");\n\t\t\treturn true;\n\t\t}\n\t\tcatch(XML_RPC2_FaultException $e)\n\t\t{\n\t\t\t$ilLog->write(__METHOD__.': '.$e->getMessage());\n\t\t\treturn false;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\t$ilLog->write(__METHOD__.': '.$e->getMessage());\n\t\t\treturn false;\n\t\t}\n\n\t\t/*\n\t\tinclude_once \"./Services/Transformation/classes/class.ilFO2PDF.php\";\n\t\t$fo2pdf = new ilFO2PDF();\n\t\t$fo2pdf->setFOString($fo);\n\t\t$result = $fo2pdf->send();\n\t\tilUtil::deliverData($result, ilUtil::getASCIIFilename($this->getTitle()) . \".pdf\", \"application/pdf\");\n\t\t*/\n\t}", "function outputDOCX($mode=1,$save=\"invoice.docx\"){\n\t// PARAM $mode : 1 = force download (provide the file name in $save)\n\t// 2 = save on server (provide the absolute path and file name in $save)\n\t// $save : output filename\n\n\t\t// PHPWORD\n\t\trequire __DIR__ . DIRECTORY_SEPARATOR . \"phpword\" . DIRECTORY_SEPARATOR . \"autoload.php\";\n\t\t$pw = new \\PhpOffice\\PhpWord\\PhpWord();\n\n\t\t// LOAD TEMPLATE FILE\n\t\t$file = $this->path_template . \"DOCX\" . DIRECTORY_SEPARATOR . $this->template . \".php\";\n\t\tif (!file_exists($file)) { die(\"$file not found.\"); }\n\t\t$this->data = \"\";\n\t\trequire $file;\n\n\t\t// OUTPUT\n\t\tswitch ($mode) {\n\t\t\t// FORCE DOWNLOAD\n\t\t\tdefault: case 1:\n\t\t\t\t$this->outputDown($save);\n\t\t\t\t$objWriter = \\PhpOffice\\PhpWord\\IOFactory::createWriter($pw, 'Word2007');\n\t\t\t\t$objWriter->save('php://output');\n\t\t\t\tbreak;\n\n\t\t\t// SAVE FILE ON SERVER\n\t\t\tcase 2:\n\t\t\t\t$pw->save($save, \"Word2007\");\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function displayXML()\n\t{\n\t\techo \"<pre>\";\n\t\tprint_r($this->haloXML);\n\t\techo \"</pre>\";\n\t}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}", "public function printContent() {}" ]
[ "0.6214776", "0.59330314", "0.57175887", "0.5589538", "0.553988", "0.54900855", "0.5452032", "0.5452032", "0.5452032", "0.54512674", "0.54512674", "0.54500586", "0.5440119", "0.53912795", "0.5291556", "0.5174643", "0.5159971", "0.503058", "0.4960448", "0.49530137", "0.4824958", "0.48228213", "0.48217207", "0.48142025", "0.48142025", "0.48142025", "0.48142025", "0.48142025", "0.48126587", "0.48126587" ]
0.77248365
0
Delivers a PDF file from a XSLFO string
function deliverPDFfromFO($fo) { global $ilLog; include_once "./Services/Utilities/classes/class.ilUtil.php"; $fo_file = ilUtil::ilTempnam() . ".fo"; $fp = fopen($fo_file, "w"); fwrite($fp, $fo); fclose($fp); include_once './Services/WebServices/RPC/classes/class.ilRpcClientFactory.php'; try { $pdf_base64 = ilRpcClientFactory::factory('RPCTransformationHandler')->ilFO2PDF($fo); ilUtil::deliverData($pdf_base64->scalar, ilUtil::getASCIIFilename($this->getTitle()) . ".pdf", "application/pdf"); return true; } catch(XML_RPC2_FaultException $e) { $ilLog->write(__METHOD__.': '.$e->getMessage()); return false; } catch(Exception $e) { $ilLog->write(__METHOD__.': '.$e->getMessage()); return false; } /* include_once "./Services/Transformation/classes/class.ilFO2PDF.php"; $fo2pdf = new ilFO2PDF(); $fo2pdf->setFOString($fo); $result = $fo2pdf->send(); ilUtil::deliverData($result, ilUtil::getASCIIFilename($this->getTitle()) . ".pdf", "application/pdf"); */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convert_to_pdf($document_content, $file_name = false, $test = false) {\n\t$response = @file_get_contents('https://docraptor.com/docs?user_credentials=95gWBkqAtpdvRLTmfOU', false, stream_context_create(array(\n\t\t'http' => array (\n\t\t\t'method' => 'POST',\n\t\t\t'header' => 'Content-type: application/x-www-form-urlencoded' . \"\\r\\n\",\n\t\t\t'content' => http_build_query(array(\n\t\t\t\t'doc[document_content]' => $document_content, \n\t 'doc[document_type]' => 'pdf',\n\t 'doc[name]' => 'voucher.pdf',\n\t 'doc[test]' => ($test ? 'true' : false)\n\t\t\t))\n\t\t)\n\t)));\n\tif ($response && $file_name) {\n\t\t$path = '/tmp/'.$file_name;\n\t\t$file = fopen ($path, 'w'); \n\t\tfwrite($file, $response); \n\t\tfclose ($file);\n\t\treturn $path;\n\t} else if ($response) {\n\t\treturn $response;\n\t} else {\n\t\treturn false;\n\t}\n}", "function convert_to_pdf($document_content, $file_name = false, $test = false) {\n\t$response = @file_get_contents('https://docraptor.com/docs?user_credentials=95gWBkqAtpdvRLTmfOU', false, stream_context_create(array(\n\t\t'http' => array (\n\t\t\t'method' => 'POST',\n\t\t\t'header' => 'Content-type: application/x-www-form-urlencoded' . \"\\r\\n\",\n\t\t\t'content' => http_build_query(array(\n\t\t\t\t'doc[document_content]' => $document_content, \n\t 'doc[document_type]' => 'pdf',\n\t 'doc[name]' => 'voucher.pdf',\n\t 'doc[test]' => ($test ? 'true' : false)\n\t\t\t))\n\t\t)\n\t)));\n\tif ($response && $file_name) {\n\t\t$path = '/tmp/'.$file_name;\n\t\t$file = fopen ($path, 'w'); \n\t\tfwrite($file, $response); \n\t\tfclose ($file);\n\t\treturn $path;\n\t} else if ($response) {\n\t\treturn $response;\n\t} else {\n\t\treturn false;\n\t}\n}", "function pdf2string($sourcefile) {\n # Funktion zum direkten lesen von PDF mit PHP\n # gibt den daraus extrahierten Text zurück\n # Quellcode von mattb at bluewebstudios dot com\n # 04-Feb-2005 10:44 http://de2.php.net/manual/en/ref.pdf.php#49690\n \n $fp = fopen($sourcefile, 'rb');\n $content = fread($fp, filesize($sourcefile));\n fclose($fp);\n\n # Locate all text hidden within the stream and endstream tags\n $searchstart = 'stream';\n $searchend = 'endstream';\n $pdfdocument = \"\";\n\n $pos = 0;\n $pos2 = 0;\n $startpos = 0;\n # Iterate through each stream block\n while( $pos !== false && $pos2 !== false ) {\n # Grab beginning and end tag locations if they have not yet been parsed\n $pos = strpos($content, $searchstart, $startpos);\n $pos2 = strpos($content, $searchend, $startpos + 1);\n if( $pos !== false && $pos2 !== false ) {\n # Extract compressed text from between stream tags and uncompress\n $textsection = substr($content, $pos + strlen($searchstart) + 2, $pos2 - $pos - strlen($searchstart) - 1);\n $data = @gzuncompress($textsection);\n # Clean up text via a special function\n $data = $this->extractText($data);\n # Increase our PDF pointer past the section we just read\n $startpos = $pos2 + strlen($searchend) - 1;\n if( $data === false ) { return -1; }\n $pdfdocument = $pdfdocument . $data;\n }\n }\n return $pdfdocument;\n }", "public static function convertPdfString($string, $outEncoding = 'UTF-8') {}", "function createXFDF($pdfurl, $fielddata) {\n\t// Define XML namespace\n\t$xfdf =\n\t\t'<?xml version=\"1.0\" encoding=\"UTF-8\"?>' . \"\\n\" .\n\t\t'<xfdf xmlns=\"http://ns.adobe.com/xfdf/\" xml:space=\"preserve\">' . \"\\n\";\n\n\t// Permanent identifier based on the contents of the source PDf file (MD5 signature value)\n\t// Unique identifier for the modified version of the PDF.\n\t// See specification for more information\n\t$xfdf .=\n\t\t' <ids original=\"' . md5($pdfurl) . '\" modified=\"' . md5($pdfurl . time()) . '\" />' . \"\\n\";\n\n\t$xfdf .=\n\t\t' <f href=\"' . $pdfurl . '\" />' . \"\\n\" .\n\t\t' <fields>' . \"\\n\";\n\n\tif (!empty($fielddata)) {\n\t\tforeach ($fielddata as $field => $value) {\n\t\t\t$xfdf .= ' <field name=\"' . $field . '\">' . \"\\n\";\n\t\t\t$xfdf .= ' <value>' . htmlspecialchars($value) . '</value>' . \"\\n\";\n\t\t\t$xfdf .= ' </field>' . \"\\n\";\n\t\t}\n\t}\n\n\t$xfdf .=\n\t\t' </fields>' . \"\\n\" .\n\t\t'</xfdf>';\n\treturn $xfdf;\n}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function toPdfString(\\SetaPDF_Core_Document $pdfDocument) {}", "public function getPDF() {\n $data = Input::all();\n $document = document::where(\"id\", \"=\", $data['docuId'])->first();\n $this->makePDF($document->path);\n return str_replace(\"/var/www/sphinx/\", \"\", $document->path) . \"/build/latex/\" . $document->name . \".pdf\";\n }", "public function createPDF()\n {\n $soxId = $this->getEditObjectId();\n if ($soxId != \"-1\" && isset($soxId)) {\n // load object\n $oOrder = oxNew(\"oxorder\");\n if ($oOrder->load($soxId)) {\n $oUtils = oxRegistry::getUtils();\n $sTrimmedBillName = trim($oOrder->oxorder__oxbilllname->getRawValue());\n $sFilename = $oOrder->oxorder__oxordernr->value . \"_\" . $sTrimmedBillName . \".pdf\";\n $sFilename = $this->makeValidFileName($sFilename);\n ob_start();\n $oOrder->genPDF($sFilename, oxRegistry::getConfig()->getRequestParameter(\"pdflanguage\"));\n $sPDF = ob_get_contents();\n ob_end_clean();\n $oUtils->setHeader(\"Pragma: public\");\n $oUtils->setHeader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n $oUtils->setHeader(\"Expires: 0\");\n $oUtils->setHeader(\"Content-type: application/pdf\");\n $oUtils->setHeader(\"Content-Disposition: attachment; filename=\" . $sFilename);\n oxRegistry::getUtils()->showMessageAndExit($sPDF);\n }\n }\n }", "public static function FDF2PDF($FileFDF, $FilePDF_Out = '') {\n//Laod FDF\n $FilePDF_In = self::Load($FileFDF, TRUE);\n\n//Prepare the name of the PDF\n $FilePDF_Ref = basename($FilePDF_In);\n\n//Find the name of the output file\n if (!$FilePDF_Out) {\n $FilePDF_Out = str_replace(\".fdf\", \".pdf\", $FileFDF);\n }\n\n//Retrieve the PDF\n if ($FilePDF_Ref AND ! file_exists($FilePDF_Ref)) {\n copy($FilePDF_In, $FilePDF_Ref);\n }\n\n//Empty the old version of PDF if it exists\n if ($FilePDF_Out AND file_exists($FilePDF_Out)) {\n unlink($FilePDF_Out);\n }\n\n//Converted\n exec(\"pdftk $FilePDF_Ref fill_form $FileFDF output $FilePDF_Out\");\n\n return $FilePDF_Out;\n }", "abstract public function toPdfString(\\SetaPDF_Core_Document $pdfDocument);", "private function makePDF($path) {\n $output = shell_exec(\"sudo /var/www/sphinx/./myMake.sh \" . $path . \" latexpdf\");\n //dd($output); \n $this->addNewNews(0, 0, 3, \"Erstellt PDF\");\n }", "function dolibarr_pdfiser_facture($factref) {\n\n\t// Generer le PDF et le recopier dans SPIP\n\tif ($factref\n\t\tand $pdf_file = dolibarr_facture_pdf(0, $factref)\n\t and file_exists($pdf_file)) {\n\t\t$dir_pdf = sous_repertoire(_DIR_IMG,\"factures\");\n\t\tif (!file_exists($dir_pdf.\".htaccess\"))\n\t\t\tecrire_fichier($dir_pdf.\".htaccess\",\"deny from all\\n\");\n\t\t@copy($pdf_file, $dir_pdf . texte_script($factref) . '.pdf');\n\t}\n\telse {\n\t\tspip_log(\"fichier pdf dolibarr manquant \".$pdf_file,'dolibarr'._LOG_ERREUR);\n\t}\n\n}", "public function pdf($value) {\n return $this->setProperty('pdf', $value);\n }", "function processPrintoutput2FO($print_output)\n\t{\n\t\tglobal $ilLog; \n\t\t\n\t\tif (extension_loaded(\"tidy\"))\n\t\t{\n\t\t\t$config = array(\n\t\t\t\t\"indent\" => false,\n\t\t\t\t\"output-xml\" => true,\n\t\t\t\t\"numeric-entities\" => true\n\t\t\t);\n\t\t\t$tidy = new tidy();\n\t\t\t$tidy->parseString($print_output, $config, 'utf8');\n\t\t\t$tidy->cleanRepair();\n\t\t\t$print_output = tidy_get_output($tidy);\n\t\t\t$print_output = preg_replace(\"/^.*?(<html)/\", \"\\\\1\", $print_output);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$print_output = str_replace(\"&nbsp;\", \"&#160;\", $print_output);\n\t\t\t$print_output = str_replace(\"&otimes;\", \"X\", $print_output);\n\t\t\t\n\t\t\t// #17680 - metric questions use &#160; in print view\n\t\t\t$print_output = str_replace(\"&gt;\", \">\", $print_output);\n\t\t\t$print_output = str_replace(\"&lt;\", \"<\", $print_output);\n\t\t\t$print_output = str_replace(\"&#160;\", \"~|nbsp|~\", $print_output);\n\t\t\t$print_output = preg_replace('/&(?!amp)/', '&amp;', $print_output);\n\t\t\t$print_output = str_replace(\"~|nbsp|~\", \"&#160;\", $print_output);\t\t\t\n\t\t}\n\t\t$xsl = file_get_contents(\"./Modules/Survey/xml/question2fo.xsl\");\n\n\t\t// additional font support\n\t\t$xsl = str_replace(\n\t\t\t\t'font-family=\"Helvetica, unifont\"',\n\t\t\t\t'font-family=\"'.$GLOBALS['ilSetting']->get('rpc_pdf_font','Helvetica, unifont').'\"',\n\t\t\t\t$xsl\n\t\t);\n\t\t\n\t\t$args = array( '/_xml' => $print_output, '/_xsl' => $xsl );\n\t\t$xh = xslt_create();\n\t\t$params = array();\n\t\t$output = xslt_process($xh, \"arg:/_xml\", \"arg:/_xsl\", NULL, $args, $params);\n\t\txslt_error($xh);\n\t\txslt_free($xh);\n\t\t$ilLog->write($output);\n\t\treturn $output;\n\t}", "function htmlToPdf($string) {\n\t\n\t$string = htmlentities($string, ENT_QUOTES, 'UTF-8');\n\t\n\treturn htmlspecialchars_decode($string);\n}", "function _testXpdf() {\r\n \tglobal $output, $status;\r\n @exec('pdftotext', $output, $status);\r\n if (!empty($output[0])) {\r\n if (preg_match(\"/pdftotext/i\",$output[0], $matches)) {\r\n return \"pdftotext\";\r\n }\r\n }\r\n unset($output, $status);\r\n }", "public function executeArticlePDF(sfWebRequest $request) {\n \t$this->setLayout(false);\n \t$filename = $request->getParameter('title_slug');\n \t$pdf_path = $this->_pdf_directory . $filename . '.pdf';\n \t$this->forward404Unless($this->isValidPDF($filename) && file_exists($pdf_path));\n \t$response = $this->getResponse();\n \t$response->clearHttpHeaders();\n \t$response->setContentType('application/pdf');\n \t$response->sendHttpHeaders();\n \t$response->setContent(readfile($pdf_path));\n \t$response->sendContent();\n\t\treturn sfView::HEADER_ONLY;\n }" ]
[ "0.6208754", "0.6208754", "0.5836685", "0.57483786", "0.5725785", "0.5662273", "0.5662273", "0.5662273", "0.5662273", "0.5662273", "0.5661486", "0.5661486", "0.5661486", "0.5661486", "0.5661486", "0.5661486", "0.5660574", "0.5660574", "0.5660574", "0.5650231", "0.5563584", "0.5563265", "0.5531798", "0.5506036", "0.54783475", "0.541336", "0.53600824", "0.5359731", "0.5355293", "0.53527695" ]
0.66359556
0
Checks whether or not a question plugin with a given name is active
function isPluginActive($a_pname) { global $ilPluginAdmin; if ($ilPluginAdmin->isActive(IL_COMP_MODULE, "SurveyQuestionPool", "svyq", $a_pname)) { return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function validate($name) {\n\t\treturn file_exists(TH_PLUGINS.$name.'/plugin.php');\n\t}", "function plugin_is_active() {\n\t\treturn class_exists( 'Marketpress' );\n\t}", "abstract function is_plugin();", "private function is_required_plugin_installed() {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\t\t$requvired_plugin_list = array(\n\t\t\t'rest-api/plugin.php',\n\t\t\t'butterbean/butterbean.php',\n\t\t);\n\t\tforeach ( $requvired_plugin_list as $plugin ) {\n\t\t\tif ( ! is_plugin_active( $plugin ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public function has($name)\n {\n return $this->pluginManager->has($name);\n }", "function plugin_is_active() {\n\t\treturn function_exists( 'jigoshop_init' ) || class_exists( 'JigoshopInit' );\n\t}", "function acf_is_plugin_active()\n{\n}", "function plugin_is_active($name, $version = null, $compOperator = '>=')\n{\n $plugin = get_db()->getTable('Plugin')->findByDirectoryName($name);\n if (!$plugin) {\n return false;\n }\n if (!$plugin->isActive()) {\n return false;\n }\n if ($version) {\n return version_compare($plugin->getDbVersion(), $version, $compOperator);\n } else {\n return true;\n }\n}", "function heateor_ss_is_plugin_active($pluginFile){\r\n\treturn in_array($pluginFile, apply_filters('active_plugins', get_option('active_plugins')));\r\n}", "public static function Wpml_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'sitepress-multilingual-cms/sitepress.php', self::$active_plugins ) || array_key_exists( 'sitepress-multilingual-cms/sitepress.php', self::$active_plugins );\n }", "public function hasPlugin( string $name ) : bool\n {\n if( count( $this->plugins ) > 0 )\n {\n foreach( $this->plugins as $plugin )\n {\n if( $plugin->getName() == $name )\n {\n return true;\n }\n }\n }\n return false;\n }", "public function isActive()\n {\n If ($this->theme_active == 1)\n {\n //plugin is active\n return true;\n\n } else {\n \n //plugin is not active\n return false;\n }\n\n }", "function should_load() {\n\t\tinclude_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\treturn is_plugin_active( 'revslider/revslider.php' );\n\t}", "public static function check_activated_plugin() {\n\t\t$set = [];\n\t\t$plugins = get_option( 'active_plugins', [] );\n\n\t\tforeach ( self::get_conflicting_plugins() as $plugin => $type ) {\n\t\t\tif ( ! isset( $set[ $type ] ) && in_array( $plugin, $plugins, true ) ) {\n\t\t\t\t$set[ $type ] = true;\n\t\t\t\tself::set_notification( $type );\n\t\t\t}\n\t\t}\n\n\t\tif ( in_array( 'wpml-string-translation/plugin.php', $plugins, true ) ) {\n\t\t\tGlobalHelper::remove_notification( 'convert_wpml_settings' );\n\t\t}\n\t}", "public function isPluginActive($sPluginName)\n {\n $pluginModel = Plugin::model();\n $record = $pluginModel->findByAttributes(array('name' => $sPluginName, 'active' => '1'));\n if ($record == false)\n {\n return false;\n }\n else\n {\n return true;\n }\n }", "public function is_configured($name)\n\t{\n\t\treturn isset($this->extensions[$name]['ext_active']);\n\t}", "public static function Elementor_active_check() {\n\n if ( ! self::$active_plugins ) {\n self::init();\n }\n\n return in_array( 'elementor/elementor.php', self::$active_plugins ) || array_key_exists( 'elementor/elementor.php', self::$active_plugins );\n }", "public function is_plugins_active( $pl_file_path = NULL ){\r\n $installed_plugins_list = get_plugins();\r\n return isset( $installed_plugins_list[$pl_file_path] );\r\n }", "function wpdc_check_active(){ \r\n\r\n // plugin is ok\r\n // do the actions and filters\r\n\t\t\tadd_action( 'admin_menu',\t'wpdc_my_add_plugin_admin_page'); // the function to show the plugin settings page\r\n }", "function isMuPlugin ()\n\t{\n\t\tif ( strpos( dirname( __FILE__ ), 'mu-plugins' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function ipal_check_active_question(){\r\n global $DB;\r\n global $ipal;\r\n if($DB->record_exists('ipal_active_questions', array('ipal_id'=>$ipal->id))){\r\nreturn(1);\r\n }\r\n else\r\n {\r\n return(0);\r\n }\r\n}", "function plugin_depends($plugin_name)\n\t{\n\t\tif (!is_plugin_enabled($plugin_name))\n\t\t\tthrow new PluginException(sprintf(_echo('plugins:exception:missingplugin'), $plugin_name)); \n\t\t\t\n\t\treturn true;\n\t}", "static function wpl_toolskit_ot_active() {\n\t\t//if ( is_plugin_active( 'option-tree/ot-loader.php' ) ) {\n\t\t\treturn true;\n\t\t//}\n\t}", "public function is_plugin_installed() {\n\t\trequire_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n\n\t\t$plugins = get_plugins();\n\n\t\treturn ! empty( $plugins[ self::PLUGIN_SLUG ] );\n\t}", "function isPackagePluginActive( $pPluginGuid ) {\n\t\treturn( $this->getPackagePluginConfigValue( $pPluginGuid, 'active' ) == 'y' );\n\t}", "public function isEnabled( $name ) {\n if ( is_null($this->_plugins) ) $this->getPlugins();\n return isset($this->_plugins[ $name ]) && $this->_plugins[ $name ]->isEnabled();\n }", "public function base_plugin_active()\n\t{\n\t\treturn true;\n\t}", "protected function isQuestionActive(){\n return $this->socialQuestion &&\n $this->socialQuestion->SocialPermissions->isActive();\n }", "function is_active_addons($key)\r\n{\r\n $act_key = get_option($key);\r\n if ($act_key != '')\r\n {\r\n return true;\r\n }\r\n}", "public static function is_wpml_active() {\n \n include_once( ABSPATH . 'wp-admin/includes/plugin.php' );\n \n $wpml_active = is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' );\n \n $string_translation_active = is_plugin_active( 'wpml-string-translation/plugin.php' );\n \n return $wpml_active && $string_translation_active;\n \n }" ]
[ "0.6994261", "0.6841296", "0.6797729", "0.67614067", "0.67600656", "0.6749377", "0.67284447", "0.66833436", "0.6674373", "0.66321385", "0.655363", "0.64991814", "0.6439421", "0.6414147", "0.6384623", "0.6378078", "0.6367552", "0.6346158", "0.63453746", "0.63306105", "0.6246297", "0.6200266", "0.6198907", "0.61900127", "0.6159383", "0.6150012", "0.61355674", "0.61321926", "0.61117435", "0.6076813" ]
0.77032197
0
Sets the survey id
public function setSurveyId($survey_id) { $this->survey_id = $survey_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSurveyId()\n\t{\n\t\treturn $this->survey_id;\n\t}", "public function set_id($setid){\n $this->id = $setid;\n }", "function SetId($value) { $this->id=$value; }", "function setId($id) {\r\n $this->_id = $id;\r\n }", "function set_id($id) {\n\t\t$this->id = $id;\n\t}", "function setId($id) {\n\t\t$this->_id = $id;\n\t}", "public function set_id($id){\n $this->id = $id;\n }", "function set_id($id)\n {\n $this->id = $id;\n }", "public function setRespondent($id) {\n\t\tif (0) deb(\"survey1.setRespondent(): id:\", $id);\n\t\t$this->person = new Person($id);\n\t\tif (0) deb(\"survey1.setRespondent(): Person data:\", $this->person);\n\t}", "public function setId($id)\n {\n $this->setIdExpert($id);\n }", "public function setId($id){\n $this->_id = $id;\n }", "public function set_id( $id ) {\n\t\t\t$this->id = $id;\n\t\t}", "function set_id( $id ){\n\t\t$this->id = $id;\n\t\t// this is add request. so number is 0\n\t\tif( $this->id == $this->id_base ){\n\t\t\t$this->number = 0;\n\t\t\t$this->is_new = true;\n\t\t}\n\t\t// parse number\n\t\telse{\n\t\t\t$this->number = str_replace($this->id_base.'-', '', $this->id);\n\n\t\t\t// load instance data\n\t\t\t$this->instance = jcf_field_settings_get( $this->id );\n\t\t\tif( !empty($this->instance) ){\n\t\t\t\t$this->slug = $this->instance['slug'];\n\t\t\t}\n\t\t}\n\t}", "function setId($id){\r\n\t\t$this->id = $id;\r\n\t}", "function setId($id){\n\t\t$this->id = $id;\n\t}", "function setId($id) {\n $this->id = $id;\n }", "function setId($id) {\n $this->id = $id;\n }", "public function set_id( $id ) {\n\t\t$this->id = absint( $id );\n\t}", "function setId($id)\n {\n $this->id = $id;\n }", "private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}", "public function setId($id)\n {\n $this->id = $id;\n\n \n }", "public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}", "public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}", "public function setId($id) {\r\n $this->_id = $id;\r\n }", "public function setId($x) { $this->id = $x; }", "function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}", "public function setID($id){\n $this->id = $id;\n }", "function setId($value) {\n $this->_id = intval($value);\n }", "public function SetId ($id);", "public function setId($id){\n $this->id = $id;\n }" ]
[ "0.7021759", "0.6748963", "0.6270328", "0.60995823", "0.6076206", "0.6072761", "0.60450727", "0.60389477", "0.6034578", "0.602308", "0.60211366", "0.6014459", "0.6008872", "0.5994465", "0.5985043", "0.5976509", "0.5976509", "0.5971289", "0.5952198", "0.5936737", "0.5921503", "0.59160346", "0.59078246", "0.59038424", "0.58972085", "0.5885721", "0.5882658", "0.58752483", "0.58735365", "0.5872953" ]
0.72491056
0
Get finished id for an appraisee and a rater
function getFinishedIdForAppraiseeIdAndRaterId($a_appr_id, $a_rat_id) { global $ilDB; $set = $ilDB->query("SELECT finished_id, user_fi FROM svy_finished". " WHERE survey_fi = ".$ilDB->quote($this->getSurveyId(), "integer"). " AND appr_id = ".$ilDB->quote($a_appr_id, "integer"). " AND user_fi = ".$ilDB->quote($a_rat_id, "integer")); $row = $ilDB->fetchAssoc($set); return $row["finished_id"]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate_archieve_reconcillation_id() {\n $result = $this->db2->query(\"SELECT archieve_id FROM `gstr_2a_reconciliation_history_all` ORDER BY archieve_id DESC LIMIT 0,1\");\n if ($result->num_rows() > 0) {\n $data = $result->row();\n $archieve_id = $data->archieve_id;\n//generate user_id\n $archieve_id = str_pad( ++$archieve_id, 5, '0', STR_PAD_LEFT);\n return $archieve_id;\n } else {\n $archieve_id = 'archieve_1001';\n return $archieve_id;\n }\n }", "public function generate_archieve_reconcill_partially_id() {\n $result = $this->db2->query(\"SELECT archieve_id FROM `gstr_2a_reconciliation_partially_match_summary_history` ORDER BY archieve_id DESC LIMIT 0,1\");\n if ($result->num_rows() > 0) {\n $data = $result->row();\n $archieve_id = $data->archieve_id;\n//generate user_id\n $archieve_id = str_pad( ++$archieve_id, 5, '0', STR_PAD_LEFT);\n return $archieve_id;\n } else {\n $archieve_id = 'archieve_1001';\n return $archieve_id;\n }\n }", "public function getRequestedId() {}", "function getAppoId($date, $time){\n $CI = get_instance();\n\n // You may need to load the model if it hasn't been pre-loaded\n $CI->load->model('Customer/GetAppointment_model', 'appoModel');\n\n $result = $CI->appoModel->getAppoId($date, $time);\n $id = $result[0]['id'];\n // Call a function of the model\n return $id;\n }", "public function getID(){\n return $this->_idArmure;\n }", "function nextId() {\n\t\treturn $this->honeyPotId++;\n\t}", "public function recupereMaxId()\n {\n return $this->getGreaterId('membre_jury');\n }", "public function determineId() {}", "public function getLastId2()\r\n\t{\r\n\t\tif (Conexion::getEstatusConexion()) {\r\n\t\t\t$strSql = 'SELECT id_investigacion FROM investigaciones ORDER BY id_investigacion DESC LIMIT 1;';\r\n\t\t\t$respuestaArreglo = [];\r\n\t\t\t$id = 0;\r\n\t\t\ttry {\r\n\t\t\t\t$strExec = Conexion::prepare($strSql);\r\n\t\t\t\t$strExec->execute();\r\n\t\t\t\t$respuestaArreglo = $strExec->fetchAll();\r\n\t\t\t\tforeach ($respuestaArreglo as $valor) {\r\n\t\t\t\t\t$id = $valor['id_investigacion'];\r\n\t\t\t\t}\r\n\t\t\t} catch (PDOException $e) {\r\n\t\t\t\t\r\n\t\t\t\treturn $id;\r\n\t\t\t}\r\n\r\n\t\t\treturn $id;\r\n\t\t} else {\r\n\t\t\treturn $id;\r\n\t\t}\r\n\t}", "public function getOGApplicationID();", "public function obtenerID();", "public function generate_archieve_comparison_id() {\n $result = $this->db2->query(\"SELECT archieve_id FROM `comparison_summary_history_all` ORDER BY archieve_id DESC LIMIT 0,1\");\n if ($result->num_rows() > 0) {\n $data = $result->row();\n $archieve_id = $data->archieve_id;\n//generate user_id\n $archieve_id = str_pad( ++$archieve_id, 5, '0', STR_PAD_LEFT);\n return $archieve_id;\n } else {\n $archieve_id = 'archieve_1001';\n return $archieve_id;\n }\n }", "public function obtenerId() {}", "public function fetch_the_id() {}", "public function main() {\n return $this->id;\n }", "public function main() {\n return $this->id;\n }", "abstract public function get_id();", "private function getId(): int|string\n {\n return '/'.($_SESSION['rfe']['lastUsedItemId']++);\n }", "private function getRetailerId()\n {\n $retailerId = null;\n if ($this->currentStore->getRetailer() && $this->currentStore->getRetailer()->getId()) {\n $retailerId = (int) $this->currentStore->getRetailer()->getId();\n }\n\n return $retailerId;\n }", "function recupererid(){\n\t\t$sql=\"select max(idres) maximum from reservation \";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\t foreach($liste as $row){$id=$row['maximum'] ;}\n\t\t return $id;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function get_last_id()\n {\n // TODO: Implement get_last_id() method.\n }", "function getEarnotchID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from pigs_tbl where pig_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['earnotch'];\n\n\t}\n\t$crud->disconnect();\n}", "public function getExcavateId()\n {\n return $this->get(self::_EXCAVATE_ID);\n }", "private function devolverUltimoId()\n\t{\n\t\t$rta = 0;\n\n\t\tif(!empty($_SESSION['Producto']))\n\t\t{\n\t\t\t$rta=end($_SESSION['Producto'])->getId();\n\t\t}\n\n\t\treturn $rta + 1;\n\t}", "public function generate_archieve_state_wise_id() {\n $result = $this->db2->query(\"SELECT archieve_id FROM `state_wise_summary_all_history` ORDER BY archieve_id DESC LIMIT 0,1\");\n if ($result->num_rows() > 0) {\n $data = $result->row();\n $archieve_id = $data->archieve_id;\n//generate user_id\n $archieve_id = str_pad( ++$archieve_id, 5, '0', STR_PAD_LEFT);\n return $archieve_id;\n } else {\n $archieve_id = 'archieve_1001';\n return $archieve_id;\n }\n }", "public function sel_next_prog_id()\n\t{\n\t\t$prog_id = null;\n\t\ttry{\n\t\t\t$t_prog = new Model_T_Prog($this->db, $this->client_id);\n\t\t\t$prog_id = $t_prog->sel_next_id();\n\t\t} catch(Exception $e){\n\t\t\tKohana::$log->add(Log::ERROR, Kohana_Exception::text($e))->write();\n\t\t\t$prog_id = null;\n\t\t}\n\t\treturn $prog_id;\n\t}", "public function get_id();", "public function get_id();", "public function getAppointmentId()\n {\n return $this->appointmentId;\n }", "public function getRelaterId()\n {\n $value = $this->get(self::RELATER_ID);\n return $value === null ? (integer)$value : $value;\n }" ]
[ "0.6034842", "0.6028015", "0.592773", "0.5658867", "0.560318", "0.5600537", "0.5598136", "0.55688363", "0.55508363", "0.5535915", "0.55335665", "0.55306447", "0.5515159", "0.5421823", "0.54217017", "0.54217017", "0.5402917", "0.54004985", "0.53715163", "0.53653467", "0.5355175", "0.53515583", "0.5332405", "0.5315772", "0.5306638", "0.5298586", "0.5290784", "0.5290784", "0.52871805", "0.5279308" ]
0.7878513
0
Returns the user that is used to calculate and render the progress in the tree
protected function getTreeUser() { return $this->getReportingUser(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOwner()\n\t{\n\t\t$command='stat -c %U' . sprintf(' \"%s\"', $this->getFullPath());\n\t\t$user=$this->executeCommand($command);\n\t\treturn $user;\n }", "public function getUser(): string {\n return $this->context->user;\n }", "private function getCurrentUser()\n {\n // ALERTA[Xavi] Si s'obté el nom de l'usuari del info (WikiIocInfoManager::getInfo('userinfo')['name']) pot no coincidir amb el que es guarda al common.php#lock, ja que utilitza el codi següent:\n// if($_SERVER['REMOTE_USER']) {\n $currentUser = $_SERVER['REMOTE_USER'];\n// } else {\n// $currentUser = clientIP().\"\\n\".session_id());\n// }\n\n return $currentUser;\n }", "public function user()\n {\n return $this->luser;\n }", "public function displayUser()\n {\n $entry = $this->getEntry();\n if ($entry) {\n return $entry->displayUser();\n }\n }", "function get_user () {\n\t\treturn $this->user_id;\n\t}", "public function user()\n {\n return $this->context-> getUser();\n }", "public function getUserInfo()\n {\n return $this->_process('user/info')->user;\n }", "public function getCurrentUser() {\n $user = new Varien_Object(array('username' => ''));\n if ($adminUser = Mage::getModel('admin/session')->getUser()) {\n $user->setUsername($adminUser->getUsername());\n }\n Mage::dispatchEvent('inp_get_current_username', array('user' => $user));\n return $user->getUsername();\n }", "function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }", "function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }", "public function returnUser() {\n return $this->user_id;\n }", "public function get_cursor_user()\n {\n }", "public function getCurrentUser() {\n\t\treturn $this->request->getServer ()->get ( 'REMOTE_USER', 'NoUser' );\n\t}", "public function get_current_user(){\n $username = $this->session->userdata['logged_in']['username'];\n return $user_id = $this->research_model->current_user($username);\n }", "public function invoiceuser()\n {\n return $this->bean->info()->user()->name();\n }", "public function getOwnerusername() {}", "public function currentUser(){\n global $login, $security;\n\n if(!is_a($login, \"Login\")){\n $login = new Login();\n }\n\n // Get Current User\n if($login->isLogged()){\n return \"bludit::\" . $login->username();\n }\n return \"guest::\" . md5($security->getUserIp() . $_SERVER[\"HTTP_USER_AGENT\"]);\n }", "public function getUser ()\r\n\t{\r\n\t\treturn $this->user;\r\n\t}", "public static function getCurrentUser() {\n return Users::model()->findByAttributes(array(\n // [NguyenPT]: TODO - Investigate should use 'username' or 'id'\n DomainConst::KEY_USERNAME => Yii::app()->user->id\n ));\n }", "public function GetCurrentUser()\n {\n return $this->userManager->getCurrent();\n }", "public function getUsername()\n {\n return $this->userProf;\n }", "public function get_current_user()\n\t{\n\t\treturn $this->current_user;\n\t}", "public function getTaskUserName()\n\t{\n\t\treturn $this->getUser()->getFullName();\n\t}", "public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}", "public function getUsername()\r\n\t{\r\n\t\treturn $this->admin['user'];\r\n\t}", "public function user() { return $this->user; }", "public function getUser(){\n\t\treturn $this->user;\n\t}", "function _getUser()\n\t{\n\t\treturn 'root';\n\t}", "public function getUserId() {\n\t\t$this->assignment->getUserId();\n\t}" ]
[ "0.6358728", "0.62904054", "0.62105876", "0.61914754", "0.6145585", "0.61324984", "0.6084648", "0.60811996", "0.60758793", "0.6019401", "0.6019401", "0.5968529", "0.59658897", "0.5963069", "0.5956666", "0.59563655", "0.5933064", "0.5921058", "0.59018826", "0.5895571", "0.5894371", "0.58891547", "0.5879112", "0.5859681", "0.58571196", "0.5853247", "0.5844064", "0.5843426", "0.584339", "0.58374816" ]
0.73794365
0
A reference to a description of the source being referenced.
public function getDescriptionRef() { return $this->descriptionRef; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_source_description() {\n\t\t$description = $this->source;\n\n\t\t$payment = $this->get_first_payment();\n\n\t\tif ( $payment ) {\n\t\t\t$description = apply_filters( 'pronamic_payment_source_description', $description, $payment );\n\t\t\t$description = apply_filters( 'pronamic_payment_source_description_' . $this->source, $description, $payment );\n\t\t}\n\n\t\treturn $description;\n\t}", "function garland_diptera_cdm_OriginalSource($descriptionElementSource, $doLink = TRUE){\n\n //ev. delegate to theme_cdm_ReferencedEntityBase\n $out = '';\n if($descriptionElementSource->citation){\n $datePublished = $descriptionElementSource->citation->datePublished;\n if (strlen($datePublished->start) >0){\n $year=substr($datePublished->start,0,strpos($datePublished->start,'-'));\n }\n\n $author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $descriptionElementSource->citation->uuid);\n $author_team_titlecache = $author_team->titleCache;\n if (strlen($year)>0){\n $reference = $author_team_titlecache.' '. $year;\n }else {\n $reference = $author_team_titlecache ;\n }\n\n if($doLink){\n $out = l('<span class=\"reference\">'.$reference.'</span>'\n , path_to_reference($descriptionElementSource->citation->uuid)\n , array(\"class\"=>\"reference\")\n , NULL, NULL, FALSE ,TRUE);\n } else {\n $out = $reference;\n }\n if($descriptionElementSource->citationMicroReference){\n $out .= ': '. $descriptionElementSource->citationMicroReference;\n }\n }\n return $out;\n}", "public function source() {\n return $this->source;\n }", "public function getSource()\n {\n return 'lab';\n }", "public function source()\n {\n return $this->source;\n }", "public function get_source() {\n\t\treturn $this->source;\n\t}", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return 'pdv_descontos';\n }", "public function getSource(): string\n {\n return $this->source;\n }", "public function getSource(): string\n {\n return $this->source;\n }", "public function source()\n\t{\n\t\treturn $this->source;\n\t}", "public function getSource() {\n return $this->source;\n }", "public function getSource() {\n return $this->source;\n }", "public function getSource();", "public function getSource();", "public function getSource();", "public function getSource();", "public function getSource();", "public function getSource()\r\n {\r\n return $this->source;\r\n }", "public function get_source()\n {\n }", "function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->Source;\n }", "public function getSource()\n {\n return 'comments';\n }", "public function getSource()\n {\n return 'comments';\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }", "public function getSource()\n {\n return $this->source;\n }" ]
[ "0.6925339", "0.67070085", "0.660226", "0.65636945", "0.65049267", "0.649197", "0.6442161", "0.6441025", "0.6438079", "0.6438079", "0.64378136", "0.64348435", "0.64348435", "0.63965344", "0.63965344", "0.63965344", "0.63965344", "0.63965344", "0.63654256", "0.63440424", "0.63373286", "0.633172", "0.6313519", "0.6313519", "0.62996304", "0.62996304", "0.62996304", "0.62996304", "0.62996304", "0.62996304" ]
0.6974304
0
The attribution metadata for this source reference.
public function getAttribution() { return $this->attribution; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAttribution() \n {\n return $this->_attribution;\n }", "public function get_attribution()\n {\n }", "public function getMetaData();", "public function getMetaData()\n {\n return $this->metadata;\n }", "public function getMetadata();", "public function getMetadata();", "public function getMetadata();", "public function getMetadata() {}", "public function getMetadata() {}", "public function getAttributionToken()\n {\n return $this->attribution_token;\n }", "public function getMetaData() {\n\t\treturn $this->arrMetadata;\n\t}", "abstract public function getCorrespondingMetaData();", "function getMetadata() {\n\t\treturn $this->_Metadata;\n\t}", "public function attribution($value) {\n return $this->setProperty('attribution', $value);\n }", "public function attribution($value) {\n return $this->setProperty('attribution', $value);\n }", "public function getMetadata()\n {\n return $this->Metadata;\n }", "public function attributions() {\n return $this->hasMany('Rockit\\Models\\Attribution');\n }", "public function get_metadata() {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->_metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }", "public function getMetadata()\n {\n return $this->metadata;\n }" ]
[ "0.72936976", "0.71695805", "0.66840726", "0.6365214", "0.6333959", "0.6333959", "0.6333959", "0.62797874", "0.62797874", "0.62732995", "0.626247", "0.6200708", "0.61211425", "0.6103003", "0.6103003", "0.6056639", "0.6018305", "0.60028964", "0.60021675", "0.59578305", "0.59578305", "0.59578305", "0.59578305", "0.59578305", "0.59578305", "0.59578305", "0.59578305", "0.59578305", "0.59578305", "0.59578305" ]
0.7435759
0
The qualifiers associated with this source reference.
public function getQualifiers() { return $this->qualifiers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSrcQualifier() {\n return $this->srcQualifier;\n }", "protected function getSubActionQualifiers()\n {\n $sourceQualifiers = $this->source ? $this->source->getStringQualifiers() : [];\n $sourceTransformation = $this->source ? $this->source->getTransformation() : null;\n $additionalQualifiers = $this->getStringQualifiers();\n\n $additionalQualifiers [] = Flag::layerApply();\n\n return [\n 'source' => $sourceQualifiers,\n 'transformation' => $sourceTransformation,\n 'additional' => $additionalQualifiers,\n ];\n }", "public function getStringQualifiers()\n {\n return ArrayUtils::safeFilter([$this->startOffset, (string)$this->endOffset]);\n }", "public function setQualifiers($qualifiers)\n {\n $this->qualifiers = $qualifiers;\n }", "function getDestQualifier() {\n return $this->destQualifier;\n }", "private function parseQualifiers(): void\n {\n $n = preg_match('/^(?<qualifiers>(T_FINAL |T_ABSTRACT )*)(?<type>T_CLASS |T_INTERFACE |T_TRAIT )/',\n $this->tokens->asString(),\n $matches);\n\n if ($n==1)\n {\n PhpAutoDoc::$dl->padClassUpdateFlag($this->clsId,\n Cast::toManInt(TokenMatchHelper::isFinal($matches)),\n Cast::toManInt(TokenMatchHelper::isClass($matches)),\n Cast::toManInt(TokenMatchHelper::isAbstract($matches)),\n Cast::toManInt(TokenMatchHelper::isInterface($matches)),\n Cast::toManInt(TokenMatchHelper::isTrait($matches)),\n 1);\n }\n }", "public function getRateQualifier()\n {\n return $this->rateQualifier;\n }", "public function getResourceContainedResourceReferenceList()\n {\n return $this->resourceContainedResourceReferenceList;\n }", "function &getCVs() {\n $suppFileDao =& DAORegistry::getDAO('SuppFileDAO');\n return $suppFileDao->getSuppFilesByArticleTypeAndAssocId($this->getArticleId(), SUPP_FILE_CV, $this->getId());\n\t}", "public function toArray()\n {\n $a = parent::toArray();\n if ($this->descriptionRef) {\n $a[\"description\"] = $this->descriptionRef;\n }\n if ($this->attribution) {\n $a[\"attribution\"] = $this->attribution->toArray();\n }\n if ($this->qualifiers) {\n $ab = array();\n foreach ($this->qualifiers as $i => $x) {\n $ab[$i] = $x->toArray();\n }\n $a['qualifiers'] = $ab;\n }\n return $a;\n }", "public function getWildCard()\n\t{\n\t\treturn $this->masterArray[$this->ref_wildCard];\n\t}", "function setSrcQualifier($srcQualifier) {\n if ($srcQualifier !== ($oldSrcQualifier = $this->srcQualifier)) {\n if ($this->immutable) throw self::immutableException();\n $this->srcQualifier = $srcQualifier;\n }\n }", "function getAffectations()\n\t{\n\t\t/* genre:\n\t\t\t{\n\t\t\t\t[1] = {pcname, pb, activityHistory, ...}\n\t\t\t}\n\t\t*/\n\t}", "public function getSourceAccessConditions()\n {\n return $this->sourceAccessConditions;\n }", "public function getReferenceProperties() {}", "public function get_attribution()\n {\n }", "function getSrcExtraJoins() {\n return $this->srcExtraJoins;\n }", "public function getAffectations()\n\t{\n\t\treturn $this->affectations;\n\t}", "public function qualifications($qualifications)\n {\n return $this->setProperty('qualifications', $qualifications);\n }", "public function __toString()\n {\n $subActions = $this->getSubActionQualifiers();\n\n return ArrayUtils::implodeUrl([\n ArrayUtils::implodeActionQualifiers(...$subActions['source']),\n $subActions['transformation'],\n ArrayUtils::implodeActionQualifiers(...$subActions['additional']),\n ]);\n }", "public function getAnnotationsFilter()\n {\n return $this->annotations_filter;\n }", "public function getCodeQualif() {\n return $this->codeQualif;\n }", "public function getAgcAndColorStripeRestriction()\n {\n return $this->_agcAndColorStripeRestriction;\n }", "abstract function getQualifyingPattern();", "public function getAttribution()\n {\n return $this->attribution;\n }", "public function getSubrogationConstantes() {\n return $this->subrogationConstantes;\n }", "function getAttribution() \n {\n return $this->_attribution;\n }", "public function getConstList(){\n\t\treturn $this->getConstantsList();\n\t}", "public function getDncSourceTypeAllowableValues()\n {\n return [\n self::DNC_SOURCE_TYPE_RDS,\n self::DNC_SOURCE_TYPE_DNCCOM,\n self::DNC_SOURCE_TYPE_GRYPHON,\n ];\n }", "public function getEffectiveValueSourceAllowableValues()\n {\n return [\n self::EFFECTIVE_VALUE_SOURCE__DEFAULT,\n self::EFFECTIVE_VALUE_SOURCE_APPLICATION,\n self::EFFECTIVE_VALUE_SOURCE_LEARNING_STANDARD_FOR_APPLICATION,\n self::EFFECTIVE_VALUE_SOURCE_DISPATCH_DESTINATION,\n self::EFFECTIVE_VALUE_SOURCE_COURSE,\n self::EFFECTIVE_VALUE_SOURCE_DISPATCH,\n self::EFFECTIVE_VALUE_SOURCE_REGISTRATION,\n ];\n }" ]
[ "0.6840164", "0.62149405", "0.6043494", "0.5954648", "0.57549524", "0.55836374", "0.5224615", "0.49366456", "0.4918287", "0.491237", "0.4891207", "0.48860607", "0.4870766", "0.478804", "0.47789568", "0.47510988", "0.47469836", "0.47403923", "0.47347435", "0.47147945", "0.47086594", "0.46894762", "0.46607253", "0.46183783", "0.46083397", "0.46077895", "0.4589266", "0.45792037", "0.45697072", "0.4560754" ]
0.7615449
0
Get an instance of Msd_Log for a special type Allowed types are self::PHP, self::PERL, self::PERL_COMPLETE or self::ERROR
public function getLogInstance($type) { if (!isset($this->_logInstance[$type])) { $writer = new Zend_Log_Writer_Stream($this->getFile($type)); $formatter = new Zend_Log_Formatter_Simple("%timestamp% %message%\n"); $writer->setFormatter($formatter); $this->_logInstance[$type] = new Zend_Log($writer); } return $this->_logInstance[$type]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function set_log_type () {\n\t\t# check settings\n\t\t$this->log_type = $this->settings->log;\n\t}", "public function type_for_log() {\n return $this->type;\n }", "function getDefaultLogEntryClass();", "static public function get_instance( )\n\t{\n\t\tif (is_null(self::$_instance)) {\n\t\t\tself::$_instance = new Log( );\n\t\t}\n\n\t\treturn self::$_instance;\n\t}", "public static function newInstance() {\n $class = self::class;\n $void_log = new $class();\n return $void_log;\n }", "public function log($_msg,$_opt=array()){\r\n return (new Object())->log($_msg,$_opt);\r\n }", "public function setLogType($type)\n {\n $this->type = ($type == 'func') ? $type : 'tech';\n return $this;\n }", "public function create($type = 'default')\r\n {\r\n switch ($this->loggerAlias) {\r\n case self::LOGGER_ALIAS_FILE:\r\n $this->logger = $this->fileFactory->create(\r\n [\r\n 'logFileName' => $type,\r\n 'logAll' => $this->logAll,\r\n 'logCallStack' => $this->logCallStack,\r\n ]\r\n );\r\n break;\r\n default:\r\n $this->logger = $this->fileFactory->create();\r\n break;\r\n }\r\n\r\n return $this->logger;\r\n }", "public static function getLogs($type='_all_')\n\t{\n\t\tif($type == '_all_') return self::$_logs;\n\t}", "function phpbmsLog($value=NULL,$type=NULL,$userid=NULL,$db=NULL,$sendLog=true){\r\n\t\t// so that it can properly supress errors without goofing things up.\r\n\t\tif($db){\r\n\t\t\tif(is_object($db)){\r\n\r\n\t\t\t\t$this->db = $db;\r\n\r\n\t\t\t\t$this->db->showError=false;\r\n\t\t\t\t$this->db->logError=false;\r\n\t\t\t\t$this->db->stopOnError=false;\r\n\r\n\t\t\t}//endif object\r\n\r\n\t\t} else {\r\n\r\n\t\t\tif(class_exists(\"db\")){\r\n\r\n\t\t\t\t$this->db= new db(false);\r\n\r\n\t\t\t\t$this->db->showError=false;\r\n\t\t\t\t$this->db->logError=false;\r\n\t\t\t\t$this->db->stopOnError=false;\r\n\r\n\t\t\t\t$this->db->connect();\r\n\t\t\t\t$this->db->selectSchema();\r\n\r\n\t\t\t} else\r\n\t\t\t\treturn false;\r\n\r\n\t\t}//endif db\r\n\r\n\t\tif($value)\r\n\t\t\t$this->value = $value;\r\n\r\n\t\tif($type)\r\n\t\t\t$this->type = $type;\r\n\r\n\t\tif($userid)\r\n\t\t\t$this->userid = $userid;\r\n\r\n\t\tif($sendLog)\r\n\t\t\treturn $this->sendLog();\r\n\t\telse\r\n\t\t\treturn true;\r\n\r\n\t}", "function __construct()\n {\n $this->mylog = new mylog;\n }", "public function Log($log, $log_type = Logger::ERROR)\n {\n $this->logger = new Logger('log');\n $this->log_name = 'log-' . Carbon::now()->toDateString() . '.log';\n\n\n if (!file_exists(__DIR__ . '/../../storage/log/' . $this->log_name)) {\n file_put_contents(__DIR__ . '/../../storage/log/' . $this->log_name, '');\n }\n\n $this->logger->pushHandler(new StreamHandler(__DIR__ . '/../../storage/log/' . $this->log_name, Logger::DEBUG));\n\n switch ($log_type) {\n case Logger::DEBUG :\n $this->logger->debug($log);\n break;\n case Logger::INFO :\n $this->logger->info($log);\n break;\n case Logger::NOTICE :\n $this->logger->notice($log);\n break;\n case Logger::WARNING :\n $this->logger->warning($log);\n break;\n case Logger::ERROR :\n $this->logger->error($log);\n break;\n case Logger::CRITICAL :\n $this->logger->critical($log);\n break;\n case Logger::ALERT :\n $this->logger->alert($log);\n break;\n case Logger::EMERGENCY :\n $this->logger->emergency($log);\n break;\n\n }\n }", "protected static final function phpLog (S $stringToLog) {\n // Do return ... [and LOG];\n return new B (error_log ($stringToLog));\n }", "public static function getLogsByType($type)\n {\n return Log::where(\"type\", \"=\", $type)->get();\n }", "protected function newLog($action = ''): Logging\\LogInterface{\n return new Logging\\DefaultLog($action);\n }", "public function log($msg, $type = FALSE)\n\t{\n\t\t$this->EE->load->model('log_model');\n\t\t\n\t\treturn $this->EE->log_model->log($msg, $type);\n\t}", "public function _write_log($type, $result, $user = NULL, $description = NULL);", "function error_log_details($type = \"info\",$label = \"no label\") \n\t{\n\t\t$w_call_detail = __FILE__.\" line (\".__LINE__.\") call from (\".$_SERVER[\"SCRIPT_FILENAME\"].\") : \";\n\t\tswitch($type) \n\t\t{\n\t\t\tcase \"fatal\":\n\t\t\t\t$w_prefixe = \"Fatal error on \".$w_call_detail;\n\t\t\t\terror_log($w_prefixe.$label);\n\t\t\t\tdie();\n\t\t\t\tbreak;\n\t\t\tcase \"info\":\n\t\t\t\t$w_prefixe = \"Info : \".$w_call_detail;\n\t\t\t\terror_log($w_prefixe.$label);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$w_prefixe = \"STOP : \".$w_call_detail;\n\t\t\t\terror_log($w_prefixe.\"!!!! unknown type parameters call !!!!!!\");\n\t\t\t\tdie();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public static function GetLog($type)\n \t{\n \t\t//Ouverture du fichier\n\t\t$Name =$type.date('dmY');\n\t\t$Directory =\"Log\\\\\".$type.\"\\\\\";\n\n\t\t$File=$Directory.$Name.\".JLog\";\n\t\t$Log = \"\";\n\n\t\tif (!file_exists($File) || !$fp = fopen($File,\"r\"))\n\t\t{\n\t\t\techo \"--Echec de l'ouverture du fichier\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile(!feof($fp))\n\t\t\t{\n\t\t\t\t$Ligne = fgets($fp,255);\n\t\t\t\t$Log .= $Ligne;\n\t\t\t}\n\n\t\tfclose($fp); // On ferme le fichier\n\t\treturn $Log;\n\t\t}\n \t}", "public static function createLog($type, $msg){\n $log = new App\\Log();\n $log->setTable('log');\n $log->type = $type;\n $log->msg = $msg;\n $log->save();\n }", "function createLogger($class);", "public function getObject() {\n return Log::getInstance();\n }", "protected function log($msg, $type){\n\t\tif($this->logger){\n\t\t\tif(!$this->dbLogger){\n\t\t\t\t$this->dbLogger = new Logger($this->logger);\n\t\t\t}\n\t\t\t$this->dbLogger->log($msg, $type);\n\t\t}\t\n\t}", "protected function getLogService()\n {\n return $this->services['log'] = new \\phpbb\\log\\log(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, ${($_ = isset($this->services['dispatcher']) ? $this->services['dispatcher'] : $this->getDispatcherService()) && false ?: '_'}, './../', 'adm/', 'php', 'phpbb_log');\n }", "protected function _getLogger(\n $logType = TechDivision_Logger_System::LOG_TYPE_SYSTEM)\n {\n \treturn $this->getLogger();\n }", "protected function _getLogger(\n $logType = TechDivision_Logger_System::LOG_TYPE_SYSTEM)\n {\n \treturn $this->getLogger();\n }", "public static function log()\n {\n self::$arrBacktrace = array_shift(debug_backtrace());\n $strMessage = self::$arrBacktrace['file'] . ' on line ' . self::$arrBacktrace['line'];\n $arrLogDisplay = self::$arrBacktrace;\n $arrLogDisplay['debug'] = [];\n\n if (is_array($arrLogDisplay['args']) && !empty($arrLogDisplay['args'])) {\n foreach ($arrLogDisplay['args'] as $intKey => $mixValue) {\n array_push(\n $arrLogDisplay['debug'],\n array(\n \"Argument \" . ($intKey + 1) => $mixValue\n )\n );\n }\n }\n\n $log = new Logger(self::$strLogName);\n $log->pushProcessor(new MemoryPeakUsageProcessor());\n $log->pushProcessor(new WebProcessor());\n $streamHandler = new StreamHandler(self::$strLogPath, Logger::DEBUG);\n $log->pushHandler($streamHandler);\n\n unset(\n $arrLogDisplay['args'],\n $arrLogDisplay['class'],\n $arrLogDisplay['type'],\n $arrLogDisplay['file'],\n $arrLogDisplay['line']\n );\n\n return $log->debug($strMessage, $arrLogDisplay);\n }", "protected function log_manager() {\n\t\treturn tribe( 'logger' );\n\t}", "function wlog($msg,$typ='INF',$level=1)\n{\n global $log;\n\n if ($level==0)\n {\n return; //no logging\n }\n else {\n $log->log($msg,$typ );\n }\n\n}", "public static function log($type, $message)\n {\n if (self::$log_levels[$type] <= self::$configuration['core']['log_threshold']) {\n $message = array(date('Y-m-d H:i:s P'), $type, $message);\n\n // Run the system.log event\n Event::run('system.log', $message);\n\n self::$log[] = $message;\n }\n }" ]
[ "0.6326493", "0.6099906", "0.58292866", "0.56727827", "0.56052065", "0.55763847", "0.5500946", "0.54939145", "0.5467415", "0.546453", "0.54230386", "0.5421032", "0.54015625", "0.539689", "0.5376655", "0.5315755", "0.5314873", "0.5308393", "0.5295687", "0.5262672", "0.52457404", "0.52137876", "0.5211451", "0.52109873", "0.5191049", "0.5191049", "0.5167183", "0.5152906", "0.5132357", "0.5129489" ]
0.6252775
1
month must be nonnull, and between 1 and 12
private function validate_month($value) { return ($value == '' || $value > 12 || $value < 1) ? 0 : 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidMonth($month) {\n\t\t$input = file_get_contents('php://input');\n\t\t$_POST = json_decode($input, TRUE);\n\t\tif ($_POST['every_unit'] == 'Year') {\n\t\t\tif (empty($month) || !is_numeric($month) || $month < 1 || $month > 12) {\n\t\t\t\t$this->form_validation->set_message('isValidMonth', 'The Month is Invalid');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}", "public function is_month()\n {\n }", "function setMonth($m)\r\n {\r\n if($m < 1 || $m > 12) {\r\n $this->mes = 1;\r\n } else {\r\n $this->mes = $m;\r\n }\r\n }", "public function get_month($month_number)\n {\n }", "function month( \n\t $name, $title = null, $value = null, \n\t $required = false, \n\t $attributes = null\n\t){\n return $this->input(\n\t $name, \n\t Form::TYPE_MONTH,\n\t $title, \n\t $value, \n\t $required, \n\t $attributes,\n\t null,\n\t Form::DATA_DATE\n );\n\t}", "function monthFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_MONTH_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "public function getValidFromMonth()\n {\n return $this->valid_from_month;\n }", "public function setMonth($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function filterPublishDate(int $year, ?int $month): self;", "private function getMonth() {\n\t\treturn $this->month;\n\t}", "public function get_month_permastruct()\n {\n }", "public function setMonth($month){\n\t\tif($month>12){\n\t\t\t$this->_month = $month%12;\n\t\t\t$this->_year += ((int)($month/12));\n\t\t} else {\n\t\t\tif($month<1){\n\t\t\t\t$this->_month = 13-(abs($month)%12);\n\t\t\t\t$this->_year -= (((int)(abs($month)/12))+1);\n\t\t\t} else {\n\t\t\t\t$this->_month = (int) $month;\n\t\t\t}\n\t\t}\n\t\t$monthDays = self::$_monthTable[$this->_month-1];\n\t\tif($this->isLeapYear()==true&&$this->_month==2){\n\t\t\t++$monthDays;\n\t\t}\n\t\tif($this->_day>$monthDays){\n\t\t\t$this->_day = self::$_monthTable[$this->_month-1];\n\t\t}\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}", "public function setMonth($month)\n {\n $this->month = $month;\n }", "public function isValidDayOfMonth($date) {\n\t\t$input = file_get_contents('php://input');\n\t\t$_POST = json_decode($input, TRUE);\n\t\tif ($_POST['every_unit'] == 'Month' || $_POST['every_unit'] == 'Year') {\n\t\t\tif (empty($date) || !is_numeric($date) || $date < 1 || $date > 31) {\n\t\t\t\t$this->form_validation->set_message('isValidDayOfMonth', 'The Day of Month is Invalid');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}", "function set_start_month($startMonth,&$error)\r\n {\r\n if (strlen($startMonth) > 0 && $startMonth != \"Select A Month\")\r\n\t\t{\r\n if (!preg_match('/[a-zA-Z]/i', $startMonth))\r\n {\r\n //return a invalid css class\r\n\t\t\t return \"class='error'\";\r\n }\r\n else\r\n {\r\n $this->StartMonth = filter_var(trim($startMonth), FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH);\r\n\r\n //return a valid css class\r\n\t\t\t return \"class='valid'\";\r\n }\r\n \r\n }\r\n else\r\n {\r\n //return a invalid css class\r\n\t\t\t return \"class='error'\";\r\n }\r\n\r\n }", "private function _daysInMonth($month=null,$year=null){\n \n if(null==($year))\n $year = date(\"Y\",time()); \n \n if(null==($month))\n $month = date(\"m\",time());\n \n return date('t',strtotime($year.'-'.$month.'-01'));\n }", "public function setMonth($month)\n\t{\n\t\t$this->month = $month;\n\t}", "public function setMonth($month) {\n\t\t$this->month = $month;\n\t}", "function valid_payment($student, $month, $year)\n {\n $this->ci->db->where('student_id', $student);\n $this->ci->db->where('financial_year', $year);\n $val = $this->ci->db->get($this->table)->row();\n\n if ($val->$month){ return FALSE; } else{ return TRUE; }\n }", "public function getMonth($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function takePostBaseOnMonth();", "public function get_month_choices()\n {\n }", "public function isMonth() : bool {\n $monthsArr = $this->taskDetails['months'];\n $retVal = true;\n\n if ($monthsArr['every-month'] !== true) {\n $retVal = false;\n $current = TasksManager::getMonth();\n $ranges = $monthsArr['at-range'];\n\n foreach ($ranges as $range) {\n if ($current >= $range[0] && $current <= $range[1]) {\n $retVal = true;\n break;\n }\n }\n\n if ($retVal === false) {\n $months = $monthsArr['every-x-month'];\n $retVal = in_array($current, $months);\n }\n }\n\n return $retVal;\n }", "public function testYearOnlyDateWithParamJanuary1()\n {\n $this->assertContains(\n '1066-01-01', neatlinetime_convert_date('1066', 'january_1')\n );\n $this->assertFalse(\n neatlinetime_convert_date('1066', 'skip')\n );\n }", "function getMonthlyEventData($month, $session=7) {\n //Check month format\n $isValidMonth = date_create_from_format(\"m\", $month);\n if(!$isValidMonth) {\n //TODO Add any more validations that may be required\n // createFromFormat returns false if the format is invalid or month is invalid\n echo \"Please enter a valid month as an int. Cannot proceed due to invalid month error\";\n } else if(!is_numeric($session) && ($session>0 && $session<8)){\n //$session is not valid\n echo \"Please enter a valid session as an int with value between 1 and 7 inclusive. Cannot proceed due to invalid session error\";\n }else {\n $monthUrl = sprintf(self::$monthEventUrl, $session, $month);\n return parent::convert($monthUrl,3);\n }\n }", "public function setValidFromMonth($var)\n {\n GPBUtil::checkInt32($var);\n $this->valid_from_month = $var;\n\n return $this;\n }", "public function getMonth(){\n\t\treturn $this->_month;\n\t}", "function prim_options_month() {\n $month = array(\n 'jan' => t('jan'),\n 'feb' => t('feb'),\n 'mar' => t('mar'),\n 'apr' => t('apr'),\n 'may' => t('maj'),\n 'jun' => t('jun'),\n 'jul' => t('jul'),\n 'aug' => t('aug'),\n 'sep' => t('sep'),\n 'oct' => t('okt'),\n 'nov' => t('nov'),\n 'dec' => t('dec'),\n );\n\n return $month;\n}", "function monthParamName() {\n\t\tif (func_num_args()) {\n\t\t\t$this->_monthParamName = trim(func_get_arg(0));\n\t\t}\n\t\telse return $this->_monthParamName;\n\t}", "public function setMonth($month = null): object\n {\n if (null !== $month && !($month instanceof FHIRString)) {\n $month = new FHIRString($month);\n }\n $this->_trackValueSet($this->month, $month);\n $this->month = $month;\n return $this;\n }" ]
[ "0.74105084", "0.73813313", "0.67582345", "0.67526424", "0.66120327", "0.6553738", "0.64288527", "0.63856345", "0.6379256", "0.6372042", "0.6344793", "0.6338817", "0.6331252", "0.6311929", "0.628673", "0.62839997", "0.62462425", "0.62365085", "0.62245655", "0.6221138", "0.6201785", "0.61915153", "0.61904246", "0.6171272", "0.6161267", "0.61480373", "0.6144143", "0.613685", "0.61063874", "0.60962486" ]
0.7434619
0
year must be nonnull, and between 2010 and 2021
private function validate_year($value) { return ($value == '' || $value > 12 || $value < 1) ? 0 : 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validateYear($year) {\n if (empty($year)) {\n exit(\"<h1>Please Provide Year.</h1>\");\n }\n if (!is_numeric($year) || strlen($year) != 4) {\n exit(\"<h1>Please Provide Valid Year.</h1>\");\n }\n }", "public function is_year()\n {\n }", "function yearFormat ($value){\n \n if(strlen($value) == 0){\n return true;\n }\n \n else if(!preg_match(VALID_YEAR_FORMAT,$value)){\n return false;\n }\n \n return true;\n}", "public function testYearOnlyDateWithParamFullYear()\n {\n $this->assertFalse(neatlinetime_convert_date('1066', 'full_year'));\n $result = neatlinetime_convert_single_date('1066', 'full_year');\n $this->assertContains('1066-01-01', $result[0]);\n $this->assertContains('1066-12-31', $result[1]);\n }", "function validYear($tmpYear){\n if (!preg_match(\"/^[0-9]*$/\",$tmpYear)) {\n $yearErr = \"Invalid Year format\";\n\t} elseif (strlen($tmpYear)!='4') {\n\t\t$yearErr = \"Must be 4 digits long\"; \n\t} elseif ($tmpYear < 1900) {\n\t\t$yearErr = \"Year must be >= 1900\";\n\t} elseif ($tmpYear > 2000) {\n\t\t$yearErr = \"Year must be <= 2000\";\n\t} else {\n\t\t$yearErr = \"\";\n\t}\n\treturn $yearErr;\n}", "public function validate() {\n//\t\tif( intval($this->params[\"startYear\"] < date(\"yyyy\"))) $this->add_validation_error(\"Season cannot exist in the past.\");\n\t}", "public function getValidFromYear()\n {\n return $this->valid_from_year;\n }", "public function setYear($year);", "public function getYear() {}", "public function isYearException(int $year): void\n {\n if ($year < 1900) {\n throw new \\InvalidArgumentException;\n }\n }", "public function year_check(){\n\t\t\t$str = $this->input->post('year_of_manufacture');\n\t\t\tif ($str == '' || $str == '0'){\n\t\t\t\t$this->form_validation->set_message('year_check', 'Please select a year');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}", "function isLeapYear(int $year)\n{\n if ($year < 1900) {\n throw new InvalidArgumentException('Expected value is above 1900. Your input is' . $year);\n }\n return ($year % 4 == 0 and $year % 100 !== 0 or $year % 400 == 0);\n}", "public static function validateYear()\n\t{\n\t\treturn [\n\t\t\tnew LengthValidator(null, 255),\n\t\t];\n\t}", "public function getYear() : string;", "public function modelYear();", "public function getMinYearBuilt();", "public function setValidFromYear($var)\n {\n GPBUtil::checkInt32($var);\n $this->valid_from_year = $var;\n\n return $this;\n }", "function set_start_year($startYear,&$error)\r\n {\r\n if (strlen($startYear) > 0)\r\n\t\t{\r\n //check if the name contains special characters\r\n if (!preg_match('/^\\d{4}$/', $startYear))\r\n {\r\n \r\n $error = \"Start Year Is Not Valid\";\r\n }\r\n else\r\n { //sanitize and feed back up the pipe to display in the form and save on the server\r\n $this->StartYear = filter_var(trim($startYear), FILTER_SANITIZE_NUMBER_INT); \r\n \r\n //return a valid css class\r\n\t\t\treturn \"class='valid'\"; \r\n }\r\n }//end if >0\r\n else\r\n {\r\n \r\n $error = \"Start Year Must Be Greater Than Zero\";\r\n\r\n //return a invalid css class\r\n\t\t\t return \"class='error'\";\r\n }//end else\r\n\r\n }", "public function __construct($year)\n {\n $this->year = $year;\n }", "function options_validate(&$form, &$form_state) {\n parent::options_validate($form, $form_state);\n if (!preg_match('/^(?:\\-[0-9]{1,4}|[0-9]{4}):(?:[\\+|\\-][0-9]{1,4}|[0-9]{4})$/', $form_state['values']['options']['year_range'])) {\n form_error($form['year_range'], t('Date year range must be in the format -9:+9, 2005:2010, -9:2010, or 2005:+9'));\n }\n }", "public function validate(int $year)\n {\n if ($year >= 1000 && $year <= 9999) {\n return true;\n }\n\n return false;\n }", "function isValidYearValue($yearString, $minYear, $maxYear) {\n\n $digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n\n // remove external whitespace\n $yearString = trim($yearString);\n\n // check that $yearString contains 4 characters\n if (strlen($yearString) != 4) {\n return 0;\n }\n\n // check that all the characters in $yearString are digits\n for ($i = 0; $i < strlen($yearString); ++$i) {\n $currentCharacter = substr($yearString, $i, 1);\n if (strpos($yearString, $currentCharacter) === false) {\n return 0; // current character is not a digit\n }\n }\n\n // check that $yearString, when converted to an int, lies between\n // $minYear and $maxYear (both inclusive)\n $year = (int)$yearString;\n if (($year < $minYear) || ($year > $maxYear)) {\n return 0;\n }\n\n // if we've fallen through, the year has passed all the validation checks\n // and is valid\n return 1;\n}", "function tep_is_leap_year($year) {\n if ($year % 100 == 0) {\n if ($year % 400 == 0) return true;\n } else {\n if (($year % 4) == 0) return true;\n }\n\n return false;\n }", "function isSchoolYearinvalid($str = null){\n if ($str) {\n $year1 =substr($str,0 ,4);\n $year2 =substr($str,5 ,4);\n if ((strlen($str)==9) && ($str[4])==\"-\" && is_numeric($year1) && is_numeric($year2)){\n echo \"is valid<br>\";\n return false;\n }else\n echo \"invalid<br>\";\n return true;\n }\n}", "public function testYearOnlyDate() {\n $this->assertEquals('2012-01-01T00:00:00+00:00',\n neatlinetime_convert_date('2012')\n );\n }", "public function setYear($year)\n {\n $this->year = $year;\n }", "public function hasStartYear() {\n return $this->_has(4);\n }", "public function testCanGetBirthYear() : void\n {\n $this->assertSame('1990', $this->personalCodeObj->getBirthYear());\n\n $formatsAndExpectedValues = [\n 'L' => 0, // Whether it's a leap year\n 'o' => 1990, // ISO-8601 week-numbering year.\n 'y' => 90, // A two digit representation of a year\n ];\n\n foreach ($formatsAndExpectedValues as $format => $expectedValue) {\n $this->assertEquals($expectedValue, $this->personalCodeObj->getBirthYear($format));\n }\n }", "function tep_is_leap_year($year) {\n if ($year % 100 == 0) {\n if ($year % 400 == 0) return true;\n } else {\n if (($year % 4) == 0) return true;\n }\n\n return false;\n}", "static function leapYear($n)\n {\n if (strlen((string)$n)==4) \n {\n //check year is leap or not\n if ((($n % 4 == 0) && ($n % 100 != 0)) || ($n % 400 == 0)) \n {\n echo \"leap year\".\"\\n\";\n } \n else \n {\n echo \"not leap year\".\"\\n\";\n } \n } \n else\n {\n echo \"invalid input\".\"\\n\";\n } \n }" ]
[ "0.7501873", "0.7347705", "0.7144444", "0.7116113", "0.7082587", "0.694735", "0.6911246", "0.68076587", "0.6791426", "0.6789036", "0.6764261", "0.67242163", "0.67186284", "0.66407436", "0.66173935", "0.6584991", "0.65367067", "0.65132064", "0.650971", "0.6497728", "0.6448915", "0.6448857", "0.6380556", "0.63587177", "0.6339779", "0.6306355", "0.6304035", "0.6293923", "0.6270193", "0.6258965" ]
0.74626637
1
Initializes a new bulk upsert booking custom attributes request object.
public function build(): BulkUpsertBookingCustomAttributesRequest { return CoreHelper::clone($this->instance); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function init(array $values): self\n {\n return new self(new BulkUpsertBookingCustomAttributesRequest($values));\n }", "public function build(): BulkUpsertLocationCustomAttributesRequest\n {\n return CoreHelper::clone($this->instance);\n }", "public static function init(): self\n {\n return new self(new BookingCustomAttributeUpsertResponse());\n }", "public static function init(array $values): self\n {\n return new self(new BulkUpsertLocationCustomAttributesRequest($values));\n }", "protected function prepareForValidation()\n {\n $this->merge([\n self::ATTRIBUTE_REFERER => $this->prepareArray($this->input(self::ATTRIBUTE_REFERER)),\n self::ATTRIBUTE_IP => $this->prepareArray($this->input(self::ATTRIBUTE_IP)),\n ]);\n }", "protected function _set_request_data_from_params(){\n \n //if( !$this->request->is('post') && !empty($this->request->params['named'])){\n// $this->request->data['Region']['id'] = $this->request->params['named']['region_id'];\n// $this->request->data['Area']['id'] = $this->request->params['named']['area_id'];\n// $this->request->data['House']['id'] = $this->request->params['named']['house_id'];\n// \n// if( isset($this->request->params['named']['house_id']) ){\n// $this->request->data['House']['id'] = $this->request->params['named']['house_id'];\n// }\n// if( isset($this->request->params['named']['representative_id']) ){\n// $this->request->data['Representative']['id'] = $this->request->params['named']['representative_id'];\n// }\n// if( isset($this->request->params['named']['section_id']) ){\n// $this->request->data['Section']['id'] = $this->request->params['named']['section_id'];\n// }\n// if( isset($this->request->params['named']['outlet_id']) ){\n// $this->request->data['Outlet']['id'] = $this->request->params['named']['outlet_id'];\n// }\n// if( isset($this->request->params['named']['from_date']) ){\n// $this->request->data['from_date'] = $this->request->params['named']['from_date'];\n// }\n// if( isset($this->request->params['named']['till_date']) ){\n// $this->request->data['till_date'] = $this->request->params['named']['till_date'];\n// }\n //} \n \n $this->request->data['Region']['id'] = $this->request->query['region_id'];\n $this->request->data['Area']['id'] = $this->request->query['area_id'];\n $this->request->data['House']['id'] = $this->request->query['house_id'];\n \n \n if( isset($this->request->params['named']['representative_id']) ){\n $this->request->data['Representative']['id'] = $this->request->query['representative_id'];\n }\n if( isset($this->request->params['named']['section_id']) ){\n $this->request->data['Section']['id'] = $this->request->query['section_id'];\n }\n if( isset($this->request->params['named']['outlet_id']) ){\n $this->request->data['Outlet']['id'] = $this->request->query['outlet_id'];\n }\n if( isset($this->request->params['named']['from_date']) ){\n $this->request->data['from_date'] = $this->request->query['from_date'];\n }\n if( isset($this->request->params['named']['till_date']) ){\n $this->request->data['till_date'] = $this->request->query['till_date'];\n }\n }", "public function build(): BookingCustomAttributeUpsertResponse\n {\n return CoreHelper::clone($this->instance);\n }", "public function __construct() {\n\t\tadd_filter( 'rest_pre_insert_post', [ $this, 'set_request' ], 10, 2 );\n\t}", "public function setUpdateParametersFromRequest($request)\n {\n if (!isset($request->from))\n {\n $this->from = '';\n }\n else\n {\n $this->from = $request->from;\n }\n\n if (!isset($request->until))\n {\n $this->until = '';\n }\n else\n {\n $this->until = $request->until;\n }\n\n if (!isset($request->set))\n {\n $this->set = '';\n }\n else\n {\n $this->set = $request->set;\n }\n\n if (!isset($request->metadataPrefix))\n {\n $this->metadataPrefix = 'oai_dc';\n }\n else\n {\n $this->metadataPrefix = $request->metadataPrefix;\n }\n\n // If cursor not supplied, define as 0\n if (!isset($request->cursor))\n {\n $this->cursor = 0;\n }\n else\n {\n $this->cursor = $request->cursor;\n }\n }", "public function prepAttributesForUse()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\tswitch ($config['type'])\n\t\t\t{\n\t\t\t\tcase AttributeType::DateTime:\n\t\t\t\t{\n\t\t\t\t\tif ($value)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (DateTimeHelper::isValidTimeStamp($value))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dateTime = new DateTime('@'.$value);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// TODO: MySQL specific.\n\t\t\t\t\t\t\t$dateTime = DateTime::createFromFormat(DateTime::MYSQL_DATETIME, $value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this->setAttribute($name, $dateTime);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase AttributeType::Mixed:\n\t\t\t\t{\n\t\t\t\t\tif (!empty($value) && is_string($value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, JsonHelper::decode($value));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->setAttribute($name, array());\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function __construct(PostResourceAsyncMergesRequestBody $requestBody)\n {\n $this->body = $requestBody;\n }", "public function prepAttributesForSave()\n\t{\n\t\t$attributes = $this->defineAttributes();\n\t\t$attributes['dateUpdated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\t\t$attributes['dateCreated'] = array('0' => AttributeType::DateTime, 'required' => true);\n\n\t\tforeach ($attributes as $name => $config)\n\t\t{\n\t\t\t$config = ModelHelper::normalizeAttributeConfig($config);\n\t\t\t$value = $this->getAttribute($name);\n\n\t\t\t$this->setAttribute($name, ModelHelper::packageAttributeValue($config, $value, true));\n\t\t}\n\n\t\t// Populate dateCreated and uid if this is a new record\n\t\tif ($this->isNewRecord())\n\t\t{\n\t\t\t$this->dateCreated = DateTimeHelper::currentTimeForDb();\n\t\t\t$this->uid = StringHelper::UUID();\n\t\t}\n\n\t\t// Update the dateUpdated\n\t\t$this->dateUpdated = DateTimeHelper::currentTimeForDb();\n\t}", "private function setRequestXml(){\n\n $orderHandleRepos = new InternationOrderHandleRepository();\n $this->orderInfo = $orderHandleRepos->getOneWithNotes($this->handleId);\n\n //设置请求用户信息\n $this->userInfoSet($this->requestXml);\n $this->currencySet($this->requestXml);\n\n /**\n * 获取AddBookingRequest xml部分\n * 用户设置 订单新增主体信息\n */\n\n $addBookingRequestXml = $this->requestXml->RequestDetails->AddBookingRequest;\n //设置请求货币类别\n /** @var \\SimpleXMLElement $addBookingRequestXml */\n $addBookingRequestXml->attributes()->Currency = ConfigGta::CURRENCY;\n //订单号设置\n $addBookingRequestXml->addChild(\"BookingReference\",(string)$this->orderInfo[\"order_sn\"]);\n //客户出发时间设置,默认与入住时间相同\n $addBookingRequestXml->addChild(\"BookingDepartureDate\",(string)$this->orderInfo[\"begin_date\"]);\n\n //获取 客户 和 pid 属性 数组\n $guestPids = $this->getGuestPids();\n\n\n\n //客户姓名设置\n $this->setPaxNamesXml($addBookingRequestXml,$guestPids);\n\n //价格处理\n //计算预定房间数\n $roomNum = $this->orderInfo->internationOrderNotes[0]->room_number;\n $roomTotalPrice = number_format($this->orderInfo[\"floor_price_origin\"]/$roomNum,2,\".\",\"\");\n\n\n //booking item 设置\n $bookItemsXml = $addBookingRequestXml->addChild(\"BookingItems\");\n foreach ($guestPids as $index=>$guestPid)\n {\n $this->setBookItemXml($bookItemsXml,$guestPid,$index,$roomTotalPrice);\n\n }\n\n }", "public function upsert($externalFieldName, array $objects, $objectType);", "public function run()\n {\n Product::upsert([\n [\n 'id' => 1,\n 'name' => 'Product 1',\n 'state' => 'Weapon', //'Weapon', 'Accessories', 'Other'\n 'price' => 2000,\n 'is_disable' => 0,\n 'product_categories_id' => 8,//must be use valid category id\n 'product_types_id' => 3,//must be use valid product types id, which is connected with given category id\n 'product_brands_id' => 5,//must be use valid product brand id, which is connected with given category id\n ],\n [\n 'id' => 2,\n 'name' => 'Product 2',\n 'state' => 'Weapon', //'Weapon', 'Accessories', 'Other'\n 'price' => 1000,\n 'is_disable' => 0,\n 'product_categories_id' => 10,//must be use valid category id\n 'product_types_id' => 18,//must be use valid product types id, which is connected with given category id\n 'product_brands_id' => 65,//must be use valid product brand id, which is connected with given category id\n ],\n\n ], [], ['id']);\n\n ProductAttribute::upsert([\n [\n 'id' => 1,\n 'attributes_id' => 1,\n 'products_id' => 1,\n 'values' => json_encode([2,3])\n ],\n [\n 'id' => 2,\n 'attributes_id' => 2,\n 'products_id' => 2,\n 'values' => json_encode([55])\n ],\n\n ],[],['id']);\n\n /*ProductTag::upsert([ //use if needed\n [\n 'id' => 1,\n 'tags_id' => 2,\n 'products_id' => 2\n ]\n ],[],['id']);*/\n }", "protected function init_bulkactions(){\r\n\t\t\tif ( file_exists( $this->include_path . '/Bulk' ) ) {\r\n\t\t\t\t$Directory = new RecursiveDirectoryIterator( $this->include_path . '/Bulk' );\r\n\t\t\t\t$Iterator = new RecursiveIteratorIterator( $Directory );\r\n\t\t\t\t$Regex = new RegexIterator( $Iterator, '/^.+\\.php$/i', RecursiveRegexIterator::GET_MATCH );\r\n\t\t\t\t$include_array = array();\r\n\t\t\t\t$rc = new ReflectionClass( $this );\r\n\t\t\t\tforeach ( $Regex as $name => $obj ) {\r\n\t\t\t\t\t$name = str_replace($this->include_path . '/Bulk/', '', $name);\r\n\t\t\t\t\t$name = str_replace( ['.php', '/'], ['', '\\\\'], $name );\r\n\t\t\t\t\t$namespace = $rc->getNamespaceName();\r\n\t\t\t\t\tarray_push( $include_array, $namespace . '\\\\Bulk\\\\' . $name );\r\n\t\t\t\t}\r\n\r\n\t\t\t\tforeach ( $include_array as $bulk ) {\r\n\t\t\t\t\tnew $bulk();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "protected function prepareDataForUpdate(){\n\n\t\t// the object get by isUsing function\n\t\t$object = $this->_currentObject[$this->_model->alias];\n\t\t$post = $this->request->data;\n\t\tif (!$this->_model->validates()){\n\t\t\tthrow new NotFoundException($this->_model->getValidateMessage());\n\t\t}\n\t\tif ($object['assign_situation_id'] == 1 && $post['assign_situation_id'] == 2){\n\t\t\t// in this case we can update all\n\t\t\t$updateData = $post;\n\t\t}else {\n\t\t\tif (!in_array($post['assign_situation_id'], array(0,1,2,9))){\n\t\t\t\tthrow new Exception('assign_situation_id not in range (0,1,2,9)');\n\t\t\t}\n\t\t\t// only update assign situation\n\t\t\t$updateData = array(\n\t\t\t\t'id' => $post['id'],\n\t\t\t\t'assign_situation_id' => $post['assign_situation_id']\n\t\t\t);\n\t\t}\n\t\treturn $updateData;\n\t}", "private function initContactInsertArgs() {\n $this->esitWScontact = new Api\\esitWScontact();\n $this->esitWScontactAddress = new Api\\esitWScontactAddress();\n $this->esitWScontactAttribute = new Api\\esitWScontactAttribute();\n // Defaults should be opt-out for data protection, according to best\n // practices. All boolean.\n // $doNotContact, $doNotMail, $doNotPhone, $doNotEmail, $doNotSMS, $mailThirdParty, $emailThirdParty, $phoneThirdParty, $dmEmailOptIn, $dmMailOptIn\n $this->esitWScontactDataProtection = new Api\\esitWScontactDataProtection(FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);\n }", "public function __construct(array $batch)\n\t{\n\t\tif(Tivoka::$version == Tivoka::VER_1_0) throw new Tivoka_exception('Batch requests are not supported by JSON-RPC 1.0 spec', Tivoka::ERR_SPEC_INCOMPATIBLE);\n\t\t$this->id = array();\n\t\n\t\t//prepare requests...\n\t\tforeach($batch as $request)\n\t\t{\n\t\t\tif(!($request instanceof Tivoka_Request) && !($request instanceof Tivoka_Notification))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\t//request...\n\t\t\tif($request instanceof Tivoka_Request)\n\t\t\t{\n\t\t\t\tif(in_array($request->id,$this->id,true)) continue;\n\t\t\t\t$this->id[$request->id] = $request;\n\t\t\t}\n\t\t\t\n\t\t\t$this->request[] = $request->request;\n\t\t}\n\t}", "protected function _prepareEnrtyForSave()\n {\n $object = $this->getObject();\n if (!($object instanceof Varien_Object)) {\n Mage::throwException(Mage::helper('googlebase')->__('Object model is not specified to save Google Base entry.'));\n }\n\n $this->_setUniversalData();\n\n $attributes = $this->getAttributeValues();\n if (is_array($attributes) && count($attributes)) {\n foreach ($attributes as $name => $data) {\n\n $name = $this->_normalizeString($name);\n $value = isset($data['value']) ? $data['value'] : '';\n $type = isset($data['type']) && $data['type'] ? $data['type'] : self::DEFAULT_ATTRIBUTE_TYPE;\n\n $customSetter = '_setAttribute' . ucfirst($name);\n if (method_exists($this, $customSetter)) {\n $this->$customSetter($name, $value, $type);\n } else {\n $this->_setAttribute($name, $value, $type);\n }\n }\n }\n return $this;\n }", "public function __construct(){\n if(count($this->fillable) == 0){\n foreach($this->attributes as $key => $attr){\n array_push($this->fillable, $key);\n }\n }\n }", "public function initialize()\n\t{\n\t\t// attributes\n\t\t$this->setName('oobookings');\n\t\t$this->setPhpName('OOBooking');\n\t\t$this->setClassname('OOBooking');\n\t\t$this->setPackage('momo');\n\t\t$this->setUseIdGenerator(true);\n\t\t// columns\n\t\t$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);\n\t\t$this->addForeignKey('USER_ID', 'UserId', 'INTEGER', 'users', 'ID', true, null, null);\n\t\t$this->addForeignKey('OOBOOKINGTYPE_ID', 'OobookingtypeId', 'INTEGER', 'oobookingtypes', 'ID', true, null, null);\n\t\t$this->addColumn('AUTOASSIGNWORKTIMECREDIT', 'Autoassignworktimecredit', 'BOOLEAN', false, 1, null);\n\t\t// validators\n\t}", "public function __construct( ) {\n foreach( $_REQUEST as $property=>$value){\n $this->$property = $value;\n }\n \n }", "public function __construct(array $attributes = [])\n {\n $this->mergeRules([\n 'bookable_id' => ['required', new UuidRule],\n 'bookable_type' => ['required', 'string'],\n 'range' => ['required', Rule::in(DatesRangeEnum::keys())],\n 'from' => ['nullable', 'date:Y-m-d h:i:s'],\n 'to' => ['nullable', 'date:Y-m-d h:i:s', 'after_or_equal:from'],\n 'base_cost' => ['nullable', 'numeric'],\n 'unit_cost' => ['required', 'numeric'],\n 'priority' => ['nullable', 'integer'],\n 'status' => ['nullable', Rule::in(StatusEnum::keys())],\n ]);\n\n parent::__construct($attributes);\n }", "protected function prepareForValidation(): void\n {\n // $this->merge([\n // 'created_by' => Auth::user()->id\n // ]);\n // $this->merge([\n // 'updated_by' => Auth::user()->id\n // ]);\n\n // $this->merge([\n // 'status' => 'Active',\n // 'name' => $this->input('display_name'),\n // 'password' => ''\n // ]);\n\n\n // $this->merge([\n // 'slug' => str_slug($this->input('title'))\n // ]);\n // $this->merge([\n // 'posted_at' => Carbon::parse($this->input('posted_at'))\n // ]);\n }", "public function __construct(Cpf_Core_Request $request)\n\t{\n\t\tparent::__construct();\n\t\tforeach ($request as $key=>$value)\n\t\t{\n\t\t\t$this->$key = $value;\n\t\t}\n\t}", "public function update_resource_data() {\n $post_data = wp_unslash( $_POST ); // phpcs:ignore\n\n if ( ! isset( $post_data['dokan_booking_resource_update'] ) ) {\n return;\n }\n\n $post_id = intval( $post_data['resource_id'] );\n\n $post = get_post( $post_id );\n $post->post_title = sanitize_text_field( $post_data['post_title'] );\n\n wp_update_post( $post );\n\n // Qty field\n update_post_meta( $post_id, 'qty', wc_clean( $post_data['_wc_booking_qty'] ) );\n // Availability\n $availability = array();\n $row_size = isset( $post_data['wc_booking_availability_type'] ) ? count( $post_data['wc_booking_availability_type'] ) : 0;\n for ( $i = 0; $i < $row_size; $i ++ ) {\n $availability[ $i ]['type'] = wc_clean( $post_data['wc_booking_availability_type'][ $i ] );\n $availability[ $i ]['bookable'] = wc_clean( $post_data['wc_booking_availability_bookable'][ $i ] );\n $availability[ $i ]['priority'] = intval( $post_data['wc_booking_availability_priority'][ $i ] );\n\n switch ( $availability[ $i ]['type'] ) {\n case 'custom':\n $availability[ $i ]['from'] = wc_clean( $post_data['wc_booking_availability_from_date'][ $i ] );\n $availability[ $i ]['to'] = wc_clean( $post_data['wc_booking_availability_to_date'][ $i ] );\n break;\n case 'months':\n $availability[ $i ]['from'] = wc_clean( $post_data['wc_booking_availability_from_month'][ $i ] );\n $availability[ $i ]['to'] = wc_clean( $post_data['wc_booking_availability_to_month'][ $i ] );\n break;\n case 'weeks':\n $availability[ $i ]['from'] = wc_clean( $post_data['wc_booking_availability_from_week'][ $i ] );\n $availability[ $i ]['to'] = wc_clean( $post_data['wc_booking_availability_to_week'][ $i ] );\n break;\n case 'days':\n $availability[ $i ]['from'] = wc_clean( $post_data['wc_booking_availability_from_day_of_week'][ $i ] );\n $availability[ $i ]['to'] = wc_clean( $post_data['wc_booking_availability_to_day_of_week'][ $i ] );\n break;\n case 'time':\n case 'time:1':\n case 'time:2':\n case 'time:3':\n case 'time:4':\n case 'time:5':\n case 'time:6':\n case 'time:7':\n $availability[ $i ]['from'] = wc_booking_sanitize_time( $post_data['wc_booking_availability_from_time'][ $i ] );\n $availability[ $i ]['to'] = wc_booking_sanitize_time( $post_data['wc_booking_availability_to_time'][ $i ] );\n break;\n case 'time:range':\n $availability[ $i ]['from'] = wc_booking_sanitize_time( $post_data['wc_booking_availability_from_time'][ $i ] );\n $availability[ $i ]['to'] = wc_booking_sanitize_time( $post_data['wc_booking_availability_to_time'][ $i ] );\n\n $availability[ $i ]['from_date'] = wc_clean( $post_data['wc_booking_availability_from_date'][ $i ] );\n $availability[ $i ]['to_date'] = wc_clean( $post_data['wc_booking_availability_to_date'][ $i ] );\n break;\n }\n }\n update_post_meta( $post_id, '_wc_booking_availability', $availability );\n\n $redirect_url = dokan_get_navigation_url( 'booking' ) . 'resources/edit/?id=' . $post_id;\n wp_safe_redirect( add_query_arg( array( 'message' => 'success' ), $redirect_url ) );\n }", "public function build(): UpsertLocationCustomAttributeRequest\n {\n return CoreHelper::clone($this->instance);\n }", "public function distributeInquiriesToAgents(){\n \t$college_id = 6731;\n \t$org_branch_id = 254;\n \t$arr = array(292, 293, 294, 295, 296, 298 );\n\n \t$qry = Recruitment::on('bk')->where('college_id', $college_id)->select('user_id')->get();\n\n \t$arr_cnt = count($arr);\n\n \t$counter = 0;\n \tforeach ($qry as $key) {\n \t\tif ($counter > $arr_cnt -1) {\n \t\t\t$counter = 0;\n \t\t}\n\n \t\t//print_r(\"user_id \". $key->user_id. \" college_id 6731 org_portal_id \". $arr[$counter] . \"<br>\");\n\n \t\t$attr = array(\"user_id\" => $key->user_id, \"college_id\" => $college_id, \"org_portal_id\" => $arr[$counter]);\n \t\t$val = array(\"user_id\" => $key->user_id, \"college_id\" => $college_id, \"org_portal_id\" => $arr[$counter]);\n\n \t\tRecruitmentTag::updateOrCreate($attr, $val);\n \t\t$counter++;\n \t}\n\n \treturn \"success\";\n }", "public function populate_from_request()\r\n\t\t{\t\t\r\n\t\t\t// Interate through each class method.\r\n\t\t\tforeach(get_class_methods($this) as $method) \r\n\t\t\t{\t\t\r\n\t\t\t\t$key = str_replace('set_', '', $method);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t// If there is a request var with key matching\r\n\t\t\t\t// current method name, then the current method \r\n\t\t\t\t// is a set mutator for this request var. Run \r\n\t\t\t\t// it (the set method) with the request var. \r\n\t\t\t\tif(isset($_GET[$key]))\r\n\t\t\t\t{\t\t\t\t\t\r\n\t\t\t\t\t$this->$method($_GET[$key]);\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}" ]
[ "0.66758084", "0.6379349", "0.6327678", "0.6104836", "0.5334002", "0.51088935", "0.5051264", "0.49724373", "0.4933316", "0.48938915", "0.48719057", "0.48640937", "0.48487002", "0.48354745", "0.48003933", "0.4790082", "0.47699046", "0.475416", "0.47393948", "0.4736222", "0.47322866", "0.47036326", "0.46946102", "0.46907094", "0.468086", "0.46788663", "0.46784166", "0.46712354", "0.46643394", "0.46596888" ]
0.6790471
0
Determine if image needs resizing.
private function needsResizing(Image $image) { return $image->width() > $this->maxWidth || $image->height() > $this->maxHeight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkImage()\n\t{\n\t\tif (!$this->imageResized) {\n\t\t\t$this->resize($this->width, $this->height);\n\t\t}\n\t}", "public function images_done_resizing() {\r\n\t\treturn (int)$this->images_done === 1;\r\n\t}", "public function hasImageWidth()\n {\n return $this->image_width !== null;\n }", "private function _isResize()\n {\n if ($this->download || $this->output == 'pptx' || $this->output == 'docx') {\n return true;\n }\n return false;\n }", "function is_config_over_resize() {\n\treturn conditional_config('over_resize');\n}", "public function testResizeIfNeededNeeded()\n {\n $resized = Processor::resizeIfNeeded('/app/tests/tall-image.jpg', true);\n $this->assertTrue($resized);\n }", "public static function isWindowResized() : bool {}", "public function testResizeIfNeededNotNeeded()\n {\n $resized = Processor::resizeIfNeeded('/app/tests/small-image.jpg', true);\n $this->assertFalse($resized);\n\n // wide image to be resized\n $resized = Processor::resizeIfNeeded('/app/tests/wide-image.jpg', true);\n $this->assertTrue($resized);\n }", "function has_image_size($name)\n {\n }", "public function hasHardSizes() {\n return (!empty($this->cropBox['width']) && !empty($this->cropBox['height'])) ? TRUE : FALSE;\n }", "public function getImageResized()\n {\n return $this->performImageResize($this->Image());\n }", "public function checkMaxWidth()\n {\n if (!isset($this->maxWidth)) {\n return true;\n }\n if (false !== $dimension = getimagesize($this->mediaTmpName)) {\n if ($dimension[0] > $this->maxWidth) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_FILE_WIDTH_TO_LARGE, $this->maxWidth, $dimension[0]));\n return false;\n }\n } else {\n trigger_error(sprintf(\\XoopsLocale::EF_IMAGE_SIZE_NOT_FETCHED, $this->mediaTmpName), E_USER_WARNING);\n }\n return true;\n }", "function checkImg(){\n global $postpath;\n return getimagesize($postpath) !== false;\n }", "public function is_valid_image() {\n\n if ( get_post_type( $this->slide->ID ) === 'attachment' ) {\n $image_id = $this->slide->ID;\n } else {\n $image_id = get_post_thumbnail_id( $this->slide->ID );\n }\n\n $meta = wp_get_attachment_metadata( $image_id );\n\n $is_valid = isset( $meta['width'], $meta['height'] );\n\n return apply_filters( 'metaslider_is_valid_image', $is_valid, $this->slide );\n }", "function image_resize()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('resize');\n\t}", "public function _set_new_size_auto()\n {\n if (empty($this->source_width) || empty($this->source_height)) {\n if ( ! $this->SILENT_MODE) {\n trigger_error('Missing source image sizes!', E_USER_WARNING);\n }\n return false;\n }\n $k1 = $this->source_width / $this->limit_x;\n $k2 = $this->source_height / $this->limit_y;\n $k = $k1 >= $k2 ? $k1 : $k2;\n if ($this->reduce_only && $k1 <= 1 && $k2 <= 1) {\n $this->output_width = $this->source_width;\n $this->output_height = $this->source_height;\n } else {\n $this->output_width = round($this->source_width / $k, 0);\n $this->output_height = round($this->source_height / $k, 0);\n }\n return true;\n }", "private function isResizeNeeded($src_image_name, $dst_image_name)\n {\n return !file_exists($dst_image_name) || // File not exists yet\n filemtime($src_image_name) > filemtime($dst_image_name); // Source image is modified after that resized\n }", "public function validDimensions() {\n\t\tlist($width, $height) = getimagesize($this->file['tmp_name']);\n\t\n\t\tif($height <= $this->max_height && $width <= $this->max_width) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\t\t\t\t\t\n\t}", "public function hasSizes() {\n if (!empty($this->cropBox['width'])) {\n return TRUE;\n }\n\n if (!empty($this->cropBox['height'])) {\n return TRUE;\n }\n\n return FALSE;\n }", "public function hasImageHeight()\n {\n return $this->image_height !== null;\n }", "public function fileNeedsProcessing()\n {\n // @todo Implement fileNeedsProcessing() method.\n\n /**\n * Checks to perform:\n * - width/height smaller than image, keeping aspect ratio?\n */\n }", "public function image_process_gd($action = 'resize')\n\t{\n\t\t$v2_override = FALSE;\n\n\t\t// If the target width/height match the source, AND if the new file name is not equal to the old file name\n\t\t// we'll simply make a copy of the original with the new name... assuming dynamic rendering is off.\n\t\tif ($this->dynamic_output === FALSE && $this->orig_width === $this->width && $this->orig_height === $this->height)\n\t\t{\n\t\t\tif ($this->source_image !== $this->new_image && @copy($this->full_src_path, $this->full_dst_path))\n\t\t\t{\n\t\t\t\tchmod($this->full_dst_path, $this->file_permissions);\n\t\t\t}\n\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// Let's set up our values based on the action\n\t\tif ($action === 'crop')\n\t\t{\n\t\t\t// Reassign the source width/height if cropping\n\t\t\t$this->orig_width = $this->width;\n\t\t\t$this->orig_height = $this->height;\n\n\t\t\t// GD 2.0 has a cropping bug so we'll test for it\n\t\t\tif ($this->gd_version() !== FALSE)\n\t\t\t{\n\t\t\t\t$gd_version = str_replace('0', '', $this->gd_version());\n\t\t\t\t$v2_override = ($gd_version == 2);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// If resizing the x/y axis must be zero\n\t\t\t$this->x_axis = 0;\n\t\t\t$this->y_axis = 0;\n\t\t}\n\n\t\t// Create the image handle\n\t\tif ( ! ($src_img = $this->image_create_gd()))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t/* Create the image\n\t\t *\n\t\t * Old conditional which users report cause problems with shared GD libs who report themselves as \"2.0 or greater\"\n\t\t * it appears that this is no longer the issue that it was in 2004, so we've removed it, retaining it in the comment\n\t\t * below should that ever prove inaccurate.\n\t\t *\n\t\t * if ($this->image_library === 'gd2' && function_exists('imagecreatetruecolor') && $v2_override === FALSE)\n\t\t */\n\t\tif ($this->image_library === 'gd2' && function_exists('imagecreatetruecolor'))\n\t\t{\n\t\t\t$create\t= 'imagecreatetruecolor';\n\t\t\t$copy\t= 'imagecopyresampled';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$create\t= 'imagecreate';\n\t\t\t$copy\t= 'imagecopyresized';\n\t\t}\n\n\t\t$dst_img = $create($this->width, $this->height);\n\n\t\tif ($this->image_type === 3) // png we can actually preserve transparency\n\t\t{\n\t\t\timagealphablending($dst_img, FALSE);\n\t\t\timagesavealpha($dst_img, TRUE);\n\t\t}\n\n\t\t$copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height);\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($dst_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($dst_img)) // Or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($dst_img);\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}", "function imageCheck($target,$width=1,$height=1){\n if($width==1&&$height==1){\n return is_array(getimagesize($target));\n }else{\n $rvalue = false;\n if(is_array(getimagesize($target))){\n try {\n $img = new Imagick($target);\n if(strtoupper($img->getImageFormat())=='GIF'){\n $img = $img->coalesceImages();\n $img = $img->coalesceImages();\n do {\n if($width==0||$height==0)\n $img->resizeImage($width, $height, Imagick::FILTER_BOX, 1);\n else $img->resizeImage($width, $height, Imagick::FILTER_BOX, 1,true);\n } while ($img->nextImage());\n $img = $img->deconstructImages();\n $img->writeImages($target,true);\n }else{\n if($width==0||$height==0)\n $img->thumbnailImage($width, $height);\n else $img->thumbnailImage($width, $height,true);\n $img->writeImage($target);\n }\n $img->destroy();\n $rvalue = true;\n } catch (Exception $e) {\n }\n }\n return $rvalue;\n }\n}", "protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }", "public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}", "function Is_image($filename){\n \n $size = getimagesize($filename);\nif($size==FALSE){\n $er=FALSE; \n\n}else{\n $er=TRUE; \n}\nreturn $er;\n}", "public function GetImageSize() {\n\n return $this->IsValid()\n ? @getimagesize($this->TmpName) // @ - prevent warning on reading non-images\n : false;\n }", "public function resize($img, $dems)\n {\n // check if there is a need to resize based on dimensions passed\n if ($img->height() < $dems['height'] && $img->width() < $dems['width']) {\n return false;\n }\n\n // resize to dimensions\n $img->resize($dems['width'], $dems['height'], function ($con) {\n // respect aspectRatio and never upsize\n $con->aspectRatio();\n $con->upsize();\n });\n\n return true;\n }", "public function is_image()\n\t\t{\n\t\t\treturn !is_null($f = $this->format()) && $f;\n\t\t}", "public function hasImage(): bool\n {\n return $this->hasImageType(\n $this->getMimeType()\n );\n }" ]
[ "0.7325628", "0.72167456", "0.71899045", "0.7029213", "0.69956076", "0.68875074", "0.68694293", "0.6830616", "0.6621196", "0.6555775", "0.65295607", "0.6526149", "0.6515436", "0.65104705", "0.6509947", "0.64898175", "0.64841384", "0.64685374", "0.6406487", "0.63992804", "0.63157964", "0.63103783", "0.6308049", "0.6296863", "0.62799805", "0.6262513", "0.62415224", "0.6222452", "0.6181097", "0.613805" ]
0.7597212
0
Builds method type object
private function create($method_type, $config) { $class_string = $method_type; $namespaced_class = Utilities::getFullNamespace($class_string); $class = new $namespaced_class(); $object = $this->build($class, $config); return $object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function buildSearchType($method, $searchDefinition) {\n\t\t$this->_searchTypesModel->addSearchType($method, $searchDefinition);\n\t\t$this->_searchFieldsModel->addSearchFieldsForTypeId(\n\t\t\t\t$this->_searchTypesModel->getRowId(),\n\t\t\t\t$searchDefinition\n\t\t);\n\t\t$this->_searchColumnsModel->addSearchColumnsForTypeId(\n\t\t\t\t$this->_searchTypesModel->getRowId(),\n\t\t\t\t$searchDefinition\n\t\t);\n\t\t$this->_searchFormatsModel->addSearchFormatsForTypeId(\n\t\t\t\t$this->_searchTypesModel->getRowId(),\n\t\t\t\t$searchDefinition,\n\t\t\t\t$this->_searchFormatColumnsModel,\n\t\t\t\t$this->_searchColumnsModel\n\t\t);\n\t}", "public function build($type)\n\t{\n\t\t$meta = $this->meta();\n\t\t\n\t\t// Construct new builder object based on query type\n\t\tswitch ($type)\n\t\t{\n\t\t\tcase Database::SELECT:\n\t\t\t\t$this->_db_builder = DB::select();\n\t\t\t\tbreak;\n\t\t\tcase Database::UPDATE:\n\t\t\t\t$this->_db_builder = DB::update($meta->table);\n\t\t\t\tbreak;\n\t\t\tcase Database::INSERT:\n\t\t\t\t$this->_db_builder = DB::insert($meta->table);\n\t\t\t\tbreak;\n\t\t\tcase Database::DELETE:\n\t\t\t\t$this->_db_builder = DB::delete($meta->table);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t// Process pending database method calls\n\t\tforeach ($this->_db_pending as $method)\n\t\t{\n\t\t\t$name = $method['name'];\n\t\t\t$args = $method['args'];\n\n\t\t\t$this->_db_applied[$name] = $args;\n\t\t\t\n\t\t\tif (!method_exists($this->_db_builder, $method['name']))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tswitch (count($args))\n\t\t\t{\n\t\t\t\tcase 0:\n\t\t\t\t\t$this->_db_builder->$name();\n\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$this->_db_builder->$name($args[0]);\n\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$this->_db_builder->$name($args[0], $args[1]);\n\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->_db_builder->$name($args[0], $args[1], $args[2]);\n\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$this->_db_builder->$name($args[0], $args[1], $args[2], $args[3]);\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// Here comes the snail...\n\t\t\t\t\tcall_user_func_array(array($this->_db_builder, $name), $args);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_db_builder;\n\t}", "public function generate(\n ReflectionMethod $method\n ): MethodInterface {\n $returnType = $method->getReturnType();\n $astMethod = new Method(\n $method->getName(),\n $method->isPrivate() ?\n 'private' :\n ($method->isProtected() ? 'protected' : 'public'),\n $returnType !== null ? $returnType->getName() : ''\n );\n\n $astMethod->setIsAbstract($method->isAbstract());\n $astMethod->setIsFinal($method->isFinal());\n\n $parameters = [];\n foreach ($method->getParameters() as $parameter) {\n $parameters[] = $this->variableGenerator->generate($parameter);\n }\n\n $astMethod->setParameters(...$parameters);\n\n return $astMethod;\n }", "public function setMethod(string $method): BuilderInterface;", "private function build()\n\t{\n\t\tif ( (isset($_GET['trashed'])) && (intval($_GET['trashed']) > 0) ) $this->type = 'TrashConfirmation';\n\t\tif ( (isset($_GET['untrashed'])) && (intval($_GET['untrashed']) > 0) ) $this->type = 'TrashRestoredConfirmation';\n\t\tif ( (isset($_GET['linkdeleted'])) && (intval($_GET['linkdeleted']) > 0 ) ) $this->type = 'LinkDeletedConfirmation';\n\t\tif ( $this->type ) $this->createClass();\n\t}", "public function createMethod()\n {\n return $this->addExcludesNameEntry($this->methods);\n }", "protected function parseMethod() {\n $reader = $this->reader; // alias in local\n\n $method = new Method;\n $method->name = $this->mangleMethodName($reader->getAttribute('name'));\n $method->identifier = $reader->getAttribute('c:identifier');\n if($reader->getAttribute('throws')) {\n $method->throws = 1;\n }\n\n do {\n // parameter handling goes here\n if($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'parameter') {\n $method->args[] = $this->parseParameter();\n // if return-type name == the class name this is a constructor\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'return-value') {\n $method->returnValue = $this->parseReturn();\n // this will get a doc node if it exists\n } elseif($reader->nodeType == XMLReader::ELEMENT && $reader->name == 'doc') {\n $method->doc = $reader->readString();\n // this will ALWAYS stop our loop\n } elseif($reader->nodeType == XMLReader::END_ELEMENT && $reader->name == 'method') {\n break;\n }\n } while($reader->read());\n\n /* if the name of the method is ONLY free or destroy - this is a free */\n if (empty($method->args) && $method->name === 'free' || $method->name === 'destroy') {\n $e = new FreeObjectHandlerException();\n $e->method = $method;\n throw $e;\n }\n\n return $method;\n }", "function entity_operation_info_build($entity_type) {\n $instanceArgs = array(\n 'entity_type' => $entity_type,\n );\n $factoryArgs = array(\n 'entity_type' => $entity_type,\n 'instance_args' => $instanceArgs\n );\n $builder = hook_get_builder('entity_operation_info', $factoryArgs);\n $build = array($entity_type => $builder->build());\n\n return $build;\n}", "protected function buildAvailableByMethod()\n {\n \treturn $this->availableByMethod = collect((new ReflectionClass($this))->getMethods())\n\t \t->map->name\n\t \t->filter(function ($method) {\n\t \t\treturn Str::startsWith($method, 'create') && Str::endsWith($method, 'Driver');\n\t \t})\n\t \t->map(function ($method) {\n\t \t\treturn Str::replaceLast(\n\t \t\t\t'Driver',\n\t \t\t\t'',\n\t \t\t\tStr::after($method, 'create')\n\t \t\t);\n\t \t})\n\t \t->toArray();\n }", "function mdl_create_method(array $definition)\n{\n /**\n * @var ClassMethod\n */\n $method = PHPClassMethod(preg_replace(\"/\\s+/\", \"\", $definition['name']), [], isset($definition['returns']) ? str_replace(\"\\\\\\\\\", \"\\\\\", $definition['returns']) : null, $definition['modifier'] ?? 'public', $definition['comment'] ?? null);\n if (isset($definition['throws'])) {\n /**\n * @var ClassMethod\n */\n $method = $method->throws(array_map(function ($item) {\n return str_replace(\"\\\\\\\\\", \"\\\\\", $item);\n }, mdl_array_wrap($definition['throws'])));\n }\n\n if (isset($definition['parameters'])) {\n foreach (mdl_array_wrap($definition['parameters']) as $value) {\n /**\n * @var ClassMethod\n */\n $method = $method->addParameter(mdl_create_function_parameter($value));\n }\n }\n if (isset($definition['static']) && (true === boolval($definition['static']))) {\n /**\n * @var ClassMethod $method\n */\n $method = $method->asStatic(true);\n }\n if (isset($definition['lines']) && ($lines = mdl_array_wrap($definition['lines']))) {\n foreach ($lines as $line) {\n $method = $method->addLine($line);\n }\n }\n return $method;\n}", "abstract public function getReflection($method);", "abstract function build();", "private function initializeMethod()\n {\n //something like initializeScaffold\n return 'initialize' . $this->type;\n }", "abstract public function build();", "abstract public function build();", "public abstract function build();", "public abstract function build();", "private function buildTypes(array $types, ReflectionClass $reflectionClass, string $fieldName, ?string $methodOnEmptyResult)\n {\n $phpDocTypes = $this->phpDocExtractor->getTypes($reflectionClass->getName(), $fieldName) ?? [];\n foreach ($phpDocTypes as $type) {\n $types[] = $type;\n }\n // fallback checking getters/setters if no typehint was given.\n if (empty($types) && $methodOnEmptyResult) {\n $mapping = $this->$methodOnEmptyResult($reflectionClass);\n if (!isset($mapping[$fieldName])) {\n return [];\n }\n $res = TypeUtils::convertToTypeArray($mapping[$fieldName]);\n return $this->buildTypes($res, $reflectionClass, $fieldName, null);\n }\n return $this->unique($types);\n }", "function populate_method_info() {\n\n $method_info = array();\n\n // get functions\n $all_functions = get_defined_functions();\n $internal_functions = $all_functions[\"internal\"];\n\n foreach ($internal_functions as $function) {\n // populate new method record\n $function_record = array();\n $function_record[CLASS_NAME] = \"Function\";\n $function_record[METHOD_NAME] = $function;\n $function_record[IS_TESTED] = \"no\";\n $function_record[TESTS] = \"\";\n $function_record[IS_DUPLICATE] = false;\n\n // record the extension that the function belongs to\n $reflectionFunction = new ReflectionFunction($function);\n $extension = $reflectionFunction->getExtension();\n if ($extension != null) {\n $function_record[EXTENSION_NAME] = $extension->getName();\n } else {\n $function_record[EXTENSION_NAME] = \"\";\n }\n // insert new method record into info array\n $method_info[] = $function_record;\n }\n\n // get methods\n $all_classes = get_declared_classes();\n foreach ($all_classes as $class) {\n $reflectionClass = new ReflectionClass($class);\n $methods = $reflectionClass->getMethods();\n foreach ($methods as $method) {\n // populate new method record\n $new_method_record = array();\n $new_method_record[CLASS_NAME] = $reflectionClass->getName();\n $new_method_record[METHOD_NAME] = $method->getName();\n $new_method_record[IS_TESTED] = \"no\";\n $new_method_record[TESTS] = \"\";\n\n $extension = $reflectionClass->getExtension();\n if ($extension != null) {\n $new_method_record[EXTENSION_NAME] = $extension->getName();\n } else {\n $new_method_record[EXTENSION_NAME] = \"\";\n }\n\n // check for duplicate method names\n $new_method_record[IS_DUPLICATE] = false;\n foreach ($method_info as &$current_record) {\n if (strcmp($current_record[METHOD_NAME], $new_method_record[METHOD_NAME]) == 0) {\n $new_method_record[IS_DUPLICATE] = true;\n $current_record[IS_DUPLICATE] = true;\n }\n }\n // insert new method record into info array\n $method_info[] = $new_method_record;\n }\n }\n\n return $method_info;\n}", "public function make($type);", "public function getMethod();", "public function getMethod();", "public function getMethod();", "public function getMethod();", "public function getMethod();", "public function getMethod();", "public function getMethod();", "public function testGetGetMethodType() {\n $type = new MethodEnum();\n $this->assertSame('GET', MethodEnum::GET);\n $this->assertSame('GET', $type(MethodEnum::GET));\n }", "abstract public function type();", "abstract public function type();" ]
[ "0.58977085", "0.56902844", "0.56221455", "0.5559734", "0.5558954", "0.5487633", "0.5415961", "0.54136825", "0.53554404", "0.53312093", "0.5329505", "0.53057903", "0.5295661", "0.52757794", "0.52757794", "0.521268", "0.521268", "0.5190535", "0.5184549", "0.5164685", "0.51588225", "0.51588225", "0.51588225", "0.51588225", "0.51588225", "0.51588225", "0.51588225", "0.5131237", "0.511629", "0.511629" ]
0.61109024
0
Sets object property for supplied method_type object
private function setMethodType(\LewNelson\Namecheap\NamecheapMethodTypesInterface $object, $method_type) { $method_type = Utilities::convertCamelCaseToUnderscore($method_type); $this->$method_type = $object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function setMethod();", "public function setMethod($value) { $this->_method = $value; }", "public function setMethod($method);", "public function setMethod($method);", "function setObjtype($objtype) {\n $this->objtype = $objtype;\n }", "public function SetMethod ($method = NULL);", "function setMethod( $val){\n\t$this->_method = $val;\n\t}", "public function set_method($method)\n {\n }", "function setProperty(&$object, $methodName, $value) {\r\n\r\n\t\t$trace = $this->log->getLog('isTraceEnabled');\t// See: constructor\r\n\r\n\t\t// Check if we have a setter method available on this object\r\n\t\t// Note: get_class_methods(...) returns lower case method names\r\n\t\t$classMethods = get_class_methods($object);\t// array\r\n\r\n\t\t// Setup setter method name. Eg: autoCommit(...) => setAutoCommit(...)\r\n\t\t$methodName = 'set'.ucfirst($methodName);// autoCommit\r\n\r\n\t\t// Note: array_search(..) seems dodgy on PHP v4.2.2 Red Hat v6.2\r\n\t\t#if( array_search(strtolower($methodName), $classMethods) === NULL ) {\r\n\t\t#\treturn;\r\n\t\t#}\r\n\r\n\t\t$res = NULL;\r\n\t\tforeach($classMethods as $val) {\r\n\t\t\t// Have to lowercase both method names to maintain php4 compatibility\r\n\t\t\tif(strtolower($methodName) == strtolower($val)) {\r\n\t\t\t\t$res = True;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif( is_null($res) ) {\r\n\t\t return 0;\r\n\t\t}\r\n\r\n\t\t// Trace logging (if enabled)\r\n\t\t$strBuff = '';\r\n\t\tif($trace) {\r\n\t\t\t$strBuff = ' setProperty(';\r\n\t\t\t$strBuff .= get_class($object);\r\n\t\t\t$strBuff .= ', ';\r\n\t\t\t$strBuff .= $methodName;\r\n\t\t\t$strBuff .= ', ';\r\n\t\t\tif(value == NULL) {\r\n\t\t\t\t$strBuff .= '<NULL>';\r\n\t\t\t} else if( is_string($value) ) {\r\n\t\t\t\t$strBuff .= $value;\r\n } else {\r\n\t\t\t\t$strBuff .= (string) $value;\r\n }\r\n\t\t\t$strBuff .= \")\";\r\n\r\n\t\t\t$this->log->trace($strBuff);\r\n\t\t}\r\n\r\n\t\t$object->$methodName($value);\r\n\t\treturn 1; \r\n\r\n }", "public function setObject(object $object): void;", "function set_property(){\n }", "public function set_props($object_type, $args)\n {\n }", "function setObject($object);", "public function setMethod($method)\n {\n $this->method = $method;\n }", "public function set_method($method) {\n $this->_method = (string)$method;\n }", "function mdl_create_property_setter(ValueContainer $property, string $type = null, bool $immutable = false)\n{\n $type = str_replace(\"\\\\\\\\\", \"\\\\\", $type);\n $method = PHPClassMethod('set' . mdl_str_camelize($name = $property->getName()), [PHPFunctionParameter('value', $type)], 'self', 'public', \"Set $name property value\");\n return $immutable ? $method->addLine(\"\\$self = clone \\$this\")->addLine(\"\\$self->\" . $name . \" = \\$value\")->addLine(\"return \\$self\"): $method->addLine(\"\\$this->\" . $name . \" = \\$value\")->addLine(\"return \\$this\");\n}", "final function set($value){\n if(is_object($value) and get_class($value)===get_class($this)){\n $this->value = $value->get();\n $this->isset = TRUE;\n return $this->_ok();\n }\n\n // use accept for type-check\n $this->isset = FALSE;\n $typ = $this->get_type($value,FALSE,FALSE);\n if($this->accept($value,$typ)!==TRUE) \n return $this->_err(array(3,strval($value)),FALSE);\n\n // get method responisble for this type\n $mth = 'set_' . (method_exists($this,'set_' . $typ)?$typ:'default');\n $res = $this->$mth($value);\n $this->isset = $this->isok();\n return $res;\n }", "public function setMethod(string $method): self;", "public function setMethod($request_method) {}", "public function setObject(object $object): self;", "protected function setMethod($method) {\n $this->_method = $method;\n }", "public function setValue($value) {\n $this->setMethods($value);\n }", "function set($data) {\n\tif (! is_object($data)) throw new Exception('Supplied argument is not an object.');\n\t\n\tforeach (get_object_vars($data) as $prop=>$val) {\n\t if (property_exists($this,$prop)) {\n\t\t$this->$prop = $val;\n\t }\n\t}\n\t\n }", "function callbackSetValue($object,$field) {\n \n\n //echo get_class($object);\n switch ($field) {\n case 'name':\n // name does not set dirty flag - its a simple rename..\n $value = $object->get_text();\n if (@$this->$field == $value) {\n return;\n }\n $this->$field = $value;\n //print_r($this->data['TABLES'][$table]['FIELDS']);\n $this->table->database->dirty=true;\n break;\n case 'length':\n case 'default':\n $value = $object->get_text();\n if (@$this->$field == $value) {\n return;\n }\n // echo \"CHANGE?\";\n $this->$field = $value;\n //print_r($this->data['TABLES'][$table]['FIELDS']);\n $this->table->database->dirty=true;\n $this->dirty = true;\n break;\n case 'notnull':\n case 'isIndex':\n case 'sequence':\n case 'unique': \n $value = (int) $object->get_active();\n if (@$this->$field == $value) {\n return;\n }\n //echo \"CHANGE?\";\n $this->$field = $value;\n //print_r($this->data['TABLES'][$table]['FIELDS']);\n $this->table->database->dirty=true;\n $this->table->database->save();\n $this->setVisable();\n $this->dirty = true;\n break;\n default: \n echo \"opps forgot :$field\\n\";\n \n \n }\n //print_r(func_get_args());\n }", "public function setMethod($method)\n {\n $this->method = $method;\n }", "public function setMethod($method)\n {\n $this->method = $method;\n }", "public function setMethod($method)\n {\n $this->method = $method;\n }", "public function setMethod($method)\n {\n $this->method = $method;\n }", "public function setObject($object) {\n $this->object = $object;\n }", "private function setMethod(string $method): void\n {\n $this->method = $method;\n }" ]
[ "0.6512611", "0.6458118", "0.61746645", "0.61746645", "0.60321146", "0.59769195", "0.5934114", "0.5901032", "0.58191955", "0.5806323", "0.5782891", "0.57785857", "0.57784647", "0.5725926", "0.5694579", "0.5666068", "0.56530696", "0.56388265", "0.56351954", "0.5622923", "0.5592306", "0.5562308", "0.5513497", "0.5466188", "0.5453537", "0.5453537", "0.5453537", "0.5453537", "0.54459006", "0.543808" ]
0.71373475
0
if tosave is set so it the save of the stagingForm wicht this function, I only return the list a fields in error
public function getFields($tosave = null) { $status = $this->getStatus() ; if(!$status) return null ; $fieldsToShow = array(); foreach($status as $key => $value) { if($tosave) { // staging_people and institution_relationship status are updated by a trigger, so we don't care about it here if(!in_array($key,array('people','identifiers','operator','institution_relationship'))) $fieldsToShow[$key] = $value ; } else $fieldsToShow[$key] = array( 'embedded_field' => $this->getFieldsToUseFor($key).'_'.$value, // to TEST 'display_error' => self::$errors[($key=='duplicate'?$key:$value)], 'fields' => $this->getFieldsToUseFor($key)); if($key == 'duplicate') $fieldsToShow[$key]['duplicate_record'] = $value ; } return($fieldsToShow) ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSaveFields()\n {\n\n return array\n (\n 'wbfsys_person_duplicate_suspicion' => array\n (\n 'id_person',\n 'id_duplicate',\n 'id_propability',\n 'm_version',\n ),\n\n );\n\n }", "function saveForm(){\t\n\t\t$this->saveFormBase();\n\t\t$this->saveFormGeoCoverage();\n\t\t$this->saveVaFormResolution();\n\t\tif ($this->dataset->nbModForm >0) $this->saveModForm();\n\t\tif ($this->dataset->nbSatForm >0) $this->saveSatForm();\n\t\tif ($this->dataset->nbInstruForm >0) $this->saveInstruForm();\n\t\t$this->saveFormGrid();\n\t\t//Parameter\n\t\t$this->saveFormVariables($this->dataset->nbVars);\n\t\t//REQ DATA_FORMAT\n\t\t$this->dataset->required_data_formats = array();\n\t\t$this->dataset->required_data_formats[0] = new data_format;\n\t\t$this->dataset->required_data_formats[0]->data_format_id = $this->exportValue('required_data_format');\n\t}", "public function getErrors() {\r\n \t$this->getForm()->getErrors();\r\n }", "function checkSaveButtons() {\n if ($this->arrTableParameters['savedok'] || $this->arrTableParameters['saveandclosedok']) {\n $tce = GeneralUtility::makeInstance('t3lib_TCEmain');\n $tce->stripslashes_values=0;\n if (count($this->arrTableParameters['grps'])) {\n\t $arrSave['grps'] = $this->arrTableParameters['grps'];\n\t $arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = serialize($arrSave);\n } else {\n \t$arrData[$this->arrWizardParameters['table']][$this->arrWizardParameters['uid']][$this->arrWizardParameters['field']] = '';\n }\n $tce->start($arrData,array());\n\t $tce->process_datamap();\n if ($this->arrTableParameters['saveandclosedok']) {\n header('Location: ' . GeneralUtility::locationHeaderUrl($this->arrWizardParameters['returnUrl']));\n\t\t\t\texit;\n }\n }\n }", "function webform2html_edit_form_validate($form, &$form_state) {\n if ($form_state['values']['op'] == t('Save')) {\n/* if (!empty($form_state['values']['h_txt'])) {\n $header = explode('<br />', nl2br( str_replace('<br>', '<br />', $form_state['values']['h_txt']) ) );\n if ( count($header) > 5) {\n form_set_error('h_txt', t('Up to 5 rows can be set!'));\n }\n }\n\n if (!empty($form_state['values']['f_txt'])) {\n $footer = explode('<br />', nl2br( str_replace('<br>', '<br />', $form_state['values']['f_txt']) ) );\n if ( count($footer) > 2) {\n form_set_error('f_txt', t('Up to 2 rows can be set!'));\n }\n }\n\n if (!(is_numeric($form_state['values']['h_font_size']) && ($form_state['values']['h_font_size'] > 0))) {\n form_set_error('h_font_size', t('Header font size must be numeric.'));\n }\n\n if (!(is_numeric($form_state['values']['p_font_size']) && ($form_state['values']['p_font_size'] > 0))) {\n form_set_error('p_font_size', t('Content font size must be numeric.'));\n }\n\n if (!(is_numeric($form_state['values']['f_font_size']) && ($form_state['values']['f_font_size'] > 0))) {\n form_set_error('f_font_size', t('Footer font size must be numeric.'));\n }\n*/\n }\n}", "public function validateSave() {\n\t\t//0. Pobranie parametrów z walidacją\n\t\t$this->form->id = getFromRequest('id',true,'Błędne wywołanie aplikacji');\n\t\t$this->form->volt1 = getFromRequest('v1',true,'Błędne wywołanie aplikacji');\n\t\t$this->form->volt2 = getFromRequest('v2',true,'Błędne wywołanie aplikacji');\n\t\t$this->form->amps = getFromRequest('amp',true,'Błędne wywołanie aplikacji');\n $this->form->resis = getFromRequest('resistor',true,'Błędne wywołanie aplikacji');\n\n\t\tif ( getMessages()->isError() ) return false;\n\n\t\t// 1. sprawdzenie czy wartości wymagane nie są puste\n\t\tif (empty(trim($this->form->volt1))) {\n\t\t\tgetMessages()->addError('Wprowadź napięcie zasilania');\n\t\t}\n\t\tif (empty(trim($this->form->volt2))) {\n\t\t\tgetMessages()->addError('Wprowadź napięcie przewodzenia diody');\n\t\t}\n\t\tif (empty(trim($this->form->amps))) {\n\t\t\tgetMessages()->addError('Wprowadź prąd przewodzenia diody');\n\t\t}\n\n\t\tif ( getMessages()->isError() ) return false;\n\t\t\n\t\treturn ! getMessages()->isError();\n\t}", "public function validateSave() {\r\n //0. Pobranie parametrów z walidacją\r\n $this->form->id = ParamUtils::getFromRequest('id', true, 'Błędne wywołanie aplikacji');\r\n $this->form->name = ParamUtils::getFromRequest('name', true, 'Błędne wywołanie aplikacji');\r\n $this->form->surname = ParamUtils::getFromRequest('surname', true, 'Błędne wywołanie aplikacji');\r\n $this->form->birthdate = ParamUtils::getFromRequest('birthdate', true, 'Błędne wywołanie aplikacji');\r\n $this->form->jobTitle = ParamUtils::getFromRequest('jobTitle', true, 'Błędne wywołanie aplikacji');\r\n $this->form->jobPlace = ParamUtils::getFromRequest('jobPlace', true, 'Błędne wywołanie aplikacji');\r\n $this->form->userName = ParamUtils::getFromRequest('userName', true, 'Błędne wywołanie aplikacji');\r\n $this->form->role = ParamUtils::getFromRequest('role', true, 'Błędne wywołanie aplikacji');\r\n $this->form->password = ParamUtils::getFromRequest('password', true, 'Błędne wywołanie aplikacji');\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 1. sprawdzenie czy wartości wymagane nie są puste\r\n if (empty(trim($this->form->name))) {\r\n Utils::addErrorMessage('Wprowadź imię');\r\n }\r\n if (empty(trim($this->form->surname))) {\r\n Utils::addErrorMessage('Wprowadź nazwisko');\r\n }\r\n if (empty(trim($this->form->birthdate))) {\r\n Utils::addErrorMessage('Wprowadź datę urodzenia');\r\n }\r\n if (empty(trim($this->form->jobTitle))) {\r\n Utils::addErrorMessage('Wprowadź nazwę stanowiska');\r\n }\r\n if (empty(trim($this->form->jobPlace))) {\r\n Utils::addErrorMessage('Wprowadź miejsce');\r\n }\r\n if (empty(trim($this->form->userName))) {\r\n Utils::addErrorMessage('Wprowadź nazwę użytkownika');\r\n }\r\n if (empty(trim($this->form->role))) {\r\n Utils::addErrorMessage('Wprowadź role użytkownika');\r\n }\r\n if (empty(trim($this->form->password)) && empty(trim($this->form->id))) {\r\n Utils::addErrorMessage('Wprowadź hasło');\r\n }\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 2. sprawdzenie poprawności przekazanych parametrów\r\n\r\n \r\n\r\n $check_birth = $this->form->birthdate;\r\n $check_name = $this->form->name;\r\n $check_surname = $this->form->surname;\r\n\r\n $d = checkdate(substr($check_birth, 5, 2), substr($check_birth, 8, 2), substr($check_birth, 0, 4));\r\n if ($d === false || strlen($check_birth) <> 10) {\r\n Utils::addErrorMessage('Zły format daty. Przykład: 2018-12-20 lub data nie istnieje');\r\n }\r\n \r\n\r\n function my_mb_ucfirst($str) {\r\n $fc = mb_strtoupper(mb_substr($str, 0, 1));\r\n return $fc . mb_substr($str, 1);\r\n }\r\n\r\n $this->form->name = my_mb_ucfirst($check_name);\r\n $this->form->surname = my_mb_ucfirst($check_surname);\r\n\r\n// $test = App::getDB()->get('person', '*', [\r\n// 'user_name' => $this->form->userName\r\n// ]);\r\n// $testUser = $test['user_name'];\r\n// var_dump($test); \r\n// var_dump($test['user_name'] === $testUser);die;\r\n// \r\n// if($test['user_name'] === $testUser)\r\n// {\r\n// Utils::addErrorMessage('Podany użytkownik już istnieje');\r\n// }\r\n return !App::getMessages()->isError();\r\n }", "function save() {\n //save the added fields\n }", "function tower_form_errors($data, $fields=[]) {\n $form_errors = [];\n foreach ($fields as $field) {\n $rules = explode('|', $field['rules']);\n $field_is_valid = true;\n $field_name = $field['name'];\n $value = trim(sanitize_text_field($data->get_param($field_name)));\n\n foreach ($rules as $rule) {\n if (! $field_is_valid) break;\n\n switch ($rule) {\n case 'email':\n if (! filter_var($value, FILTER_VALIDATE_EMAIL)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'Enter a valid email address';\n }\n break;\n\n case 'number':\n if (! is_numeric($value)) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field needs to be numeric';\n }\n break;\n\n case 'required':\n if ($value == '') {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This field is required';\n }\n break;\n\n case 'unique':\n // check DB for meta-value duplicate entry\n global $wpdb;\n $row_count = $wpdb->get_var(\"\n SELECT COUNT(`meta_id`)\n FROM {$wpdb->postmeta} \n WHERE `meta_key` = '{$field_name}' \n AND `meta_value` = '{$value}'\n \");\n if ($row_count > 0) {\n $field_is_valid = false;\n $form_errors[$field_name] = 'This value already exists. Please select another';\n }\n break;\n }\n }\n }\n return $form_errors;\n}", "public function savesubmit(){\n\t\t$this->autoRender = false;\n\t\t if($this->request->is('POST')){ \n\t\t\t //\n\t\t \n\t\t\t$this->Session->write('project.aftersave', 'sent');\n//\t\t\t$this->Session->write('brief.type', $this->name);\n\t\t\t$this->Session->write('brief.type', $this->params['controller']);\n\t\t\t$this->Session->write('brief.id', $this->Email->id);\n\t\t\t \n\t\t\t \n\t\t\t//echo 'aftersave';\t\n\t\t\t //$this->redirect(array('controller'=>'projects', 'action' => 'view', $this->Session->read('project.id') ));\n\n\t\t }\t\t\n\t}", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "public function offerte_save() {\t\t\n\t\t\n\t\tif (!$this->session->user) {\n\t\t\taudit_log(\"Error: tentativo salvataggio offerta con utente non loggato. (admin/offerte_save)\");\n\t\t\texit(\"Operazione non consentita\");\n\t\t}\n\t\t\n\t\t// regole validazione form save\n\t\t$this->load->library('form_validation');\t\t\n\t\t$this->form_validation->set_rules('nome', 'Nome', 'required',\n\t\t\t\tarray('required' => '%s obbligatorio')\n\t\t);\n\t\t$this->form_validation->set_rules('descr[it]', 'Descrizione ITA', 'required',\n\t\t\t\tarray('required' => '%s obbligatoria')\n\t\t);\n\t\t$this->form_validation->set_rules('descr[en]', 'Descrizione ENG', 'required',\n\t\t\t\tarray('required' => '%s obbligatoria')\n\t\t);\n\t\t\n\t\t// validazione ok\n\t\tif ($this->form_validation->run() !== FALSE) {\n\t\t\t$post=$this->input->post();\t// post: {\"nome\":\"sdfsd\",\"descr\":{\"it\":\"sdfsdf\",\"en\":\"sdfsdf\"},\"accessori\":{\"it\":\"\",\"en\":\"\"},\"home_file\":\"[]\",\"gallery_files\":\"[]\",\"banner_file\":\"[]\",\"link\":\"[]\",\"btn_txt\":\"sdfsdf\",\"visible\":\"1\",\"type\":\"offerte\"}\n\t\t\t\n\t\t\t// creo record usato\n\t\t\t$record=array();\n\t\t\t$record['nome']=$post['nome'];\n\t\t\t$record['descr']=json_encode($post['descr']);\n\t\t\t$record['url']=url_title($post['nome']);\n\t\t\t$home_file=json_decode($post['home_file']);\n\t\t\t$banner_file=json_decode($post['banner_file']);\n\t\t\t// home_file e banner_file arrivano sempre come array\n\t\t\t$record['img_home']=isset($home_file[0]) ? $home_file[0] : \"null.jpg\"; // se l'utente non carica immagine uso null.jpg in sostituzione\n\t\t\t$record['img_banner']=isset($banner_file[0]) ? $banner_file[0] : \"null.jpg\";\t\t\t\n\t\t\t$record['visible']=isset($post['visible']) ? \"1\" : \"0\";\n\t\t\t$link_ita=json_decode($post['link']);\n\t\t\t$link_eng=json_decode($post['link_en']);\t\t\t\n\t\t\t$linkit=isset($link_ita[0]) ? $link_ita[0] : \"\";\n\t\t\t$linken=isset($link_eng[0]) ? $link_eng[0] : \"\";\n\t\t\t$link=new stdClass();\n\t\t\t$link->it=$linkit;\n\t\t\t$link->en=$linken;\n\t\t\t$record['link']=json_encode($link);\t\t\t\n\t\t\t$buttontext=$post['btn_txt'];\n\t\t\t$btn_txt=new stdClass();\n\t\t\t$btn_txt->it=$buttontext['it'];\n\t\t\t$btn_txt->en=$buttontext['en'];\t\t\t\t\n\t\t\t$record['btn_txt']=json_encode($btn_txt);\n\t\t\t// seo offerta\n\t\t\t$seo=new stdClass();\n\t\t\t$seo->og_title=new stdClass();\n\t\t\t$seo->og_description=new stdClass();\n\t\t\t$og_title=$post['og_title'];\n\t\t\t$og_description=$post['og_description'];\n\t\t\t$seo->og_title->it=$og_title['it'];\n\t\t\t$seo->og_title->en=$og_title['en'];\n\t\t\t$seo->og_description->it=$og_description['it'];\n\t\t\t$seo->og_description->en=$og_description['en'];\n\t\t\t$record['seo']=json_encode($seo);\n\t\t\tunset($post['og_title']);\n\t\t\tunset($post['og_description']);\n\n\t\t\t// salvo record offerta\n\t\t\tif (is_numeric($newid=$this->offerte_model->createOfferta($record))) { \n\t\t\t\t// se il return della funzione non è numerico vuol dire che contiene un messaggio di errore\n\t\t\t\taudit_log(\"Message: salvato record offerta \".json_encode($record).\" con ID $newid. (admin/offerte_save)\");\n\t\t\t\t// ridimensiono e sposto immagini tmp in cartella offerte\t\t\t\t\n\t\t\t\t$tmpStoreFolder=$this->config->item('tmp_store_folder'); \n\t\t\t\t$storeFolder=str_replace(\"%type%\",$post['type'],$this->config->item('store_folder')); \n\t\t\t\t\n\t\t\t\tif (isset($banner_file[0])) {\n\t\t\t\t\t// resize\n\t\t\t\t\t$tmpFile=$tmpStoreFolder.$banner_file[0];\n\t\t\t\t\tif ($this->common->resizeImage($tmpFile,1900,300)) {\n\t\t\t\t\t\taudit_log(\"Message: ridimensionata foto banner $tmpFile. (admin/offerte_save)\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\taudit_log(\"Warning: ridimensionamento foto banner $tmpFile non riuscito. (admin/offerte_save)\");\n\t\t\t\t\t}\n\t\t\t\t\t// spostamento\n\t\t\t\t\tif (rename ($tmpFile,$storeFolder.$banner_file[0])) {\n\t\t\t\t\t\taudit_log(\"Message: spostata foto banner \".$banner_file[0].\". (admin/offerte_save)\");\n\t\t\t\t\t\tchmod($storeFolder.$banner_file[0],0644);\n\t\t\t\t\t}else{\n\t\t\t\t\t\taudit_log(\"Error: spostamento foto banner \".$banner_file[0].\". (admin/offerte_save)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($home_file[0])) {\n\t\t\t\t\t// resize\n\t\t\t\t\t$tmpFile=$tmpStoreFolder.$home_file[0];\n\t\t\t\t\tif ($this->common->resizeImage($tmpFile,300,190)) {\n\t\t\t\t\t\taudit_log(\"Message: ridimensionata foto home $tmpFile. (admin/offerte_save)\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\taudit_log(\"Warning: ridimensionamento foto homr $tmpFile non riuscito. (admin/offerte_save)\");\n\t\t\t\t\t}\n\t\t\t\t\t// spostamento\n\t\t\t\t\tif (rename ($tmpFile,$storeFolder.$home_file[0])) {\n\t\t\t\t\t\taudit_log(\"Message: spostata foto home \".$home_file[0].\". (admin/offerte_save)\");\n\t\t\t\t\t\t//chmod($storeFolder.$home_file[0],0644);\n\t\t\t\t\t\tif (chmod($storeFolder.$home_file[0],0644)) audit_log(\"Message: modificati permessi foto home \".$storeFolder.$home_file[0].\". (admin/offerte_save)\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\taudit_log(\"Error: spostamento foto home \".$home_file[0].\". (admin/offerte_save)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$gallery_files=json_decode($post['gallery_files']);\n\t\t\t\tif (isset($gallery_files[0])) {\n\t\t\t\t\tforeach ($gallery_files as $file) {\n\t\t\t\t\t\t// resize\n\t\t\t\t\t\t$tmpFile=$tmpStoreFolder.$file;\n\t\t\t\t\t\tif ($this->common->resizeImage($tmpFile,1000,635)) {\n\t\t\t\t\t\t\taudit_log(\"Message: ridimensionata foto gallery $tmpFile. (admin/offerte_save)\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\taudit_log(\"Warning: ridimensionamento foto gallery $tmpFile non riuscito. (admin/offerte_save)\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// spostamento\n\t\t\t\t\t\tif (rename ($tmpFile,$storeFolder.$file)) {\n\t\t\t\t\t\t\taudit_log(\"Message: spostata foto gallery \".$file.\". (admin/offerte_save)\");\n\t\t\t\t\t\t\tchmod($storeFolder.$file,0644);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\taudit_log(\"Error: spostamento foto gallery \".$file.\". (admin/offerte_save)\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// sposto allegati in directory public\n\t\t\t\t$attachStoreFolder=$this->config->item('public_folder');\n\t\t\t\tif (isset($link_ita[0])) {\n\t\t\t\t\t$tmpFile=$tmpStoreFolder.$link_ita[0];\n\t\t\t\t\t// spostamento\n\t\t\t\t\tif (rename ($tmpFile,$attachStoreFolder.$link_ita[0])) {\n\t\t\t\t\t\taudit_log(\"Message: spostato allegato ita \".$link_ita[0].\". (admin/offerte_save)\");\n\t\t\t\t\t\tchmod($attachStoreFolder.$link_ita[0],0644);\n\t\t\t\t\t}else{\n\t\t\t\t\t\taudit_log(\"Error: spostamento allegato ita \".$link_ita[0].\". (admin/offerte_save)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (isset($link_eng[0])) {\n\t\t\t\t\t$tmpFile=$tmpStoreFolder.$link_eng[0];\n\t\t\t\t\t// spostamento\n\t\t\t\t\tif (rename ($tmpFile,$attachStoreFolder.$link_eng[0])) {\n\t\t\t\t\t\taudit_log(\"Message: spostato allegato eng \".$link_eng[0].\". (admin/offerte_save)\");\n\t\t\t\t\t\tchmod($attachStoreFolder.$link_eng[0],0644);\n\t\t\t\t\t}else{\n\t\t\t\t\t\taudit_log(\"Error: spostamento allegato eng \".$link_eng[0].\". (admin/offerte_save)\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// creo array offerte_pics\n\t\t\t\tif (count($gallery_files) > 0){\n\t\t\t\t\t$pics=array();\n\t\t\t\t\tforeach ($gallery_files as $val) {\n\t\t\t\t\t\t$pics[]=array(\"id_offerta\"=>$newid,\"pic\"=>$val);\n\t\t\t\t\t}\n\t\t\t\t\t// salvo batch offerte_pics\n\t\t\t\t\tif ($this->offerte_model->createOffertaPics($pics)) {\n\t\t\t\t\t\taudit_log(\"Message: create foto gallery offerta \".json_encode($pics).\". (admin/offerte_save)\");\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\taudit_log(\"Error: creazione foto gallery offerta \".json_encode($pics).\". (admin/offerte_save)\");\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->session->set_flashdata('save','Salvataggio offerta completato');\n\t\t\t\t$this->session->set_flashdata('save_status','success');\n\t\t\t\taudit_log(\"Message: salvataggio offerta completato. (admin/offerte_save)\");\n\t\t\t\techo $newid;\n\t\t\t}else{\n\t\t\t\taudit_log(\"Error: salvataggio record offerta \".json_encode($record).\". Errore DB \".$newid['message'].\". (admin/offerte_save)\");\t\t\t\t\n\t\t\t\techo $newid['message']; // errore db query createUsato\n\t\t\t}\t\t\t\n\t\t}else{\n\t\t\t// validazione no\n\t\t\techo strip_tags(validation_errors());\n\t\t}\n\t\t\t\t\n\t}", "function gatherFormFields($submitType)\n{\n\t// then pass the data to the appropriate function for\n\t// editing or insertion.\n\t\n\t$arrFields = array(); // To hold the sanitized values\n\t\n\t// Field: ID\n\tif (isset($_POST['dealid']))\n\t{\n\t\t$id = (int)$_POST['dealid'];\n\t}\n\telse\n\t{\n\t\t$submitType = 'new';\t// Even if this was submitted as an edit, if no dealid was provided, create a new record.\n\t}\n\t\n\t// Field: company\n\tif (isset($_POST['edit_company']))\n\t{\n\t\t$arrFields['store'] = intval($_POST['edit_company']);\n\t}\n\telse\n\t{\n\t\t$arrFields['store'] = null;\n\t}\n\t\n\t// Field: dealurl\n\tif (isset($_POST['edit_dealurl']))\n\t{\n\t\t$arrFields['dealurl'] = mysql_real_escape_string($_POST['edit_dealurl']);\n\t}\n\telse\n\t{\n\t\t$arrFields['dealurl'] = '';\n\t}\n\n\t// Field: img\n\tif (isset($_POST['edit_image']))\n\t{\n\t\t$arrFields['img'] = mysql_real_escape_string($_POST['edit_image']);\n\t}\n\telse\n\t{\n\t\t$arrFields['img'] = '';\n\t}\n\n\t// Field: imgurl\n\tif (isset($_POST['edit_imageurl']))\n\t{\n\t\t$arrFields['imgurl'] = mysql_real_escape_string($_POST['edit_imageurl']);\n\t}\n\telse\n\t{\n\t\t$arrFields['imgurl'] = '';\n\t}\n\n\t// Field: showdate\n\tif (isset($_POST['edit_show_date']))\n\t{\n\t\t$arrFields['showdate'] = mysql_real_escape_string($_POST['edit_show_date']);\n\t}\n\telse\n\t{\n\t\t$arrFields['showdate'] = date('Y-m-d H:i:s');\n\t}\n\n\t// Field: expire\n\tif (isset($_POST['edit_expiration_date']))\n\t{\n\t\t$arrFields['expire'] = mysql_real_escape_string($_POST['edit_expiration_date']);\n\t}\n\telse\n\t{\n\t\t$arrFields['expire'] = null;\n\t}\n\n\t// Field: valid\n\tif (isset($_POST['edit_valid']))\n\t{\n\t\t$arrFields['valid'] = intval($_POST['edit_valid']);\n\t}\n\telse\n\t{\n\t\t$arrFields['valid'] = 1;\n\t}\n\t\n\t// Field: invalidreason\n\tif (isset($_POST['edit_invalidreason']))\n\t{\n\t\t$arrFields['invalidreason'] = mysql_real_escape_string($_POST['edit_invalidreason']);\n\t}\n\telse\n\t{\n\t\t$arrFields['invalidreason'] = '';\n\t}\n\t\n\t// Field: subject\n\tif (isset($_POST['edit_subject']))\n\t{\n\t\t$arrFields['subject'] = mysql_real_escape_string($_POST['edit_subject']);\n\t}\n\telse\n\t{\n\t\t$arrFields['subject'] = '';\n\t}\n\t\n\t// Field: brief\n\tif (isset($_POST['edit_brief']))\n\t{\n\t\t$arrFields['brief'] = mysql_real_escape_string($_POST['edit_brief']);\n\t\t$arrFields['verbose'] = mysql_real_escape_string($_POST['edit_brief']);\n\t}\n\telse\n\t{\n\t\t$arrFields['brief'] = '';\n\t\t$arrFields['verbose'] = '';\n\t}\n\n\t// Field: updated\n\t$arrFields['updated']\t\t= date('Y-m-d H:i:s');\n\t$arrFields['whoupdated']\t= $_SESSION['firstname'];\n\t\n\tif ($submitType == 'edit')\n\t{\n\t\tsaveEdit($arrFields, $id);\n\t}\n\telse\n\t{\n\t\tsaveNew($arrFields);\n\t}\n}", "public function afterSave(){\n\t\t$Log = Logger::getLogger(\"accessLog\");\n\n\t\tif($this->oldAttributes==NULL)\n \t\t$action=\"create\";\n \telse \t\n \t\t$action=\"update\";\n \t\n\t\t$uid=Yii::app()->user->getState(\"uid\");\n\t \t$Log->info($uid.\"\\t\".Yii::app()->user->name.\"\\t\".$this->getModelName().\"\\t\".$action.\"\\t\".$this->orgId);\t\n\t \n\t \tif($this->orgName != $this->oldAttributes['orgName'])\n\t \t\t{$Log->info(\"orgName \".$this->oldAttributes['orgName'].\" \".$this->orgName);}\n\t \tif($this->noEmp != $this->oldAttributes['noEmp'])\n\t \t\t{$Log->info(\"noEmp \".$this->oldAttributes['noEmp'].\" \".$this->noEmp);}\n\t\tif($this->phone != $this->oldAttributes['phone'])\n\t \t\t{$Log->info(\"phone \".$this->oldAttributes['phone'].\" \".$this->phone);}\n\t\tif($this->email != $this->oldAttributes['email'])\n\t \t\t{$Log->info(\"email \".$this->oldAttributes['email'].\" \".$this->email);}\n\t\tif($this->addr1 != $this->oldAttributes['addr1'])\n\t \t\t{$Log->info(\"addr1 \".$this->oldAttributes['addr1'].\" \".$this->addr1);}\n\t\tif($this->addr2 != $this->oldAttributes['addr2'])\n\t \t\t{$Log->info(\"addr2 \".$this->oldAttributes['addr2'].\" \".$this->addr2);}\n\t\tif($this->state != $this->oldAttributes['state'])\n\t \t\t{$Log->info(\"state \".$this->oldAttributes['state'].\" \".$this->state);}\n\t\tif($this->country != $this->oldAttributes['country'])\n\t \t\t{$Log->info(\"country \".$this->oldAttributes['country'].\" \".$this->country);}\n\t\tif($this->orgType != $this->oldAttributes['orgType'])\n\t \t\t{$Log->info(\"orgType \".$this->oldAttributes['orgType'].\" \".$this->orgType);}\n\t\tif($this->description != $this->oldAttributes['description'])\n\t \t\t{$Log->info(\"description \".$this->oldAttributes['description'].\" \".$this->description);}\n\t\tif($this->fax != $this->oldAttributes['fax'])\n\t \t\t{$Log->info(\"fax \".$this->oldAttributes['fax'].\" \".$this->fax);}\n\t\tif($this->validity != $this->oldAttributes['validity'])\n\t \t\t{$Log->info(\"validity \".$this->oldAttributes['validity'].\" \".$this->validity);}\t\t\t\t\t\t\t\t\n\treturn parent::afterSave();\t\n\t}", "function save_all()\n {\n $total = FSInput::get('total', 0, 'int');\n if (!$total)\n return true;\n $field_change = FSInput::get('field_change');\n if (!$field_change)\n return false;\n $field_change_arr = explode(',', $field_change);\n $total_field_change = count($field_change_arr);\n $record_change_success = 0;\n for ($i = 0; $i < $total; $i++){\n $row = array();\n $update = 0;\n foreach ($field_change_arr as $field_item)\n {\n $field_value_original = FSInput::get($field_item . '_' . $i . '_original');\n $field_value_new = FSInput::get($field_item . '_' . $i);\n if (is_array($field_value_new))\n {\n $field_value_new = count($field_value_new) ? ',' . implode(',', $field_value_new) .\n ',' : '';\n }\n if ($field_value_original != $field_value_new)\n {\n $update = 1;\n $row[$field_item] = $field_value_new;\n }\n }\n if ($update)\n {\n $id = FSInput::get('id_' . $i, 0, 'int');\n $str_update = '';\n global $db;\n $j = 0;\n foreach ($row as $key => $value)\n {\n if ($j > 0)\n $str_update .= ',';\n $str_update .= \"`\" . $key . \"` = '\" . $value . \"'\";\n $j++;\n }\n $sql = ' UPDATE ' . $this->table_name . ' SET ';\n $sql .= $str_update;\n $sql .= ' WHERE id = ' . $id . ' ';\n $db->query($sql);\n $rows = $db->affected_rows();\n if (!$rows)\n return false;\n $record_change_success++;\n }\n }\n return $record_change_success;\n }", "static function save_parameters($sanitized_post) {\n\t\t$title = $sanitized_post ['sarbacane_widget_title'];\n\t\t$description = $sanitized_post ['sarbacane_widget_description'];\n\t\t$registration_button = $sanitized_post ['sarbacane_widget_registration_button'];\n\t\t$registration_message = $sanitized_post ['sarbacane_widget_registration_message'];\n\t\t$field_number = $sanitized_post ['sarbacane_field_number'];\n\t\t$fields = get_option ( \"sarbacane_news_fields\", array () );\n\t\t$new_fields = array ();\n\t\t// On parse le resultat de la requete pour recuperer les libelles et les valeurs par defaut parametres\n\t\tif (isset ( $field_number ) && $field_number > 0) {\n\t\t\tfor($i = 0; $i < $field_number; $i ++) {\n\t\t\t\t$field_config = new stdClass ();\n\t\t\t\tif (isset ( $sanitized_post ['sarbacane_label_' . $i] ) && '' != $sanitized_post ['sarbacane_label_' . $i]) {\n\t\t\t\t\t$field_config->label = $sanitized_post ['sarbacane_label_' . $i];\n\t\t\t\t\tif (isset ( $sanitized_post ['sarbacane_field_' . $i] ) && '' != $sanitized_post ['sarbacane_field_' . $i]) {\n\t\t\t\t\t\t$field_config->placeholder = $sanitized_post ['sarbacane_field_' . $i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$field_config->placeholder = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t$field_config->mandatory = isset ( $sanitized_post ['sarbacane_mandatory_' . $i] ) && $sanitized_post ['sarbacane_mandatory_' . $i] == \"true\";\n\t\t\t\t\tarray_push ( $new_fields, $field_config );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Ici on a une difference de structure, des champs ont ete ajoutes ou supprimes\n\t\t// On flag une option pour qu'a la prochaine syncro, tout soit vide puis ajoute.\n\t\tif ($new_fields != $fields) {\n\t\t\t$sd_idEnregistres = get_option ( 'sarbacane_sd_id_list', array () );\n\t\t\tforeach ( $sd_idEnregistres as $sd_idEnregistre ) {\n\t\t\t\tupdate_option ( 'sarbacane_news_list_reset_' . $sd_idEnregistre, true );\n\t\t\t}\n\t\t}\n\t\tupdate_option ( 'sarbacane_news_title', $title );\n\t\tupdate_option ( 'sarbacane_news_description', $description );\n\t\tupdate_option ( 'sarbacane_news_fields', $new_fields );\n\t\tupdate_option ( 'sarbacane_news_registration_message', $registration_message );\n\t\tupdate_option ( 'sarbacane_news_registration_button', $registration_button );\n\t}", "public function validateSave() {\r\n //0. Pobranie parametrów z walidacją\r\n $this->form->id = ParamUtils::getFromRequest('id', true, 'Błędne wywołanie aplikacji');\r\n $this->form->distance = ParamUtils::getFromRequest('distance', true, 'Błędne wywołanie aplikacji');\r\n $this->form->startTime = ParamUtils::getFromRequest('startTime', true, 'Błędne wywołanie aplikacji');\r\n $this->form->endTime = ParamUtils::getFromRequest('endTime', true, 'Błędne wywołanie aplikacji');\r\n $this->form->cityFrom = ParamUtils::getFromRequest('cityFrom', true, 'Błędne wywołanie aplikacji');\r\n $this->form->cityTo = ParamUtils::getFromRequest('cityTo', true, 'Błędne wywołanie aplikacji');\r\n $this->form->personId = ParamUtils::getFromRequest('personId', true, 'Błędne wywołanie aplikacji');\r\n $this->form->carId = ParamUtils::getFromRequest('carId', true, 'Błędne wywołanie aplikacji');\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 1. sprawdzenie czy wartości wymagane nie są puste\r\n if (empty(trim($this->form->distance))) {\r\n Utils::addErrorMessage('Wprowadź dystans');\r\n }\r\n if (empty(trim($this->form->startTime))) {\r\n Utils::addErrorMessage('Wprowadź datę wyjazdu');\r\n }\r\n if (empty(trim($this->form->endTime))) {\r\n Utils::addErrorMessage('Wprowadź datę przyjazdu na miejsce');\r\n }\r\n if (empty(trim($this->form->cityFrom))) {\r\n Utils::addErrorMessage('Wprowadź miejsce początkowe');\r\n }\r\n if (empty(trim($this->form->cityTo))) {\r\n Utils::addErrorMessage('Wprowadź miejsce końcowe');\r\n }\r\n if (empty(trim($this->form->personId))) {\r\n Utils::addErrorMessage('Wprowadź pracownika');\r\n }\r\n if (empty(trim($this->form->carId))) {\r\n Utils::addErrorMessage('Wprowadź pojazd');\r\n }\r\n\r\n if (App::getMessages()->isError())\r\n return false;\r\n\r\n // 2. sprawdzenie poprawności przekazanych parametrów\r\n $check_distance = is_numeric($this->form->distance);\r\n if ($check_distance === false) {\r\n Utils::addErrorMessage('Dystans musi być liczbą');\r\n }\r\n\r\n //sprawdzenie poprawnosci daty\r\n\r\n $sT = $this->form->startTime;\r\n $eT = $this->form->endTime;\r\n\r\n $check_timeStart = checkdate(substr($sT, 5, 2), substr($sT, 8, 2), substr($sT, 0, 4));\r\n $check_timeEnd = checkdate(substr($eT, 5, 2), substr($eT, 8, 2), substr($eT, 0, 4));\r\n\r\n if ($check_timeEnd === false) {\r\n Utils::addErrorMessage('Zły format daty. Przykład: 2018-01-01 00:00:00 lub czeski błąd');\r\n }\r\n\r\n if ($check_timeStart === false) {\r\n Utils::addErrorMessage('Zły format daty. Przykład: 2018-01-01 00:00:00 lub czeski błąd');\r\n }\r\n\r\n return !App::getMessages()->isError();\r\n }", "function several_records_form($params, $action, $data)\n{\n $conn = $GLOBALS['connection_TBSM'];\n\n $show_fields_arr = array(\n 'PFR_FO',\n 'PFR_ID_FO',\n 'PFR_TORG',\n 'PFR_ID_TORG',\n 'PFR_NAZN',\n 'NODE',\n 'PFR_OBJECT',\n 'PFR_OBJECTSERVER',\n 'SUBCATEGORY',\n 'AGENT_NODE',\n 'SITFILTER',\n 'PFR_KE_TORS',\n 'SERVICE_NAME',\n 'URL',\n 'TEMS',\n );\n $actions_arr = array (\n \"cancel\" => array (\n \"text\" \t=> \"Вернуться\",\n \"image\" \t=> \"images/arrowdown.png\",\n \"title\" \t=> \"Вернуться назад\",\n \"onclick\" => \"return true;\", // return confirm('Сделанные изменения не будут сохранены! Вернуться?');\",\n ),\n \"save_several\" => array (\n \"text\" \t=> \"Сохранить\",\n \"image\" \t=> \"images/ok.png\",\n \"title\" \t=> \"Добавить записи в PFR_LOCATIONS\",\n \"onclick\" => \"return confirm('Добавить все записи в PFR_LOCATIONS?');\",\n ),\n );\n $example_subcategory = '';\n $return_status = true;\n\n // insert records into PFR_LOCATIONS\n if ($action == 'save') {\n foreach ($_POST['rec'] as $rec) {\n $fields = \"\";\n $values = \"\";\n foreach ($rec as $field => $value) {\n $fields .= \"{$field}, \";\n switch ($data[0][$field]['COLTYPE']) {\n case 'INTEGER':\n $values .= intval($value) . \", \";\n break;\n case 'TIMESTMP':\n $values .= \"'\" . date(\"Y-m-d H:i:s\") . \"', \";\n break;\n default:\n $values .= \"'{$value}', \";\n break;\n }\n }\n $fields = rtrim($fields, \", \");\n $values = rtrim($values, \", \");\n\n $ins = \"insert into DB2INST1.PFR_LOCATIONS ({$fields}) values ({$values})\";\n $stmt = db2_prepare($conn, $ins);\n $return_status = $return_status ? db2_execute($stmt) : $return_status;\n }\n return $return_status;\n }\n\n // web-form output\n echo \"<h3>Добавление записей в таблицу PFR_LOCATIONS</h3>\";\n echo \"<h4 class='tr_rec_toggle'>Показать/скрыть примеры записей</h4>\";\n echo \"<form action='{$_SERVER[\"PHP_SELF\"]}?{$params}' method='post'>\";\n echo \"<table border='1' cellspacing='0' cellpadding='5'>\";\n echo \"<tr>\";\n foreach ($data[0] as $field => $prop)\n if (in_array($field, $show_fields_arr))\n echo \"<th>{$field}</th>\";\n echo \"</tr>\";\n $i = 0;\n foreach ($data as $rec) {\n if ($i++ == 0)\n continue;\n echo \"<tr class='new_records'>\";\n foreach ($data[0] as $field => $prop) {\n if (in_array($field, $show_fields_arr)) {\n echo \"<td>\";\n if ($field == 'SUBCATEGORY') {\n echo \"<select size = '1' id = 'subcategory' name = 'rec[$i][$field]'>\";\n foreach (subcategory_expected($rec['NODE']['VALUE']) as $val) {\n echo \"<option value = '{$val}'>$val</option>\";\n if ($i == 2 and empty($example_subcategory))\n $example_subcategory = $val;\n }\n echo \"</select>\";\n }\n else\n echo \"<input type='text' name='rec[$i][$field]' value='\".(array_key_exists($field, $rec) ? $rec[$field]['VALUE'] : '').\n \"' maxlength='{$prop['LENGTH']}' \".($prop['COLTYPE'] == 'INTEGER' ? \"pattern=\\\"[-]?[0-9]+\\\"\" : '').\n \" onkeydown=\\\"this.style.width = ((this.value.length + 1) * 7) + 'px';\\\">\";\n// size='\".(($field == 'PFR_ID_FO' or $field == 'PFR_ID_TORG' or $field == 'TEMS') ? '10' : '20').\"'\n echo \"</td>\";\n }\n }\n echo \"</tr>\";\n // example records from PFR_LOCATIONS\n if ($i == 2) {\n $sel = \"select * from DB2INST1.PFR_LOCATIONS where SUBCATEGORY = '{$example_subcategory}' and PFR_NAZN <> 'AUTO_DEFAULT'\";\n $stmt = db2_prepare($conn, $sel);\n if (!db2_execute($stmt))\n return false;\n $k = 0;\n while ($row = db2_fetch_assoc($stmt)) {\n echo \"<tr class='rec_hide example_records'>\";\n foreach ($data[0] as $field => $prop)\n if (in_array($field, $show_fields_arr))\n echo \"<td>{$row[$field]}</td>\";\n echo \"</tr>\";\n if (++$k == 10)\n break;\n }\n }\n }\n echo \"</table><br>\";\n foreach ($actions_arr as $key => $value)\n echo \"<button type='submit' name='sendRequest' value='{$key}' title='{$value['title']}' onclick=\\\"{$value['onclick']}\\\"><img src='{$value['image']}' width='16' height='16'>&nbsp;{$value['text']}</button>&emsp;\";\n echo \"</form>\";\n return true;\n}", "protected function callAfterSuccessfulSave()\n\t{\n\t\tforeach($this->editFields as $f)\n\t\t{\n\t\t\t$this->getControl($f, $this->id)->afterSuccessfulSave();\n\t\t}\n\t}", "public function getRequestFieldsToSave(){\n\t\treturn array();\n\t}", "public function savea(){\n\t\t $success = 'false';\n\t\t $config = array(array('field' => 'nombre', 'label' => 'Nombre', 'rules' => 'trim|required'),\n\t\t\t\t\t\tarray('field' => 'apellido', 'label' => 'Apellido', 'rules' => 'trim|required'),\n\t\t\t\t\t\tarray('field' => 'email', 'label' => 'Email', 'rules' => 'trim|required|valid_email'),\n\t\t\t\t\t );\n\t\t $this->form_validation->set_rules($config);\n\t\t if($this->form_validation->run()==FALSE){\n\t\t\t$this->form_validation->set_error_delimiters('<li>', '</li>');\n\t\t\t$responseType = 'function';\n\t\t\t$function = 'appendFormMessages';\n\t\t\t$messages = validation_errors();\n\t\t\t$data = array('success' => $success, 'responseType'=>$responseType, 'messages'=>$messages, 'value'=>$function);\n\t\t } else {\n\t\t\t$user_info = $this->db->get_where($this->table,array('id'=>$this->id))->row();\n\t\t\t$status = 0;\n\t\t\tif (isset($_POST['status'])) $status = 1;\n\t\t\t$values = array('nombre' => filter_input(INPUT_POST,'nombre'),\n\t\t\t\t\t\t\t'apellido' => filter_input(INPUT_POST,'apellido'),\n\t\t\t\t\t\t\t'email' => filter_input(INPUT_POST,'email'),\n\t\t\t\t\t\t\t'status' => $status\n\t\t\t\t\t\t\t);\n\t\t\t#STATUS PAGOS\n\t\t\t/*\n\t\t\tif($status===0) {\n\t\t\t\t$pago_status['pago_status'] = '-1';\n\t\t\t\t$pago_status['status'] = 'cancelled';\n\t\t\t}\n\t\t\t$payment_status = filter_input(INPUT_POST,'payment_status');\n\t\t\tif($status===1 && ($payment_status != $user_info->medio_pago) ) {\n\t\t\t\tswitch($payment_status) {\n\t\t\t\t\tcase 'rejected':\n\t\t\t\t\tcase 'refunded':\n\t\t\t\t\tcase 'refunded':\n\t\t\t\t\tcase 'cancelled':\n\t\t\t\t\tcase 'in_mediation':\n\t\t\t\t\tcase 'sin_pago':\n\t\t\t\t\t\t$pago_status['pago_status'] = '-1';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'approved':\n\t\t\t\t\t\t$pago_status['pago_status'] = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'in_process':\n\t\t\t\t\tcase 'pending':\n\t\t\t\t\t\t$pago_status['pago_status'] = 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$pago_status['status'] = $payment_status;\n\t\t\t}\n\t\t\t#SI EL PASS CAMBIA AL DEFAULT ORSONIA LO ACTUALIZO\n\t\t\tif($this->input->post('password') != md5($this->check_pass)) {\n\t\t\t\t\t$values['password'] = $this->input->post('password', true);\n\t\t\t}\n\t\t\t*/\n\t\t\t#VALIDACIÓN CAMBIO PAGOS\n\t\t\t#$pago_status = array();\n\t\t\t#$medio_pago = $this->input->post('medio_pago',true);\n\t\t\t#$payment_status = $this->input->post('payment_status',true);\n\t\t\t#$monto = $this->input->post('monto',true);\n\t\t\t#CAMBIO\n\t\t\t#$values = array('medio_pago' => $medio_pago,\n\t\t\t # 'monto' => $monto\n\t\t\t # );\n\t\t\t/*\n\t\t\t$invitacion = 0;\n\t\t\tif (isset($_POST['autorizar'])) $invitacion = 2;\n\t\t\tif($invitacion==2){\n\t\t\t\t$values = array_merge($values, array('invitacion'=>$invitacion));\n\t\t\t}\n\t\t\t*/\n\t\t\t/*\n\t\t\tif($medio_pago != $user_info->medio_pago){\n\t\t\t\t$pago_status['currency_id'] = 'ARS';\n\t\t\t\t$pago_status['status'] = $payment_status;\n\t\t\t\t$pago_status['collection_id'] = \"\";\n\t\t\t\t$pago_status['collection_status'] = \"\";\n\t\t\t\t$pago_status['preference_id'] = \"\";\n\t\t\t\t$pago_status['payment_type'] = $medio_pago;\n\t\t\t}\n\t\t\tif($monto!=$user_info->monto){\n\t\t\t\t$pago_status['transaction_amount'] = $monto;\n\t\t\t}\n\t\t\tswitch($payment_status) {\n\t\t\t\tcase 'rejected':\n\t\t\t\tcase 'refunded':\n\t\t\t\tcase 'refunded':\n\t\t\t\tcase 'cancelled':\n\t\t\t\tcase 'in_mediation':\n\t\t\t\tcase 'sin_pago':\n\t\t\t\t\t$pago_status['pago_status'] = '-1';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'approved':\n\t\t\t\t\t$pago_status['pago_status'] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'in_process':\n\t\t\t\tcase 'pending':\n\t\t\t\t\t$pago_status['pago_status'] = 2;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$pago_status['status'] = $payment_status;\n\t\t\t*/\n\t\t\tswitch($this->params['iu']) {\n\t\t\t\tcase 'new':\n\t\t\t\t\t/*\n\t\t\t\t\t$query = $this->db->insert($this->table, array_merge($values,$this->i));\n\t\t\t\t\t$this->session->set_flashdata('insert_success', 'Registro Insertado Exitosamente');\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'update':\n\t\t\t\t\t$this->db->where('id',$this->id);\n\t\t\t\t\t$query = $this->db->update($this->table, array_merge($values,$this->u));\n\t\t\t\t\t/*\n\t\t\t\t\tif($query){\n\t\t\t\t\t\tif($medio_pago != $user_info->medio_pago){\n\t\t\t\t\t\t\t$subject = \"Cambio Medio de Pago - Argentina Visión 2020\";\n\t\t\t\t\t\t\tif($medio_pago == 'transferencia_bancaria') {\n\t\t\t\t\t\t\t\t$body = $this->view('email/transferencia_bancaria',array('user_info'=>$user_info));\n\t\t\t\t\t\t\t} else if ($medio_pago == 'mercado_pago') {\n\t\t\t\t\t\t\t\t$body = $this->view('email/mercado_pago',array('user_info'=>$user_info));\n\t\t\t\t\t\t\t} else if ($medio_pago == 'pago_mis_cuentas'){\n\t\t\t\t\t\t\t\t$body = $this->view('email/pago_mis_cuentas',array('user_info'=>$user_info));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->Email->send('email_info',$user_info->email, $subject,$body);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($user_info->medio_pago=='transferencia_bancaria' && $payment_status=='approved' && $pago_info->status != $payment_status){\n\t\t\t\t\t\t\t$subject = \"Transferencia Bancaria Acreditada - Argentina Visión 2020\";\n\t\t\t\t\t\t\t$body = $this->view('email/transferencia_bancaria_ok',array('user_info'=>$user_info, 'evento'=>$this->Evento->getEvento()));\n\t\t\t\t\t\t\t$this->Email->send('email_info',$user_info->email, $subject,$body);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($user_info->medio_pago=='pago_mis_cuentas' && $payment_status=='approved' && $pago_info->status != $payment_status){\n\t\t\t\t\t\t\t$subject = \"Pago Mis Cuentas Acreditado - Argentina Visión 2020\";\n\t\t\t\t\t\t\t$body = $this->view('email/transferencia_bancaria_ok',array('user_info'=>$user_info,'evento'=>$this->Evento->getEvento()));\n\t\t\t\t\t\t\t$this->Email->send('email_info',$user_info->email, $subject,$body);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t*/\n\t\t\t\t\t$this->session->set_flashdata('insert_success', 'Registro Actualizado Exitosamente');\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif($query){\n\t\t\t\t$success = true;\n\t\t\t\t$responseType = 'redirect';\n\t\t\t\t$data = array('success' =>$success,'responseType'=>$responseType, 'value'=>base_url('module/load/m/'.$this->module.'/a/listado'));\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "function getSaveParameters()\r\n\t\t{\r\n\t\t\treturn $this->_saveParameters;\r\n\t\t}", "public function onSave()\n {\n try\n {\n TTransaction::open($this->database);\n\n $data = $this->form->getData();\n\n $object = new Format;\n $object->id = $data->id;\n $object->name = $data->name;\n $object->format_key = $data->format_key;\n\n $this->form->validate();\n $object->store();\n $data->id = $object->id;\n $this->form->setData($data);\n\n TTransaction::close();\n\n new TMessage('info', AdiantiCoreTranslator::translate('Record saved'));\n\n return $object;\n\n } catch (Exception $e) //in case of exception\n {\n //Get the form data\n $object = $this->form->getData($this->activeRecord);\n $this->form->setData($object);\n new TMessage('error', $e->getMessage());\n TTransaction::rollback();\n }\n }", "public function save() {\r\n $this->model->reverseInstantiate($_REQUEST);\r\n $message = array();\r\n\r\n if ($this->model->firstname == '') {\r\n $message['firstname'] = \"Firstname cannot be empty\";\r\n }\r\n\r\n if ($this->model->lastname == '') {\r\n $message['lastname'] = \"Lastname cannot be empty\";\r\n }\r\n\r\n if (count($message) == 0) {\r\n if (!($this->model->save())) {\r\n $message['message'] = ' No changes are made to the form';\r\n } else {\r\n $message['url'] = $this->api->getApplicationUrl() . 'contact/view?id=' . $this->model->id;\r\n $message['message'] = 'Saved Successfully';\r\n }\r\n } else {\r\n $message['message'] = 'Please Correct The Below Form Details and Try Saving';\r\n }\r\n echo json_encode($message);\r\n return true;\r\n }", "public function getFormErrors()\n {\n return $this->form->getErrors();\n }", "protected function _prepareForm()\n {\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n )\n );\n \n $this->setForm($form);\n $fieldset = $form->addFieldset('message_form', array('legend'=>Mage::helper('orderprocessing')->__('Message')));\n $fieldset->addField('id', 'hidden', array(\n 'name' => 'id',\n )\n );\n $fieldset->addField('created_at', 'label', array(\n 'label' => Mage::helper('orderprocessing')->__('Created_at'),\n 'name' => 'created_at',\n ));\n $fieldset->addField('message_type', 'label', array(\n 'label' => Mage::helper('orderprocessing')->__('Message type'),\n 'name' => 'message_type',\n ));\n $fieldset->addField('shop_order_id', 'label', array(\n 'label' => Mage::helper('orderprocessing')->__('Order Id'),\n 'name' => 'shop_order_id',\n ));\n $fieldset->addField('processed_at', 'label', array(\n 'label' => Mage::helper('orderprocessing')->__('Processed at'),\n 'name' => 'processed_at',\n ));\n $fieldset->addField('exception_log', 'textarea', array(\n 'label' => Mage::helper('orderprocessing')->__('Exception log'),\n 'style' => 'width: 1000px;',\n 'name' => 'exception_log',\n #'disabled' => true,\n ));\n $fieldset->addField('status_xml', 'select', array(\n 'label' => Mage::helper('orderprocessing')->__('Status'),\n 'name' => 'status_xml',\n 'values' => array(\n array(\n 'value' => 'open',\n 'label' => Mage::helper('orderprocessing')->__('open'),\n ),\n array(\n 'value' => 'complete',\n 'label' => Mage::helper('orderprocessing')->__('complete'),\n ),\n array(\n 'value' => 'error',\n 'label' => Mage::helper('orderprocessing')->__('error'),\n ),\n ),\n 'value' => 1,\n ));\n \n #$form->setAction($this->getUrl('*/adminhtml_brands/save'));\n #$form->setMethod('post');\n $form->setUseContainer(true);\n #$form->setId('edit_form');\n\n if($this->getRequest()->getParam('id')) {\n $id = $this->getRequest()->getParam('id');\n $data = Mage::getModel('orderprocessing/message')->load($id);\n $form->setValues($data->getData());\n \n }\n return parent::_prepareForm();\n }", "final private function errors(bool $edit = false) {\n global $http;\n\n $this->nombre = $http->request->get('nombre');\n $this->lugar = $http->request->get('lugar');\n $this->rif = $http->request->get('rif');\n $this->telefono = $http->request->get('telefono');\n $this->costo = $http->request->get('costo');\n $this->encargado = $http->request->get('encargado');\n\n if($this->functions->e($this->nombre,$this->lugar,$this->rif,$this->telefono,$this->costo,$this->encargado)){\n throw new ModelsException(\"Todos los campos son obligatorios\");\n };\n\n # throw new ModelsException('¡Esto es un error!');\n }", "function dumpFormItems()\r\n {\r\n }", "function dumpFormItems()\r\n {\r\n }", "function displayEditForm($origArr,&$conf,$exporttype='',$print='',$printerName='',$printServerName='')\t{\n\t\t//We merge data with override values and eval values ...\n\t\t$currentArr = array_merge($origArr,(array)$this->dataArr);\n\t\t\n\t\t$arr=explode(',',$conf['fieldList']);\n\t\t$pluginId=$conf['pluginId'];\n\t\t$back_lnk = $this->conf['typoscript.'][$pluginId.'.']['edit.']['nobackbutton']?false:($this->conf['typoscript.']['default.']['edit.']['nobackbutton']?false:true);\n\t\tforeach($arr as $key) {\n\t\t\tif (in_array(substr($key,0,11),array('--div--;Tab','--fsb--;FSB','--fse--;FSE'))) continue;\n\n\t\t\tif (!$this->markerArray['###EVAL_ERROR_FIELD_'.$key.'###']) {\n\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$key.'###']='';\n\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$key.'###']='';\n\t\t\t}\n\t\t\tif (!$this->markerArray['###EVAL_ERROR_FIELD_'.str_replace('.','_',$key).'###']) $this->markerArray['###EVAL_ERROR_FIELD_'.str_replace('.','_',$key).'###']='';\n\t\t\tif ( $GLOBALS['TCA'][$this->theTable]['columns'][$key]['config']['type']=='group' && $GLOBALS['TCA'][$this->theTable]['columns'][$key]['config']['internal_type']=='file')\t{\n\t\t\t\tif (!$this->markerArray['###EVAL_ERROR_FIELD_'.$key.'_file###']) {\n\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$key.'_file###']='';\n\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$key.'_file###']='';\n\t\t\t\t}\n\t\t\t\tif (!$this->markerArray['###EVAL_FIELD_'.$key.'_file_file###']) $this->markerArray['###EVAL_FIELD_'.$key.'_file_file###']='';\n\t\t\t\tif (!$this->markerArray['###EVAL_FIELD_'.$key.'_file###']) $this->markerArray['###EVAL_FIELD_'.$key.'_file###']='';\n\t\t\t\tif (!$this->markerArray['###FIELD_'.$key.'_file_file###']) $this->markerArray['###FIELD_'.$key.'_file_file###']='';\n\t\t\t\tif (!$this->markerArray['###FIELD_'.$key.'_file###']) $this->markerArray['###FIELD_'.$key.'_file###']='';\n\t\t\t\t// we handle here field_file copy in field.\n\t\t\t//if ($this->dataArr[$key.'_file'] and !in_array($this->dataArr[$key.'_file'],explode(',',$currentArr[$key]))) $currentArr[$key]=$currentArr[$key]?$currentArr[$key].','.$this->dataArr[$key.'_file']:$this->dataArr[$key.'_file'];\n\t\t\t}\n\t\t}\n\t\tif ($this->conf['debug'])\tdebug('displayEditForm(): '.'###TEMPLATE_EDIT'.$this->previewLabel.'###',1);\n\t\t$templateCode = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_EDIT'.$this->previewLabel.($exporttype?'_'.$exporttype:'').'###');\n\t\t//@todo handle preview template correctly\n\t\tif (!$templateCode) $templateCode = $this->cObj->getSubpart($this->templateCode, '###TEMPLATE_EDIT'.($exporttype?'_'.$exporttype:'').'###');\n\t\t//error_log(__METHOD__.\":\".$this->previewLabel.($exporttype?'_'.$exporttype:'').\"-\".$templateCode);\n\t\t$failure = t3lib_div::_GP('noWarnings')?'':$this->failure;\n\t\tif (!$failure)\t{$templateCode = $this->cObj->substituteSubpart($templateCode, '###SUB_REQUIRED_FIELDS_WARNING###', '');}\n\t\t$templateCode = $this->removeRequired($templateCode,$failure);\n\t\t$this->metafeeditlib->setCObjects($this->conf,$this->markerArray,$templateCode,$currentArr);\n\t\t//krumo($this->markerArray);\n\t\t\n\t\t$markerArray = $this->cObj->fillInMarkerArray($this->markerArray, $currentArr, '', TRUE, 'FIELD_', FALSE);\n\t\t$markerArray = $this->cObj->fillInMarkerArray($markerArray,$this->conf['inputvar.']['gpvars'], '', TRUE, 'GP_', FALSE);\n\t\t\n\t\t//$markerArray = $this->cObj->fillInMarkerArray($this->markerArray, $currentArr, '', TRUE, 'FIELD_', $this->conf['general.']['xhtml']);\n\t\t$markerArray['###HIDDENFIELDS###'].= '<input type=\"hidden\" name=\"FE['.$this->theTable.']['.$this->conf['uidField'].']\" value=\"'.$currentArr[$this->conf['uidField']].'\" />'.($conf['blogData']?'<input type=\"hidden\" name=\"cameFromBlog['.$pluginId.']\" value=\"1\" />':'');\n\t\tif ($this->conf['edit.']['preview'] && !$this->previewLabel)\t{$markerArray['###HIDDENFIELDS###'].= '<input type=\"hidden\" name=\"preview['.$pluginId.']\" value=\"1\" />';}\n\t\t// Here we handle actions\n\t\t\n\t\t$actions =array('SAVE','DELETE','BACK', 'NEW','PDF');\n\t\t$action=array();\n\t\tif ($this->conf['list.']['recordactions']) {\n \t\t$ActionArr=t3lib_div::trimexplode(chr(10),$this->conf['list.']['recordactions']);\n\t\tforeach($ActionArr as $act) {\n\t\t\t\t$cmdarr=t3lib_div::trimexplode('|',$act);\n\t\t\t\tif (count($cmdarr)>2) {\n\t\t\t\t\t$actionId=$cmdarr[0];\n\t\t\t\t\t$actionLib=$cmdarr[1];\n\t\t\t\t\t$actionUrl=$cmdarr[2];\n\t\t\t\t} else {\n\t\t\t\t\t$actionId=$this->metafeeditlib->enleveaccentsetespaces($cmdarr[0]);\n\t\t\t\t\t$actionLib=$cmdarr[0];\n\t\t\t\t\t$actionUrl=$cmdarr[1];\n\t\t\t\t}\n\t\t\t\t$actionId=strtoupper($actionId);\n\t\t\t\t$actions[]=$actionId;\n\t\t\t\t$js='this.form.action=\\''.$actionUrl.'\\'; this.form.submit();';\n\t\t\t\t$action[$actionId]='<div class=\"'.$this->pi_getClassName('action-'.$actionId).'\"><form name=\"'.$actionLib.'\" method=\"post\" action=\"\"><button type=\"submit\" name=\"'.$actionLib.'['.$pluginId.']\" value=\"'.$actionLib.'\" onclick=\"'.$js.'\" '.$this->pi_classParam('form-submit').'>'.$actionLib.'</button></form></div>';\n\t\t\t}\n\t\t}\n\t\t\n\n\t\tif($this->conf['delete']) {\t\t\t\n\t\t\t//$backURL=rawurlencode($this->metafeeditlib->makeFormTypoLink($this->conf,\"&rU[$pluginId]=\".$this->recUid));\n\t\t\tif($this->conf['delete.']['preview'] && !$this->conf['disableDelete'] && !$this->conf['disableEditDelete']) {\n\t\t\t\t//$deleteURL=$this->metafeeditlib->makeFormTypoLink($this->conf,\"&cmd[$pluginId]=delete&preview[$pluginId]=1&rU[$pluginId]=\".$this->recUid.\"&backURL[$pluginId]=\".$backURL);\n\t\t\t\t$deleteURL=$this->metafeeditlib->makeFormTypoLink($this->conf,\"&cmd[$pluginId]=delete&preview[$pluginId]=1&rU[$pluginId]=\".$this->recUid);\n\t\t\t\t$js='this.form.action=\\''.$deleteURL.'\\'; this.form.submit();';\n\t\t\t\t//<form name=\"'.$this->metafeeditlib->getLL(\"edit_delete_label\",$this->conf).'\" method=\"post\" action=\"\">\n\t\t\t\t$action['DELETE']='<div><button type=\"submit\" class=\"'.$this->pi_getClassName('action').' '.$this->pi_getClassName('action-DELETE').'\" name=\"'.$this->metafeeditlib->getLL(\"edit_delete_label\",$this->conf).'['.$pluginId.']\" value=\"delete\" onclick=\"'.$js.'\">'.$this->metafeeditlib->getLL(\"edit_delete_label\",$this->conf).'</button></div>'; //</form>\n\t\t\t} else if (!$this->conf['disableDelete'] && !$this->conf['disableEditDelete']) {\n\t\t\t\t//$deleteURL=$this->metafeeditlib->makeFormTypoLink($this->conf,\"&cmd[$pluginId]=delete&rU[$pluginId]=\".$this->recUid.\"&backURL[$pluginId]=\".$backURL);\n\t\t\t\t$deleteURL=$this->metafeeditlib->makeFormTypoLink($this->conf,\"&cmd[$pluginId]=delete&rU[$pluginId]=\".$this->recUid);\n\t\t\t\t$js='this.form.action=\\''.$deleteURL.'\\'; this.form.submit();';\n\t\t\t\t//<form name=\"'.$this->metafeeditlib->getLL(\"edit_delete_label\",$this->conf).'\" method=\"post\" action=\"\">\n\t\t\t\t$action['DELETE']='<div><button type=\"submit\" class=\"'.$this->pi_getClassName('action').' '.$this->pi_getClassName('action-DELETE').'\" name=\"'.$this->metafeeditlib->getLL(\"edit_delete_label\",$this->conf).'['.$pluginId.']\" value=\"\" onclick=\"'.$js.'\">'.$this->metafeeditlib->getLL(\"edit_delete_label\",$this->conf).'</button></div>'; //</form>\n\t\t\t}\n\t\t}\n\t\n\t\t$action['SAVE']=($this->conf['disableEdit']|| $this->conf['blogData'])?'':'<div class=\"'.$this->pi_getClassName('action-SAVE').'\" ><button type=\"submit\" name=\"submit['.$pluginId.']\" value=\"'.($this->conf['edit.']['preview']?'preview':'save').'\" '.$this->pi_classParam('form-submit').'>'.($this->conf['edit.']['preview']?$this->metafeeditlib->getLL(\"edit_submit_label\",$this->conf):$this->metafeeditlib->getLL(\"edit_preview_submit_label\",$this->conf)).'</button></div>';\n\t\t// We handle Export Actions Here\n\t\t$action['PDF']=$conf['edit.']['pdf']?$this->metafeeditexport->CreatePDFButtonDetail($conf,$conf['caller'],false,$this->recUid):'';\n\t\t//modif OSR 2006-12-09 Add \"add new\" button in edit screen. onclick on the button , document reload with the create url \n\t\t//maybe need an value in conf to disable this button\n\t\t//new_url is set with the current url and with cmd = create , rU = , \n\t\t\n\t\t$js='this.form.action=\\'###NEW_URL###\\'; this.form.submit();';\n\t\t//<form name=\"'.$this->metafeeditlib->getLL(\"back_label\",$this->conf).'\" method=\"post\" action=\"\">\n\t\t$action['NEW']=($this->conf['disableCreate']||$this->conf['create.']['hide'])?'':'<div><button type=\"submit\" class=\"'.$this->pi_getClassName('action').' '.$this->pi_getClassName('action-NEW').'\" name=\"'.$this->metafeeditlib->getLL(\"new_label\",$this->conf).'['.$pluginId.']\" value=\"new\" onclick=\"'. $js .'\" />'.$this->metafeeditlib->getLL(\"new_label\",$this->conf).'</button></div>'; //</form>\n\t\t$js='this.form.action=\\'###BACK_URL###\\'; this.form.submit();';\n\t\t//<form name=\"'.$this->metafeeditlib->getLL(\"back_label\",$this->conf).'\" method=\"post\" action=\"\">\n\t\t$action['BACK']=($back_lnk)?'<div><button type=\"submit\" class=\"'.$this->pi_getClassName('action').' '.$this->pi_getClassName('action-BACK').'\" name=\"'.$this->metafeeditlib->getLL(\"back_label\",$this->conf).'['.$pluginId.']\" value=\"back\" onclick=\"'. $js .'\" />'.$this->metafeeditlib->getLL(\"back_label\",$this->conf).'</button></div>':'';//</form>\n\n\t\tforeach($actions as $act) {\n\t\t\t$markerArray['###ACTION-'.$act.'###']=$this->conf['no_action']?'':$this->cObj->substituteMarkerArray($action[$act],$markerArray);\n\t\t}\n\t\t// End of actions\n \t\t$content = $this->cObj->substituteSubpart($templateCode,'###TEMPLATE_BLOG###',$this->metafeeditlib->getBlogComments($templateCode,$this->theTable,$this->recUid,$this->conf));\n\t\tif ($this->conf['blogData']) $content = $this->cObj->substituteSubpart($content,'###PREVIEWACTIONS###',$action['BACK']); ;\n\n\t\t$content = $this->cObj->substituteMarkerArray($content, $markerArray);\n\t\tif ($conf['debug.']['markerArray']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray($markerArray);\n\t\t// Blog Comment Display :\n\t\t// We handle empty fields here ..\n \t\tif ($this->conf['preview.']['noemptyfields'] && $this->preview) {\n\t\t\tforeach($arr as $key) {\n\t\t\t\tif (!$currentArr[$key]) {\n\t\t\t\t\t$cnt = '';\n\t\t\t\t\t$content=$this->cObj->substituteSubpart($content, '###editITEM-'.$key.'###',$cnt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($this->conf['edit.']['field_stdWrap.']) {\n\t\t\t\t\t\t$this->cObj->start($currentArr,$this->theTable);\n\t\t\tforeach($arr as $key) {\n\t\t\t\tif ($this->conf['edit.']['field_stdWrap.'][$key.'.']) {\n\t\t\t\t\t$cnt = $this->cObj->getSubpart($content, '###editITEM-'.$key.'###');\n\t\t\t\t\t$cnt = $this->cObj->stdWrap($cnt,$this->conf['edit.']['field_stdWrap.'][$key.'.']);\n\t\t\t\t\t$content=$this->cObj->substituteSubpart($content, '###editITEM-'.$key.'###',$cnt);\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t\t$this->conf['reportmode']='edit';\n\t\t//error_log(__METHOD__.\":\".$this->conf['reportmode']);\n\t\tswitch ($exporttype)\n\t\t{\n\t\t\tcase \"CSV\":\n\t\t\t\t$this->metafeeditexport->getCSV($content,$this,$this->piVars['exportfile']);\n\t\t\t\tbreak;\n\t\t\tcase \"PDF\": \n\t\t\t\t$this->metafeeditexport->getPDF($content,$this,$print,$printerName,$printServerName,$this->piVars['exportfile']);\n\t\t\t\tbreak;\n\t\t\tcase \"PDFTAB\": \n\t\t\t\t$this->metafeeditexport->getPDFTAB($content,$this,$print,$printerName,$printServerName,$this->piVars['exportfile']);\n\t\t\t\tbreak;\n\t\t\tcase \"PDFDET\": \n\t\t\t\t\t$this->metafeeditexport->getPDFDET($content,$this,$print,$printerName,$printServerName,$this->piVars['exportfile']);\n\t\t\t\tbreak;\n\t\t\tcase \"XLS\":\n\t\t\tcase \"EXCEL\": \n\t\t\t\t$this->metafeeditexport->getEXCEL($content,$this,$this->piVars['exportfile']);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$content = $this->cObj->stdWrap($content,$this->conf['edit.']['formWrap.']);\n\t\t$content.=$this->cObj->getUpdateJS($this->modifyDataArrForFormUpdate($currentArr), $this->theTable.'_form', 'FE['.$this->theTable.']', $this->conf['fieldList'].$this->additionalUpdateFields);\n\t\t$content.=$this->conf['blog.']['allowComments']?$this->cObj->getUpdateJS($this->modifyDataArrForFormUpdate($currentArr), 'tx_metafeedit_comments_form', 'FE[tx_metafeedit_comments]', $this->conf['blogFieldList']):'';\n\t\treturn $content;\n\t}" ]
[ "0.64540917", "0.62416196", "0.5938166", "0.5923529", "0.5823536", "0.5763204", "0.57592934", "0.5660893", "0.5592263", "0.55548", "0.5552234", "0.5537295", "0.5530391", "0.55245465", "0.55153376", "0.54783213", "0.5473285", "0.5468797", "0.5464053", "0.54572165", "0.54545456", "0.54492015", "0.5440062", "0.54372257", "0.54321903", "0.5419067", "0.54158413", "0.5389223", "0.5389223", "0.53879166" ]
0.67482036
0
Run all worker instances.
public static function runAll() { static::checkSapiEnv(); static::init(); static::daemonize(); static::initWorkers(); static::installSignal(); static::saveMasterPid(); static::displayUI(); static::forkWorkers(); static::resetStd(); static::monitorWorkers(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n $workers = Worker::factory()->count(7)->create();\n }", "public function run()\n {\n $workerList = [\n \"Андрей\",\n \"Сергей\",\n \"Михаил\",\n \"Стас\",\n \"Артем\",\n \"Татьяна\",\n \"Евгений\",\n \"Катя\",\n \"Борис\",\n ];\n\n\n foreach ($workerList as $item) {\n (new Workers([\"name\" => $item]))->save();\n }\n }", "private static function runAll () {\n\t\tif(empty(self::$registered)) return;\n\n\t\tforeach(self::$registered as $plugin) {\n\t\t\t$plugin->run();\n\t\t}\n\t}", "public function runAll()\n {\n $this->init()->run()->done();\n }", "public function run(): void\n {\n foreach ($this->seeders as $seeder) {\n $this->call($seeder);\n }\n }", "public function run() {\n\t\t$this->create_instances();\n\t\t$this->register_hooks();\n\t}", "public function run()\n {\n for ($i = 0;$i < 1000;$i++) {\n $this->call(bookSeeder::class);\n }\n }", "public function run()\n { \n \t\tforeach ($this->seeders as $seeder) {\n \t $this->call($seeder);\n \t\t} \n }", "public function run()\n {\n foreach($this->seeds as $seed)\n {\n call_user_func([$this, $seed]);\n }\n }", "public function run()\n {\n $this->call(specialites::class);\n $this->call(cancers::class);\n $this->call(organes::class);\n $this->call(wilayas::class);\n $this->call(dairas::class);\n $this->call(communes::class);\n $this->call(employes::class);\n $this->call(permissions::class);\n $this->call(roles::class);\n $this->call(users::class);\n }", "public function main()\n {\n $workers = $this->getWorkers();\n $deadWorkers = [];\n $aliveWorkers = [];\n\n foreach($workers as $worker) {\n $isAlive = CremillaWorker::isAlive($worker->pid);\n if(!$isAlive) {\n $deadWorkers[] = $worker;\n }else{\n $aliveWorkers[] = $worker->id;\n }\n }\n\n if(!empty($aliveWorkers)) {\n $event = new Event('Cremilla.Worker.alive', $this, [\n 'data' => [\n 'aliveWorkers' => $aliveWorkers\n ]\n ]);\n $this->dispatchEvent($event);\n }\n\n if(!empty($deadWorkers)) {\n if($this->shouldNotifyWorkersDead(count($aliveWorkers))) {\n $event = new Event('Cremilla.Worker.dead', $this, [\n 'data' => [\n 'deadWorkers' => $deadWorkers\n ]\n ]);\n $this->dispatchEvent($event);\n }\n }\n }", "public function go() {\n $this->startAllWorkers();\n $this->doWorkParent();\n }", "public function run()\n {\n /**\n * Mandamos a llamar los seeders\n * recuerda que primero se debe crear wallets \n * y al final Trasnsfers\n */\n $this->call(WalletsTableSeeder::class);\n $this->call(TransfersTableSeeder::class);\n }", "public static function run()\n {\n // Suppose we have the filtered `$serverCollection` variable\n\n // Validating the servers the tasks should run on.\n // (Auth object, configurations etc)\n foreach ($serverCollection as $Server) {\n $Server->validate();\n }\n\n // running tasks on servers\n }", "public function run()\n {\n $this->call(SocialIcons::class);\n $this->call(BackgroundImages::class);\n $this->call(UserAdminAcount::class);\n }", "public static function flushAllInstances()\n\t{\n\t\tforeach (self::$clients AS $client)\n\t\t{\n\t\t\t$client->flushBatch();\n\t\t}\n\t}", "public function run()\n {\n $this->call(CharactersSeeder::class);\n $this->call(EventSeeder::class);\n $this->call(StorySeeder::class);\n $this->call(SeriesSeeder::class);\n $this->call(ComicsSeeder::class);\n $this->call(CharactersComicsSeeder::class);\n }", "public function run()\n {\n\n $cleaners = factory(Cleaner::class, 20)->create();\n\n foreach ($cleaners as $cleaner) {\n\n $cities = City::inRandomOrder()->take(2)->get();\n\n $cleaner->cities()->sync($cities->pluck('id')->all());\n\n }\n\n }", "public function run()\n {\n $this->call(BarangsSeeder::class);\n $this->call(TravellerSeeder::class);\n $this->call(ActivityTravellerSeeder::class);\n $this->call(RequesterSeeder::class);\n $this->call(ActRequesterSeeder::class);\n $this->call(UsersSeeder::class);\n $this->call(PenggunaSeeder::class);\n $this->call(PostRQSeeder::class);\n\n }", "public static function all()\n\t{\n\t\t$workers = Resque::redis()->smembers('workers');\n\t\tif (!is_array($workers)) {\n\t\t\t$workers = array();\n\t\t}\n\n\t\t$instances = array();\n\t\tforeach ($workers as $workerId) {\n\t\t\t$instances[] = self::find($workerId);\n\t\t}\n\t\treturn $instances;\n\t}", "private function killAllWorkers() {\n global $workers;\n\n // Send each worker SIGTERM\n foreach ($workers as $workerID => $pid) {\n gosUtility_parallel::$logger->info(\"Killing worker $workerID (pid $pid)\");\n posix_kill($pid, SIGTERM);\n }\n\n // Wait for all of them to die\n foreach ($workers as $workerID => $pid) {\n gosUtility_parallel::$logger->info(\"Waiting on worker $workerID (pid $pid)\");\n pcntl_waitpid($pid, $status);\n }\n\n unset($workers);\n }", "public function run()\n {\n factory(Tag::class, 5)->create();\n factory(DispatchJob::class, 9)->create();\n\n $jobs = DispatchJob::all();\n\n foreach ($jobs as $job) {\n /** @var Collection $groups */\n $groups = factory(Group::class, rand(3,5))->make();\n\n $job->groups()->saveMany($groups);\n }\n\n unset($jobs);\n\n $groups = Group::all();\n\n $tags = Tag::all();\n foreach ($groups as $group) {\n /** @var Collection $links */\n $links = factory(Link::class, rand(4, 7))->make();\n $group->links()->saveMany($links);\n }\n $links = Link::all();\n $links->each(function (Link $link) use ($tags) {\n $link->tags()->attach($tags->random(rand(1,2))->pluck('id')->toArray());\n });\n }", "public function run()\n {\n Model::unguard();\n\n foreach ($this->seeders as $seeder) {\n $this->call($seeder);\n }\n\n Model::reguard();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(ClientSeeder::class);\n $this->call(MotorSeeder::class);\n $this->call(InsuranceSeeder::class);\n $this->call(PlotSeeder::class);\n $this->call(CompanySeeder::class);\n $this->call(WorkerSeeder::class);\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n $this->call(DriversSeeder::class);\n $this->call(CarsSeeder::class);\n $this->call(TracksSeeder::class);\n $this->call(TrackLayoutSeeder::class);\n $this->call(CarConfigurationSeeder::class);\n $this->call(LapsSeeder::class);\n }", "public function run()\n {\n factory(Store::class, 10)->create()->each(function ($store) {\n $store->articles()->save(factory(Article::class)->make());\n });\n }", "public function run()\n {\n $this->call([\n UsersTableSeeder::class,\n CompaniesTableSeeder::class,\n ]);\n\n Jobpost::disableSearchSyncing();\n $this->call(JobpostsTableSeeder::class);\n Jobpost::all()->searchable();\n Jobpost::enableSearchSyncing();\n }", "public function run()\n {\n foreach(range(1,50) as $index)\n {\n Task::create($this->data($index));\n }\n }", "public function run()\n {\n $this->call([\n RequestCriticalitySeeder::class,\n RequestStatusSeeder::class,\n EmployeeSeeder::class,\n UserTypeSeeder::class,\n UserSeeder::class\n ]);\n }", "public function run()\n {\n $this->call(CountriesSeed::class);\n $this->call(ReplayMapsSeeding::class);\n $this->call(ReplayTypesSeeding::class);\n $this->call(ForumSectionSeeding::class);\n $this->call(UserRoleSeeding::class);\n $this->call(GameVersionSeeding::class);\n }" ]
[ "0.76064914", "0.7161087", "0.6960634", "0.6868446", "0.6694918", "0.6642178", "0.65178114", "0.6493948", "0.64603776", "0.6445839", "0.6411748", "0.63739115", "0.63141024", "0.62988764", "0.62928337", "0.6283509", "0.62760395", "0.62691885", "0.6248755", "0.6241529", "0.6235878", "0.6222981", "0.6221889", "0.62199146", "0.62013525", "0.6197133", "0.61816657", "0.6172744", "0.61603314", "0.6158147" ]
0.7536842
1
Get Target from Date
public function getTargetFromDate($date) { if (!preg_match('/^\d{4,14}$/', $date)) { throw new \InvalidArgumentException('Invalid date. Format is YYYY[MM[DD[HH[II[SS]]]]].'); } // what we need to append to the date according to the possible date string lengths $dateStrlenToAppend = [ 14 => '', 12 => '00', 10 => '0000', 8 => '000000', 6 => '01000000', 4 => '0101000000', ]; if (!isset($dateStrlenToAppend[strlen($date)])) { throw new \InvalidArgumentException('Invalid date. Format is YYYY[MM[DD[HH[II[SS]]]]].'); } $target = $date . $dateStrlenToAppend[strlen($date)]; $dateTime = \DateTime::createFromFormat('YmdHis', $target); if ($dateTime === false) { throw new \InvalidArgumentException('Invalid date. Format is YYYY[MM[DD[HH[II[SS]]]]].'); } return $dateTime->format('YmdHis'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTargetTime()\n {\n return $this->target_time;\n }", "protected function getTargetFile() {\r\n\t\treturn str_replace('%s', $this->currentDate, $this->file);\r\n\t}", "function CloseToTarget($target_date){ \n \n $now = new DateTime(); \n $diff = abs(strtotime($target_date) - strtotime($now));\n return $diff; \n echo $now; \n \n }", "public function getTarget()\n {\n return $this->Target;\n }", "public function getTarget() {\n\n $strTarget = $this->target;\n\n if( $this->active !== '1' || ($this->stop !== '' && $this->stop <= time()) ) {\n\n if( !empty($this->fallback) ) {\n\n $strTarget = $this->fallback;\n\n } else {\n\n return null;\n }\n }\n\n $strTarget = Controller::replaceInsertTags($strTarget);\n\n if( !parse_url($strTarget, PHP_URL_HOST) ) {\n\n $strTarget = Environment::get('httpHost').'/'.$strTarget;\n }\n if( !parse_url($strTarget, PHP_URL_SCHEME) ) {\n\n $strTarget = 'http://'.$strTarget;\n }\n\n return $strTarget;\n }", "public function getTarget() {\r\n return $this->target;\r\n }", "public function getTarget()\n {\n return $this->target;\n }", "public function getTarget()\n {\n return $this->target;\n }", "public function getTarget()\n {\n return $this->target;\n }", "public function getTarget()\n {\n return $this->target;\n }", "public function getTarget()\n {\n return $this->target;\n }", "public function getTarget()\n {\n return $this->target;\n }", "public function getTarget()\n {\n return $this->target;\n }", "public function get_target() {\n\t\treturn $this->target;\n\t}", "public function getReceptionDate();", "public function getTarget() {\n\t\treturn $this->target;\n\t}", "public function getManualDateStop() {}", "public function getTarget()\n\t{\n\t\treturn $this->target;\n\t}", "public function getTarget()\n\t{\n\t\treturn $this->target;\n\t}", "protected function getCurrentTarget() {}", "public function getTarget()\n {\n // TODO: Implement getTarget() method.\n }", "public function getTarget()\n {\n // TODO: Implement getTarget() method.\n }", "public function target() {\n if (userLogedIn()) {\n if(check_access('target')){\n $fromDate = date(\"Y-m-d\", strtotime(\"first day of this month\"));\n if (isset($_POST['fromDate'])) {\n $date = explode('/', $this->input->post('repDate'));\n $day = $date[1];\n $month = $date[0];\n $year = $date[2];\n $fromDate = $year . '-' . $month . '-' . $day;\n }\n $data['get_target'] = $this->admin_model->get_target($fromDate);\n \n $date = explode('-', $fromDate);\n $day = $date[2];\n $month = $date[1];\n $year = $date[0];\n $fromDate = $month . '/' . $day . '/' . $year;\n $data['fromDate'] = $fromDate;\n $this->load->view(\"admin/target\", $data);\n }\n \n \n else{\n $url=$this->router->fetch_class().'/'.$this->router->fetch_method(); \n // echo $url;\n myLoader('No Access', 'home/login');\n }\n } else {\n $this->load->view('admin/login');\n }\n }", "function getTarget() {return $this->_target;}", "public function shouldTargetToCurrentDay()\n {\n return $this->targetToCurrentDay;\n }", "public function target();", "public static function GET_AREA_TARGET_STOP_DATE(){\n\t $SQL_String = \"SELECT ano,area_name,date_start,date_end,reason,_active FROM area_main LEFT JOIN area_stop ON ano=am_id WHERE asno=:asno AND area_main._keep=1 AND area_stop._keep=1;\";\n\t return $SQL_String;\n\t}", "public function getTaskTarget()\n {\n return $this->get(self::_TASK_TARGET);\n }", "public function getTaskTarget()\n {\n return $this->get(self::_TASK_TARGET);\n }", "public function getManualDateStart() {}" ]
[ "0.6328818", "0.5766447", "0.5612685", "0.55479383", "0.5543659", "0.5509828", "0.54870254", "0.54870254", "0.54870254", "0.54870254", "0.54870254", "0.54870254", "0.54870254", "0.54848003", "0.5438608", "0.54159606", "0.5383497", "0.5351561", "0.5351561", "0.53423476", "0.5338201", "0.5338201", "0.53082716", "0.5226234", "0.5222612", "0.5216804", "0.5201127", "0.51939195", "0.51939195", "0.5177705" ]
0.6110321
1
TODO: Implement whereIn() method.
public function whereIn($column, $value) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function whereIn($values);", "public function whereIn($column, $values);", "public function whereIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n $this->_conditions[self::WHEREIN][$field] = [self::OPERATORS['in'] => $value];\n return $this;\n }", "public function orWhereIn()\n {\n list($field, $value) = $this->extractQueryToFieldAndValue(func_get_args());\n if (!is_array($value)) {\n $value = [$value];\n }\n return $this->addOrWhereStack([$field => [self::OPERATORS['in'] => $value]]); \n }", "public function findAllWhereIn( array $value, $field, array $columns = ['*'] );", "public function whereIn(string $field, array $values, array $options = []);", "public static function whereIn($column, array $values);", "function wherein(){\n\n $emails = ['[email protected]','[email protected]','[email protected]'];\n\n return $this->db->table('posts')\n ->groupStart()\n ->where(['post_id >'=> '25', 'post_created_at <' => '1990-01-01 00:00:00'])\n ->groupEnd()\n ->orWhereIn('email', $emails)\n ->join('users', 'posts.post_author=users.user_id')\n ->limit(5,4)\n ->get()\n ->getResult();\n }", "public function whereIn($field, $data = array()){\n return $this->model->whereIn($field, $data);\n }", "public function where_emp_in($emp) {\n\t\t$this->db->where_in('ID', $emp);\n\t}", "function where_in($key = NULL, $values = NULL)\r\n\t{\r\n\t \treturn $this->_where_in($key, $values);\r\n\t}", "public function in($column,$val);", "protected function whereIn(Builder $query, $where)\n {\n $values = $this->valufy($where['values']);\n\n return $this->wrap($where['column']).' IN '.$values;\n }", "protected function _in($model, $as_array = FALSE)\n\t{\n\t\t$result = Jelly::select($this->through['model'])\n\t\t\t\t->select($this->through['columns'][1])\n\t\t\t\t->where($this->through['columns'][0], '=', $model->id());\n\n\t\tif ($as_array)\n\t\t{\n\t\t\t$result = $result\n\t\t\t\t\t\t->execute(Jelly::meta($model)->db())\n\t\t\t\t\t\t->as_array(NULL, $this->through['columns'][1]);\n\t\t}\n\n\t\treturn $result;\n\t}", "public function whereIn($field=null,$value=null,$model=null){\n if($this->model==null){\n $this->model=$value;\n }\n\n if(is_array($field) && array_key_exists(1,$field)){\n if(is_array($field[1])){\n $this->whereIn['field']=$field[0];\n $this->whereIn['operator']='=';\n $this->whereIn['value']=implode(\",\",$field[1]);\n }\n\n }\n else{\n if(is_array($value)){\n $this->whereIn['field']=$field;\n $this->whereIn['operator']='=';\n $this->whereIn['value']=implode(\",\",$value);\n }\n\n }\n\n return $this;\n }", "public function whereInQuery($field, $className, $array) {\n\t$this->parseQuery->whereInQuery($field, $className, $array);\n }", "function get_table_where_in_Q( $select_data, $where_data, $table){\n \n\t\t$this->db->select($select_data);\n\t\t$this->db->where_in('Q_id',$where_data);\n\t\t$query = $this->db->get($table); //--- Table name = User\n\t\t$result = $query->result_array(); \n\t\treturn $result;\t\n }", "function get_all_in( $conds = array(), $limit = false, $offset = false ) {\n\n\t // where clause\n\t $this->db->where_in('id', $conds);\n\n\t // from table\n\t $this->db->from( $this->table_name );\n\n\t if ( $limit ) {\n\t // if there is limit, set the limit\n\t \n\t $this->db->limit($limit);\n\t }\n\t \n\t if ( $offset ) {\n\t // if there is offset, set the offset,\n\t \n\t $this->db->offset($offset);\n\t }\n\t \n\t return $this->db->get();\n\t //print_r($this->db->last_query());die;\n\t }", "public function findWhereIn($field, array $values, $columns = ['*'])\n {\n return $this->model->whereIn($field, $values)->get($columns);\n }", "public function testWhereEqualsInArray()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '=', [1,2,3]);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'in',\n 'value' => [1,2,3],\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "public function whereIn($key, $value = null) {\n if(!$this->where_in) {\n $this->where_in = array();\n }\n if(!is_array($key)) {\n $key = array($key => $value);\n }\n foreach($key as $k => $v) {\n $this->where_in[$k] = $v;\n }\n return $this;\n }", "public function testSelectWithInCondition(): void\n {\n $this->_insert();\n $result = $this->connection->selectQuery('id', 'ordered_uuid_items')\n ->where(\n ['id' => ['48298a29-81c0-4c26-a7fb-413140cf8569', '482b7756-8da0-419a-b21f-27da40cf8569']],\n ['id' => 'ordered_uuid[]']\n )\n ->orderBy('id')\n ->execute()\n ->fetchAll('assoc');\n\n $this->assertCount(2, $result);\n $this->assertSame('419a8da0482b7756b21f27da40cf8569', $result[0]['id']);\n $this->assertSame('419a8da0482b7756b21f27da40cf8569', $result[0]['id']);\n }", "public function findWhereIn(sting $field, array $value)\n {\n $entities = $this->model->select($this->columns)\n ->whereIn($field, $value)\n ->take($this->limit)\n ->skip($this->offset)\n ->orderBy($this->order, $this->sort)\n ->with($this->relationships)\n ->get();\n\n if ($entities->isEmpty()) {\n return false;\n }\n\n return $entities;\n }", "function _where_in($key = NULL, $values = NULL, $not = FALSE, $type = 'AND ')\r\n\t{\r\n\t \t// Check if this is a related object\r\n\t\tif ( ! empty($this->parent))\r\n\t\t{\r\n\t\t\t$this->db->_where_in($this->table . '.' . $key, $values, $not, $type);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->db->_where_in($key, $values, $not, $type);\r\n\t\t}\r\n\r\n\t\t// For method chaining\r\n\t\treturn $this;\r\n\t}", "public function orIn($column,$val);", "protected function whereIn(Builder $query, array $where)\n {\n if (!empty($where['values'])) {\n return $this->wrap($where['column']) . ' in (' . $this->parameterize($where['values']) . ')';\n }\n\n return '0 = 1';\n }", "public function where_in($key = NULL, $values = NULL, $escape = NULL)\n\t{\n\t\treturn $this->_where_in($key, $values, FALSE, 'AND ', $escape);\n\t}", "protected function whereInSub(Builder $query, array $where)\n {\n return $this->wrap($where['column']) . ' in (' . $this->compileSelect($where['query']) . ')';\n }", "public function scopeOrderByWhereIn(Builder $query, $data, $column = 'id');", "protected function whereIn(Builder $builder, $where): string\n {\n if (empty($where['values'])) return '0 = 1';\n \n return $this->wrap($where['column']).' in ('.$this->parameterize($where['values']).')';\n }" ]
[ "0.7733971", "0.7192455", "0.71874446", "0.69354284", "0.69113064", "0.69108295", "0.6751012", "0.6737197", "0.6686514", "0.66743904", "0.65578145", "0.6418357", "0.6376507", "0.63685924", "0.63111216", "0.6194996", "0.61801094", "0.61729777", "0.60847586", "0.608329", "0.60818315", "0.60789055", "0.60567826", "0.6055343", "0.60337245", "0.5979878", "0.5975117", "0.59465873", "0.59216034", "0.5910399" ]
0.7495021
1
TODO: Implement createMultiple() method.
public function createMultiple(array $data) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function test_create__multiple()\n {\n\n // Element\n $element = [\n 'attributes' => [\n 'type' => 'text',\n 'name' => 'my-text',\n 'id' => 'my-id'\n ],\n 'label' => 'My label'\n ];\n // ChoiceElement\n $choice = [\n 'attributes' => [\n 'type' => 'select',\n 'name' => 'my-select',\n 'id' => 'my-id'\n ]\n ];\n // Collection - with additional elements\n $collection = [\n 'attributes' => [\n 'type' => 'collection',\n 'name' => 'my-collection',\n 'id' => 'my-collection'\n ],\n 'elements' => [$element, $choice]\n ];\n\n $elements = (new ElementFactory())->createMultiple([$element, $choice, $collection]);\n\n static::assertCount(3, $elements);\n static::assertInstanceOf(ElementInterface::class, $elements[ 0 ]);\n static::assertInstanceOf(ChoiceElementInterface::class, $elements[ 1 ]);\n static::assertInstanceOf(CollectionElementInterface::class, $elements[ 2 ]);\n }", "public function create($array) {\n \n }", "public function create($array) {\n }", "public function createMultipleDiff() {}", "public function creating(array $data);", "public function CreateMulti(array $data)\n {\n return $this->model->insert($data);\n }", "public function getMultiple() {}", "public function create(array $data) {\n \n }", "public function create( array $data );", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $data);", "public function create(array $input)\n {\n }", "public function create(array $data)\n {\n }", "public function create(array $data)\n {\n }" ]
[ "0.70777655", "0.66607034", "0.6625474", "0.6603756", "0.6455487", "0.63712376", "0.6356951", "0.63147205", "0.6314702", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.6301033", "0.62999123", "0.6280376", "0.6280376" ]
0.777264
0
this is a custom query scope that will be used inside the birthdays controller index method to find/search all birthdays. There is a problem with carbon datetime that causes the year to go missing if a month is searched so we are using this.
public function scopeBirthdays($query) { // 1st parameter is the database field name and the second parameter is the current month (formatted using carbon) return $query->whereMonth('birthday', now()->format('m')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scopePublished($query){\n $query->where('RDate','<=',Carbon::now()->format('Y-m-d'))->where('EXDate','>=',Carbon::now()->format('Y-m-d'));\n }", "public function scopeMonth($query,$filters){\n if($month = $filters['month']){\n $query->whereMonth('created_at', Carbon::parse($month)->month);\n }\n\n if($year = $filters['year']){\n $query->whereYear('created_at',$year);\n }\n\n }", "public function scopeFilterByStartDate( $query )\n { \n $date = request() -> get( 'start_date' );\n if( $date )\n {\n try \n {\n $date = Carbon :: parse( $date );\n $query -> whereDate( 'created_at', '>=', $date );\n }\n catch( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }", "public static function birthdayToday()\r\n\t{\t\t\t\t\r\n\t\t$result = new CActiveDataProvider('Contact', array(\r\n\t\t\t'criteria'=>array(\r\n\t\t\t\t'condition'=>'DAYOFYEAR( curdate( ) ) = DAYOFYEAR( DATE_ADD( dob, INTERVAL( YEAR( NOW( ) ) - YEAR( dob ) ) YEAR ) ) AND address.lead_ignore = 0',\r\n\t\t\t\t'order'=>'name ASC',\r\n\t\t\t\t'join'=>'JOIN `address` ON `address_id` = `address`.`id`'\r\n\t\t\t),\r\n\t\t\t'pagination'=>array(\r\n\t\t\t\t'pageSize'=>10,\r\n\t\t\t),\r\n\t\t));\r\n\t\treturn $result;\t\t\r\n\t}", "public function scopeThisMonth($query)\n {\n $now = Carbon::now();\n $thisMonth = strtoupper($now->format('M')); // JUN\n\n return $query->where([\n ['year', '=', $now->year],\n ['month_ABC', '=', $thisMonth],\n ])->get();\n\n //return $query->where('year', '=', $now->year)->where('month', '=', $now->month);\n }", "public function scopeSearch($query){\n if (request()->has('search_query') && !empty(request()->search_query) && request()->has('search_columns') && !empty(request()->search_columns) ) {\n \t$query = $this->getQuery($query , request()->search_columns , request()->search_query );\n }else{\n \tif (request()->has('search_query') && !empty(request()->search_query)) {\n \t\t$query = $this->getQuery($query , $this->fillable , request()->search_query );\n \t}\n }\n\n \n \n \n \n \n return $query;\n }", "public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter first_name\n if ($request->has('first_name')) {\n $query->where('first_name', 'like', \"%{$request->get('first_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('first_name')}%\");\n }\n // filter first_name\n if ($request->has('last_name')) {\n $query->where('first_name', 'like', \"%{$request->get('last_name')}%\")\n ->orWhere('last_name', 'like', \"%{$request->get('last_name')}%\");\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_active',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }", "public function scopeYear($query, $year)\n {\n return $query->whereYear('created_at', $year);\n }", "public function scopeSearch($query, $filter)\n {\n return $query->where('date', '=', $filter)\n // INNER JOIN dealers d on d.id=t.id_dealer\n ->join('dealers', 'tasks.id_dealer', '=', 'dealers.id') \n ;\n \n }", "public function getStudentClassYear($class,$year){\n\n// find the age of student \n$age =$this->findAge($class);\n$year = $year.\"-01-01\"; \n// find the born year using age \n$birthdayYear = Carbon::parse($year)->subYears($age)->year;\n\n// \n\n $result = Student::whereYear('dob' ,$birthdayYear)->get();\n return $result;\n\n\n\n\n\n }", "public function allbazarsearch($startdate, $enddate){\n // $enddate = (int) date('Y', strtotime('-1 months')); \n $this->db->select('*');\n $this->db->from('single_bazar');\n $this->db->like('curdate', $startdate);\n $this->db->or_like('curdate', $enddate);\n $this->db->where('curdate >=', $startdate);\n $this->db->or_where('curdate <=', $enddate);\n $query = $this->db->get();\n $result = $query->result();\n return $result;\n\n \n }", "public function scopeFilter($query, $filters) {\n if( $month = $filters['month'] ) {\n\n // Carbon::parse($month)->month --> converts to month number. \n $query->whereMonth('created_at', Carbon::parse($month)->month );\n }\n\n if( $year = $filters['year'] ) {\n \n $query->whereYear('created_at', $year );\n }\n\n }", "public function scopeOnCurrentMonth($query)\n {\n return $query->whereBetween('created_at', [\n Carbon::now()->startOfMonth(),\n Carbon::now()->endOfMonth(),\n ]);\n }", "public function searchByNameAndCareer(Request $request)\n {\n //separate words, this help whit 2 or more spaces cases and avoid a lot problems\n $searchValues = preg_split('/\\s+/', $request->search, -1, PREG_SPLIT_NO_EMPTY); \n\n //i know that's a lot cases, but that way, we can see all the possibilities \n if(isset($request->day) && isset($request->month) && isset($request->year)) {\n $results = User::where(function ($q) use ($searchValues) {\n foreach ($searchValues as $value) {\n $q->orWhere('name', 'like', \"%{$value}%\")\n ->orWhere('career', 'like', \"%{$value}%\");\n }})->whereYear('born_date', '=', $request->year)\n ->whereMonth('born_date', '=', $request->month)\n ->whereDay('born_date', '=', $request->day)\n ->orderBy('born_date', 'DESC')->get();\n \n } else if(isset($request->day) && isset($request->month)) {\n $results = User::where(function ($q) use ($searchValues) {\n foreach ($searchValues as $value) {\n $q->orWhere('name', 'like', \"%{$value}%\")\n ->orWhere('career', 'like', \"%{$value}%\");\n }})->whereDay('born_date', '=', $request->day)\n ->whereMonth('born_date', '=', $request->month)\n ->orderBy('born_date', 'DESC')->get();\n\n } else if(isset($request->day) && isset($request->year)) {\n $results = User::where(function ($q) use ($searchValues) {\n foreach ($searchValues as $value) {\n $q->orWhere('name', 'like', \"%{$value}%\")\n ->orWhere('career', 'like', \"%{$value}%\");\n }})->whereYear('born_date', '=', $request->year)\n ->whereDay('born_date', '=', $request->day)\n ->orderBy('born_date', 'DESC')->get(); \n\n } else if(isset($request->day)) {\n $results = User::where(function ($q) use ($searchValues) {\n foreach ($searchValues as $value) {\n $q->orWhere('name', 'like', \"%{$value}%\")\n ->orWhere('career', 'like', \"%{$value}%\");\n }})->whereDay('born_date', '=', $request->day)\n ->orderBy('born_date', 'DESC')->get();\n \n\n } else if(isset($request->month) && isset($request->year)) {\n $results = User::where(function ($q) use ($searchValues) {\n foreach ($searchValues as $value) {\n $q->orWhere('name', 'like', \"%{$value}%\")\n ->orWhere('career', 'like', \"%{$value}%\");\n }})->whereMonth('born_date', '=', $request->month)\n ->whereYear('born_date', '=', $request->year)\n ->orderBy('born_date', 'DESC')->get();\n \n } else if(isset($request->year)) {\n $results = User::where(function ($q) use ($searchValues) {\n foreach ($searchValues as $value) {\n $q->orWhere('name', 'like', \"%{$value}%\")\n ->orWhere('career', 'like', \"%{$value}%\");\n }})->whereYear('born_date', $request->year)\n ->orderBy('born_date', 'DESC')\n ->get();\n \n } else if(isset($request->month)) {\n $results = User::where(function ($q) use ($searchValues) {\n foreach ($searchValues as $value) {\n $q->orWhere('name', 'like', \"%{$value}%\")\n ->orWhere('career', 'like', \"%{$value}%\");\n }})->whereMonth('born_date', $request->month)\n ->orderBy('born_date', 'DESC')->get();\n\n } else {\n $results = User::where(function ($q) use ($searchValues) {\n foreach ($searchValues as $value) {\n $q->orWhere('name', 'like', \"%{$value}%\")\n ->orWhere('career', 'like', \"%{$value}%\");\n }})->orderBy('born_date', 'DESC')->get(); \n \n }\n return response()->json(compact('results'));\n }", "public function scopePublished($query){ \n \t$query->where('published_at','<=',Carbon::now());\n }", "public function scopeFilterByEndDate( $query )\n {\n $date = request() -> get( 'end_date' );\n\n if( $date )\n {\n try \n {\n $date = Carbon :: parse($date);\n $query -> whereDate( 'created_at', '<=', $date );\n }\n catch ( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }", "public function scopegetholiday($query, $shop_id = 0, $payroll_holiday_archived = 0)\n {\n \t$query->where('shop_id', $shop_id)->where('payroll_holiday_archived', $payroll_holiday_archived);\n\n \treturn $query;\n }", "public function index(Request $request)\n {\n \n $keyword = $request->get('search');\n $perPage = 25;\n if(isset($_GET['filtro'])){\n $filtro = $_GET['filtro'];\n }else{\n $filtro = \"\";\n }\n \n if (!empty($keyword)) {\n $encargo = Encargo::where('titulo', 'LIKE', \"%$keyword%\")\n ->orWhere('fornecedor', 'LIKE', \"%$keyword%\")\n ->orWhere('descricao', 'LIKE', \"%$keyword%\")\n ->orWhere('data', 'LIKE', \"%$keyword%\")\n ->orWhere('montante', 'LIKE', \"%$keyword%\")\n ->get();\n } else {\n \n $onlyday = date('d');\n $onlymonth = date('m');\n $onlyyear = date('Y');\n $daysinmonth = cal_days_in_month(CAL_GREGORIAN, $onlymonth, $onlyyear); \n $dayformat = date('Y-m-d');\n $day = date('Y-m-d');\n $month = date('Y-m');\n \n if($filtro == \"diario\"){\n $encargo = Encargo::where('data','LIKE', '%'.$day.'%')->get();\n }\n if($filtro == \"semanal\"){\n if($onlyday >= 1 && $onlyday <= 7){\n $encargo = Encargo::whereBetween('data' ,[$month.'-01',$month.'-07'])->get();\n }\n if($onlyday >= 8 && $onlyday <= 14){\n $encargo = Encargo::whereBetween('data' ,[$month.'-08',$month.'-14'])->get();\n } \n if($onlyday >= 15 && $onlyday <= 21){\n $encargo = Encargo::whereBetween('data' ,[$month.'-15',$month.'-21'])->get();\n } \n if($onlyday >= 22 && $onlyday <= $daysinmonth){\n $encargo = Encargo::whereBetween('data' ,[$month.'-22',$month.'-'.$daysinmonth])->get();\n } \n }\n if($filtro == \"mensal\"){\n $encargo = Encargo::where('data','LIKE', '%'.$month.'%')->get();\n }\n if($filtro == \"manual\"){\n $from = $_GET['de'];\n \n $to = $_GET['ate'];\n\n $encargo = Encargo::whereBetween('data' ,[$from,$to])->get();\n }\n \n if(empty($filtro)){\n $encargo = Encargo::all();\n }\n }\n\n return view('encargo.index', compact('encargo','filtro'));\n }", "public function scopeYearlyPost($query)\n {\n return $query->selectRaw('year(created_at)')->groupBy('year(created_at)')->orderByDesc('year(created_at)');\n }", "public function scopeFilter($query, $request)\n {\n // filter id\n if ($request->has('id')) {\n $query->where('id',$request->get('id'));\n }\n // filter title\n if ($request->has('title')) {\n $query->where('title', 'like', \"%{$request->get('title')}%\");\n }\n // filter category\n if ($request->has('category')) {\n $query->whereHas('category', function ($query) use($request) {\n $query->where('name', 'like', \"%{$request->get('category')}%\");\n });\n }\n // filter status\n if ($request->has('status')) {\n $query->where('is_publish',$request->get('status'));\n }\n // filter created_at\n if ($request->has('created_at_from')) {\n $query->where('created_at', '>=', Carbon::parse($request->get('created_at_from')));\n }\n if ($request->has('created_at_to')) {\n $query->where('created_at', '<=', Carbon::parse($request->get('created_at_to')));\n }\n return $query;\n }", "public function scopeSearched($query) // this is convention method\n {\n\n $search = request()->query('search');\n\n if (!$search) {\n\n return $query->published();\n\n }\n\n return $query->published()->where('title', 'LIKE', \"%{$search}%\");\n\n }", "public function query()\n {\n $query = AcademicYear::query();\n\n if ($this->isOrderedWithDefaultOrder()) {\n $query->orderByDesc('from');\n }\n\n $query->where('site_id', site()->id);\n\n return $query;\n }", "public function rrsearch() \n {\n // should not be searched. \n \n $criteria=new CDbCriteria; \n \n \n if((isset($this->d_fectra) && trim($this->d_fectra) != \"\") && (isset($this->d_fectra1) && trim($this->d_fectra1) != \"\")) \n $criteria->addBetweenCondition('date', ''.$this->date_first.'', ''.$this->date_last.''); \n return new CActiveDataProvider(get_class($this), array( \n 'criteria'=>$criteria, \n )); \n }", "public function scopeStarted($query)\n {\n return $query->where('date_begin', \"<=\", Carbon::now())->where('date_end', \">=\", Carbon::now());\n }", "protected function _applyDateRangeFilter()\n {\n // Remember that field PERIOD is a DATE(YYYY-MM-DD) in all databases including Oracle\n\n if ($this->_from !== null) {\n $this->getSelect()->where('created_time >= ?', $this->_from .' 00:00:00');\n }\n if ($this->_to !== null) {\n $this->getSelect()->where('created_time <= ?', $this->_to .' 23:59:59');\n }\n\n return $this;\n\n }", "public function scopeSearchEmployeeName($query,$employeeName=null){\n if(empty($employeeName)) {\n return $query;\n }\n/* return*/ $query = $query\n ->whereRaw('concat('.\\DB::getTablePrefix().'employees.first_name, '.\\DB::getTablePrefix().'employees.last_name) like \"%?%\"',[$employeeName]);\n dd($query->toSql());\n // ->where(function($q) use ($employeeName){\n // $q->where('employees.last_name', 'like', '%'. $employeeName.'%')\n // ->orWhere('employees.first_name', 'like', '%'. $employeeName.'%');\n // });\n }", "public function filteredByDate(Request $request){\n return response(Expense::where('user_id', $request->user()->id)\n ->whereBetween('created_at',[Date(\"Y-m-d\", $request->start/1000).\" 00:00:00\", Date(\"Y-m-d\", $request->end/1000).\" 23:59:59\"])\n ->with('category')\n ->orderBy('created_at', 'desc')\n ->paginate(4), 200);\n }", "public function scopeInFuture($query){\n return $query->where('end','>=', date('Y-m-d H:i:s'));\n }", "protected function modelQueryBuilder()\n {\n $queryTerm = $this->queryTerm();\n\n return Occasion::\n oldest('rank')->\n\n keywordBy($queryTerm['keyword_by'],\n $queryTerm['keyword'])->\n active($queryTerm['active']);\n }", "public function scopeNotStarted($query)\n {\n return $query->where('date_begin', \">\", Carbon::now());\n }" ]
[ "0.62848204", "0.6150643", "0.6142013", "0.60641", "0.6005736", "0.5880554", "0.5857754", "0.58381796", "0.58295476", "0.5784877", "0.5783939", "0.5744948", "0.5694011", "0.5692158", "0.5673491", "0.5648356", "0.56377035", "0.5597963", "0.559727", "0.5588612", "0.5522153", "0.54937977", "0.54547405", "0.54519075", "0.544825", "0.5442564", "0.5435746", "0.541755", "0.5381883", "0.53625697" ]
0.7435892
0
Gather user agent data.
protected function gatherUserAgentData() { // User agent container $userAgents = ['original' => null, 'nodes_meta' => null]; // Retrieve original user agent $originalUserAgent = user_agent(); if (!empty($originalUserAgent)) { $userAgents['original'] = [ 'browser' => $originalUserAgent->getBrowserWithVersion(), 'platform' => $originalUserAgent->getPlatform(), 'device' => $originalUserAgent->getDevice(), 'isMobile' => $originalUserAgent->isMobile(), 'isTablet' => $originalUserAgent->isTablet(), ]; } // Retrieve nodes user agent $nodesUserAgent = nodes_meta(); if (!empty($nodesUserAgent)) { $userAgents['nodes_meta'] = [ 'version' => $nodesUserAgent->getVersion(), 'platform' => $nodesUserAgent->getPlatform(), 'device' => $nodesUserAgent->getDevice(), ]; } return $userAgents; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user_agent() {\n static $result = null;\n if (!is_array($result)) {\n $ci = get_instance();\n $ci->load->library('user_agent');\n $agent = $ci->agent;\n $result['agent_string'] = $agent->agent_string();\n $result['platform'] = $agent->platform();\n $result['browser'] = $agent->browser();\n $result['version'] = $agent->version();\n $result['robot'] = $agent->robot();\n $result['mobile'] = $agent->mobile();\n $result['referrer'] = $agent->referrer();\n $result['is_referral'] = $agent->is_referral();\n $result['languages'] = $agent->languages();\n $result['charsets'] = $agent->charsets();\n }\n return $result;\n }", "public function setup_user_agent()\n {\n self::$USER_AGENT = \"Mozilla/5.0 (FPPVoteApiPlugin/\" . VOTING_API_PLUGIN_VERSION . \"; PHPD/\" . PHP_VERSION . \") (FPPVoteApiPlugin)\";\n //\tMozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0\n self::$DEFAULT_CURL_OPTS[CURLOPT_USERAGENT] = self::$USER_AGENT;\n }", "public function details()\n {\n \n $output = $this->ua->parse_user_agent();\n print_r($output);\n exit;\n }", "public function setUserAgent($useragent){ }", "public function getRandAgent(){\n\t\t#List with some real user agents\n\t\t$userAgents = [\n\t\t\t# Android Mobile User Agents\n\t\t\t'Mozilla/5.0 (Linux; Android 8.0.0; SM-G960F Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36', # Samsung Galaxy S9\n\t\t\t'Mozilla/5.0 (Linux; Android 7.0; SM-G892A Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/60.0.3112.107 Mobile Safari/537.36', # Samsung Galaxy S8\n\t\t\t'Mozilla/5.0 (Linux; Android 7.0; SM-G930VC Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/58.0.3029.83 Mobile Safari/537.36', # Samsung Galaxy S7\n\t\t\t'Mozilla/5.0 (Linux; Android 6.0.1; SM-G935S Build/MMB29K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Mobile Safari/537.36', # Samsung Galaxy S7 Edge\n\t\t\t'Mozilla/5.0 (Linux; Android 6.0.1; SM-G920V Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36', # Samsung Galaxy S6\n\t\t\t'Mozilla/5.0 (Linux; Android 5.1.1; SM-G928X Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36', # Samsung Galaxy S6 Edge Plus\n\t\t\t'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.83 Mobile Safari/537.36', # Nexus 6P\n\t\t\t'Mozilla/5.0 (Linux; Android 7.1.1; G8231 Build/41.2.A.0.219; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/59.0.3071.125 Mobile Safari/537.36', # Sony Xperia XZ\n\t\t\t'Mozilla/5.0 (Linux; Android 6.0.1; E6653 Build/32.2.A.0.253) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36', # Sony Xperia Z5\n\t\t\t'Mozilla/5.0 (Linux; Android 6.0; HTC One X10 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/61.0.3163.98 Mobile Safari/537.36', # HTC One X10\n\t\t\t'Mozilla/5.0 (Linux; Android 6.0; HTC One M9 Build/MRA58K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.3', # HTC One M9\n\t\t\t# iPhone User Agents\n\t\t\t'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1', # Apple iPhone XR (Safari)\n\t\t\t'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/69.0.3497.105 Mobile/15E148 Safari/605.1', # Apple iPhone XS (Chrome)\n\t\t\t'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/13.2b11866 Mobile/16A366 Safari/605.1.15', # Apple iPhone XS Max (Firefox)\n\t\t\t'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1', # Apple iPhone X\n\t\t\t'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1', # Apple iPhone 8\n\t\t\t'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A5370a Safari/604.1', # Apple iPhone 8 Plus\n\t\t\t'Mozilla/5.0 (iPhone9,3; U; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A403 Safari/602.1', # Apple iPhone 7\n\t\t\t'Mozilla/5.0 (iPhone9,4; U; CPU iPhone OS 10_0_1 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/14A403 Safari/602.1', # Apple iPhone 7 Plus\n\t\t\t'Mozilla/5.0 (Apple-iPhone7C2/1202.466; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543 Safari/419.3', # Apple iPhone 6\n\t\t\t# MS Windows Phone User Agents\n\t\t\t'Mozilla/5.0 (Windows Phone 10.0; Android 6.0.1; Microsoft; RM-1152) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Mobile Safari/537.36 Edge/15.15254', # Microsoft Lumia 650\n\t\t\t'Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; RM-1127_16056) AppleWebKit/537.36(KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Edge/12.10536', # Microsoft Lumia 550\n\t\t\t'Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/13.1058', # Microsoft Lumia 950\n\t\t\t# Tablet User Agents\n\t\t\t'Mozilla/5.0 (Linux; Android 7.0; Pixel C Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36', # Google Pixel C\n\t\t\t'Mozilla/5.0 (Linux; Android 6.0.1; SGP771 Build/32.2.A.0.253; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Safari/537.36', # Sony Xperia Z4 Tablet\n\t\t\t'Mozilla/5.0 (Linux; Android 6.0.1; SHIELD Tablet K1 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/55.0.2883.91 Safari/537.36', # Nvidia Shield Tablet K1\n\t\t\t'Mozilla/5.0 (Linux; Android 7.0; SM-T827R4 Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.116 Safari/537.36', # Samsung Galaxy Tab S3\n\t\t\t'Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-T550 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.3 Chrome/38.0.2125.102 Safari/537.36', # Samsung Galaxy Tab A\n\t\t\t'Mozilla/5.0 (Linux; Android 4.4.3; KFTHWI Build/KTU84M) AppleWebKit/537.36 (KHTML, like Gecko) Silk/47.1.79 like Chrome/47.0.2526.80 Safari/537.36', # Amazon Kindle Fire HDX 7\n\t\t\t'Mozilla/5.0 (Linux; Android 5.0.2; LG-V410/V41020c Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/34.0.1847.118 Safari/537.36', # LG G Pad 7.0\n\t\t\t# Desktop User Agents\n\t\t\t'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246', # Windows 10-based PC using Edge browser\n\t\t\t'Mozilla/5.0 (X11; CrOS x86_64 8172.45.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.64 Safari/537.36', # Chrome OS-based laptop using Chrome browser (Chromebook)\n\t\t\t'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9', # Mac OS X-based computer using a Safari browser\n\t\t\t'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36', # Windows 7-based PC using a Chrome browser\n\t\t\t'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1', # Linux-based PC using a Firefox browser\n\t\t];\n\t\t#Retrieve a random item from the list\n\t\treturn $userAgents[mt_rand(0,count($userAgents)-1)];\n\t}", "function get_user_analytics_info() {\n global $wp_version;\n\n $url = 'http://freegeoip.net/json/' . $_SERVER['REMOTE_ADDR'];\n $params = array(\n 'timeout' => 30,\n 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' )\n );\n\n $response = wp_remote_get( $url, $params );\n $user_data = wp_remote_retrieve_body( $response );\n\n if ( is_wp_error( $response ) || $response['response']['code'] != 200 ) {\n return false;\n }\n\n $user_info = (array) json_decode( $user_data );\n $user_analytics_info = array_merge( $user_info, array( 'browser_pc' => $_SERVER['HTTP_USER_AGENT'] ) );\n\n return $user_analytics_info;\n }", "public static function parse_user_agent_ ()\n {\n return array_key_exists ( \"koh_browser\" , $_SESSION ) === TRUE ? $_SESSION[ \"koh_browser\" ] : ( $_SESSION[ \"koh_browser\" ] = self:: parse_user_agent () );\n }", "public static function androidUserAgentsProvider() {}", "public function userAgent();", "public function getFromBrowserDetection()\n {\n // Set custom rule\n $this->browserDetection->addCustomBrowserDetection('Amazon Silk', 'Silk', true);\n //Parse user agent\n $this->browserDetection->setUserAgent();\n //identify browser\n $this->useragent['browser'] = $this->browserDetection->getName();\n if ($this->browserDetection->getPlatformVersion() == 'unknown') {\n $this->useragent['osFull'] = $this->browserDetection->getPlatform();\n } else {\n $this->useragent['osFull'] = $this->browserDetection->getPlatformVersion();\n }\n }", "private function getUserAgent()\n {\n return $this->_useragent;\n }", "public static function agente(){\n\t\t\t$info = get_browser($_SERVER['HTTP_USER_AGENT']);\n\t\t\tif($info):\n\t\t\t\t$dados = (object)array(\n\t\t\t\t\t'plataforma' => $info->platform,\n\t\t\t\t\t'browser' => (object)array(\n\t\t\t\t\t\t'nome' => $info->browser,\n\t\t\t\t\t\t'versao' => $info->version\n\t\t\t\t\t),\n\t\t\t\t\t'device' => (object)array(\n\t\t\t\t\t\t'tipo' => $info->device_type,\n\t\t\t\t\t\t'mobile' => $info->ismobiledevice,\n\t\t\t\t\t\t'tablet' => $info->istablet\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\treturn $dados;\n\t\t\tendif;\n\t\t}", "public static function getUserAgents()\n\t\t{\n\t\t\treturn self::getBrowsers();\n\t\t}", "public function userAgent(){\n return $this->getServerVar('HTTP_USER_AGENT');\n }", "public static function userAgent(){\n return $_SERVER['HTTP_USER_AGENT'];\n }", "public function user_agent()\n {\n return $this->server('HTTP_USER_AGENT');\n }", "public function getUserAgent();", "public function getUserAgent(){\n return $this->auth['user_agent'];\n }", "public function provideAgents()\n {\n return [\n\n [\n 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.360',\n [\n 'browserEngine' => 'Blink',\n 'browserVersion' => '63.0',\n 'browserVersionMajor' => 63,\n 'browserVersionMinor' => 0,\n 'browserVersionPatch' => null,\n ],\n ],\n [\n 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.',\n [\n 'isTablet' => true,\n ]\n ],\n [\n 'NotGonaMatchMe',\n [\n 'isMobile' => null,\n 'isTablet' => null,\n 'isDesktop' => null,\n 'browserEngine' => null,\n ],\n ],\n ];\n }", "public function __construct($useragent=null) {\n if ( $useragent === null && isset($_SERVER['HTTP_USER_AGENT']) ) {\n $useragent = $_SERVER['HTTP_USER_AGENT'];\n } \n $this->useragent = $useragent;\n \n // Cached?\n if ( USERAGENT_CACHE_DIR && is_file(USERAGENT_CACHE_DIR.'/uacache_'.md5($useragent)) ) {\n $import = file_get_contents(USERAGENT_CACHE_DIR.'/uacache_'.md5($useragent));\n $import = unserialize($import);\n $this->browser = $import->browser;\n $this->version = $import->version;\n $this->platform = $import->platform;\n $this->browser_short = $import->browser_short;\n $this->platform_short = $import->platform_short;\n unset($import);\n return;\n }\n \n $this->browser = 'Unknown';\n $this->version = 'Unknown';\n $this->platform = 'Unknown';\n $this->browser_short = '';\n $this->platform_short = '';\n \n $this->parse_user_agent($useragent);\n\n $this->translate_short_vars();\n\n if ( USERAGENT_CACHE_DIR ) {\n// file_put_contents(USERAGENT_CACHE_DIR.'/uacache_'.md5($useragent), serialize($this));\n }\n }", "function get_user_agent()\n{\n $ret = array();\n $ret['browser'] = 'Unknown';\n $ret['version'] = 'Unknown';\n $ret['user_os'] = 'Unknown';\n\n // get browser\n preg_match('/(MSIE|Safari|Firefox|Opera)/i', $_SERVER['HTTP_USER_AGENT'], $browser_matches);\n\n if (count($browser_matches) > 0)\n {\n $ret['browser'] = $browser_matches[0];\n }\n\n switch($ret['browser'])\n {\n case 'MSIE':\n preg_match('/MSIE ([0-9.]*)/i', $_SERVER['HTTP_USER_AGENT'], $version_matches);\n $ret['version'] = $version_matches[1];\n break;\n case 'Firefox':\n preg_match('/Firefox[ \\/]([0-9.]*)/i', $_SERVER['HTTP_USER_AGENT'], $version_matches);\n $ret['version'] = $version_matches[1];\n break;\n case 'Opera':\n preg_match('/Opera[ \\/]([0-9.]*)/i', $_SERVER['HTTP_USER_AGENT'], $version_matches);\n $ret['version'] = $version_matches[1];\n break;\n case 'Safari':\n // Safari's versioning is more like build numbers, actual version seems to be added to 3 and higher\n // while it may be Safari 3.0.1 the return string will be 522.12.2\n preg_match('/Safari\\/([0-9.]*)/i', $_SERVER['HTTP_USER_AGENT'], $version_matches);\n $ret['version'] = $version_matches[1];\n break;\n ## chrome can be mis-read as safari\n }\n\n // get OS\n preg_match('/(Windows|Mac)/i', $_SERVER['HTTP_USER_AGENT'], $os_matches);\n\n if (count($os_matches) > 0)\n {\n $ret['user_os'] = $os_matches[0];\n }\n\n // return array\n return $ret;\n}", "function _get_client_user_agent() {\n\t\treturn isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';\n\t}", "public function getAgentDetails()\n {\n return \\Auth::user()->agent()->first();\n }", "public function getDebugUserAgents() {\n\t\t$sql = 'SELECT * FROM '.$this->tablePrefix.UserAgentThemeSwitcherData::USERAGENTS_TABLE;\n\t\t$results = $this->connection->get_results($sql);\n\n\t\treturn $results;\n\t}", "public function getUserAgentString()\n {\n return $this->user_agent;\n }", "public function setUserAgent($user_agent){\n curl_setopt($this->ch, CURLOPT_USERAGENT, $user_agent);\n }", "private function process() {\n\n $userAgentComponents = $this->parseUserAgent($this->user_agent);\n\n $this->platform = $userAgentComponents['platform'];\n $this->platform_version = $userAgentComponents['platform_version'];\n $this->browser = $userAgentComponents['browser'];\n $this->browser_version = $userAgentComponents['browser_version'];\n\n $this->is_app = strpos(strtolower($this->user_agent), 'dalvick');\n\n $this->is_bot = in_array(strtolower($this->browser), $this->bot_browsers);\n $this->is_mobile = in_array(strtolower($this->platform), $this->mobile_platforms);\n }", "public function getUserAgent()\n {\n return $this->user_agent;\n }", "public function getUserAgent()\n {\n return $this->user_agent;\n }", "public function userAgent()\r\n {\r\n return $this->headers->get('USER_AGENT');\r\n }" ]
[ "0.6708272", "0.66069305", "0.6579718", "0.63997126", "0.63989145", "0.6300457", "0.62068605", "0.6183935", "0.609172", "0.6047646", "0.6012644", "0.6004824", "0.6000215", "0.5981201", "0.59771425", "0.5965076", "0.59342074", "0.5916829", "0.5892118", "0.5874128", "0.5840638", "0.58088946", "0.5808141", "0.57999897", "0.57902753", "0.57387465", "0.5727499", "0.56977594", "0.56977594", "0.56834596" ]
0.7964871
0
Setup the client paths. from bugsnag/bugsnaglaravel package.
protected function setupPaths(Client $client, $base, $path, $strip, $project) { if ($strip) { $client->setStripPath($strip); if (!$project) { $client->setProjectRoot("{$strip}/app"); } return; } if ($project) { if ($base && substr($project, 0, strlen($base)) === $base) { $client->setStripPath($base); } $client->setProjectRoot($project); return; } $client->setStripPath($base); $client->setProjectRoot($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->client = new Client([\n 'base_uri' => config('app.url'),\n ]);\n }", "public function setUp()\n {\n $this->client = new Client(['base_uri' => 'http://127.0.0.1:8000/']);\n }", "protected function _initPaths()\n {\n defined('PROJECT_PATH') || define('PROJECT_PATH', $this->_getProjectPath());\n defined('APPLICATION_PATH') || define('APPLICATION_PATH', $this->_getApplicationPath());\n defined('LIBRARY_PATH') || define('LIBRARY_PATH', $this->_getLibraryPath());\n defined('DOCUMENT_ROOT') || define('DOCUMENT_ROOT', $this->_getDocumentRoot());\n }", "protected function setup()\r\n {\r\n if (!defined('APNS_SSL_CERTIFICATE_FILE_PATH')\r\n || !file_exists(APNS_SSL_CERTIFICATE_FILE_PATH)\r\n ) {\r\n $this->markTestSuiteSkipped('Credentials missing in config.php');\r\n }\r\n \r\n $this->clientHandler = new Services_Apns_Client_Feedback();\r\n $this->clientHandler->setSslCertificateFilePath(APNS_SSL_CERTIFICATE_FILE_PATH);\r\n \r\n if (defined('APNS_CERTIFICATE_PASSWORD_PHRASE')) {\r\n $this->clientHandler->setPasswordPhrase(APNS_CERTIFICATE_PASSWORD_PHRASE);\r\n }\r\n \r\n if (defined('APNS_ENV')) {\r\n $this->clientHandler->setDefaultEnvironment(APNS_ENV);\r\n }\r\n }", "protected function setInitialRootPath() {}", "private function setupGuzzleClient() {\n $config = $this->getClientConfig();\n $this->client = $this->createGuzzleClient($config);\n }", "public function configureApiPaths();", "public function __construct()\n {\n //$this->cliente = new Client(['base_uri'=>'http://localhost:8002/api/']);\n $apiDireccion = config('api.ubicacion');\n $this->cliente = new Client(['base_uri'=>$apiDireccion]);\n\n }", "protected function setUp()\n {\n $this->client = new Client([\n 'base_uri' => 'http://api'\n ]);\n }", "public function setInitialPaths() {}", "protected function setUp(): void\n\t{\n\t\t$this->httpClient = new \\GuzzleHttp\\Client(\\App\\Utils::merge(\\App\\RequestHttp::getOptions(), [\n\t\t\t'base_uri' => \\App\\Config::main('site_URL') . 'webservice/ManageConsents/',\n\t\t\t'Content-Type' => 'application/json',\n\t\t\t'Accept' => 'application/json',\n\t\t\t'timeout' => 60,\n\t\t\t'connect_timeout' => 60,\n\t\t\t'http_errors' => false,\n\t\t\t'headers' => [\n\t\t\t\t'x-raw-data' => 1,\n\t\t\t],\n\t\t]));\n\t}", "protected function setUpFakeSitePathAndHost() {}", "protected function auto_register_paths()\r\n\t\t{\r\n\t\t\t// prepend all the ignore paths\r\n\t\t\t$n = count( $this->path_ignore );\r\n\t\t\tfor ( $i = 0; $i < $n; $i++ )\r\n\t\t\t\t$this->path_ignore[ $i ] = $this->local . $this->path_ignore[ $i ];\r\n\t\t\t\r\n\t\t\t$dirs = glob( $this->local . \"*\", GLOB_ONLYDIR );\r\n\t\t\t\r\n\t\t\t// setup all valid web directories\r\n\t\t\t$this->paths[ self::ROOT_PATH ] = $this->local;\r\n\t\t\tforeach( $dirs as $d )\r\n\t\t\t\tif ( !in_array( $d, $this->path_ignore ) )\r\n\t\t\t\t\t$this->paths[ basename( $d ) ] = $d . DIRECTORY_SEPARATOR;\r\n\t\t}", "public function setPaths()\n\t{\n\t\t$this->componentURL = Request::base() . 'publications/';\n\t\t$this->resourceURL = $this->componentURL . $this->id;\n\n\t\t$database = \\App::get('db');\n\t\t$pub = new \\Components\\Publications\\Tables\\Publication($database);\n\t\t$publication = $pub->getPublication($this->id);\n\t\t$this->resourceSite = \\Components\\Publications\\Helpers\\Html::buildPubPath($this->id, $publication->version_id, '', $publication->secret, 1);\n\t}", "protected function setupInstallPaths()\n\t{\n\t\t// Get the target application\n\t\t$cname = (string) $this->getManifest()->attributes()->client;\n\n\t\tif ($cname)\n\t\t{\n\t\t\t// Attempt to map the client to a base path\n\t\t\t$client = ApplicationHelper::getClientInfo($cname, true);\n\n\t\t\tif ($client === false)\n\t\t\t{\n\t\t\t\tthrow new \\RuntimeException(\n\t\t\t\t\t\\JText::sprintf(\n\t\t\t\t\t\t'JLIB_INSTALLER_ABORT_MOD_UNKNOWN_CLIENT',\n\t\t\t\t\t\t\\JText::_('JLIB_INSTALLER_' . $this->route),\n\t\t\t\t\t\t$client->name\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$basePath = $client->path;\n\t\t\t$this->clientId = $client->id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// No client attribute was found so we assume the site as the client\n\t\t\t$basePath = JPATH_SITE;\n\t\t\t$this->clientId = 0;\n\t\t}\n\n\t\t// Set the installation path\n\t\tif (empty($this->element))\n\t\t{\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\t\\JText::sprintf(\n\t\t\t\t\t'JLIB_INSTALLER_ABORT_MOD_INSTALL_NOFILE',\n\t\t\t\t\t\\JText::_('JLIB_INSTALLER_' . $this->route)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$this->parent->setPath('extension_root', $basePath . '/modules/' . $this->element);\n\t}", "protected function defineOriginalRootPath() {}", "protected function setUp()\n {\n $this->client = new HttpClient($this->api_key, $this->api_signature, $this->hostname);\n }", "private function setupClient() {\n\t\t$this->client = MeetupKeyAuthClient::factory( [\n\t\t\t'key' => $this->key\n\t\t] );\n\t}", "protected function setTemplatePaths() {}", "public function setUp()\n {\n Configure::write('Error.exceptionRenderer', JsonApiExceptionRenderer::class);\n\n Router::scope('/', function ($routes) {\n $routes->resources('Countries', [\n 'inflect' => 'dasherize'\n ]);\n $routes->resources('Currencies', [\n 'inflect' => 'dasherize'\n ]);\n $routes->resources('Cultures', [\n 'inflect' => 'dasherize'\n ]);\n });\n\n $this->configRequest([\n 'headers' => [\n 'Accept' => 'application/vnd.api+json'\n ]\n ]);\n\n // store path the the json fixtures\n $this->_JsonDir = Plugin::path('Crud') . 'tests' . DS . 'Fixture' . DS . 'JsonApi' . DS;\n }", "public static function _init()\n\t{\n\t\tstatic::$client = new \\Evernote\\Client();\n\t}", "public function setCiPaths(Request $request = null) {\n if (!$this->isConfigValid()) {\n throw new \\Exception('Code Igniter configuration is not valid.');\n }\n\n if ($this->paths_initalized === false) {\n $script_file = $request !== null\n ? '.' . $request->getBasePath() . $request->getScriptName()\n : __FILE__;\n\n $root_path = realpath($this->kernel->getRootDir().'/..');\n if ($root_path === false) {\n throw new \\LogicException('Nercury CI bundle was expecting to find kernel root dir in /app directory.');\n }\n\n $system_path = $this->getRelativePath($root_path, $this->getSystemPath()).'/';\n $application_folder = $this->getRelativePath($root_path, $this->getAppPath());\n\n if ($script_file === __FILE__) {\n $script_file = $root_path . '/app.php';\n $system_path = realpath($root_path.'/'.$system_path).'/';\n $application_folder = realpath($root_path.'/'.$application_folder);\n }\n\n $environment = $this->kernel->getEnvironment();\n $environmentMap = array('dev' => 'development', 'test' => 'testing', 'prod' => 'production');\n if(array_key_exists($environment, $environmentMap)) {\n $environment = $environmentMap[$environment];\n }\n define('ENVIRONMENT', $environment);\n\n /*\n * -------------------------------------------------------------------\n * Now that we know the path, set the main path constants\n * -------------------------------------------------------------------\n */\n // The name of THIS file\n define('SELF', pathinfo($script_file, PATHINFO_BASENAME));\n\n // The PHP file extension\n // this global constant is deprecated.\n define('EXT', '.php');\n\n // Path to the system folder\n define('BASEPATH', str_replace(\"\\\\\", \"/\", $system_path));\n\n // Path to the front controller (this file)\n define('FCPATH', str_replace(SELF, '', __FILE__));\n\n // Name of the \"system folder\"\n define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));\n\n\n // The path to the \"application\" folder\n if (is_dir($application_folder)) {\n define('APPPATH', $application_folder . '/');\n } else {\n if (!is_dir(BASEPATH . $application_folder . '/')) {\n exit(\"Your application folder path does not appear to be set correctly. Please open the following file and correct this: \" . SELF);\n }\n\n define('APPPATH', BASEPATH . $application_folder . '/');\n }\n\n $this->paths_initalized = true;\n }\n }", "public function setUp(){\n $this->client = static::createClient();\n }", "protected function setUp()\n {\n $logger = new Logger('log');\n $logger->pushHandler(new StreamHandler(__DIR__ . '/../artifacts/main.log'));\n\n $this->httpClient = new Client(\n 'secret key',\n $logger\n );\n }", "public function initHttpClients()\n {\n $clientConfig = $this->config->getHttpClientConfig();\n $authClient = new HttpClient($clientConfig);\n $this->setAuthHttpClient($authClient);\n\n $clientConfig['handler'] = $this->initHandlerStack();\n $client = new HttpClient($clientConfig);\n $this->setHttpClient($client);\n }", "public function getPaths()\n\t{\n\t\treturn [\n '/containers/nixnative/api/authenticate',\n\t\t];\n\t}", "protected function bindPathsInContainer()\n {\n $this->instance('path', $this->path());\n $this->instance('path.base', $this->basePath());\n $this->instance('path.config', $this->configPath());\n $this->instance('path.public', $this->publicPath());\n $this->instance('path.storage', $this->storagePath());\n $this->instance('path.database', $this->databasePath());\n $this->instance('path.resources', $this->resourcePath());\n }", "protected function setUp() {\n\n $this->client = new Client(['base_uri' => getenv('API_ADDR')]);\n $this->locIDs = $this->insertTestLocations();\n reuse_generateXML();\n }", "protected function bindPathsInContainer(): void\n {\n $this->instance('path.base', $this->basePath());\n\n foreach ($this->getApplicationDirectoreis() as $path) {\n $this->instance('path.' . $path, $this->basePath($path));\n }\n }", "protected function setUp(): void\n {\n parent::setUp();\n config([\"services.{$this->provider}.client_id\" => $this->faker->uuid]);\n config([\"services.{$this->provider}.client_secret\" => $this->faker->uuid]);\n }" ]
[ "0.55568147", "0.55543226", "0.5522213", "0.55194867", "0.5512424", "0.54993564", "0.5487886", "0.5486128", "0.5441194", "0.53977156", "0.53749394", "0.5326188", "0.5321319", "0.5301829", "0.5294998", "0.529244", "0.5283468", "0.5282892", "0.52817404", "0.5225094", "0.52171034", "0.52009964", "0.5186754", "0.5177407", "0.51534045", "0.5152366", "0.514549", "0.5132952", "0.51095676", "0.5108182" ]
0.5562707
0
Register an event listener to trigger on failed jobs from queues.
protected function registerFailedJobsListener() { if (!in_array($this->app->environment(), config('nodes.bugsnag.notify_release_stages', []))) { return; } if (!config('nodes.bugsnag.report_failed_jobs', true)) { return; } Queue::failing(function (JobFailed $event) { $exception = $event->exception; $meta = [ 'job' => [ 'name' => $event->job->getName(), 'queue' => $event->job->getQueue(), 'raw_body' => $event->job->getRawBody(), ], 'connection' => [ 'name' => $event->connectionName, ], ]; app('nodes.bugsnag')->notifyException($exception, function (\Bugsnag\Report $report) use ($meta) { $report->setMetaData($meta, true); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function failing($callback)\n {\n $this->app['events']->listen('custom.queue.failed', $callback);\n }", "public function failing($callback)\n {\n $this->app['events']->listen(Events\\JobFailed::class, $callback);\n }", "public function failing($callback)\n {\n $this->app['events']->listen(Events\\JobFailed::class, $callback);\n }", "public function failed()\n {\n // Called when the job is failing...\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "public function exceptionOccurred($callback)\n {\n $this->app['events']->listen(Events\\JobExceptionOccurred::class, $callback);\n }", "public function exceptionOccurred($callback)\n {\n $this->app['events']->listen(Events\\JobExceptionOccurred::class, $callback);\n }", "public function boot()\n {\n Queue::after(function ($connection, $job, $data) {\n if(!empty($data['id'])){\n NotifyLog::where('job', '=', $data['id'])->update(array('status' => 201));\n }\n\n });\n\n Queue::failing(function ($connection, $job, $data) {\n if(!empty($data['id'])){\n NotifyLog::where('job', '=', $data['id'])->update(array('status' => 500));\n }\n $command = (unserialize($data['data']['command']));\n $command->failed($data['id']);\n });\n }", "public function onWorkerMessageFailed(WorkerMessageFailedEvent $event)\n {\n $this->sendNotify(\n $event->getThrowable(),\n ['Messenger' => ['willRetry' => $event->willRetry()]]\n );\n\n // Normally we flush after a message has been handled, but this event\n // doesn't fire for failed messages so we have to flush here instead\n $this->client->flush();\n }", "public function pushErrorMessagesToFlashMessageQueue() {}", "public function logQueueLookupEvent(QueueLookupEvent $event)\n {\n $this->output->writeln('QueueLookupEvent:: Looking up Job with params' .json_encode(array(\n 'job_id' => $event->getJobId() \n )));\n }", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function test_event_notification_with_failed_notification()\n {\n $this->event_notification_helper('failed_event_method', false);\n }", "public function restart_failed($args, $assoc_args = array())\n {\n global $wp_queue;\n\n if (! $wp_queue->failed_jobs()) {\n WP_CLI::log('No failed jobs to restart...');\n\n return;\n }\n\n $count = $wp_queue->restart_failed_jobs();\n\n WP_CLI::success($count . ' failed jobs pushed to the queue');\n }", "public function register_cron_worker() {\n\t\t$attempts = add_filter( 'wp_queue_cron_attempts', 3 );\n\t\t$cron = new Cron( $this->worker( $attempts ) );\n\n\t\t$cron->init();\n\t}", "public function testListenerRegistered(): void\n {\n $this->assertEventHasListener(QueryExecuted::class, QueryExecutedEventsListener::class);\n }", "public function failed(Exception $exception)\n {\n // The job id could not be discovered, this should not happen normally, but we will set the astrometry jobs status accordingly\n $this->astrometryJob->update([\n 'status' => 'job_discovery_error'\n ]);\n # TODO: event(new AstrometryJobDiscoveryError($this->astrometryJob))\n }", "protected function failedJobs()\n {\n if ($this->failedJobsCollection === null) {\n try {\n $this->failedJobsCollection = collect($this->failedJobs->all())\n ->filter(function ($content) {\n $queue = $this->queueResolver->__invoke();\n $prefix = config('vapor-ui.queue.prefix');\n\n return \"$prefix/$queue\" == ((array) $content)['queue'];\n });\n } catch (QueryException $e) {\n $this->failedJobsCollection = collect();\n }\n }\n\n return $this->failedJobsCollection;\n }", "public function failed(\\Exception $e)\n {\n // TODO: Send notification when job failure.\n report($e);\n }", "private function _registerGraphQlListeners()\n {\n $invalidate = [$this->getGql(), 'invalidateCaches'];\n\n $this->getProjectConfig()->on(ProjectConfig::EVENT_ADD_ITEM, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_REMOVE_ITEM, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_UPDATE_ITEM, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_REBUILD, $invalidate);\n $this->getProjectConfig()->on(ProjectConfig::EVENT_AFTER_APPLY_CHANGES, $invalidate);\n $this->getElements()->on(Elements::EVENT_AFTER_SAVE_ELEMENT, $invalidate);\n $this->getElements()->on(Elements::EVENT_AFTER_DELETE_ELEMENT, $invalidate);\n $this->getStructures()->on(Structures::EVENT_AFTER_MOVE_ELEMENT, $invalidate);\n }", "public function failed(OperationFailed $event, $exception)\n {\n // TODO: If our queued event fail so here will be the worst case scenario\n }", "protected function registerListeners()\n {\n }", "public static function registerErrorLogCallback($func){\n\t\tself::$_errorLogCallbacks[]=$func;\n\t}", "public function queueEvent($eventId);", "public function onKernelException()\n {\n echo '<br> something wrong happened ! exeption event listener successfuly fired :D ';\n }", "public function serverHeartbeatFailed(ServerHeartbeatFailedEvent $event): void;", "public function boot()\n {\n //listen raw SQL operation event\n DB::listen(function($sql,$binding,$time){\n\n });\n /*\n The Queue::after method allows you to register a callback to be executed \n when a queued job executes successfully. This callback is a great opportunity \n to perform additional logging, queue a subsequent job, or increment statistics for a dashboard.\n For example, we may attach a callback to this event from the AppServiceProvider that is included with Laravel:\n */\n Queue::after(function ($connection, $job, $data) {\n Log::info(\"send a email at\".time().':'.$connection.'--'.json_encode($job).'---'.json_encode($data));\n });\n Queue::failing(function($connection,$job,$data){\n Log::error('jobs:'.$job.' failed!');;\n });\n }", "public function runFailed();", "public function invoke(): void\n {\n foreach (array_keys($this->pendingEventListenerClassNames) as $listenerClassName) {\n $job = new CatchUpEventListenerJob($listenerClassName);\n // TODO make queue name configurable (per event type?)\n $this->jobManager->queue('neos-eventsourcing', $job);\n }\n $this->pendingEventListenerClassNames = [];\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }" ]
[ "0.69554096", "0.6617831", "0.6617831", "0.5824383", "0.5686169", "0.56673723", "0.56673723", "0.55373496", "0.5236322", "0.5128657", "0.5114447", "0.5089709", "0.50803906", "0.5078969", "0.50722075", "0.50544", "0.5012601", "0.49669456", "0.49516952", "0.4901069", "0.48951447", "0.4893806", "0.4885882", "0.48699224", "0.48570773", "0.4841827", "0.48269245", "0.48196802", "0.481468", "0.47671974" ]
0.8041647
0
registerHandler we'll rebind the default Exception Handler to use our Bugsnag Handler so exceptions will be reported to Bugsnag.
protected function registerHandler() { if (!in_array($this->app->environment(), config('nodes.bugsnag.notify_release_stages', []))) { return; } if (!config('nodes.bugsnag.rebind_handler', true)) { return; } $this->app->singleton('Illuminate\Contracts\Debug\ExceptionHandler', function ($app) { return app(BugsnagHandler::class); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registerExceptionHandler()\n\t{\n\t\tset_exception_handler(function($e){\n\t\t\treturn View::handleError($e->getMessage(), 500);\n\t\t});\n\t}", "protected function registerExceptionHandlers()\n {\n // We register the framework exception handler...\n $this->container->bind(\n \\Lib\\Contracts\\Exceptions\\Handler::class,\n \\App\\Exceptions\\Handler::class\n );\n\n // As well as the Whoops library for handling exceptions.\n $whoops = new Whoops\\Run;\n $whoops->pushHandler(new Whoops\\Handler\\PrettyPageHandler);\n $whoops->register();\n }", "protected function registerExceptionHandlers()\n\t{\n\t\t$this['exception'] = function() { return new ExceptionHandler; };\n\n\t\t$this['kernel.error'] = function() { return new ErrorHandler; };\n\n\t\t$this['kernel.exception'] = function() { return new KernelHandler; };\n\t}", "protected function registerExceptionHandler()\n {\n set_exception_handler(function (\\Exception $exception) {\n $this->exception = $exception;\n $code = $this->exception->getCode();\n $statusCode = $this->response->getStatusCode();\n\n if (!is_int($code) || $code < 400 || $code > 599) {\n $code = 500;\n }\n\n // overwrite with user defined\n if ((int)$statusCode >= 400) {\n $code = $statusCode;\n }\n\n $this->response->withStatus($code);\n $this->resolve('errorHandler');\n });\n\n return $this;\n }", "protected function setExceptionHandler()\n {\n new ExceptionHandler();\n }", "public function registerErrorHandler() {\n set_error_handler(array($this, 'handleError'));\n error_reporting(E_ALL);\n }", "public function register()\n {\n set_error_handler([$this, 'handleError']);\n set_exception_handler([$this, 'handleException']);\n }", "public static function register() {\n\t\tset_error_handler(array(static::class, 'handleError'));\n\t\tset_exception_handler(array(static::class, 'handleException'));\n\t}", "static function register() {\n\n set_error_handler(array('Sabre_PHP_Exception','handleError'));\n\n }", "protected function registerExceptionHandler()\n {\n $this->app->singleton('api.exception', function ($app) {\n return new ApiExceptionsHandler($app['Illuminate\\Contracts\\Debug\\ExceptionHandler'], config('api.errorFormat'), config('api.debug'));\n });\n }", "protected function register() {\n\t\tset_error_handler(array($this, 'handleException'));\n\t\tset_exception_handler(array($this, 'handleError'));\n\t\tregister_shutdown_function(array($this, 'handleShutdown'));\n\t}", "protected function registerErrorHandling()\n {\n error_reporting(E_ALL);\n set_error_handler(function ($level, $message, $file = '', $line = 0) {\n if (error_reporting() & $level) {\n throw new \\ErrorException($message, 403, $level, $file, $line);\n }\n });\n\n set_exception_handler(function ($e) {\n echo($e);\n });\n\n register_shutdown_function(function () {\n echo(error_get_last());\n });\n }", "private static function initErrorHandler() {\n\t\t\tset_exception_handler('ErrorHandler::handleExceptions');\n\t\t\tset_error_handler('ErrorHandler::handleErrors');\n\t\t}", "protected function registerErrorHandling()\n {\n error_reporting(-1);\n\n set_error_handler(function ($level, $message, $file = '', $line = 0) {\n if (error_reporting() & $level) {\n throw new ErrorException($message, 0, $level, $file, $line);\n }\n });\n\n set_exception_handler(function ($e) {\n $this->handleUncaughtException($e);\n });\n\n register_shutdown_function(function () {\n $this->handleShutdown();\n });\n }", "protected function _register_exception_handler()\n {\n if (!class_exists('\\prggmr\\signal\\integer\\Range', false)){\n require_once 'signal/integer/range.php';\n }\n if (null === $this->_exception_handle_signal) {\n $this->_engine_handle_signal = new \\prggmr\\signal\\integer\\Range(\n 0xE002, 0xE014\n );\n } else {\n if ($this->_search_complex($this->_engine_handle_signal)[0] === self::SEARCH_FOUND) {\n return true;\n }\n }\n $this->handle(function(){\n $args = func_get_args();\n $type = end($args);\n $message = null;\n if ($args[0] instanceof \\Exception) {\n $message = $args[0]->getMessage();\n } else {\n $message = engine_code($type);\n }\n throw new EngineException($message, $type, $args);\n }, $this->_engine_handle_signal, 0, null);\n }", "abstract protected function registerHandlers();", "public function registerExceptionHandler() {\n\t\tif (!$this->_request()->is('api')) {\n\t\t\treturn;\n\t\t}\n\n\t\tApp::uses('CrudExceptionRenderer', 'Crud.Error');\n\t\tConfigure::write('Exception.renderer', 'Crud.CrudExceptionRenderer');\n\t}", "public static function register()\n\t{\n\t\tset_exception_handler('\\\\OpenFlame\\\\Framework\\\\Exception\\\\EncryptedHandler::catcher');\n\t}", "public static function setDefaultExceptionHandler($handler){\n\t\tself::$_defaultExceptionHandler = $handler;\n\t}", "public function register()\n {\n set_error_handler(array($this, 'errorHandle'));\n set_exception_handler(array($this, 'exceptionHandle'));\n }", "public static function register(): void\n {\n set_error_handler([__CLASS__, 'handleError']);\n set_exception_handler([__CLASS__, 'handleException']);\n register_shutdown_function([__CLASS__, 'handleShutdown']);\n }", "static function loadErrorHandlers() {\n\t\tset_error_handler('errorHandler', error_reporting());\n\t\tset_exception_handler('exceptionHandler');\n\t}", "private function initErrorHandler()\n {\n $handler = new ErrorHandler();\n set_error_handler([$handler, 'handler']);\n }", "public function installNotifierHandlers()\n\t{\n\t\tregister_shutdown_function(array($this, \"fatalErrorHandler\"));\n\t\t$this->previous_error_handler = set_error_handler(array($this, \"errorHandler\"));\n\t\t$this->previous_exception_handler = set_exception_handler(array($this, \"exceptionHandler\"));\n\t}", "public function setupErrorHandler()\n {\n $this->error_handler = set_error_handler(array($this, 'error_handler'));\n }", "protected function getExceptionHandler()\n {\n return Handler::getInstance();\n }", "public static function handle()\n {\n set_error_handler([ErrorHandler::class, 'errorToException'], E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED & ~E_USER_DEPRECATED);\n }", "protected function registerErrorHandling()\n {\n error_reporting(E_ALL);\n\n //do not handle for console\n if (!$this->inConsole()) {\n ini_set('display_errors', 0);\n DebugHandler::register();\n }\n }", "public static function setExceptionHandler(){\n //Set the Pokelio exception handler\n set_exception_handler('Pokelio_Exception::PokelioExceptionHandler');\n }", "public function setErrorHandler($handler)\n {\n }" ]
[ "0.7122228", "0.70543295", "0.69273514", "0.686459", "0.68639123", "0.65977246", "0.6595322", "0.65508413", "0.65447867", "0.6525875", "0.6515792", "0.6513559", "0.6501556", "0.6466589", "0.6440367", "0.642145", "0.64095706", "0.6404225", "0.6227761", "0.6204559", "0.61988866", "0.6181449", "0.6155807", "0.6137897", "0.6134564", "0.60900146", "0.60454917", "0.6045407", "0.5994058", "0.5955999" ]
0.77660275
0
Save cropped asset record and attached file
public function saveCroppedAsset() { if(!empty($this->uploadedFile)) { // If file is exist -> remove him if(file_exists($this->getFilePath())) { unlink($this->getFilePath()); } $this->genFilename(); $imagine = Image::getImagine()->open($this->uploadedFile->tempName); } else { if(file_exists($this->getFilePath())) { $imagine = Image::getImagine()->open($this->getFilePath()); } else return false; } $size = $imagine->getSize(); $width = $size->getWidth(); $height = $size->getHeight(); $cropData = explode(';', $this->cropData); if(count($cropData) == 4) { $point = new Point($cropData[0]*$width, $cropData[1]*$height); $box = new Box($cropData[2]*$width, $cropData[3]*$height); $imagine->crop($point, $box); // $imageBox = $this->getImageBox($size); // $imagine->resize($imageBox); } $imagine->save($this->getFilePath()); return $this->save(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveAsset()\n {\n if(!empty($this->uploadedFile))\n {\n // If file is exist -> remove him\n if(file_exists($this->getFilePath()))\n {\n unlink($this->getFilePath());\n }\n $this->genFilename();\n $imagine = Image::getImagine()->open($this->uploadedFile->tempName);\n }\n else\n {\n if(file_exists($this->getFilePath())) {\n $imagine = Image::getImagine()->open($this->getFilePath());\n } else return false;\n }\n\n $size = $imagine->getSize();\n $box = $this->getImageBox($size);\n\n if (($size->getWidth() <= $box->getWidth() && $size->getHeight() <= $box->getHeight()) || (!$box->getWidth() && !$box->getHeight())) {\n $widthDiff = abs($size->getWidth() - $box->getWidth()) / $size->getWidth();\n $heightDiff = abs($size->getHeight() - $box->getHeight()) / $size->getHeight();\n if($widthDiff > $heightDiff) {\n $resizeBox = new Box($box->getWidth(), $size->getHeight() * $box->getWidth()/$size->getWidth());\n } else {\n $resizeBox = new Box($size->getWidth() * $box->getHeight()/$size->getHeight(), $box->getHeight());\n }\n $imagine->resize($resizeBox);\n\n // var_dump($width);\n // var_dump($height);\n // die;\n // // $imagine->crop($point, $box);\n // $imagine->save($this->getFilePath());\n // return $this->save(false);\n }\n\n $imagine = $imagine->thumbnail($box, ManipulatorInterface::THUMBNAIL_OUTBOUND);\n $imagine->save($this->getFilePath());\n\n // create empty image to preserve aspect ratio of thumbnail\n // $thumb = Image::getImagine()->create($box, new Color('FFF', 100));\n\n // // calculate points\n // $startX = 0;\n // $startY = 0;\n // if ($size->getWidth() < $box->getWidth()) {\n // $startX = ceil($box->getWidth() - $size->getWidth()) / 2;\n // }\n // if ($size->getHeight() < $box->getHeight()) {\n // $startY = ceil($box->getHeight() - $size->getHeight()) / 2;\n // }\n\n // $thumb->paste($img, new Point($startX, $startY));\n // $thumb->save($this->getFilePath());\n\n return $this->save(false);\n }", "public function save()\n {\n\n $photo = $this->flyer->addPhoto($this->makePhoto());\n\n\n // move the photo to the images folder\n $this->file->move($photo->baseDir(), $photo->name);\n\n\n// Image::make($this->path)\n// ->fit(200)\n// ->save($this->thumbnail_path);\n\n // generate a thumbnail\n $this->thumbnail->make($photo->path, $photo->thumbnail_path);\n }", "private function save()\n {\n $this->collage->setImageFormat('jpeg');\n return $this->collage->writeImage($this->name);\n }", "public function saveInto(DataObject $record) {\r\n\t\tif(!isset($_FILES[$this->name])) return false;\r\n\t}", "public function save()\n {\n // save the new Promo data table //\n $cropimg_data = $_POST['cropimg'];\n // smth like:- data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg_remove_array1 = explode(\";\", $cropimg_data);\n // smth like:- base64,iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg_remove_array2 = explode(\",\", $cropimg_remove_array1[1]);\n // smth like:- iVBORw0KGgoAAAANSUhEUgAABaoAAAH0CAYAAADc0hrzAAAgAElEQVR4Xmy9Sax0a5aetWLv6JvT/P9t8ubNyqYyCyxbLmyMSypsIbCFZBDyDBkDLldhWTBhwgwJiQETJIYuMWcMEkhGmAmdBEJ\n\n $cropimg = base64_decode($cropimg_remove_array2[1]);\n\n $imageName = 'promo_'.time() . '.png';\n\n $dir_to_save = \"./assets/jollof_banners/fashionhompage_banner/\";\n if (!is_dir($dir_to_save)) {\n mkdir($dir_to_save);\n }\n file_put_contents($dir_to_save.$imageName, $cropimg);\n \n \n \n $input_date=$_POST['promo_date'];\n $date_start=date(\"Y-m-d H:i:s\",strtotime($input_date));\n \n $promo_duration = $this->promo->promodurationinfo($_POST['promo_duration']);\n \n if($promo_duration->durationname == '1 Day'){$date_end= date('Y-m-d H:i:s',strtotime('+1 day',$input_date));}\n else if($promo_duration->durationname == '1 Week') {$date_end= date('Y-m-d H:i:s',strtotime('+1 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '1 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+1 month',strtotime($input_date)));}\n else if($promo_duration->durationname == '3 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+3 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '6 Month'){$date_end= date('Y-m-d H:i:s',strtotime('+6 week',strtotime($input_date)));}\n else if($promo_duration->durationname == '1 Year') {$date_end= date('Y-m-d H:i:s',strtotime('+1 year',strtotime($input_date)));}\n \n $data_New = array( \n 'imageurl' => $_POST['promo_url'],\n 'imagename' => $imageName,\n 'bannertypeid' => $_POST[\"promotype\"],\n 'promodurationid'=> $_POST[\"promo_duration\"],\n 'usertype' => $this->session->Type,\n 'merchantid' => $this->session->merchant_id,\n 'userid' => $this->session->User_id,\n 'username' => $this->session->companyname,\n 'payment' => 'FREE',\n 'startdate' => $date_start,\n 'enddate' => $date_end,\n 'status' => 0\n );\n $insert_data = $this->Generic->add($data_New, $tablename=\"img_ads\");// insert to db\n\n if($insert_data) \n {\n $this->session->set_flashdata('success','success');\n $this->session->set_flashdata('message', 'Promo Saved');\n $Json_resultSave = array (\n 'status' => '1',\n 'content' => $imageName\n );\n echo json_encode($Json_resultSave);\n exit();\n }\n else \n { \n $this->session->set_flashdata('error','error');\n $this->session->set_flashdata('message', 'An error occur when Adding New Promo');\n $Json_resultSave = array (\n 'status' => '0',\n 'content' => 'There was a problem!! Pls Try Again.....'\n );\n echo json_encode($Json_resultSave);\n exit();\n }\n }", "public function ImgCropToFile(){\r\n $imgUrl = $_POST['imgUrl'];\r\n// original sizes\r\n $imgInitW = $_POST['imgInitW'];\r\n $imgInitH = $_POST['imgInitH'];\r\n// resized sizes\r\n $imgW = $_POST['imgW'];\r\n $imgH = $_POST['imgH'];\r\n// offsets\r\n $imgY1 = $_POST['imgY1'];\r\n $imgX1 = $_POST['imgX1'];\r\n// crop box\r\n $cropW = $_POST['cropW'];\r\n $cropH = $_POST['cropH'];\r\n// rotation angle\r\n $angle = $_POST['rotation'];\r\n\r\n $jpeg_quality = 100;\r\n\r\n $what = new \\Think\\Image();\r\n $name = './'.$this::getPath($imgUrl).$this::getFileName($imgUrl);\r\n $c_name = './'.$this::getPath($imgUrl).'c_'.$this::getFileName($imgUrl);\r\n $p_name = './'.$this::getPath($imgUrl).'p_'.$this::getFileName($imgUrl);\r\n $what ->open($name);\r\n $what ->thumb($imgW, $imgH)->save($c_name);\r\n $what ->open($c_name);\r\n $what ->crop(($cropW),($cropH),$imgX1,$imgY1)->save($p_name);\r\n unlink($c_name);\r\n unlink($name);\r\n\r\n $m = M('img_mapping');\r\n $data = array();\r\n $data['user'] = $_SESSION['current_user']['id'];\r\n $data['img'] = './'.$this::getPath($p_name).$this::getFileName($p_name);\r\n $m->data($data)->add();\r\n\r\n $response = Array(\r\n \"status\" => 'success',\r\n \"url\" => __ROOT__.'/'.$this::getPath($p_name).$this::getFileName($p_name)\r\n );\r\n print json_encode($response);\r\n }", "public function store()\n {\n if(!Csrf::checkToken($this->_request->getInput('_CSRF')))\n {\n $response = [\n 'status' => 'error',\n 'message' => 'csrf'\n ];\n return $this->_response->returnJson($response);\n }\n if($this->crop())\n {\n try {\n $this->_propertyImage->pid = $this->_pid;\n $this->_propertyImage->image_full_path = $this->_imageOut;\n $this->_propertyImage->save();\n }catch(Exception $e) {\n $response = [\n 'status' => 'error',\n 'message' => GENERIC_UPLOAD_ERROR_MESSAGE\n ];\n return $this->_response->returnJson($response);\n }\n $response = [\n 'status' => 'success',\n 'url' => $this->_imageOut\n ];\n return $this->_response->returnJson($response);\n }\n $response = [\n 'status' => 'error',\n 'message' => GENERIC_UPLOAD_ERROR_MESSAGE\n ];\n return $this->_response->returnJson($response);\n }", "public function save()\n\t {\n\t\tif (isset($this->_advert->date) === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$bigfile = new BigFile(\"base-\" . $this->_advert->phone, 10);\n\t\t\t$bigfile->addrecord($this->_advert->date);\n\t\t } //end if\n\n\t }", "public function save() {\n $data = array();\n $data[\"entity\"] = array_diff((array)$this->data->entity, $this->original_entity);\n if (isset($this->data->members)) {\n $data[\"members\"] = $this->data->members;\n }\n if ($this->file) {\n $response = Gallery3_Helper::request(\"put\", $this->url, $this->token, $data, $this->file);\n } else {\n $response = Gallery3_Helper::request(\"put\", $this->url, $this->token, $data);\n }\n return $this->load();\n }", "public function actionSaveCroppedImage() {\n\n if ($_REQUEST['output_filename'] == '') {\n $output_filename = \"media/croppic/croppedimg/croppedImg_\" . time();\n } else {\n $output_filename = $_REQUEST['output_filename'] . time();\n }\n $output_filename2 = Yii::app()->request->baseUrl . '/' . $output_filename;\n\n $imgUrl = Yii::app()->basePath.'/..'.str_replace(Yii::app()->request->baseUrl,'',$_POST['imgUrl']);\n $imgInitW = $_POST['imgInitW'];\n $imgInitH = $_POST['imgInitH'];\n $imgW = $_POST['imgW'];\n $imgH = $_POST['imgH'];\n $imgY1 = $_POST['imgY1'];\n $imgX1 = $_POST['imgX1'];\n $cropW = $_POST['cropW'];\n $cropH = $_POST['cropH'];\n\n $jpeg_quality = 100;\n\n $what = getimagesize($imgUrl);\n \n switch (strtolower($what['mime'])) {\n case 'image/png':\n $img_r = imagecreatefrompng($imgUrl);\n $source_image = imagecreatefrompng($imgUrl);\n $type = '.png';\n break;\n case 'image/jpeg':\n $img_r = imagecreatefromjpeg($imgUrl);\n $source_image = imagecreatefromjpeg($imgUrl);\n $type = '.jpeg';\n break;\n case 'image/gif':\n $img_r = imagecreatefromgif($imgUrl);\n $source_image = imagecreatefromgif($imgUrl);\n $type = '.gif';\n break;\n default: die('image type not supported');\n }\n\n $resizedImage = imagecreatetruecolor($imgW, $imgH);\n imagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, $imgH, $imgInitW, $imgInitH);\n\n\n $dest_image = imagecreatetruecolor($cropW, $cropH);\n imagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, $cropH, $cropW, $cropH);\n\n\n imagejpeg($dest_image, $output_filename . $type, $jpeg_quality);\n\n $response = array(\n \"status\" => 'success',\n \"url\" => $output_filename2 . $type\n );\n print json_encode($response);\n }", "private function savePhoto()\n {\n $image = Image::make($this->filePath);\n\n File::exists($this->sanghaPhotosPath()) or File::makeDirectory($this->sanghaPhotosPath());\n\n $image->resize(400, null, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n })\n ->save($this->sanghaPhotosPath() . $this->fileName)\n ->resize(200, null, function ($constraint) {\n $constraint->aspectRatio();\n })\n ->save($this->sanghaPhotosPath() . 'tn_' . $this->fileName);\n\n }", "function we_save($resave = 0) {\n\n\t\t// get original width and height of the image\n\t\t$arr = $this->getOrigSize(true, true);\n\t\t$this->setElement(\"origwidth\",isset($arr[0]) ? $arr[0] : 0);\n\t\t$this->setElement(\"origheight\",isset($arr[1]) ? $arr[1] : 0);\n\t\t$docChanged = $this->DocChanged; // will be reseted in parent::we_save()\n\t\tif (parent::we_save($resave)) {\n\t\t\tif($docChanged){\n\t\t\t\t$thumbs = $this->getThumbs();\n\t\t\t\tinclude_once($_SERVER[\"DOCUMENT_ROOT\"].\"/webEdition/we/include/\".\"we_delete_fn.inc.php\");\n\t\t\t\tdeleteThumbsByImageID($this->ID);\n\t\t\t\tif(count($thumbs)){\n\t\t\t\t\tforeach($thumbs as $thumbID) {\n\t\t\t\t\t\t$thumbObj = new we_thumbnail();\n\t\t\t\t\t\t$thumbObj->initByThumbID($thumbID,$this->ID,$this->Filename,$this->Path,$this->Extension,$this->getElement(\"origwidth\"),$this->getElement(\"origheight\"),$this->getDocument());\n\t\t\t\t\t\t$thumbObj->createThumb();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function save(): void\n {\n foreach ($this->getChunks() as $chunk) {\n $this->getFile()->seek(0, SeekType::SEEK_END);\n $chunk->setOffset($this->getFile()->tell() / 4096);\n $chunkData = $chunk->getChunkData();\n $this->getFile()->write($chunkData);\n $this->getFile()->seek($this->calcOffset($chunk->getCoordinates()),\n SeekType::SEEK_SET\n );\n $chunkLocation = $chunk->getLocation();\n $this->getFile()->write($chunkLocation);\n }\n }", "public function saveFile()\n {\n $newFileName = $this->generateFilename();\n $this->getOwner()->setAttribute($this->attributeName, $newFileName);\n return $this->uploadManager->save($this->getUploadedFileInstance(), $this->getUploadPath(), $newFileName);\n }", "function _saveOriginal(&$model, $name) {\n $setting = $this->settings[$model->name][$name];\n \n # create original data to save into the database\n $original = array(\n 'foreign_key' => $model->id,\n 'model' => $model->name,\n 'field' => $name,\n 'version' => 'original',\n 'filename' => null,\n 'mime' => assetMimeType($model->data[$name]['tmp_name']),\n 'size' => $model->data[$name]['size']\n );\n \n # include dimensions if a valid file-type (image, swf, etc)\n list($original['width'], $original['height']) = getimagesize($model->data[$name]['tmp_name']);\n \n # if this is not an update and files are set to overwrite\n if (!isset($setting['overwrite']) || $setting['overwrite'] == true) {\n \n # count the existing rows for renaming the file\n $existing = $model->{$name}->find('all', array(\n 'fields' => array('id', 'filename'),\n 'conditions' => array('model' => $model->name, 'foreign_key' => $model->id, 'field' => $name)\n ));\n \n # loop through the existing files and remove each entry\n foreach (!empty($existing) && is_array($existing) ? $existing : array() as $remove) {\n assetDelete($model, array($remove[$name]['filename']));\n }\n \n # delete all existing records for this field\n $model->{$name}->deleteAll(array('model' => $model->name, 'foreign_key' => $model->id, 'field' => $name));\n }\n \n # set the filename field value\n $original['filename'] = assetFileName($model->data[$name]['name'], 'original', $name);\n \n # create new entry\n $model->{$name}->create();\n \n # save the original file data\n if (!$model->{$name}->create() || !$model->{$name}->save($original, false)) {\n $model->{$name}->delete($original['parent_id']);\n $this->_setError($model, 'Critical Error found while saving record in afterSave: '. $name, 'error');\n return false;\n }\n \n # update the parent_id\n $model->{$name}->saveField('parent_id', $model->{$name}->id);\n \n # create the directory path for this asset\n if (!assetDirectoryCreate($model)) {\n $this->_setError($model, 'Storage directory was not created, file not properly uploaded. Please try again and/or contact an Administrator.');\n return false;\n }\n \n $this->directory = assetDirectoryPath($model);\n \n # move the original file\n if (!assetSaveFile($model, $model->data[$name]['tmp_name'], $original['filename'])) {\n $this->_setError($model, 'Critical Error found while saving file in afterSave: '. $name, 'error');\n return false;\n }\n \n # save the original filename\n unset($model->data[$name]);\n $model->data[$name]['filename'] = $original['filename'];\n $model->data[$name]['type'] = $original['mime'];\n \n return true;\n }", "public function saveToFile() {\n\n $file = $this->getExtractedFile();\n\n $file->close();\n\n $this->extractedFile = false;\n }", "public function afterSave()\n {\n if (!$this->files) {\n return;\n } else if ($this->contentAttribute) {\n $this->owner->updateAttributes([$this->contentAttribute => $this->processContentFiles(true)['content']]);\n } else {\n /** @var UploadedFile $file */\n foreach ($this->files as $key => $file) {\n $this->files[$key] = $this->saveFile($file->tempName, $file->name);\n }\n }\n $this->setAttributeValue(\\array_map(function($v){ return basename($v); }, array_filter($this->files)));\n }", "public function save(array $options = []) {\n/* if (preg_match('/image/', $this->mime_type)) {\n $this->isImage = true;\n $manager = new ImageManager(array('driver' => 'gd'));\n $image = Storage::disk('public')->get($this->myFile);\n $imageOrig = $manager->make($image); \n //Get width and height of the image\n $this->img_width = $imageOrig->width();\n $this->img_height = $imageOrig->height();\n }*/\n parent::save($options);\n $this->createThumbs();\n }", "public function save()\n {\n $this->validate();\n $this->validate(['image' => 'required|image']);\n\n // try to upload image and resize by ImageSaverController config\n try {\n $imageSaver = new ImageSaverController();\n $this->imagePath = $imageSaver->loadImage($this->image->getRealPath())->saveAllSizes();\n }catch (\\RuntimeException $exception){\n dd($exception);\n }\n\n $this->PostSaver();\n\n $this->resetAll();\n $this->ChangeCreatedMode();\n $this->swAlert([\n 'title' => 'Good job',\n 'text' => 'successfully added',\n 'icon' => 'success'\n ]);\n $this->render();\n }", "function imageSave($property, UploadedFile $file);", "public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}", "function save_camp_image(){\n\t\n\t\n\t$data = $_POST['data'];\n\tlist($type, $data) = explode(';', $data);\n\tlist(, $data) = explode(',', $data);\n\t$data = base64_decode($data);\t\t\n\t$img_name = 'tshirt'.time().'.png';\n\t\n\t$upload_dir = wp_upload_dir();\t\n\t\n\t$target_path_image = $upload_dir['path'].'/'.$img_name;\n\t\n\tfile_put_contents($target_path_image, $data);\n\t\n\techo json_encode(array('action'=>'done','img'=>$img_name));\t\n\tdie();\n}", "public function saveFileToPage() {\n if(!$this->savePage || !$this->saveField) {\n throw new WireException('You must define the savePage and saveField options before trying to save an image field');\n }\n\n $value = $this->value;\n // Move attachment into its own temp/quarantined folder so we can give it a nice file name\n if (is_array($value['tmp_name'])) {\n foreach($value['tmp_name'] as $key => $tempName) {\n $this->addFileToField($value['name'][$key], $tempName);\n }\n } else {\n $this->addFileToField($value['name'], $value['tmp_name']);\n }\n $this->value = $this->savePage->getUnformatted($this->saveField);\n }", "protected function save()\n {\n switch ($this->image_info['mime']) {\n \n case 'image/gif':\n imagegif($this->image, $this->getPath(true));\n break;\n \n case 'image/jpeg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/jpg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/png':\n imagepng($this->image, $this->getPath(true), round($this->quality / 10));\n break;\n \n default:\n $_errors[] = $this->image_info['mime'] . ' images are not supported';\n return $this->errorHandler();\n break;\n }\n \n chmod($this->getPath(true), 0777);\n }", "public function onSave()\n {\n // first, use the default onSave()\n $object = parent::onSave();\n \n // if the object has been saved\n// if ($object instanceof Voo)\n// {\n// // $source_file = 'tmp/'.$object->photo_path;\n// // $target_file = 'images/' . $object->photo_path;\n// // $finfo = new finfo(FILEINFO_MIME_TYPE);\n// \n// // if the user uploaded a source file\n// if (file_exists($source_file) AND $finfo->file($source_file) == 'image/png')\n// {\n// // move to the target directory\n// // rename($source_file, $target_file);\n// \n// try\n// {\n// TTransaction::open($this->database);\n// // update the photo_path\n// // $object->photo_path = 'images/'.$object->photo_path;\n// $object->store();\n// TTransaction::close();\n// }\n// catch (Exception $e) // in case of exception\n// {\n// new TMessage('error', '<b>Error</b> ' . $e->getMessage());\n// TTransaction::rollback();\n// }\n// }\n// }\n }", "public function saveToDb()\n\t{\n\t\tparent::saveToDb();\n\t\t$this->insertAttachment();\n\t}", "protected function saveImage()\n {\n if ( $this->initialImage != $this->image )\n {\n $this->deleteOldImage();\n\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n $imageHandler->save($this->getImagesFolder( TRUE ) . $imageHandler->getBaseFileName() );\n\n $settings = $this->getThumbsSettings();\n\n if ( !empty( $settings ) )\n {\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n\n foreach( $settings as $prefix => $dimensions )\n {\n list( $width, $height ) = $dimensions;\n $imageHandler\n ->thumb( $width, $height )\n ->save( $this->getImagesFolder( TRUE ) . $prefix . $imageHandler->getBaseFileName() );\n }\n }\n\n @unlink( $this->getTempFolder( TRUE ) . $this->image );\n }\n }", "public function writeimg() {\n\t\t$data = Input::all();\n\t\t$img = $data['imgdata'];\n\t\t$student_id = $data['student_id'];\n\t\t$img = str_replace('data:image/png;base64,', '', $img);\n\t\t$img = str_replace(' ', '+', $img);\n\t\t$imgdat = base64_decode($img);\n\t\t$myPublicFolder = public_path();\n\t\t$savePath = $myPublicFolder.\"/photo\";\n\t\t$path = $savePath.\"/$student_id.png\";\n\t\tFile::delete($path);\n\t\tFile::put($path , $imgdat);\n\t\t$last_add = Student::orderby('id', 'desc')->first();\n\t\tStudent::where('student_id', '=', $student_id)->update(array('pic' => \"$student_id.png\"));\n\t\treturn View::make('finish', array('imgid' => Student::where('student_id', '=', $student_id)->firstOrFail()->group));\n\t}", "protected function saveImage($asset)\n {\n\n if($this->isRemoteFile($asset->src) && $this->isUnisaFile($asset->src))\n {\n $image = $this->getImageManager()->make($asset->src);\n\n } elseif( ! $this->isBase64($asset->src))\n {\n $image = $this->getImageManager()->make(base_path('../') . $asset->src);\n\n } else {\n return $asset;\n }\n\n if($this->getFileTypeFromUrl($asset->src) == 'svg')\n {\n $src_filename = str_replace_first('svg', 'png', $asset->src);\n }\n else\n {\n $src_filename = $asset->src;\n }\n\n $store_path = Storage::disk('storage')->path($this->getDestPath($asset->tag, $src_filename));\n\n $asset->src = $this->getRelativePath($asset->tag, $src_filename);\n $asset->height = $image->height();\n $asset->width = $image->width();\n $asset->style = \"width: {$image->width()}px; height: {$image->height()}px;\";\n\n $image->save($store_path);\n $image->destroy();\n\n return $asset;\n }", "public function save() {\n\t\t/** @var FieldtypeFile $fieldtype */\n\t\t$fieldtype = $this->field->type;\n\t\treturn $fieldtype->saveFile($this->page, $this->field, $this);\n\t}" ]
[ "0.6489585", "0.6342781", "0.6172256", "0.58826715", "0.5855111", "0.57686734", "0.5734282", "0.57185435", "0.5714957", "0.57120895", "0.57008255", "0.5699926", "0.5682639", "0.5665804", "0.5645153", "0.5616319", "0.5611331", "0.5572959", "0.54994774", "0.5497668", "0.549116", "0.5456972", "0.5456445", "0.54526407", "0.5435144", "0.54066163", "0.5385559", "0.53783715", "0.5372613", "0.5365516" ]
0.6992652
0
Get default file url
public function getDefaultFileUrl() { return $this->baseUrl.'/default_image.png'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getUrl()\n {\n if (!$this->filename) {\n return null;\n }\n\n return $this->base_url . '/' . $this->filename;\n }", "public function getFileUrl()\n {\n\n return get_bloginfo('url') . \"/\" . $this->getFileName();\n\n }", "public function getFileBaseUrl()\n {\n return Mage::getBaseUrl('media').'family'.'/'.'file';\n }", "public function getDefaultUri()\n {\n return $this->default_uri;\n }", "public function getFileUrl(){\n $url = config('kontaktformular.fileDownloadUrl');\n //Prüfen ob $url auf / endet\n if(substr($url, -1) != '/'){\n $url .= '/';\n }\n return $url . $this->file_hash .'/' . $this->file_name .'/'. $this->id;\n }", "public function getFileBaseUrl()\n {\n return Mage::getBaseUrl('media').'invitationstatus'.'/'.'file';\n }", "public function getUrl(){\n\t \treturn $this->dirname.'/'.$this->filename.'.'.$this->extension;\n\t }", "public function get_uploaded_file_url()\n {\n return App::getBaseURL() . $this->uploaded_file_path;\n }", "public function getDefaultAttachAssetUrl()\n {\n return $this->defaultAttachAssetUrl;\n }", "private function getFileUrl() {\n return Storage::disk('public')->url('/uploads/' . $this->file_name);\n }", "public function getUrl()\n {\n return $this->storage()->url(\n $this->getFilepath().DIRECTORY_SEPARATOR.$this->filename\n );\n }", "protected function ___url() {\n\t\treturn $this->pagefiles->url . $this->basename;\n\t}", "public function getUploadedFileUrl()\n {\n return !empty($this->fileurl) ? $this->fileurl : \n (!empty($this->filename) ? $this->uploadUrl . $this->filename : null);\n }", "function get_default_min_path()\n\t{\n\t\tif (!empty($this->default_min_path))\n\t\t\treturn $this->default_min_path;\n\n\t\t// @since 1.3.0 we get a path relative to root for Minify instead of an\n\t\t// absolute URL to add compatibility to staging or mirror site.\n\t\t$min_path = preg_replace('#https?://[^/]+#ui', '', $this->plugin_wp_url);\n\t\t$min_path = $min_path . 'min/';\n\n\t\t$this->default_min_path = $min_path;\n\t\treturn $min_path;\n\t}", "public static function getDefaultUrl() {\n\t\treturn 'index.php?module=Workflows&parent=Settings&view=List';\n\t}", "public function getDefaultUrl()\n\t{\n\t\treturn 'index.php?module=' . $this->getName() . '&parent=Settings&view=List';\n\t}", "public function getDocumentUrl() {\n Yii::$app->params['uploadUrl'] = Yii::$app->urlManager->baseUrl . '/web/pdf/estrategias/';\n// return a default image placeholder if your source avatar is not found\n $evidencias = isset($this->evidencias) ? $this->evidencias : null;\n return Yii::$app->params['uploadUrl'] . $evidencias;\n }", "public function getDocumentUrl() {\n Yii::$app->params['uploadUrl'] = Yii::$app->urlManager->baseUrl . '/web/pdf/subproyectos/';\n// return a default image placeholder if your source avatar is not found\n $evidencias = isset($this->evidencias) ? $this->evidencias : null;\n return Yii::$app->params['uploadUrl'] . $evidencias;\n }", "public function getUrl( $file );", "public static function get_baseurl()\n {\n }", "public function getDefaultImagePath()\n {\n return $this->defaultImagePath;\n }", "protected function _getDefaultImage()\n {\n $path = $this->_getImageBasePath(false)\n . self::USER_DEFAULT_IMAGE;\n\n return $path;\n }", "public function getAbsoluteUrl(){\n\t \treturn Yii::app()->getBaseUrl(true).'/'.$this->dirname.'/'.$this->filename.'.'.$this->extension;\n\t }", "protected function get_default_file_vars()\n\t{\n\t\treturn array(\n\t\t\t'U_DOWNLOAD_LINK'\t=> $this->get_url(),\n\t\t\t'L_DOWNLOAD_COUNT'\t=> 'DOWNLOAD_COUNTS',\n\t\t\t'S_FILE'\t\t\t=> true,\n\t\t);\n\t}", "function getBaseUrl()\n{\n $doc_root_folders = utf8_explode(\"/\", $_SERVER['DOCUMENT_ROOT']);\n $cwd__folders = utf8_explode(\"/\", getcwd());\n //the difference between those is the path from doc root to the folder where\n //all files for this URI reside\n $path_from_doc_root = implode(\"/\", array_diff($cwd__folders, $doc_root_folders));\n return $_SERVER['HTTP_HOST'].'/'.$path_from_doc_root;\n}", "function webform_file_url($filepath) {\r\n if (!empty($filepath)) {\r\n $info = pathinfo($filepath);\r\n $file_url = file_create_url($info['dirname'] .'/'. rawurlencode($info['basename']));\r\n }\r\n return isset($file_url) ? $file_url : '';\r\n}", "function get_theme_file_uri($file = '')\n {\n }", "public function getParamRedirectUrl( $default = '' )\n\t{\n\t\treturn Forum::getBaseUri();\n\t}", "public function getUrl($suffix = \"\")\n {\n if ($this->_url == null) {\n $this->_url = Yii::app()->baseUrl.'/uploads/'.$this->folder_uploads.'/'.$this->guid.'/'.$this->file_name;\n }\n return $this->_url;\n }", "public function getUrl(): string\n {\n $url = $this->getBaseMediaDirectoryUrl().'/'.$this->getPathRelativeToRoot();\n $url = $this->makeCompatibleForNonUnixHosts($url);\n $url = $this->rawUrlEncodeFilename($url);\n\n return $url;\n }" ]
[ "0.74343115", "0.7353781", "0.72325313", "0.71754056", "0.70734674", "0.6938624", "0.6914747", "0.6911481", "0.6827444", "0.67132115", "0.66992396", "0.66643625", "0.65948397", "0.6569082", "0.6566136", "0.6525367", "0.65250313", "0.6514947", "0.6514485", "0.64838815", "0.6452079", "0.64477193", "0.64464766", "0.64288527", "0.64272565", "0.641218", "0.64033926", "0.63931936", "0.6387323", "0.63781935" ]
0.83693975
0
Gets list of watchers for a category.
public static function getWatcherList($category) { $adodb = adodbGetConnection(); $adodb->SetFetchMode(ADODB_FETCH_ASSOC); $sql = 'SELECT * FROM '.TABLE_CATEGORY_WATCH.' WHERE categoryid=?'; $rs = $adodb->Execute($sql, Array($category->getId())); if ( $rs === false ) { die('['.__CLASS__.'.getWatcherList()] Error: ' . $adodb->ErrorMsg()); } $result = Array(); while ( !$rs->EOF ) { $userId = $rs->fields['userid']+0; $user = UserDao::getUser($userId); if ( $user !== NULL ) { $result[] = $user; } $rs->MoveNext(); } $rs->Close(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function watching()\n {\n return $this->hasMany(watching::class);\n }", "public function all()\n\t{\n\t\treturn $this->watchlist->orderBy('created_at','desc')->get();\n\t}", "public function watchers(){\n\n return $this->hasMany('App\\Watcher');\n }", "public function getCategories(){\n return Category::get();\n }", "public function getCronksByCategory($category_uid) {\n $out = array();\n $cronks = $this->getCronks(true); // Get all\n foreach ($cronks as $cid=>$cronk) {\n if (isset($cronk['categories']) \n && AppKitArrayUtil::matchAgainstStringList($cronk['categories'], $category_uid)) {\n $out[$cid] = $cronk;\n }\n }\n return $out;\n }", "public function getWatchUserList(\n $fieldSelector = null,\n $labelSelector = null,\n $pretty = null,\n $resourceVersion = null,\n $timeoutSeconds = null,\n $watch = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/oapi/v1/watch/users';\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'fieldSelector' => $fieldSelector,\n 'labelSelector' => $labelSelector,\n 'pretty' => $pretty,\n 'resourceVersion' => $resourceVersion,\n 'timeoutSeconds' => $timeoutSeconds,\n 'watch' => var_export($watch, true),\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1WatchEvent');\n }", "public function getWatchOAuthClientList(\n $fieldSelector = null,\n $labelSelector = null,\n $pretty = null,\n $resourceVersion = null,\n $timeoutSeconds = null,\n $watch = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/oapi/v1/watch/oauthclients';\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'fieldSelector' => $fieldSelector,\n 'labelSelector' => $labelSelector,\n 'pretty' => $pretty,\n 'resourceVersion' => $resourceVersion,\n 'timeoutSeconds' => $timeoutSeconds,\n 'watch' => var_export($watch, true),\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1WatchEvent');\n }", "public function getChats()\n {\n return $this->doRequest('GET', 'chats', []);\n }", "private function getChannels()\r\n {\r\n static $channels;\r\n\r\n if (empty($channels)) {\r\n // Store the cache forever.\r\n $cache_key = 'categoryFirst';\r\n $channels = \\SCache::sear($cache_key, function () {\r\n $categories = $this->all();\r\n $channels = [];\r\n foreach ($categories as $category) {\r\n if ($category['bclassid'] == 0) {\r\n $channels[] = $category;\r\n }\r\n }\r\n return $channels;\r\n });\r\n }\r\n\r\n return $channels;\r\n }", "public function getSuggestions()\n {\n $ttl = 60; // seconds\n\n $categories = Cache::remember('customer_suggestions', $ttl, function () {\n return Category::inRandomOrder()\n ->orderBy('name')\n ->take(5)\n ->get()\n ->sortBy(function ($model) {\n return $model->name;\n })\n ->values()\n ->each(function ($category) {\n $category->load(['films' => function ($query) {\n $query->inRandomOrder()->take(10);\n }]);\n });\n });\n\n return new CategoryCollection($categories);\n }", "public static function getChargers()\n {\n return ChargersGetter :: get();\n }", "public function getEventsByCategory() {\n\t\t$eventsByCategory = [];\n\n\t\tforeach ( $this->categories as $category => $categoryDetails ) {\n\t\t\t$eventsByCategory[$category] = [];\n\t\t}\n\n\t\tforeach ( $this->notifications as $notificationType => $notificationDetails ) {\n\t\t\t$category = $notificationDetails['category'];\n\t\t\tif ( isset( $eventsByCategory[$category] ) ) {\n\t\t\t\t// Only real categories. Currently, this excludes the 'foreign'\n\t\t\t\t// pseudo-category.\n\t\t\t\t$eventsByCategory[$category][] = $notificationType;\n\t\t\t}\n\t\t}\n\n\t\treturn $eventsByCategory;\n\t}", "public function getCategories()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('categories');\n }", "public function index(Category $category)\n {\n $buyers = $this->buyerService->getCategoryBuyers($category);\n\n return $this->showAll($buyers);\n }", "public function list()\n {\n \n $stream = Category::all();\n \n return response()->json(['categories' => $stream], 200);\n }", "public function findByCategory(Category $category)\n {\n try {\n $collection = self::getObjectDataByKeyValue(self::ENTRY, 'category', $category->getId(), false);\n } catch (\\UnexpectedValueException $e) {\n return [];\n }\n\n return array_map(function($data) {\n return $this->build($data);\n }, $collection);\n }", "public function get_categories () {\n\t\treturn Category::all();\n\t}", "public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}", "public static function getCategories()\n\t{\n\t\treturn Category::getAll();\n\t}", "public function getWatchGroupList(\n $fieldSelector = null,\n $labelSelector = null,\n $pretty = null,\n $resourceVersion = null,\n $timeoutSeconds = null,\n $watch = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/oapi/v1/watch/groups';\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'fieldSelector' => $fieldSelector,\n 'labelSelector' => $labelSelector,\n 'pretty' => $pretty,\n 'resourceVersion' => $resourceVersion,\n 'timeoutSeconds' => $timeoutSeconds,\n 'watch' => var_export($watch, true),\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1WatchEvent');\n }", "public function categories()\n {\n // Cache results\n static $categories;\n\n if ($categories) {\n return $categories;\n }\n\n $app = \\Slim\\Slim::getInstance();\n $dataMapper = $app->dataMapper;\n $CategoryMapper = $dataMapper('CategoryMapper');\n\n return $categories = $CategoryMapper->getAllCategories();\n }", "public function getWatchedVideosToday(){\n $watched_videos = $this->watchedVideos;\n $watched_videos_today = $watched_videos->filter(function ($v){\n return self::watchedVideoFilter($v);\n });\n\n return $watched_videos_today;\n }", "public function getOffersByCategory(string $category)\n {\n return $this->createQueryBuilder('o')\n ->join('AppBundle:OffersCategory', 'c', 'WITH', 'o.offersCategory = c.id')\n ->where('c.slug = :category')\n ->setParameter('category', $category)\n ->getQuery();\n }", "public function getCategories()\n {\n return Category::all();\n }", "public function getWatchOAuthClientAuthorizationList(\n $fieldSelector = null,\n $labelSelector = null,\n $pretty = null,\n $resourceVersion = null,\n $timeoutSeconds = null,\n $watch = null\n ) {\n\n //the base uri for api requests\n $_queryBuilder = Configuration::$BASEURI;\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/oapi/v1/watch/oauthclientauthorizations';\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'fieldSelector' => $fieldSelector,\n 'labelSelector' => $labelSelector,\n 'pretty' => $pretty,\n 'resourceVersion' => $resourceVersion,\n 'timeoutSeconds' => $timeoutSeconds,\n 'watch' => var_export($watch, true),\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'APIMATIC 2.0',\n 'Accept' => 'application/json'\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::get($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'OpenShiftAPIWithKubernetesLib\\\\Models\\\\V1WatchEvent');\n }", "public static function getCategories()\n {\n //get cached categories\n $catCached = Yii::$app->cache->get('catCached');\n if ($catCached) {\n return $catCached;\n } else {\n return self::find()->indexBy('category_id')->asArray()->all();\n }\n }", "public function getAll()\n {\n\t\t\treturn Category::with([\n\t\t\t\t'user'=>function($query){\n\t\t\t\t\t$query->select(['id','firstname','lastname']);\n\t\t\t\t},\n\t\t\t\t'updatedByUser'=>function($query){\n\t\t\t\t\t$query->select(['id','firstname','lastname']);\n\t\t\t\t},\n\t\t\t])->get(['id','name','type','created_by','updated_by']);\n }", "public function getCategoryListAttribute()\n {\n return $this->categories->lists('category_id')->all();\n }", "public function listCategories()\n {\n $categories = Category::all();\n\n return $categories;\n }", "public function recentlyWatched()\n {\n return $this->hasMany(WatchHistory::class, 'video_id', 'id');\n }" ]
[ "0.54338086", "0.54285103", "0.52182585", "0.51749563", "0.51534826", "0.5136615", "0.512477", "0.50920874", "0.5078673", "0.5044089", "0.4977112", "0.4973489", "0.49577263", "0.495265", "0.49508035", "0.4942523", "0.49350345", "0.49132296", "0.48890138", "0.48879623", "0.48858476", "0.4875085", "0.48624483", "0.48556447", "0.48486766", "0.484078", "0.4835454", "0.4827527", "0.48214784", "0.48107773" ]
0.73874205
0
Checks if a user is watching a category
public static function isWatching($user, $category) { $adodb = adodbGetConnection(); $sql = 'SELECT * FROM '.TABLE_CATEGORY_WATCH.' WHERE categoryid=? AND userid=?'; $rs = $adodb->Execute($sql, Array($category->getId(), $user->getId())); $result = $rs !== false && !$rs->EOF; $rs->Close(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function category() {\n if ($this->is_logged_in()){\n return true; //check if user had been logged in!!!\n }else{\n exit;\n }\n }", "public function isWatching(): bool {\n $f3 = \\Base::instance();\n $watch = new Watched();\n\n return $watch->count(['user = ? AND geokret = ?', $f3->get('CURRENT_USER'), $this->id], ttl: 0);\n }", "function feed_category_access($allow_public = FALSE, $feed_category) {\r\n global $user;\r\n \r\n if ($allow_public && $feed_category->is_public) {\r\n return TRUE;\r\n }\r\n if (isset($feed_category->uid)) {\r\n return $feed_category->uid == $user->uid;\r\n }\r\n return FALSE;\r\n}", "public function okCategory($cat, $error = 1, $user_isadmin = false, $user_cat = false) {\n if ($user_isadmin === false) {\n $user_isadmin = $_SESSION['isadmin'];\n }\n\n if ($user_cat === false) {\n $user_cat = $_SESSION['categories'];\n }\n\n /* Is admin? */\n if ($user_isadmin) {\n return true;\n }\n /* Staff with access? */ elseif (in_array($cat, $user_cat)) {\n return true;\n }\n /* No access */ else {\n if ($error) {\n $this->helpbase->common->_error(_('You are not authorized to view tickets inside this category!'));\n } else {\n return false;\n }\n }\n }", "public function isCategory($category): bool;", "static function canMatch($cat)\n {\n \tif(User::getCategoryCount($cat) > 9)\n \t\tif(!self::isWeekend(time()))\n \t\t\treturn true;\n \t\telse\n \t\t\treturn false;\n \telse\n \t\treturn false;\n \n }", "public function is_watched_by_auth_user() {\n $id = Auth::id();\n\n\n $watcher_user_ids = [];\n\n foreach($this->watchers as $watcher) {\n\n //ja polnime nizata so user_id-s od konkretniot watcher\n $watcher_user_ids[] = $watcher->user_id;\n\n }\n\n // go sporeduvame sekoj user_id od watchers so id-to na logiraniot user\n if(in_array($id, $watcher_user_ids)){\n\n return true;\n }else{\n\n return false;\n }\n\n\n }", "function publisher_userIsModerator($itemObj)\r\n{\r\n $publisher = PublisherPublisher::getInstance();\r\n $categoriesGranted = $publisher->getHandler('permission')->getGrantedItems('category_moderation');\r\n return (is_object($itemObj) && in_array($itemObj->categoryid(), $categoriesGranted));\r\n}", "public function hasCategory(): bool;", "public function authorize()\n {\n return auth()->user()->can('update', [Category::class, request('category')]);\n }", "function feed_category_term_access($feed_category_term) {\r\n global $user;\r\n \r\n if (isset($feed_category_term->uid) && $feed_category_term->uid == $user->uid) {\r\n return TRUE;\r\n }\r\n if (isset($feed_category_term->fcid) && $feed_category = feed_category_load($feed_category_term->fcid)) {\r\n return $feed_category->uid == $user->uid;\r\n }\r\n return FALSE;\r\n}", "public function view(UserPolicy $user, Category $category)\n {\n if ($user->canDo('forum.category.view') && $user->isAdmin()) {\n return true;\n }\n\n return $category->user_id == user_id() && $category->user_type == user_type();\n }", "public function authorize()\n {\n return PrivateCategory::where([\n ['owner_id', '=', Auth::user()->id],\n ['id', '=', $this->category_id],\n ])->exists();\n }", "public function update(UserPolicy $user, Category $category)\n {\n if ($user->canDo('forum.category.edit') && $user->isAdmin()) {\n return true;\n }\n\n return $category->user_id == user_id() && $category->user_type == user_type();\n }", "public function isAuthorized($user = array())\n\t{\n\t\tif ($this->action === 'add')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t// The owner of a TempCategory can view, toggle, edit, and delete it\n\t\tif (in_array($this->action, array('view', 'toggle', 'edit', 'delete'))) \n\t\t{\n\t\t\t$temp_categoryId = $this->request->params['pass'][0];\n\t\t\tif ($this->TempCategory->isOwnedBy($temp_categoryId, AuthComponent::user('id')))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn parent::isAuthorized($user);\n\t}", "public function view(User $user, Category $category) {\n return ($user->hasPermission('categories.view.any'));\n }", "public function authorize()\n {\n if (Auth::user() && Auth::user()->hasPermissionTo('manage categories')) {\n return true;\n } else {\n return false;\n }\n }", "public function is_category($category = '')\n {\n }", "function is_video_category( $term = '' ) {\n return is_tax( 'video_cat', $term );\n }", "function nm_cmb_is_category_tyskysour( $cmb ) {\n $term = get_term($cmb->object_id);\n\n if (isset($term->slug) && ($term->slug === 'tyskysour-video')) {\n return true;\n }\n\n return false;\n}", "function chkResourceAccess($cats,$mbrCat) {\n\tglobal $isAdmin;\n\t\n\t$aCat = explode(\",\",$cats);\n\t$aMbrCat = explode(\",\",$mbrCat);\n\tif($isAdmin) return true;\n\tif($cats == \"*\") return true;\n\t$catMatch = array_intersect($aMbrCat,$aCat);\n\tif(count($catMatch)>0) return true;\n\treturn false;\n}", "public function isReadyForPurge()\n\t{\n\t\tif($this->getStatus() != CategoryStatus::DELETED)\n\t\t\treturn false;\n\t\t\t\n\t\tif($this->getMembersCount())\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getMembersCount() . \"] users\");\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\tif($this->getEntriesCount() > 0)\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getEntriesCount() . \"] entries\");\n\t\t\treturn false;\n\t\t}\n\t\t\t\n\t\tif($this->getDirectSubCategoriesCount() > 0)\n\t\t{\n\t\t\tKalturaLog::debug(\"Category still associated with [\" . $this->getDirectSubCategoriesCount() . \"] sub categories\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }", "function feed_category_admin_access() {\r\n $arguments = func_get_args();\r\n $allow_public = array_shift($arguments);\r\n $feed_category = array_shift($arguments);\r\n foreach ($arguments as $access) {\r\n if (!user_access($access)) {\r\n return FALSE;\r\n }\r\n }\r\n return feed_category_access($allow_public, $feed_category);\r\n}", "public function authorize()\n {\n if ($this->method() == 'PUT') {\n $categorySlug = $this->route('category');\n $category = $this->categoryRepo->getWithModerator($categorySlug);\n\n return $this->authUserRepo->can('update', $category);\n }\n else {\n return $this->authUserRepo->can('createOrDelete', 'App\\\\Category');\n }\n }", "public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }", "public function viewList(User $user) {\n return $user->hasPermission('categories.view.list');\n }", "public function update(User $user, Category $category) {\n return $user->hasPermission('categories.edit.any');\n }", "protected function _canShow(Mage_Catalog_Model_Category $category)\n {\n // check if the category is new\n if (!$category->getId()) {\n // if yes, return FALSE\n return false;\n }\n // check if the category is active\n if (!$category->getIsActive()) {\n // if yes, return FALSE\n return false;\n }\n // else return TRUE\n return true;\n }", "public function category_exists() {\n\t\t$users_name = trim($this->input->post ( 'category_name' ));\n\n\t\t$where = array ('category_name' => trim ( $users_name ));\n\t\t\n\t\t$result = $this->Mydb->get_record ( 'category_id', $this->table, $where );\n\t\tif (! empty ( $result )) {\n\t\t\t$this->form_validation->set_message ( 'cate_exists', get_label('username_exists') );\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}" ]
[ "0.6260988", "0.62571096", "0.6177837", "0.6116819", "0.5976005", "0.59670824", "0.5944458", "0.5864672", "0.5858774", "0.5825024", "0.58050007", "0.5796772", "0.5739628", "0.57086855", "0.5708132", "0.57022846", "0.5611773", "0.55885553", "0.5558433", "0.55528027", "0.5538581", "0.55194664", "0.54949623", "0.5484424", "0.5450766", "0.54322994", "0.5419713", "0.54152113", "0.5405178", "0.5382496" ]
0.7593479
0
accept WKT as a parameter, convert and store in the DB, and fetch back the geometry in WKT format DataMapper ORM won't handle this smoothly so we had to write our own wrappers here
public function setWKT($wkt) { $this->db->query("UPDATE {$this->table} SET geom=ST_GeomFromText(?,4326) WHERE id=?", array($this->db->escape_str($wkt), $this->id) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getWKT() {\r\n $wkt = $this->db->query(\"SELECT ST_AsText(geom) AS wkt FROM {$this->table} WHERE id=?\", array($this->id) );\r\n $wkt = $wkt->row()->wkt;\r\n return $wkt;\r\n}", "public function wktGenerateGeometry();", "public function WKTListToWKB($wktgeoms) {\r\n // go over the list and verify that each one fits the required geomtype\r\n // while we're at it, wrap it in ST_GEOMFROMTEXT() so we have a list of geometry-construction clauses suitable for forming a geom array\r\n $geom_array = array();\r\n foreach ($wktgeoms as $geom) {\r\n if (! preg_match('/^(POLYGON|MULTIPOLYGON)\\s*\\([\\d\\.\\-\\s\\,\\(\\)]+\\)$/', $geom) ) throw new Exception(\"Invalid geometry: expected a POLYGON\");\r\n $geom_array[] = sprintf(\"ST_GEOMFROMTEXT('%s',4326)\", $geom);\r\n }\r\n\r\n $wkb = sprintf(\"SELECT MULTI(ST_FORCE_2D(ST_UNION(ARRAY[%s]))) AS wkb\", implode(\",\", $geom_array) );\r\n $wkb = $this->db->query($wkb)->row()->wkb;\r\n return $wkb;\r\n}", "public function geomFromText($text) {\r\n $text = mb_strtolower($text, mb_detect_encoding($text));\r\n $text = preg_replace('/<!\\[cdata\\[(.*?)\\]\\]>/s','',$text);\r\n\r\n // Load into DOMDOcument\r\n $xmlobj = new DOMDocument();\r\n @$xmlobj->loadXML($text);\r\n if ($xmlobj === false) {\r\n throw new Exception(\"Invalid KML: \". $text);\r\n }\r\n\r\n $this->xmlobj = $xmlobj;\r\n try {\r\n $geom = $this->geomFromXML();\r\n } catch(InvalidText $e) {\r\n throw new Exception(\"Cannot Read Geometry From KML: \". $text);\r\n } catch(Exception $e) {\r\n throw $e;\r\n }\r\n\r\n return $geom;\r\n }", "public static function toGeometry($type, $coordinates, $srid = 4326)\n {\n\n $geoJson = self::toGeoJson($type, $coordinates, $srid);\n\n return \"ST_GeomFromGeoJSON('$geoJson')\";\n\n }", "public function toWGS84()\n {\n $gkProjection = new GaussKreugerProjection();\n $gkProjection->swedish_params($this->getProjectionString($this->projection));\n $lat_lon = $gkProjection->grid_to_geodetic($this->latitude, $this->longitude);\n\n $newPos = new WGS84Position($lat_lon[0], $lat_lon[1]);\n\n return $newPos;\n }", "function convertToPostGisPoint($latlng){\n\t\t//Remove leading parentheses\n\t\t$latlng = str_replace(array('(',')'), '', $latlng);\n\t\n\t\t//Explode and trim latitude and longitude\n\t\tlist ($lat, $lng) = array_map('trim',explode(\",\",$latlng));\n\t\n\t\t$expr = \"ST_GeomFromText('POINT(\".$lng.\" \".$lat.\")', 4326)\";\n\t\t$db = $this->getDataSource();\n\t\treturn $db->expression($expr);\n\t}", "function posListToWKT($posList, $order) {\n\n /*\n * Explode posList into the $coordinates array\n * Note the trim() to avoid weird results :)\n */\n $posList = preg_replace('!\\s+!', ' ', $posList);\n $coordinates = explode(' ', trim($posList));\n $count = count($coordinates);\n $polygon = '';\n\n /*\n * Parse each coordinates\n */\n for ($i = 0; $i < $count; $i = $i + 2) {\n\n /*\n * Case 1 : coordinates order is latitude then longitude\n */\n if ($order === \"LATLON\") {\n $polygon .= ((float)$coordinates[$i + 1]) . ' ' . ((float)$coordinates[$i]) . ',';\n }\n /*\n * Case 2 : coordinates order is longitude then latitude\n */\n else {\n $polygon .= ((float)$coordinates[$i]) . ' ' . ((float)$coordinates[$i + 1]) . ',';\n }\n }\n\n // Substring to remove the last ',' character\n return 'POLYGON((' . substr($polygon, 0, -1) . '))';\n}", "public function parse(object|string $data, ?string $type = null): GeometryProxy\n {\n $geometry = $this->loadGeometry($data, $type);\n\n if (is_null($geometry)) {\n throw new InvalidArgumentException('Could not parse the supplied data.');\n }\n\n $geometry_class = $this->buildGeometryClassName($geometry);\n\n // If running in Laravel, then use the IoC\n return is_null($this->app)\n ? new $geometry_class($geometry, $this->mapper)\n : $this->app->make($geometry_class, [$geometry, $this->mapper]);\n }", "public function getGeometry()\n {\n return $this->geometry;\n }", "public static function geoJSONGeometryToWKT($geometry)\n {\n if (!isset($geometry)) {\n return null;\n }\n \n $type = strtoupper($geometry['type']);\n $epsgCode = RestoGeometryUtil::geoJSONGeometryToSRID($geometry);\n $srid = $epsgCode === 4326 ? '' : 'SRID=' . $epsgCode . ';';\n switch ($type) {\n case 'POINT':\n $wkt = $srid . $type . RestoGeometryUtil::toPoint($geometry['coordinates']);\n break;\n \n case 'MULTIPOINT':\n $wkt = $srid . $type . RestoGeometryUtil::coordinatesToString($geometry['coordinates'], 'toPoint');\n break;\n \n case 'LINESTRING':\n $wkt = $srid . $type . RestoGeometryUtil::coordinatesToString($geometry['coordinates']);\n break;\n\n case 'MULTILINESTRING':\n case 'POLYGON':\n $wkt = $srid . $type . RestoGeometryUtil::coordinatesToString($geometry['coordinates'], 'toLineString');\n break;\n\n case 'MULTIPOLYGON':\n $wkt = $srid . $type . RestoGeometryUtil::coordinatesToString($geometry['coordinates'], 'toPolygon');\n break;\n \n case 'GEOMETRYCOLLECTION':\n $wkts = array();\n for ($i = count($geometry['geometries']); $i--;) {\n $wkts[] = RestoGeometryUtil::geoJSONGeometryToWKT($geometry['geometries'][$i]);\n }\n $wkt = $srid . $type . '(' . join(',', $wkts). ')';\n break;\n\n default:\n $wkt = null;\n }\n\n return $wkt;\n }", "function processGeometry($geometry) {\n\t\t$json = array();\n\t\t$jsonOuter = array();\n\t\t$jsonInner = array();\n\n//If the object has multiple geometries\nif (strpos($geometry,'<MultiGeometry>') == true) {\n\t\t//IMPLEMENT\n\t\t//Return the stuff between the multiple geometry tags so that the caller knows to expect more than one\n\t\t$search = array(\"<MultiGeometry>\",\"</MultiGeometry>\");\n\t\treturn \"multiple\";\n} else {\n\t\t//Get the coordinates between the outerBoundary tags inside LinearRing\n\t\t$outer = get_string($geometry, \"<outerBoundaryIs><LinearRing><coordinates>\",\"</coordinates></LinearRing></outerBoundaryIs>\");\n\t\t//Split the string by spaces to create a list of the coordinate pairs\n\t\t$outer = explode(\" \", $outer);\n\t\t//This gets added to the JSON information\n\t\tarray_push($json, $outer); \n\n\t\t//Get the coordinates between the innerBoundary tags inside LinearRing\n\t\t$inner = get_string($geometry, \"<innerBoundaryIs><LinearRing><coordinates>\",\"</coordinates></LinearRing></innerBoundaryIs>\");\n\t\t//If it isn't empty,\n\t\tif($inner !== null || $inner !== \"\") {\n\t\t\t//Split the coordinate pairs into a list\n\t\t\t$inner = explode(\" \", $inner);\n\t\t\t//Add the coordinates to the JSON information\n\t\t\tarray_push($json, $inner); \n\t\t}\n\t\t//Return the JSON information\n\t\treturn $json;\n}\n}", "public function jsonSerialize(): mixed\n {\n $position = [$this->getLng(), $this->getLat()];\n if ($this->is3d()) $position[] = $this->getAlt();\n return new \\GeoJson\\Geometry\\Point($position);\n }", "public function FetchFullInfo($params) {\r\n // $params\r\n // wkt if TRUE then the \"wkt\" geometry will be included\r\n // otherwise, the attribute will still exist but is NULL\r\n\r\n if (@$params['wkt']) $geom = \"ST_AsText(geom) \";\r\n else $geom = \"NULL\";\r\n\r\n // eins, zwei, drei, aust!\r\n $row = $this->db->query(\"SELECT *, $geom AS wkt FROM {$this->table} WHERE id=?\", array($this->id) )->row();\r\n return $row;\r\n}", "public function fetchBBOX() {\r\n $row = $this->db->query(\"SELECT ST_X(geom)-0.0001 AS w, ST_X(geom)+0.0001 AS e, ST_YMIN(geom)-0.0001 AS s, ST_YMAX(geom)+0.0001 AS n FROM {$this->table} WHERE id=?\", array($this->id) )->row();\r\n $row->w = (float) $row->w;\r\n $row->s = (float) $row->s;\r\n $row->e = (float) $row->e;\r\n $row->n = (float) $row->n;\r\n return $row;\r\n}", "public static function convertToWellKnownText($data, $includeSRID = false): string\n {\n global $dbi;\n\n // Convert to WKT format\n $hex = bin2hex($data);\n $spatialAsText = 'ASTEXT';\n $spatialSrid = 'SRID';\n $axisOrder = '';\n $mysqlVersionInt = $dbi->getVersion();\n if ($mysqlVersionInt >= 50600) {\n $spatialAsText = 'ST_ASTEXT';\n $spatialSrid = 'ST_SRID';\n }\n\n if ($mysqlVersionInt >= 80001 && ! $dbi->isMariaDb()) {\n $axisOrder = ', \\'axis-order=long-lat\\'';\n }\n\n $wktsql = 'SELECT ' . $spatialAsText . \"(x'\" . $hex . \"'\" . $axisOrder . ')';\n if ($includeSRID) {\n $wktsql .= ', ' . $spatialSrid . \"(x'\" . $hex . \"')\";\n }\n\n $wktresult = $dbi->tryQuery($wktsql);\n $wktarr = [];\n if ($wktresult) {\n $wktarr = $wktresult->fetchRow();\n }\n\n $wktval = $wktarr[0] ?? '';\n\n if ($includeSRID) {\n $srid = $wktarr[1] ?? null;\n $wktval = \"'\" . $wktval . \"',\" . $srid;\n }\n\n return $wktval;\n }", "public function fetchBBOX() {\r\n $row = $this->db->query(\"SELECT ST_XMIN(geom) AS w, ST_XMAX(geom) AS e, ST_YMIN(geom) AS s, ST_YMAX(geom) AS n FROM {$this->table} WHERE id=?\", array($this->id) )->row();\r\n $row->w = (float) $row->w;\r\n $row->s = (float) $row->s;\r\n $row->e = (float) $row->e;\r\n $row->n = (float) $row->n;\r\n return $row;\r\n}", "public static function forceWKT($geostring)\n {\n // Issue #329 - pystac_client GeoJSON string is within double quotes (so not valid GeoJSON)\n // e.g. \"intersects\":\"\\\"{\\\\\\\"type\\\\\\\": \\\\\\\"Polygon\\\\\\\", \\\\\\\"coordinates\\\\\\\": [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]}\\\"\"\n $geostring = stripslashes(trim($geostring, '\\'\"'));\n\n if (isset($geostring) && isset($geostring[0]) && $geostring[0] === '{') {\n $geostring = RestoGeometryUtil::geoJSONGeometryToWKT(json_decode($geostring, true));\n }\n \n if (!isset($geostring) || !RestoGeometryUtil::isValidWKT($geostring)) {\n return RestoLogUtil::httpError(400, 'Invalid input geometry for intersects - should be a valid GeoJSON or Well Known Text standard (WKT)');\n }\n \n return $geostring;\n }", "protected function sanitize_geometry(& $geometry){\n\t\tlist($width, $height) = $this->properties();\n\t\t\n\t\t// Turn off error reporting\n\t\t$reporting = error_reporting(0);\n\t\t\n\t\t// Width and height cannot exceed current image size\n\t\t$geometry['width'] = min($geometry['width'], $width);\n\t\t$geometry['height'] = min($geometry['height'], $height);\n\t\t\n\t\t// Set standard coordinates if given, otherwise use pixel values\n\t\tif($geometry['top'] === 'center'){\n\t\t\t$geometry['top'] = floor(($height / 2) - ($geometry['height'] / 2));\n\t\t}elseif($geometry['top'] === 'top'){\n\t\t\t$geometry['top'] = 0;\n\t\t}elseif($geometry['top'] === 'bottom'){\n\t\t\t$geometry['top'] = $height - $geometry['height'];\n\t\t}\n\t\t\n\t\t// Set standard coordinates if given, otherwise use pixel values\n\t\tif($geometry['left'] === 'center'){\n\t\t\t$geometry['left'] = floor(($width / 2) - ($geometry['width'] / 2));\n\t\t}elseif($geometry['left'] === 'left'){\n\t\t\t$geometry['left'] = 0;\n\t\t}elseif($geometry['left'] === 'right'){\n\t\t\t$geometry['left'] = $width - $geometry['height'];\n\t\t}\n\t\t\n\t\t// Restore error reporting\n\t\terror_reporting($reporting);\n\t}", "function import_gml_to_db() {\n\t\tglobal $GUI;\n\t\t$result = $this->get_source_srid();\n\t\tif (! $result['success']) {\n\t\t\treturn array(\n\t\t\t\t'succes' => false,\n\t\t\t\t'msg' => 'Import der GML in die Datenbank mit ogr2ogr_gmlas fehlgeschlagen Fehler: ' . $result['msg']\n\t\t\t);\n\t\t}\n\t\t$this->input_epsg = $result['epsg'];\n\t\t$this->xsd_location = '/var/www/html/modell/xsd/' . $this->get_xsd_version() . '/XPlanung-Operationen.xsd';\n\n\t\t# TODO should the target EPSG be stelle or rolle specific?\n\t\t$this->epsg = $GUI->Stelle->epsg_code;\n\t\t$this->build_basic_tables();\n\t\t$result = $this->ogr2ogr_gmlas();\n\t\tif (!$result['success']) {\n\t\t\tif ($GUI->formvars['format'] != 'json_result') {\n\t\t\t\techo 'Laden der Daten mit GML-AS fehlgeschlagen. Bitte kontaktieren Sie Ihren Administrator!';\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t\t\t#ToDo pk: Hier prüfen ob mindestens ein Plan und ein dazugehöriger Bereich angelegt wurden.\n\t\t\t\n\t\t# $tables = $this->get_all_tables_in_schema($this->gmlas_schema);\n\n\t\t# Revert the geom of GML to database specific winding order of vertices (CW/RHR IN DB and Shape, CCW/LHR in GML)\n\t\t# NOTE:\n\t\t# As lines have to be reverted as well, it cannot be confirmed automatically whether the order is correct.\n\t\t# It must be assumed that source data conforms to the GML standard (left hand order) on all geometries\n\t\t# For Polygons alone, this could be deduced through an inside/outside check (e.g. with ST_ForceRHR())\n\t\t$fachobjekte_tables_and_geometries = $this->get_fachobjekte_geometry_tables_attributes($this->gmlas_schema);\n\t\tif (!empty($fachobjekte_tables_and_geometries)) {\n\t\t\tforeach ($fachobjekte_tables_and_geometries as $fachobjekt_table_and_geometry) {\n\t\t\t\t$this->revert_vertex_order_for_table_with_geom_column_in_schema($fachobjekt_table_and_geometry['table_name'],$fachobjekt_table_and_geometry['column_name'],$this->gmlas_schema);\n\t\t\t}\n\t\t}\n\t\treturn array(\n\t\t\t'success' => true,\n\t\t\t'msg' => 'ogr2ogr_gmlas output: ' . $result['msg'],\n\t\t\t'url' => $result['url']\n\t\t);\n\t}", "protected function createAndPersistGISCoordinate($node, $type)\n {\n $lat = floatval($node['lat']);\n $lon = floatval($node['lon']);\n $coordinate = new GISCoordinate($lat, $lon, $type);\n $this->em->persist($coordinate);\n\n return $coordinate;\n }", "public function get_data_geojson($d,$tbl){\n $siz =!empty(sizeof($d['a']))?sizeof($d['a']):0;\n for($i=0; $siz >$i; $i++){\n //$this->db->select($d['a'][$i]['col'].' AS '. $d['a'][$i]['name']);\n $this->db->select($d['a'][$i]['col'].' AS '. pg_escape_string(str_replace(\".\",\"\",$d['a'][$i]['name'])));\n }\n $this->db->select('ST_AsGeoJSON(the_geom)');\n $this->db->order_by('id','ASC');\n $q=$this->db->get($tbl);\n return $q;\n }", "function getByBBOX($w,$s,$e,$n) {\r\n $geom = sprintf(\"ST_Transform(ST_GeometryFromText('POLYGON((%f %f, %f %f, %f %f, %f %f, %f %f))',4326),3734)\",\r\n $w, $s,\r\n $w, $n,\r\n $e, $n,\r\n $e, $s,\r\n $w, $s\r\n );\r\n $row = $this->db->query(\"SELECT * FROM {$this->table} WHERE ST_Intersects(the_geom,$geom) LIMIT 1\");\r\n $row = $row->row();\r\n return $row;\r\n}", "public function FetchFullInfo($params) {\r\n // $params\r\n // wkt if TRUE then the \"wkt\" geometry will be included\r\n // otherwise, the attribute will still exist but is NULL\r\n // simplify if TRUE then the \"wkt\" geometry will be simplified to a certain degree\r\n // for a lot of uploaded areas this actually makes a huge difference in download volume (download speed), and in vertices (browser hanging)\r\n // note: setting 'simplify' implicitly sets 'wkt' as well\r\n\r\n // if they asked for simplify then of course they asked for wkt\r\n if (@$params['simplify']) $params['wkt'] = TRUE;\r\n\r\n // how hard do we simplfy the wkt?\r\n // strategy here scales up the simplification based on number of vertices (0.0001 = about 30 feet in most USA latitudes)\r\n // but if they didn't ask for WKT anyway then we simploify it to NULL\r\n if (@$params['wkt'] and @$params['simplify']) $geom = \"ST_AsText(ST_Simplify(geom,0.0001 * (ST_NPoints(geom)/500) )) \";\r\n else if (@$params['wkt']) $geom = \"ST_AsText(geom) \";\r\n else $geom = \"NULL\";\r\n\r\n // eins, zwei, drei, aust!\r\n $row = $this->db->query(\"SELECT *, $geom AS wkt FROM {$this->table} WHERE id=?\", array($this->id) )->row();\r\n return $row;\r\n}", "protected function encodeGeometryType(array $data): string\n {\n $wkt = parent::encodeGeometryType($data);\n if (-1 !== $data['crs']['srid'] ?? -1) {\n $wkt = \"SRID={$data['crs']['srid']};\" . $wkt;\n }\n return $wkt;\n }", "public function getSpGeometryArray() {\n if ($this->getSpGeometry()) {\n $json['type'] = $this->getSpGeometry()->getType();\n $json['coordinates'] = $this->getSpGeometry()->toArray();\n\n return $json;\n }\n\n return NULL;\n }", "function set_ms_data_string(&$ms_layer, $db_layer){\n\t\t$data_str = \"the_geom from \"\n\t\t\t\t\t\t. \"(\" \n\t\t\t\t\t\t\t. \"SELECT \" \n\t\t\t\t\t\t\t\t. \"* \"\n\t\t\t\t\t\t\t. \" FROM \" \n\t\t\t\t\t\t\t\t. $db_layer->view_name . \" \"\n\t\t\t\t\t\t\t. \"WHERE \" \n\t\t\t\t\t\t\t\t. \"layer_id = \" .$db_layer->layer_id . \" \"\n\t\t\t\t\t\t. \") \"\n\t\t\t\t\t\t. \"AS foo USING UNIQUE \" .$db_layer->geom_pk_col_name . \" \"\n\t\t\t\t\t\t. \"USING SRID=-1\";\n\t\t\t\t\t\t\n\t\t/* - query used for testing - no layer id specified.\n\t\t$data_str = \"the_geom FROM \" . $db_layer->view_name . \" \"\n\t\t\t\t\t\t. \"AS foo USING UNIQUE \" .$db_layer->geom_pk_col_name . \" \"\n\t\t\t\t\t\t. \"USING SRID=-1\";\n\t\t*/\n\t\t$ms_layer->set(\"data\", $data_str);\n\t}", "protected function setGetSpatial( $data) {\n\t\tR::nuke();\n\t\t$place = R::dispense('place');\n\t\t$place->location = $data; //R::$f->GeomFromText('\"'.$data.'\"');\n\t\tR::store($place);\n\t\tasrt(R::getCell('SELECT AsText(location) FROM place LIMIT 1'),$data);\n\t}", "function set_ms_layer_type(&$ms_layer, $db_layer){\n\t\tswitch ($db_layer->geom_type){\n\t\t\t// point\n\t\t\tcase \"point\":\n\t\t\tcase \"multipoint\":\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_POINT);\n\t\t\t\tbreak;\n\t\t\t// line\t\n\t\t\tcase \"line\":\n\t\t\tcase \"linestring\":\n\t\t\tcase \"multilinestring\":\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_LINE);\n\t\t\t\tbreak;\n\t\t\t// polygon\n\t\t\tcase \"polygon\":\n\t\t\tcase \"multipolygon\":\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_POLYGON);\n\t\t\t\tbreak;\n\t\t\t// default\n\t\t\tdefault:\n\t\t\t\t$ms_layer->set(\"type\", MS_LAYER_POLYGON);\n\t\t}\n\t}", "public function convertToDatabaseValue(AbstractSpatialType $type, GeometryInterface $value)\n {\n\n return sprintf('%s', parent::convertToDatabaseValue($type, $value));\n }" ]
[ "0.65746605", "0.60581577", "0.6025827", "0.5585051", "0.5451591", "0.5435655", "0.5435575", "0.52223617", "0.5179099", "0.50965846", "0.50466734", "0.5024059", "0.5020915", "0.502058", "0.5014355", "0.49625355", "0.48897508", "0.4868394", "0.4848783", "0.48297527", "0.48238036", "0.47824135", "0.47612652", "0.47337198", "0.47275367", "0.47250187", "0.47138754", "0.47133106", "0.47000384", "0.46795058" ]
0.6920957
0
a function to fetch back the whole set of info for this edit: the id, all fields, and WKTencoded geometry
public function FetchFullInfo($params) { // $params // wkt if TRUE then the "wkt" geometry will be included // otherwise, the attribute will still exist but is NULL if (@$params['wkt']) $geom = "ST_AsText(geom) "; else $geom = "NULL"; // eins, zwei, drei, aust! $row = $this->db->query("SELECT *, $geom AS wkt FROM {$this->table} WHERE id=?", array($this->id) )->row(); return $row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function FetchFullInfo($params) {\r\n // $params\r\n // wkt if TRUE then the \"wkt\" geometry will be included\r\n // otherwise, the attribute will still exist but is NULL\r\n // simplify if TRUE then the \"wkt\" geometry will be simplified to a certain degree\r\n // for a lot of uploaded areas this actually makes a huge difference in download volume (download speed), and in vertices (browser hanging)\r\n // note: setting 'simplify' implicitly sets 'wkt' as well\r\n\r\n // if they asked for simplify then of course they asked for wkt\r\n if (@$params['simplify']) $params['wkt'] = TRUE;\r\n\r\n // how hard do we simplfy the wkt?\r\n // strategy here scales up the simplification based on number of vertices (0.0001 = about 30 feet in most USA latitudes)\r\n // but if they didn't ask for WKT anyway then we simploify it to NULL\r\n if (@$params['wkt'] and @$params['simplify']) $geom = \"ST_AsText(ST_Simplify(geom,0.0001 * (ST_NPoints(geom)/500) )) \";\r\n else if (@$params['wkt']) $geom = \"ST_AsText(geom) \";\r\n else $geom = \"NULL\";\r\n\r\n // eins, zwei, drei, aust!\r\n $row = $this->db->query(\"SELECT *, $geom AS wkt FROM {$this->table} WHERE id=?\", array($this->id) )->row();\r\n return $row;\r\n}", "public function getEditData($id) {\n $findspotdata = $this->getAdapter();\n $select = $findspotdata->select()\n ->from($this->_name)\n ->where('findspots.id = ?', (int)$id)\n ->group($this->_primary)\n ->limit('1');\n return $findspotdata->fetchAll($select);\n }", "public function get_EditPlg() {\n\t\t\t$table = 'TB_PELANGGAN';\n\t\t\t$attrs = 'IDPEL';\n\t\t\t$idval = $this->input->get('p');\n\n\t\t\t$out = array();\n\t\t\t$data = $this->data_model->getRowCustsByID($idval);\n\t\t\t$out = $data;\n\n\t\t\techo json_encode($out);\n\t\t}", "function getAll() {\n return array(\n 'name' => $this->get('name'),\n 'lat' => $this->get('lat'),\n 'lon' => $this->get('lon'),\n 'address' => $this->get('address'),\n 'id' => $this->get('id'),\n );\n }", "public function getEditRaw();", "public function fetchFields();", "public function getWKT() {\r\n $wkt = $this->db->query(\"SELECT ST_AsText(geom) AS wkt FROM {$this->table} WHERE id=?\", array($this->id) );\r\n $wkt = $wkt->row()->wkt;\r\n return $wkt;\r\n}", "public function fetch_fields() {}", "protected function getCompleteFieldInformation() {}", "public function getEdit($id)\n\t{\n\t\t//\n\t}", "public function supplier_details(){\n\t\t$supplier_id = $this->input->post('id');\n\t\t$parameters['where'] = array('id' => $supplier_id);\n\t\t$data['view_edit'] = $this->MY_Model->getRows('supplier',$parameters,'row');\n\t\t// echo $this->db->last_query();\n\t\techo json_encode($data);\n\t}", "function mrbsGetEntryInfo($id)\n{\n\tglobal $tbl_entry;\n\n\t$sql = \"SELECT start_time, end_time, entry_type, repeat_id, room_id,\n\t timestamp, create_by, name, type, description\n FROM $tbl_entry WHERE (ID = $id)\";\n\t\n\t$res = sql_query($sql);\n\tif (! $res) return;\n\t\n\t$ret = \"\";\n\tif(sql_count($res) > 0)\n\t{\n\t\t$row = sql_row($res, 0);\n\t\t\n\t\t$ret[\"start_time\"] = $row[0];\n\t\t$ret[\"end_time\"] = $row[1];\n\t\t$ret[\"entry_type\"] = $row[2];\n\t\t$ret[\"repeat_id\"] = $row[3];\n\t\t$ret[\"room_id\"] = $row[4];\n\t\t$ret[\"timestamp\"] = $row[5];\n\t\t$ret[\"create_by\"] = $row[6];\n\t\t$ret[\"name\"] = $row[7];\n\t\t$ret[\"type\"] = $row[8];\n\t\t$ret[\"description\"] = $row[9];\n\t}\n\tsql_free($res);\n\t\n\treturn $ret;\n}", "public function get_editordetails($id){\n $sql33 = \"select * from editors where editor_id='$id'\";\n $result33 = mysqli_query($this->db,$sql33);\n $editor_data = mysqli_fetch_array($result33);\n $this->firstname = $editor_data['first_name'];\n $this->lastname = $editor_data['last_name'];\n $this->universityname = $editor_data['editor_university'];\n $this->email = $editor_data['editor_email'];\n $this->designation = $editor_data['designation'];\n $this->type = $editor_data['editor_designation'];\n $this->searchuniversity = $editor_data['search_university'];\n $this->universityurl = $editor_data['university_url'];\n $this->countryname = $editor_data['country_name'];\n $this->profileurl = $editor_data['profile_url'];\n $this->interviewurl = $editor_data['interview_url'];\n $this->googlescolar = $editor_data['google_scolar'];\n $this->description = $editor_data['description'];\n $this->network = $editor_data['network'];\n $this->biography = $editor_data['biography'];\n $this->researchinterest = $editor_data['research_interest'];\n $this->interview = $editor_data['interview'];\n $this->universitylogo = $editor_data['university_logo'];\n $this->profilepic = $editor_data['image'];\n return true;\n }", "function model_article_getDetails($revisionId)\n{\n\t\t$articleResult = db_query(\"SELECT * FROM `article_revisions` WHERE `id`='$revisionId'\");\n\t\t$num_rows = mysql_num_rows($articleResult);\n\t\tif($num_rows)\n\t\t{\n\t\t\t$article = mysql_fetch_assoc($articleResult);\n\t\t\t$details['title'] = $article['title'];\n\t\t\t$details['content'] = $article['content'];\n\t\t\t$details['categoryId'] = $article['category_id'];\n\t\t\t// Get category name\n\t\t\t$categoryResult = db_query(\"SELECT * FROM `article_categories` WHERE `id`='\".$article['category_id'].\"'\");\n\t\t\tif($categoryResult)\n\t\t\t{\n\t\t\t\t$category = mysql_fetch_assoc($categoryResult);\n\t\t\t\t$details['category'] = $category['name'];\n\t\t\t}\n\t\t\t\n\t\t\t// Get tags\n\t\t\t$tagResult = db_query(\"SELECT * FROM `article_tags` WHERE `article_id`='\".$article['id'].\"'\");\n\t\t\tif($tagResult)\n\t\t\t{\n\t\t\t\t$tagList = \"\";\n\t\t\t\twhile($tags = mysql_fetch_assoc($tagResult))\n\t\t\t\t{\n\t\t\t\t\t$tagId = $tags['tag_id'];\n\t\t\t\t\t$tagNameResult = db_query(\"SELECT * FROM `tags` WHERE `id`='$tagId'\");\n\t\t\t\t\tif($tagNameResult)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tagName = mysql_fetch_assoc($tagNameResult);\n\t\t\t\t\t\t$tagList .= $tagName['name'].\", \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$details['tags'] = $tagList;\n\t\t\t\t$details['articleId'] = $article['article_id'];\n\t\t\t\t$details['date'] = $article['date'];\n\t\t\t}\n\t\t\treturn $details;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n}", "public function wktGenerateGeometry();", "function get_fields() {\n global $Tainacan_Item_Metadata;\n return $Tainacan_Item_Metadata->fetch($this, 'OBJECT');\n\n }", "function getCoords(){\n\tglobal $conn;\n\t$numargs = func_num_args();\n\t/* all foi */\n\tif ($numargs == 0){\n\t\t$result= pg_query($conn,\"SELECT ST_X(geom), ST_Y(geom) FROM feature_of_interest\");\n\t\treturn pg_fetch_all($result);\n\t}\n\t/* one foi */\n\telse\n\t{\n\t\t$foi_id = func_get_arg(0);\n\t\t$result = pg_query($conn,\"SELECT ST_X(geom), ST_Y(geom) \n\t\t\t\tFROM feature_of_interest \n\t\t\t\tWHERE feature_of_interest_id = '$foi_id' \");\n\t\treturn pg_fetch_all($result);\n\t}\n}", "public function extract_data_get()\r\n {\r\n if(isset($this->id)){\r\n $search = $this->Ajax->extract($this->id);\r\n foreach ($search as $row) {\r\n echo $row['word'].'<br>';\r\n }\r\n }\r\n }", "public function getEdit()\n\t{\n\t}", "public function getEditData($id)\n {\n $group=Group::find($id);\n return json_encode($group);\n }", "public function get_data_geojson($d,$tbl){\n $siz =!empty(sizeof($d['a']))?sizeof($d['a']):0;\n for($i=0; $siz >$i; $i++){\n //$this->db->select($d['a'][$i]['col'].' AS '. $d['a'][$i]['name']);\n $this->db->select($d['a'][$i]['col'].' AS '. pg_escape_string(str_replace(\".\",\"\",$d['a'][$i]['name'])));\n }\n $this->db->select('ST_AsGeoJSON(the_geom)');\n $this->db->order_by('id','ASC');\n $q=$this->db->get($tbl);\n return $q;\n }", "public function getContactDataFields();", "function edit($id) {\n \n $l = ORM::factory('incident')\n ->where('id', $id)\n ->find();\n\n $state_id = $l->location->state_id;\n $city_id = $l->location->city_id;\n\n header('Content-type: application/json; charset=utf-8');\n\t\techo json_encode(compact('state_id', 'city_id'));\n }", "public static function ADMIN_AREA_GET_AREA_EDIT_DATA(){\n\t $SQL_String = \"SELECT area_type,area_name,area_descrip,area_link,area_gates,area_load,accept_max_day,accept_min_day,revise_day,cancel_day,filled_day,wait_list,member_max,auto_pass,time_open,time_close,refer_json,form_json FROM area_main WHERE area_code=:area_code AND _keep=1 ;\";\n\t return $SQL_String;\n\t}", "public function getFindSpotData($id) {\n \n $findspotdata = $this->getAdapter();\n $select = $findspotdata->select()\n ->from($this->_name, array(\n 'county', 'district', 'parish',\n 'easting', 'northing', 'gridref',\n 'declat', 'declong', 'fourFigure',\n 'knownas', 'smrref', 'map25k',\n 'map10k', 'landusecode', 'landusevalue',\n 'id', 'old_findspotid', 'createdBy',\n 'description', 'comments', 'address',\n 'woeid', 'elevation', 'postcode',\n 'landowner', 'fourFigureLat', 'fourFigureLon',\n 'gridlen', 'woeid', 'geonamesID',\n 'districtID', 'countyID', 'regionID',\n 'parishID'\n ))\n ->joinLeft('finds','finds.secuid = findspots.findID', \n array('discmethod'))\n ->joinLeft(array('land1' => 'landuses'),\n 'land1.id = findspots.landusecode',\n array('landuse' => 'term'))\n ->joinLeft(array('land2' =>'landuses'),\n 'land2.id = findspots.landusevalue',\n array('landvalue' => 'term'))\n ->joinLeft('maporigins','maporigins.id = findspots.gridrefsrc',\n array('source' => 'term'))\n ->joinLeft('osRegions','findspots.regionID = osRegions.osID',\n array('region' => 'label'))\n ->joinLeft('osCounties', 'findspots.countyID = osCounties.osID', \n array('countyType' => 'type'))\n ->joinLeft('osDistricts', 'findspots.districtID = osDistricts.osID', \n array('districtType' => 'type'))\n ->joinLeft('osParishes', 'findspots.parishID = osParishes.osID', \n array(\n 'parishType' => 'type', \n 'centreLat' => 'lat', \n 'centreLon' => 'lon'\n ))\n ->joinLeft('people',$this->_name . '.landowner = people.secuid', \n array('landownername' => 'fullname'))\n ->joinLeft('discmethods','finds.discmethod = discmethods.id', \n array('method'))\n ->where('finds.id = ?', (int)$id)\n ->group('finds.id')\n ->limit('1');\n return $findspotdata->fetchAll($select);\n }", "function extras_short_data($id) {\r\n\t\t\t\t$this->db->select('extras_title,extras_desc');\r\n\t\t\t\t$this->db->where('extras_id', $id);\r\n\t\t\t\treturn $this->db->get('pt_extras')->result();\r\n\t\t}", "public function editData($id){\n $dbResult = $this->db->query(\"SELECT * FROM customer WHERE id_customer = ?\", array($id));\n return $dbResult->getResult();\n }", "static public function getDataMap()\n {\n return array(\n 'fields' => array(\n 'rev' => array(\n 'type' => 'integer',\n ),\n 'cover' => array(\n 'type' => 'string',\n ),\n 'wiki_id' => array(\n 'type' => 'integer',\n ),\n 'title' => array(\n 'type' => 'string',\n ),\n 'html_cache' => array(\n 'type' => 'string',\n ),\n 'content' => array(\n 'type' => 'string',\n ),\n 'tags' => array(\n 'type' => 'raw',\n ),\n 'comment_tags' => array(\n 'type' => 'raw',\n ),\n 'model' => array(\n 'type' => 'string',\n ),\n 'has_video' => array(\n 'type' => 'integer',\n ),\n 'like_num' => array(\n 'type' => 'integer',\n ),\n 'dislike_num' => array(\n 'type' => 'integer',\n ),\n 'watched_num' => array(\n 'type' => 'integer',\n ),\n 'admin_id' => array(\n 'type' => 'integer',\n ),\n 'do_date' => array(\n 'type' => 'date',\n ),\n 'source' => array(\n 'type' => 'raw',\n ),\n 'tvsou_id' => array(\n 'type' => 'string',\n ),\n 'first_letter' => array(\n 'type' => 'string',\n ),\n 'douban_id' => array(\n 'type' => 'string',\n ),\n 'verify' => array(\n 'type' => 'integer',\n ),\n 'created_at' => array(\n 'type' => 'date',\n ),\n 'updated_at' => array(\n 'type' => 'date',\n ),\n ),\n 'references' => array(\n\n ),\n 'embeddeds' => array(\n\n ),\n 'relations' => array(\n\n ),\n );\n }", "function FeaturesDetails() \n {\n \n $FeaturesDetails= \"SELECT f.*,fd.*,st.*,fs.name as fname,pi.pi_title as ptitle,tp.name as tname\n FROM features AS f\n LEFT JOIN feature_statuses AS fs ON fs.id = f.f_status_id\n LEFT JOIN productincrements AS pi ON pi.pi_id = f.f_PI\n LEFT JOIN topics AS tp ON tp.id = f.f_topic_id\n LEFT JOIN feature_details AS fd ON fd.f_id = f.f_id\n LEFT JOIN staff AS st ON st.staff_id = fd.f_SME\"; \n $FeaturesDetailsresult = $this->ds->select($FeaturesDetails);\n //print '<pre>';print_r($FeaturesDetailsresult);\n return $FeaturesDetailsresult;\n }", "function getSingleClothes($edit_id){\r\n\t\t \r\n \t\t$mysqli = new mysqli($GLOBALS[\"servername\"], $GLOBALS[\"server_username\"], $GLOBALS[\"server_password\"], $GLOBALS[\"database\"]); \r\n \t\t \r\n \t\t$stmt = $mysqli->prepare(\"SELECT clothes, brand, size, color FROM fashion WHERE id=?\");\r\n\r\n\t\t$stmt->bind_param(\"i\", $edit_id);\r\n\t\t$stmt->bind_result($id, $clothes, $brand, $size, $color);\r\n\t\t$stmt->execute();\r\n \t\t\r\n \t\t$fashionn = new Stdclass(); \r\n \t\t \r\n \t\t//saime uhe rea andmeid \r\n \t\tif($stmt->fetch()){\r\n\t\t\t//saan siin alles kasutada bind_result muutujaid\r\n\t\t\t$fashionn->clothes = $clothes;\r\n\t\t\t$fashionn->brand = $brand;\r\n\t\t\t$fashionn->size = $size;\r\n\t\t\t$fashionn->color = $color;\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\theader(\"Location: table.php\");\r\n\t\t\t\t\r\n\t\t}\r\n\t\treturn $fashionn;\r\n\t\t\r\n\t\t$stmt->close();\r\n\t\t$mysqli->close();\r\n\t}" ]
[ "0.6306961", "0.5873052", "0.57099456", "0.55437505", "0.5543054", "0.54214877", "0.539332", "0.5362502", "0.53290975", "0.53251475", "0.53051996", "0.5284377", "0.5228499", "0.518409", "0.5182405", "0.51784396", "0.51737255", "0.5150448", "0.5144191", "0.5136557", "0.5104999", "0.5104548", "0.5090399", "0.5088935", "0.5082422", "0.5077168", "0.5059738", "0.5031483", "0.5030191", "0.5027306" ]
0.6215488
1
Returns database specific message provided to the constructor.
public function getDatabaseMessage() { return $this->databaseMessage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function get_message();", "public function getMessage() {}", "public function getMessage() {}", "public function getMessage() {}", "public function get_message() { return $this->getMessage(); }", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "public function getMessage();", "protected abstract function _message();", "public function getMessage() {\n return self::$message;\n }", "public function getMessage()\n {\n if ($this->message) {\n return $this->message;\n }\n\n return $this->newMessage();\n }", "public function getMessage(): string\n {\n return $this->requireString('message');\n }", "public function __construct($message)\n\t{\n\t\tparent::__construct($message . ' is unsupported by this DAO', 0);\n\t}", "final public function getMessage()\n {\n return 'message';\n }", "private function _messageFor()\n {\n // First, get the message\n //$message_for = preg_match('^!messagefor-[$1]', $this->_data->message)\n //preg_match('/^!messagefor-(.*):/', '!messagefor-Mike I missed you', $matches); var_dump($matches);\n try {\n // Connect\n $dbh = $this->_connectToDb();\n\n // Insert\n $stmt = $dbh->prepare(\"INSERT INTO message(`nick`, `message`, `when`, `from`) VALUES (:nick, :message, NOW(), :from)\");\n\n $stmt->bindParam(':nick', $message_for, PDO::PARAM_STR);\n $stmt->bindParam(':message', $message_payload, PDO::PARAM_STR);\n $stmt->bindParam(':from', $this->_data->nick, PDO::PARAM_STR);\n\n $stmt->execute();\n\n $dbh = null;\n\n }\n catch(PDOException $e)\n {\n echo $e->getMessage();\n }\n }", "function __construct($message, $code = \"\", $query = null, $description = null){ \n parent::__construct($message, $code); \n if ($query != null) \n $this->_sql = $query; \n \n if($description != null){\n $this->_decription = $description;\t\n }\n }", "final public function getMessage()\n {\n return $this->documentTypeLogKey;\n }", "private static function fromDBRecord(array $record, $db): Message {\n $message = new Message;\n $message->setId($record['id']);\n $message->setText($record['text']);\n $message->setAuthorId($record['author_id']);\n $message->setPublicId($record['public_id']);\n $message->setDB($db);\n $message->setCreatedAt(DateTime::createFromFormat('Y-m-d H:i:s', $record['created_at']));\n if ($record['parent_id']) {\n $message->setParentMessageId($record['parent_id']);\n }\n return $message;\n }", "function getMessage() {\n return $this->message;\n }", "public function getMessage() {\n return $this->message;\n }" ]
[ "0.65168744", "0.6279108", "0.6279108", "0.6279108", "0.6231922", "0.62175566", "0.62175566", "0.62175566", "0.62175566", "0.62175566", "0.62175566", "0.62175566", "0.62175566", "0.62175566", "0.62175566", "0.62175566", "0.62175566", "0.62175566", "0.61753887", "0.614337", "0.6129962", "0.6127617", "0.6124223", "0.61174875", "0.61060536", "0.6105536", "0.6102835", "0.60713387", "0.6040717", "0.6024184" ]
0.7413875
0
Get meta tag with language default.
function v2_mumm_get_meta_tag($arg = '', $name = '') { global $language; $title = t('Mumm International'); $list_meta = variable_get('list_meta', array()); if ($list_meta[$language->language]['title_' . $arg]) { $title = $list_meta[$language->language]['title_' . $arg] . ' | ' . $name; } return $title; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSiteDefaultLanguage();", "public function getFromLanguage(): string;", "public function getDefaultLanguage() : ?string;", "public function getLanguage() {}", "abstract public function get_app_language();", "public function getDefaultLanguage(){\n\t\treturn $this->_lang_default;\n\t}", "function GetDefaultLang() : string\n{\n return 'ar';\n}", "public static function tag_language_default(FTL_Binding $tag)\n\t{\n\t\treturn self::output_value($tag, $tag->getValue('def'));\n\t}", "private function getDefault() {\n $result = new PapayaContentLanguage();\n $result->assign(\n array(\n 'id' => 1,\n 'identifier' => 'en',\n 'code' => 'en-US',\n 'title' => 'English',\n 'image' => 'us.gif',\n 'is_content' => 1,\n 'is_interface' => 1\n )\n );\n return $result;\n }", "function kulam_acf_set_default_language() {\n\n\t// return\n\treturn acf_get_setting( 'default_language' );\n\n}", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public function getLanguage();", "public static function getDefaultLang() {\n return self::find()->where(['is_default' => self::LANGUAGE_IS_DEFAULT, 'status' => self::LANGUAGE_STATUS_ACTIVE])->one();\n }", "function default_language()\n\t{\n\t\treturn 'en_US';\n\t}", "static function get()\n\t{\n\t\treturn self::$lang;\n\t}", "function getDefaultLanguage() {\n if( isset($_SERVER[\"HTTP_ACCEPT_LANGUAGE\"]) ){\n return parseDefaultLanguage($_SERVER[\"HTTP_ACCEPT_LANGUAGE\"]);\n } else{\n return parseDefaultLanguage(NULL);\n }\n}", "function default_lang()\n {\n $browser_lang = !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ',') : '';\n $browser_lang = substr($browser_lang, 0,2);\n if(array_key_exists($browser_lang, $this->languages))\n return $browser_lang;\n else{\n reset($this->languages);\n return key($this->languages);\n }\n }", "public function get_language()\n {\n }", "protected function getLanguageParameter() {}", "public function getHrefLang(string $lang): ?TagInterface;", "public function getDefaultLanguage(): string\n {\n $this->fetchLanguages();\n\n $language = collect($this->languages)->where('default', true)->first();\n self::$language = $language;\n\n return $language->name;\n }", "public function defaultLanguage()\r\n\t{\r\n\t\treturn $this->default_language;\r\n\t}", "private function initDefaultLanguage()\r\n\t{\r\n\t\t$default_language = $this->xml->xpath(\"configuration/config[@name='languages']/language[position()=1]/@code\");\r\n\t\t\r\n\t\tif ( count($default_language) > 0)\r\n\t\t{\r\n\t\t\t$this->default_language = (string) $default_language[0][\"code\"];\r\n\t\t}\t\t\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->default_language = null;\r\n\t\t}\r\n\r\n\t\treturn $this->default_language;\r\n\t}", "public function getLang();", "function site_meta($key, $default = '') {\n\tglobal $app;\n\n\treturn $app['meta']->get($key, $default);\n}", "public static function get() {\n\t\treturn self::$lang;\n\t}" ]
[ "0.68456525", "0.65500563", "0.6478061", "0.6444824", "0.63865393", "0.63549304", "0.6352228", "0.6319265", "0.6276994", "0.62709373", "0.6262119", "0.6262119", "0.6262119", "0.6262119", "0.6262119", "0.6262119", "0.6238714", "0.6231729", "0.6202931", "0.6188543", "0.61833245", "0.6169949", "0.6142004", "0.6141029", "0.613892", "0.6137188", "0.6130302", "0.6079712", "0.6066642", "0.60628694" ]
0.6786804
1
Remove style.css in page outdatedbrowser
function v2_mumm_css_alter(&$css) { $path = drupal_get_path('theme', 'v2_mumm'); if ($_GET['q'] === 'outdated-browser') { unset($css[$path . '/css/style.css']); } else { unset($css[$path . '/css/unsupported-browsers.css']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function webbusiness_reset_cache_custom_css() {\n\tdelete_transient('webbusiness_custom_css_preview');\n\twebbusiness_cache_custom_css_preview();\n}", "function remove_default_admin_stylesheets() {\n \t// wp_deregister_style('wp-reset-editor-styles');\n }", "function delete_stylesheet() {\n\t\t\t$css_file = $this->get_stylesheet();\n\t\t\tThemify_Filesystem::delete($css_file,'f');\n\t\t}", "function remove_editor_styles()\n {\n }", "function updated_file() {\r\n\t\tdelete_transient( 'av5_css_file' );\r\n\t}", "static public function remove_gform_styles()\n {\n wp_dequeue_style( 'gforms_reset_css' );\n // wp_dequeue_style( 'gforms_datepicker_css' );\n wp_dequeue_style( 'gforms_formsmain_css' );\n wp_dequeue_style( 'gforms_ready_class_css' );\n wp_dequeue_style( 'gforms_browsers_css' );\n }", "function first_edition_deregister_styles() {\n\tif ( '' != get_option( 'first_edition_font_pair' ) ) {\n\t\twp_dequeue_style( 'quattrocento' );\n\t\twp_dequeue_style( 'quattrocento-sans' );\n\t}\n}", "function wpgrade_head_cleanup() {\r\n\t// Remove WP version\r\n\tremove_action( 'wp_head', 'wp_generator' );\r\n\t\r\n\tremove_action( 'wp_head', 'rsd_link' );\r\n\t// windows live writer\r\n\tremove_action( 'wp_head', 'wlwmanifest_link' );\r\n\t\r\n\t// remove WP version from css - those parameters can prevent caching\r\n\t//add_filter( 'style_loader_src', 'wpgrade_noversion_css_js', 9999 );\r\n\t// remove WP version from scripts - those parameters can prevent caching\r\n\t//add_filter( 'script_loader_src', 'wpgrade_noversion_css_js', 9999 );\r\n\r\n}", "function unhook_parent_style() {\n \n wp_dequeue_style( 'genericons' );\n\twp_deregister_style( 'genericons' );\n wp_dequeue_style( 'twentyfifteen-ie' );\n\twp_deregister_style( 'twentyfifteen-ie' );\n wp_dequeue_style( 'twentyfifteen-ie7' );\n\twp_deregister_style( 'twentyfifteen-ie7' );\n wp_dequeue_style( 'twentyfifteen-fonts' );\n\twp_deregister_style( 'twentyfifteen-fonts' );\n}", "function twentyten_remove_gallery_css( $css ) {\n\treturn preg_replace( \"#<style type='text/css'>(.*?)</style>#s\", '', $css );\n}", "function twentyten_remove_gallery_css( $css ) {\n\treturn preg_replace( \"#<style type='text/css'>(.*?)</style>#s\", '', $css );\n}", "function start_remove_gallery_style( $css ) {\n\treturn preg_replace( \"!<style type='text/css'>(.*?)</style>!s\", '', $css );\n}", "function affwp_remove_bctt_styling() {\n remove_action('wp_enqueue_scripts', 'bctt_scripts');\n}", "function disable_shopp_css() {\n\tglobal $Shopp;\n\tremove_action('wp_head',array(&$Shopp,'header'));\n}", "function wpfolio_remove_gallery_css( $css ) {\n\treturn preg_replace( \"#<style type='text/css'>(.*?)</style>#s\", '', $css );\n\t}", "function ks_remove_recent_comments_style() {\n\tglobal $wp_widget_factory;\n\tremove_action( 'wp_head', array(\n\t\t$wp_widget_factory->widgets['WP_Widget_Recent_Comments'],\n\t\t'recent_comments_style'\n\t) );\n}", "function tempera_remove_recent_comments_style() {\n\tglobal $wp_widget_factory;\n\tremove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );\n}", "function remove_pending_css_admin() { \n\t?>\n\n\t<link rel=\"stylesheet\" href=\"<?php echo get_bloginfo( 'home' ) . '/' . PLUGINDIR . '/remove-pending-comments/css/admin.css' ?>\" type=\"text/css\" media=\"all\" /> \n\n\t<?php\n}", "function rusticmodern_remove_gallery_css( $css ) {\n\treturn preg_replace( \"#<style type='text/css'>(.*?)</style>#s\", '', $css );\n}", "function cloud4all_dequeue_styles() {\n\twp_dequeue_style('twentytwelve-ie');\n}", "function bleachwave_remove_gallery_css( $css ) {\n\treturn preg_replace( \"#<style type='text/css'>(.*?)</style>#s\", '', $css );\n}", "function twentyten_remove_recent_comments_style() {\n\tglobal $wp_widget_factory;\n\tremove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );\n}", "function remove_gravityforms_style() {\n\twp_dequeue_style('gforms_css');\n}", "function wp_deregister_style($handle)\n {\n }", "function tlh_remove_wp_widget_recent_comments_style() {\n\tif ( has_filter( 'wp_head', 'wp_widget_recent_comments_style' ) ) {\n\t\tremove_filter( 'wp_head', 'wp_widget_recent_comments_style' );\n\t}\n}", "function wpgrade_gallery_style($css) {\r\n return preg_replace(\"!<style type='text/css'>(.*?)</style>!s\", '', $css);\r\n}", "public function clearStylesheets()\n {\n foreach (array_keys($this->getStylesheets()) as $file)\n {\n $this->removeStylesheet($file);\n }\n }", "function spartan_remove_wp_widget_recent_comments_style() {\n if ( has_filter('wp_head', 'wp_widget_recent_comments_style') ) {\n remove_filter('wp_head', 'wp_widget_recent_comments_style' );\n }\n}", "function bfa_remove_wp_widget_recent_comments_style() {\r\n remove_filter('wp_head', 'wp_widget_recent_comments_style' );\r\n}", "function sf_child_theme_dequeue_style()\n{\n wp_dequeue_style('storefront-style');\n wp_dequeue_style('storefront-woocommerce-style');\n}" ]
[ "0.7121672", "0.6820813", "0.6767376", "0.66542", "0.6637675", "0.65933967", "0.6542895", "0.64284766", "0.63788235", "0.63734704", "0.63734704", "0.6369779", "0.63692594", "0.63396305", "0.63282734", "0.63256955", "0.63195795", "0.6314363", "0.63023406", "0.62994653", "0.6292427", "0.6278474", "0.6275828", "0.6273388", "0.625406", "0.62500185", "0.62491953", "0.6229999", "0.6228554", "0.6225958" ]
0.7393213
0
/ hook menu tree new main menu
function v2_mumm_menu_tree__menu_new_main_menu(&$variables) { return '<ul>' . $variables['tree'] . '</ul>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getMenuTree();", "public function add_menus()\n {\n }", "protected function _menu()\n\t{\n\t\tif (ee()->view->disabled('ee_menu'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tee()->view->cp_main_menu = ee()->menu->generate_menu();\n\t}", "public function menu( )\n {\n\n if( $this->view->isType( View::SUBWINDOW ) )\n {\n $view = $this->view->newWindow('WebfrapMainMenu', 'Default');\n }\n else if( $this->view->isType( View::MAINTAB ) )\n {\n $view = $this->view->newMaintab('WebfrapMainMenu', 'Default');\n $view->setLabel('Explorer');\n }\n else\n {\n $view = $this->view;\n }\n\n $view->setTitle('Webfrap Main Menu');\n\n $view->setTemplate( 'webfrap/menu/modmenu' );\n\n $modMenu = $view->newItem( 'modMenu', 'MenuFolder' );\n $modMenu->setData( DaoFoldermenu::get('webfrap/root',true) );\n\n }", "function v2_mumm_menu_link__menu_new_main_menu(&$variables) {\n $element = $variables ['element'];\n if (!$element ['#title']) {\n $href_array = explode('/', $element['#href']);\n if ($href_array[0] == 'node' && is_numeric($href_array[1])) {\n $node = node_load($href_array[1]);\n $element['#title'] = $node->title;\n }\n }\n $element['#localized_options']['attributes'] = array(\n 'data-tracking' => '',\n 'data-track-action' => 'click',\n 'data-track-category' => 'header',\n 'data-track-label' => strtolower($element ['#title']),\n 'data-track-type' => 'event',\n );\n $output = l($element ['#title'], $element ['#href'], $element ['#localized_options']);\n\n if (in_array('first', (array)$element['#attributes']['class'])) {\n return '<li class=\"first\">' . $output . '</li>';\n }\n if (in_array('hidden', (array)$element['#localized_options']['attributes']['class'])) {\n return '';\n }\n $class_item_attributes = $element['#original_link']['options']['item_attributes']['class'];\n return '<li class=\"item '.$class_item_attributes.'\">' . $output . '</li>';\n}", "public function menu_main_menu()\n {\n return menu_main_menu();\n }", "function ft_hook_menu() {}", "public function makeMenu() {}", "protected function prepareMenuItemsForRootlineMenu() {}", "function susy_menu_tree__main_menu($vars) {\n return '<ul class=\"menu inline clearfix\">' . $vars['tree'] . '</ul>';\n}", "public function modMenu() {}", "public function modMenu() {}", "public function modMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "public function admin_menu(&$menu)\n {\n\n\t}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "protected function menus()\n {\n\n }", "protected function getModuleMenu() {}", "function uwwtd_menu_link__main_menu(&$variables) {\n $element = $variables['element'];\n\n $sub_menu = ($element['#below'] ? drupal_render($element['#below']) : '');\n $depth = $element['#original_link']['depth'] + 1;\n\n $unused = array('leaf', 'first', 'menu-mlid-' . $element['#original_link']['mlid']);\n $element['#attributes']['class'] = array_diff($element['#attributes']['class'], $unused);\n\n $element['#attributes']['class'][] = 'menu-item';\n $element['#attributes']['class'][] = 'menu-item--depth-' . $element['#original_link']['depth'];\n\n $element['#localized_options']['html'] = TRUE;\n $element['#localized_options']['attributes']['class'][] = 'menu-link';\n $element['#localized_options']['attributes']['class'][] = 'menu-link--depth-' . $element['#original_link']['depth'];\n\n if (!empty($sub_menu)) {\n // Wrap menu-level for each level.\n $sub_menu = '<div class=\"menu-level menu-level--' . $depth . '\">' . $sub_menu . '</div>';\n }\n // krumo($element);\n if ($depth == 2 && $element['#below']) {\n $link = l('<span class=\"title\">' . $element['#title'] . ' <i style=\"float:right;line-height:20px;\" class=\"fa fa-caret-down\"></i></span>', $element['#href'], $element['#localized_options']);\n } elseif ($depth == 3 && $element['#below']) {\n $link = l('<span class=\"title\">' . $element['#title'] . ' <i style=\"float:right;line-height:20px;\" class=\"fa fa-caret-right\"></i></span>', $element['#href'], $element['#localized_options']);\n } else {\n $link = l('<span class=\"title\">' . $element['#title'] . '</span>', $element['#href'], $element['#localized_options']);\n }\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $link . $sub_menu . '</li>';\n\n}", "function anipics_add_main_menu(){\n register_nav_menu('main_menu', 'Menu principal');\n}", "public function filter_adminhandler_post_loadplugins_main_menu( $menu ) {\n\t\t// obtain existing last submenu item\n\t\t$last_used = end( $menu[ 'create' ][ 'submenu' ]);\n\t\t// add a menu item at the bottom\n\t\t$menu[ 'create' ][ 'submenu' ][] = array(\n\t\t\t'title' => _t( 'Create a new Menu', 'termmenus' ),\n\t\t\t'url' => URL::get( 'admin', array( 'page' => 'menus', 'action' => 'create' ) ),\n\t\t\t'text' => _t( 'Menu', 'termmenus' ),\n\t\t\t'hotkey' => $last_used[ 'hotkey' ] + 1, // next available hotkey is last used + 1\n\t\t);\n\t\t$last_used = end( $menu[ 'manage' ][ 'submenu' ]);\n\t\t$menu[ 'manage' ][ 'submenu' ][] = array(\n\t\t\t'title' => _t( 'Manage Menus', 'termmenus' ),\n\t\t\t'url' => URL::get( 'admin', 'page=menus' ), // might as well make listing the existing menus the default\n\t\t\t'text' => _t( 'Menus', 'termmenus' ),\n\t\t\t'hotkey' => $last_used[ 'hotkey' ] + 1,\n\t\t);\n\t\treturn $menu;\n\t}", "public static function add_admin_menus()\n\t{\n\t}", "function trimestral_module_init_menu_items()\n{\n $CI = &get_instance();\n\n $CI->app->add_quick_actions_link([\n 'name' => _l('trimestral_name'),\n 'url' => 'trimestral',\n ]);\n\n $CI->app_menu->add_sidebar_children_item('utilities', [\n 'slug' => 'trimestral',\n 'name' => _l('trimestral_name'),\n 'href' => admin_url('trimestral'),\n ]);\n}", "public function create_menu() {\n\t\tif ( get_network()->site_id !== get_current_blog_id() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t//create new top-level menu\n\t\tadd_management_page(\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t'manage_options',\n\t\t\t'sync-newsletter',\n\t\t\tarray( $this, 'display_submenu_page' ),\n\t\t\t6\n\t\t);\n\t}" ]
[ "0.7769254", "0.7483676", "0.7359278", "0.7307369", "0.72944605", "0.72934026", "0.7284114", "0.72696567", "0.7092574", "0.70556545", "0.70442617", "0.7043374", "0.7042811", "0.70421255", "0.70421255", "0.70421255", "0.70421255", "0.70421255", "0.70421255", "0.7026042", "0.6988817", "0.6988817", "0.69880116", "0.6987759", "0.69630444", "0.6950515", "0.6950056", "0.69483995", "0.6947781", "0.69061595" ]
0.7784215
0
/ hook menu tree menu doormat
function v2_mumm_menu_tree__menu_doormat(&$variables) { return $variables['tree']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function getMenuTree();", "function v2_mumm_menu_link__menu_doormat(&$variables) {\n $element = $variables ['element'];\n $sub_menu = '';\n\n if ($element ['#below']) {\n $sub_menu = drupal_render($element ['#below']);\n }\n\n if ($element['#change_location']) {\n\n $output = '<a class=\"hidden-xs\" data-trigger-toggle=\"change-location\" title=\"' . $element ['#title'] . '\" href=\"javascript:;\"'\n . 'data-tracking data-track-action=\"click\" data-track-category=\"footer\" data-track-label=\"' . strtolower($element ['#title']) . '\" data-track-type=\"event\">' . $element ['#title'] . '</a>';\n }\n else {\n $element['#localized_options']['attributes'] = array(\n 'data-tracking' => '',\n 'data-track-action' => 'click',\n 'data-track-category' => 'footer',\n 'data-track-label' => strtolower($element ['#title']),\n 'data-track-type' => 'event',\n );\n\n $output = l($element ['#title'], $element ['#href'], $element ['#localized_options']);\n }\n return $output . $sub_menu;\n}", "private function setTreeOutput(){\n \n $item = $this->item;\n \n $treeoutput = NULL;\n $menuname = NULL;\n $parameters = NULL;\n \n $menutree = \\Drupal::menuTree();\n \n if($item->menu_name == 'active-menu'){\n \n $menuname = $this->getCurrentMenuName();\n \n if($menuname)\n $parameters = $menutree->getCurrentRouteMenuTreeParameters($menuname);\n \n }else{\n $parameters = new MenuTreeParameters();\n $parameters->root = $item->menu_plid;\n $menuname = $item->menu_name;\n }\n \n \n if($parameters && $menuname){\n \n $parameters->setMaxDepth($item->menu_level);\n\n $tree = $menutree->load($menuname, $parameters);\n $treeoutput = $menutree->build($tree);\n \n }\n \n $this->treeoutput = $treeoutput;\n }", "function susy_menu_tree__main_menu($vars) {\n return '<ul class=\"menu inline clearfix\">' . $vars['tree'] . '</ul>';\n}", "function printrightMenu($tree,$level=0) {\n\tif(!is_null($tree) && count($tree) > 0) {\n\tif($level==0){\n\techo '<ul class=\"dropdown-menu rightClickMenu\">';\n\t}\n\t\tforeach($tree as $node) {\n\t\techo \"\\n\";\n\t\t\t// Top level\n\t\t\tif ( empty($node['children']) ) {\n\t\t\t\tif ( !empty($node['value']['menu_type']) AND ($node['value']['menu_type']== \"inlineForm\") ) {\n\t\t\t\t\techo '<li><a class=\"trigger right-caret '.$node['value']['action_type'].' '.$node['value']['icon'].' '.$node['value']['menu_type'].' '.$node['value']['action_type'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>\n\t\t\t\t<ul class=\"dropdown-menu sub-menu\"><li>'. $node['value']['custom'] . '</li></ul></li>';\n\t\t\t\t}else{\n\t\t\t\techo '<li><a class=\"iconItemSelection '.$node['value']['action_type'].' '.$node['value']['icon'].' MenuActionItem '.$node['value']['menu_type'].' '.$node['value']['code'].' '.$node['value']['action_type'].'\" type=\"button\" data-animationui=\"'.$node['value']['code'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-code=\"'.$node['value']['code'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>'. (!empty($node[\"value\"][\"code\"]) ? '<span data-animationui=\"'.$node['value']['code'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" style=\"position:absolute; right:15px; top:9px; text-size=16px;\" class=\"addKeyframeMenu fa fa-plus-square-o fa-lg pull-right\"></span>' : ''). '</li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( !empty($node['children']) AND !empty($node['children']['0']['children'] )) {\n\t\t\t\techo '<li class=\"dropdown-submenu\">\n\t\t\t\t<a class=\"trigger right-caret '.$node['value']['icon'].' '.$node['value']['action_type'].' '.$node['value']['menu_type'].' '.$node['value']['code'].' '.$node['value']['action_type'].'\" data-animationui=\"'.$node['value']['code'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-code=\"'.$node['value']['code'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>\n\t\t\t\t<ul class=\"dropdown-menu sub-menu\">';\n\t\t\t}\n\t\t\tif ( !empty($node['children']) AND empty($node['children']['0']['children']) ) {\n\t\t\t\techo '<li class=\"dropdown-submenu\">\n\t\t\t\t<a class=\"trigger right-caret '.$node['value']['action_type'].' '.$node['value']['icon'].' '.$node['value']['menu_type'].' '.$node['value']['code'].' '.$node['value']['action_type'].'\" data-menu_type=\"'.$node['value']['menu_type'].'\" data-code=\"'.$node['value']['code'].'\" data-action_type=\"'.$node['value']['action_type'].'\" data-id=\"'.$node['value']['id'].'\">'. (!empty($node[\"value\"][\"image\"]) ? '<img class=\"rightClickIcon\" height=\"15\" src=\"'.$node['value']['image'].'\">' : ''). '&nbsp;'.$node['value']['name'].'</a>\n\t\t\t\t<ul class=\"dropdown-menu sub-menu\" style=\"max-height:400px;overflow:auto;\">';\n\t\t\t}\n\t\t\tprintrightMenu($node['children'], $level+1);\n\t\t\tif (!empty($node['children']) ) {echo '</li></ul>';}\n\t\t} // end foreach\n\t} // end if\n\tif($level==0){\n\techo '<div class=\"currentAnimations\"></div>';\n\t}\n}", "function latto_menu_tree__menu_block__1($vars) { \n return '<ul class=\"main-menu nav nav-inline\">' . $vars['tree'] . '</ul>';\n}", "function minorite_menu_tree($variables) {\n return '<ul class=\"nav meganav\">' . $variables['tree'] . '</ul>';\n}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "function Menu_Rendering($menu) {\r\n}", "public function menu_tree_output($tree)\n {\n return menu_tree_output($tree);\n }", "function susy_menu_tree__secondary_menu($vars) {\n return '<ul class=\"menu inline clearfix\">' . $vars['tree'] . '</ul>';\n}", "function soho_menu_tree__header_menu($variables){\n return '<ul class=\"menu\" id=\"menu-main-menu\">' . $variables['tree'] . '</ul>';\n \n}", "public function renderMenu()\n {\n echo \"<ul class=\\\"sidebar-menu\\\">\\n\";\n foreach ($this->_menus as $menu) {\n if (count($menu->subMenu()) == 0) {\n echo \"<li \".$this->is_li_class_active($menu->getLinks()).\">\\n\";\n echo \"<a href=\\\"\".SystemURLs::getRootPath() . \"/\" . $menu->getUri().\"\\\">\\n\";\n echo \"<i class=\\\"\".$menu->getIcon().\"\\\"></i> <span>\".gettext($menu->getTitle()).\"</span>\\n\";\n echo \"</a>\\n\";\n echo \"</li>\\n\";\n } else {// we are in the case of a treeview\n echo \"<li class=\\\"treeview\".$this->is_treeview_Opened($menu->getLinks()).\"\\\">\";\n echo \"<a href=\\\"\".SystemURLs::getRootPath() . \"/\" . $menu->getUri().\"\\\">\\n\";\n echo \" <i class=\\\"\".$menu->getIcon().\"\\\"></i>\\n\";\n echo \" <span>\".gettext($menu->getTitle()).\"</span>\\n\";\n echo \" <i class=\\\"fa fa-angle-left pull-right\\\"></i>\\n\";\n if (count($menu->getBadges()) > 0) {\n foreach ($menu->getBadges() as $badge) {\n if ($badge['id'] != ''){\n echo \"<small class=\\\"\".$badge['class'].\"\\\" id=\\\"\".$badge['id'].\"\\\">\".$badge['value'].\"</small>\\n\";\n } else if ($badge['data-id'] != ''){\n echo \"<small class=\\\"\".$badge['class'].\"\\\" data-id=\\\"\".$badge['data-id'].\"\\\">\".$badge['value'].\"</small>\\n\"; \n } else {\n echo \"<small class=\\\"\".$badge['class'].\"\\\">\".$badge['value'].\"</small>\\n\";\n }\n }\n }\n echo \"</a>\\n\";\n echo \"<ul \".$this->is_treeview_menu_open($menu->getLinks()).\">\\n\";\n $this->addSubMenu($menu->subMenu());\n echo \"</ul>\\n\";\n echo \"</li>\\n\";\n } \n }\n echo \"</ul>\\n\";\n }", "function _gwt_drupal_mega_menu_formatted(){\n // dependent on gwt_drupal_helper module\n if(!module_exists('gwt_drupal_helper')){\n return;\n }\n $output = '';\n \n $mega_menu = gwt_drupal_mega_menu_load_all();\n // $output .= '<pre>'.print_r($mega_menu, 1).'</pre>';\n // print_r($mega_menu);\n // $output .= '<div id=\"nav-megamenu\">';\n foreach($mega_menu as $mlid => $item){\n $attr = array();\n // TODO: load the node content\n // TODO: also load sub menu for loading of sub mega menu\n $nid = $item->nid;\n $mlid = $item->mlid;\n // $menu_link = menu_link_load($mlid);\n // $output .= '<pre>'.print_r($menu_link, 1).'</pre>';\n // $sub_items = menu_tree_all_data('main-menu', $menu_link, 2);\n\n $node = node_load($nid);\n $node_view = node_view($node);\n\n $node_view['#theme'] = 'mega_menu';\n // drupal_render($node_view['#node']->title);\n\n $rendered_node = drupal_render($node_view);\n $attr['class'] = array(\n 'mega-menu-item',\n 'mega-menu-item-'.$mlid,\n 'row',\n 'fullwidth',\n 'collapse',\n );\n $attr['data-menu-item'] = $mlid;\n\n $output .= \"<div \".drupal_attributes($attr).\">\\n\";\n if(!empty($item->children)){\n $mega_menu_sub_items = \"\";\n $mega_menu_sub_items .= \"<li class=\\\"tab-title active\\\">\";\n $mega_menu_sub_items .= '<a href=\"#mega-menu-item-'.$mlid.'\" data-tab-link=\"'.$mlid.'\">'.$node_view['#node']->title.'</a>';\n $mega_menu_sub_items .= \"</li>\\n\";\n \n $mega_menu_sub_items_content = '';\n $mega_menu_sub_items_content .= \"<div class=\\\"mega-sub-content active\\\" id=\\\"mega-menu-item-\".$mlid.\"\\\" data-tab-item=\\\"\".$mlid.\"\\\">\\n\";\n $mega_menu_sub_items_content .= '<h3 class=\"mega-menu-title\">'.$node_view['#node']->title.'</h3>';\n $mega_menu_sub_items_content .= $rendered_node;\n $mega_menu_sub_items_content .= \"</div>\\n\";\n\n $output .= \"<div class=\\\"mega-sub-menu large-3 columns\\\">\\n\";\n $output .= \"<h3 class=\\\"mega-menu-title\\\">\".$node_view['#node']->title.'</h3>';\n foreach($item->children as $child_mlid => $child_item){\n $child_nid = $child_item->nid;\n $child_node = node_load($child_nid);\n $child_node_view = node_view($child_node);\n $child_node_view['#theme'] = 'mega_menu';\n $child_rendered_node = drupal_render($child_node_view);\n\n $mega_menu_sub_items .= '<li class=\"tab-title\">';\n $mega_menu_sub_items .= '<a href=\"#mega-menu-item-'.$child_mlid.'\" data-tab-link=\"'.$child_mlid.'\">'.$child_node_view['#node']->title.'</a>';\n $mega_menu_sub_items .= \"</li>\\n\";\n\n $mega_menu_sub_items_content .= \"<div class=\\\"mega-sub-content\\\" id=\\\"mega-menu-item-\".$child_mlid.\"\\\" data-tab-item=\\\"\".$child_mlid.\"\\\">\\n\";\n $mega_menu_sub_items_content .= '<h3 class=\"mega-menu-title\">'.$child_node_view['#node']->title.'</h3>';\n $mega_menu_sub_items_content .= $child_rendered_node;\n $mega_menu_sub_items_content .= \"</div>\\n\";\n }\n $output .= \"<ul class=\\\"mega-sub-items tabs\\\" data-tab>\\n\";\n $output .= $mega_menu_sub_items;\n $output .= \"</ul>\\n\";\n $output .= \"</div>\\n\";\n\n $output .= \"<div class=\\\"mega-sub-contents large-9 columns\\\">\\n\";\n $output .= $mega_menu_sub_items_content;\n $output .= \"</div>\\n\";\n }\n else{\n $output .= \"<div class=\\\"mega-menu-contents row\\\">\\n\";\n $output .= \"<h2 class=\\\"mega-menu-title\\\">\".$node_view['#node']->title.\"</h2>\\n\";\n $output .= $rendered_node;\n $output .= \"</div>\\n\";\n }\n\n $output .= \"</div>\\n\";\n }\n // $output .= \"</div>\\n\";\n return $output;\n}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "protected function prepareMenuItemsForRootlineMenu() {}", "function render_multi_level_menu($menu_source, $start_node, $start_link, $level = 0, $anc_destination)\n {\n \n// if($level==0)DebugBreak();\n \n global $TMS, $_PATH, $REQUEST_ASSOC, $REQUEST_VARS;\n static $branches;\n\n if ($REQUEST_VARS[0] == 'show' && ($level === 0))\n {\n $objid =$this->get_requested_basic_id($anc_destination);\n $this->menu_selected_obj_id=$objid;\n $this->menu_selected_id =$this->_tree->GetAncestor($objid);\n $this->menu_selected_id3 =$this->_tree->GetAncestor($this->menu_selected_id);\n }\n elseif ($REQUEST_VARS[0] == 'showobj' && $objid && ($level === 0))\n {\n $this->menu_selected_obj_id=$objid;\n $this->menu_selected_id =$this->_tree->GetAncestor($objid);\n }\n elseif ($level === 0&&$objid)\n {\n $this->menu_selected_id=$objid;\n }\n\n \n if (!$branches && $objid)\n {\n $this->_tree->BonesMas=null;\n $this->_tree->GetBones($objid, 1);\n $branches= $this->_tree->BonesMas;\n \n }\n \n if (($menu_source) && ($menu_source[$start_node]))\n {\n foreach ($menu_source[$start_node] as $key => $menuitem)\n {\n if ($menuitem['params']['Disable'])\n unset ($menu_source[$start_node][$key]);\n }\n\n $xtr_count=count($menu_source[$start_node]);\n\n $i =0;\n\n foreach ($menu_source[$start_node] as $menuitem)\n {\n $itembasic = $menuitem['basic'];\n\n $menuitem =$this->_common_obj->property_set_to_properties($menuitem['params']['Property_set'],$menuitem,'',true,$this);\n\n if (is_array($menuitem['props']))$menuitem=array_merge($menuitem, $menuitem['props']);\n\n unset ($menuitem['props']);\n\n $menuitem['_num'] =$i++;\n $menuitem['Ancestor']=$start_node;\n\n if ($menuitem['obj_type'] == '_CATGROUP')\n {\n\n $menuitem['subcount']=count($menu_source[$menuitem['id']]);\n }\n\n $rpath =$this->_tree->calculate_r_path($menuitem['id'], $anc_destination, $this->_sel_arr,\n 2);\n $menuitem['Link'] =$start_link . '/' . $rpath;\n\n $menuitem['submenu']='';\n\n \n if (is_array($menu_source[$menuitem['id']]))\n {\n\n $menuitem['submenu']=$this->render_multi_level_menu($menu_source, $menuitem['id'], $start_link,\n $level + 1, $anc_destination);\n }\n\n $selected=false;\n\n if (in_array($menuitem['id'], array\n (\n $this->menu_selected_id,\n $this->menu_selected_obj_id\n )))\n {\n $selected =true;\n $selected_item=$menuitem;\n }\n\n $branch_detected=false;\n\n\n if (!$selected && $branches && in_array($menuitem['id'], $branches))\n {\n \n $branch_detected=true;\n }\n\n if (($menuitem['obj_type'] == '_CATGROUP') && is_array($menu_source[$menuitem['id']])\n && ($TMS->isSectionDefined('_menu_item_nested_level' . $level)))\n {\n $TMS->AddMassReplace('_menu_item_nested_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_nested_level' . $level);\n $TMS->clear_section_fields('_menu_item_nested_level' . $level);\n }\n elseif ($branch_detected && ($TMS->isSectionDefined('_menu_item_branch_level' . $level)))\n {\n $TMS->AddMassReplace('_menu_item_branch_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_branch_level' . $level);\n }\n elseif (($i == 1) && ($selected) && ($TMS->isSectionDefined(\n '_menu_item_first_selected_level' . $level)))\n {\n $TMS->AddMassReplace('_menu_item_first_selected_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_first_selected_level' . $level);\n $TMS->clear_section_fields('_menu_item_first_selected_level' . $level);\n }\n elseif (($i == 1) && ($TMS->isSectionDefined('_menu_item_first_level' . $level)))\n {\n $TMS->AddMassReplace('_menu_item_first_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_first_level' . $level);\n $TMS->clear_section_fields('_menu_item_first_level' . $level);\n }\n elseif (($i == $xtr_count) and ($selected) && ($TMS->isSectionDefined(\n '_menu_item_last_selected_level' . $level)))\n {\n $TMS->AddMassReplace('_menu_item_last_selected_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_last_selected_level' . $level);\n $TMS->clear_section_fields('_menu_item_last_selected_level' . $level);\n }\n elseif ($i == $xtr_count && $TMS->isSectionDefined('_menu_item_last_level' . $level))\n {\n $TMS->AddMassReplace('_menu_item_last_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_last_level' . $level);\n $TMS->clear_section_fields('_menu_item_last_level' . $level);\n }\n elseif ($selected && $TMS->isSectionDefined('_menu_item_middle_selected_level' . $level))\n {\n $TMS->AddMassReplace('_menu_item_middle_selected_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_middle_selected_level' . $level);\n $TMS->clear_section_fields('_menu_item_middle_selected_level' . $level);\n }\n elseif ($TMS->isSectionDefined('_menu_item_middle_level' . $level))\n {\n $TMS->AddMassReplace('_menu_item_middle_level' . $level, $menuitem);\n $menu_buff.=$TMS->parseSection('_menu_item_middle_level' . $level);\n $TMS->clear_section_fields('_menu_item_middle_level' . $level);\n }\n\n if ($level == 0)\n {\n $anc_node=$this->menu_ancestor;\n $TMS->AddMassReplace('_menu_main_level' . $level, $anc_node['params']);\n }\n\n if (($this->devide_by_rows) && ($i % (int)$this->devide_by_rows == 0))\n {\n $levnum++;\n $TMS->AddReplace('_menu_main_level' . $level, 'id', $start_node);\n $TMS->AddReplace('_menu_main_level' . $level, 'menu_buff', $menu_buff);\n $TMS->AddReplace('_menu_main_level' . $level, '__divnum', $levnum);\n\n $menu_buff='';\n $menu_dbuff.=$TMS->parseSection('_menu_main_level' . $level);\n $exit_section='_menu_divide_container' . $level;\n $TMS->KillField('_menu_main_level' . $level, 'menu_buff');\n }\n }\n\n if (($this->devide_by_rows) && (($i % (int)$this->devide_by_rows != 0)))\n {\n $levnum++;\n $TMS->AddReplace('_menu_main_level' . $level, 'menu_buff', $menu_buff);\n $TMS->AddReplace('_menu_main_level' . $level, '__divnum', $levnum);\n\n $menu_dbuff.=$TMS->parseSection('_menu_main_level' . $level);\n $exit_section='_menu_divide_container' . $level;\n $menu_buff =$menu_dbuff;\n }\n elseif (!$this->devide_by_rows)\n {\n $exit_section='_menu_main_level' . $level;\n }\n else\n {\n $menu_buff=$menu_dbuff;\n }\n\n $TMS->AddReplace($exit_section, 'menu_buff', $menu_buff);\n\n $TMS->AddReplace('_menu_main_level' . $level, 'id', $start_node);\n $TMS->AddReplace($exit_section, 'ancestor', $this->menu_ancestor['params']['Name']);\n $TMS->AddReplace($exit_section, 'id', $start_node);\n $TMS->AddMassReplace($exit_section, $branch_item);\n\n $main=$TMS->parseSection($exit_section);\n\n $TMS->KillField($exit_section, 'menu_buff');\n\n return $main;\n }\n }", "function addAdminMenu()\n\t{\n\t\tglobal $tpl, $tree, $rbacsystem, $lng;\n\n\t\tinclude_once(\"./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php\");\n\t\t$gl = new ilGroupedListGUI();\n\n\t\t$objects = $tree->getChilds(SYSTEM_FOLDER_ID);\n\t\tforeach($objects as $object)\n\t\t{\n\t\t\t$new_objects[$object[\"title\"].\":\".$object[\"child\"]]\n\t\t\t\t= $object;\n\t\t\t//have to set it manually as translation type of main node cannot be \"sys\" as this type is a orgu itself.\n\t\t\tif($object[\"type\"] == \"orgu\")\n\t\t\t\t$new_objects[$object[\"title\"].\":\".$object[\"child\"]][\"title\"] = $lng->txt(\"obj_orgu\");\n\t\t}\n\n\t\t// add entry for switching to repository admin\n\t\t// note: please see showChilds methods which prevents infinite look\n\t\t$new_objects[$lng->txt(\"repository_admin\").\":\".ROOT_FOLDER_ID] =\n\t\t\tarray(\n\t\t\t\t\"tree\" => 1,\n\t\t\t\t\"child\" => ROOT_FOLDER_ID,\n\t\t\t\t\"ref_id\" => ROOT_FOLDER_ID,\n\t\t\t\t\"depth\" => 3,\n\t\t\t\t\"type\" => \"root\",\n\t\t\t\t\"title\" => $lng->txt(\"repository_admin\"),\n\t\t\t\t\"description\" => $lng->txt(\"repository_admin_desc\"),\n\t\t\t\t\"desc\" => $lng->txt(\"repository_admin_desc\"),\n\t\t\t);\n\n//$nd = $tree->getNodeData(SYSTEM_FOLDER_ID);\n//var_dump($nd);\n\t\t$new_objects[$lng->txt(\"general_settings\").\":\".SYSTEM_FOLDER_ID] =\n\t\t\tarray(\n\t\t\t\t\"tree\" => 1,\n\t\t\t\t\"child\" => SYSTEM_FOLDER_ID,\n\t\t\t\t\"ref_id\" => SYSTEM_FOLDER_ID,\n\t\t\t\t\"depth\" => 2,\n\t\t\t\t\"type\" => \"adm\",\n\t\t\t\t\"title\" => $lng->txt(\"general_settings\"),\n\t\t\t);\n\t\tksort($new_objects);\n\n\t\t// determine items to show\n\t\t$items = array();\n\t\tforeach ($new_objects as $c)\n\t\t{\n\t\t\t// check visibility\n\t\t\tif ($tree->getParentId($c[\"ref_id\"]) == ROOT_FOLDER_ID && $c[\"type\"] != \"adm\" &&\n\t\t\t\t$_GET[\"admin_mode\"] != \"repository\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// these objects may exist due to test cases that didnt clear\n\t\t\t// data properly\n\t\t\tif ($c[\"type\"] == \"\" || $c[\"type\"] == \"objf\" ||\n\t\t\t\t$c[\"type\"] == \"xxx\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$accessible = $rbacsystem->checkAccess('visible,read', $c[\"ref_id\"]);\n\t\t\tif (!$accessible)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($c[\"ref_id\"] == ROOT_FOLDER_ID &&\n\t\t\t\t!$rbacsystem->checkAccess('write', $c[\"ref_id\"]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($c[\"type\"] == \"rolf\" && $c[\"ref_id\"] != ROLE_FOLDER_ID)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$items[] = $c;\n\t\t}\n\n\t\t$titems = array();\n\t\tforeach ($items as $i)\n\t\t{\n\t\t\t$titems[$i[\"type\"]] = $i;\n\t\t}\n\t\t// admin menu layout\n\t\t$layout = array(\n\t\t\t1 => array(\n\t\t\t\t\"adn\" =>\n\t\t\t\t\tarray(\"xaad\", \"xaec\",\"xaed\", \"xaes\", \"xaep\", \"xacp\", \"xata\", \"xamd\", \"xast\"),\n\t\t\t\t\"basic\" =>\n\t\t\t\t\tarray(\"adm\", \"stys\", \"adve\", \"lngf\", \"hlps\", \"accs\", \"cmps\", \"extt\"),\n\t\t\t\t\"user_administration\" =>\n\t\t\t\t\tarray(\"usrf\", 'tos', \"rolf\", \"auth\", \"ps\", \"orgu\"),\n\t\t\t\t\"learning_outcomes\" =>\n\t\t\t\t\tarray(\"skmg\", \"cert\", \"trac\")\n\t\t\t),\n\t\t\t2 => array(\n\t\t\t\t\"user_services\" =>\n\t\t\t\t\tarray(\"pdts\", \"prfa\", \"nwss\", \"awra\", \"cadm\", \"cals\", \"mail\"),\n\t\t\t\t\"content_services\" =>\n\t\t\t\t\tarray(\"seas\", \"mds\", \"tags\", \"taxs\", 'ecss', \"pays\", \"otpl\"),\n\t\t\t\t\"maintenance\" =>\n\t\t\t\t\tarray('sysc', \"recf\", 'logs', \"root\")\n\t\t\t),\n\t\t\t3 => array(\n\t\t\t\t\"container\" =>\n\t\t\t\t\tarray(\"reps\", \"crss\", \"grps\", \"prgs\"),\n\t\t\t\t\"content_objects\" =>\n\t\t\t\t\tarray(\"bibs\", \"blga\", \"chta\", \"excs\", \"facs\", \"frma\",\n\t\t\t\t\t\t\"lrss\", \"mcts\", \"mobs\", \"svyf\", \"assf\", \"wbrs\", \"wiks\")\n\t\t\t)\n\t\t);\n\n\t\t// now get all items and groups that are accessible\n\t\t$groups = array();\n\t\tfor ($i = 1; $i <= 3; $i++)\n\t\t{\n\t\t\t$groups[$i] = array();\n\t\t\tforeach ($layout[$i] as $group => $entries)\n\t\t\t{\n\t\t\t\t$groups[$i][$group] = array();\n\t\t\t\t$entries_since_last_sep = false;\n\t\t\t\tforeach ($entries as $e)\n\t\t\t\t{\n\t\t\t\t\tif ($e == \"---\" || $titems[$e][\"type\"] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($e == \"---\" && $entries_since_last_sep)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$groups[$i][$group][] = $e;\n\t\t\t\t\t\t\t$entries_since_last_sep = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($e != \"---\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$groups[$i][$group][] = $e;\n\t\t\t\t\t\t\t$entries_since_last_sep = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tinclude_once(\"./Services/UIComponent/GroupedList/classes/class.ilGroupedListGUI.php\");\n\t\t$gl = new ilGroupedListGUI();\n\n\t\tfor ($i = 1; $i <= 3; $i++)\n\t\t{\n\t\t\tif ($i > 1)\n\t\t\t{\n//\t\t\t\t$gl->nextColumn();\n\t\t\t}\n\t\t\tforeach ($groups[$i] as $group => $entries)\n\t\t\t{\n\t\t\t\tif (count($entries) > 0)\n\t\t\t\t{\n\t\t\t\t\t$gl->addGroupHeader($lng->txt(\"adm_\".$group));\n\n\t\t\t\t\tforeach ($entries as $e)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($e == \"---\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$gl->addSeparator();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$path = ilObject::_getIcon(\"\", \"tiny\", $titems[$e][\"type\"]);\n\t\t\t\t\t\t\t$icon = ($path != \"\")\n\t\t\t\t\t\t\t\t? ilUtil::img($path).\" \"\n\t\t\t\t\t\t\t\t: \"\";\n\n\t\t\t\t\t\t\tif ($_GET[\"admin_mode\"] == \"settings\" && $titems[$e][\"ref_id\"] == ROOT_FOLDER_ID)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$gl->addEntry($icon.$titems[$e][\"title\"],\n\t\t\t\t\t\t\t\t\t\"ilias.php?baseClass=ilAdministrationGUI&amp;ref_id=\".\n\t\t\t\t\t\t\t\t\t$titems[$e][\"ref_id\"].\"&amp;admin_mode=repository\",\n\t\t\t\t\t\t\t\t\t\"_top\", \"\", \"\", \"mm_adm_rep\",\n\t\t\t\t\t\t\t\t\tilHelp::getMainMenuTooltip(\"mm_adm_rep\"),\n\t\t\t\t\t\t\t\t\t\"bottom center\", \"top center\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$gl->addEntry($icon.$titems[$e][\"title\"],\n\t\t\t\t\t\t\t\t\t\"ilias.php?baseClass=ilAdministrationGUI&amp;ref_id=\".\n\t\t\t\t\t\t\t\t\t$titems[$e][\"ref_id\"].\"&amp;cmd=jump\",\n\t\t\t\t\t\t\t\t\t\"_top\", \"\", \"\", \"mm_adm_\".$titems[$e][\"type\"],\n\t\t\t\t\t\t\t\t\tilHelp::getMainMenuTooltip(\"mm_adm_\".$titems[$e][\"type\"]),\n\t\t\t\t\t\t\t\t\t\"bottom center\", \"top center\", false);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//$gl->addSeparator();\n\n\t\t$tpl->setLeftNavContent(\"<div id='adn_adm_side_menu'>\".$gl->getHTML().\"</div>\");\n\t}", "protected function generateModuleMenu() {}", "function show_tree(){\n\t\t\t\t\tswitch(LINK_TYPE){\n\t\t\t\t\t\tcase \"static\":\n\t\t\t\t\t\t\treturn $this->show_tree_static();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"burc\":\n\t\t\t\t\t\tcase \"dynamic\":\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\treturn $this->show_tree_dynamic();\n\t\t\t\t\t}\n\t\t\t\t}", "function renderTree($arvore) {\n $lastLevel = 0;\n//Outer list item\n $html = \"<ul class=\\\"jstree\\\">\";\n//Iterating tree from tree root\n foreach ($arvore->fetchTree() as $node) {\n//If we are on the item of the same level, closing <li> tag before printing item\n if (($node['level'] == $lastLevel) and ($lastLevel > 0)) {\n $html .= '</li>';\n }\n//If we are printing a next-level item, starting a new <ul>\n if ($node['level'] > $lastLevel) {\n $html .= '<ul>';\n }\n//If we are going to return back by several levels, closing appropriate tags\n if ($node['level'] < $lastLevel) {\n $html .= str_repeat(\"</li></ul>\", $lastLevel - $node['level']) . '</li>';\n }\n//Priting item without closing tag\n $html .= '\n <li id=\"tree_node[' . $node['uuid'] . ']\">\n <ins class=\"jstree-icon\">&nbsp;</ins>\n <a><ins class=\"jstree-icon\">&#160;</ins>' . $node['nome'] . '</a>';\n//Refreshing last level of the item\n $lastLevel = $node['level'];\n }\n $html .= \"</ul>\";\n return $html;\n}", "protected function getModuleMenu() {}" ]
[ "0.75815296", "0.693262", "0.6785069", "0.67822325", "0.6747974", "0.66673255", "0.66452086", "0.6637228", "0.6637228", "0.6637228", "0.6637228", "0.6637228", "0.6637228", "0.65968657", "0.6546187", "0.651056", "0.65010273", "0.6418793", "0.64155686", "0.63781244", "0.63779885", "0.6377577", "0.6377577", "0.6354185", "0.6349692", "0.6348972", "0.6340786", "0.63295674", "0.6285805", "0.6252378" ]
0.8066589
0
/ hook menu link menu doormat
function v2_mumm_menu_link__menu_doormat(&$variables) { $element = $variables ['element']; $sub_menu = ''; if ($element ['#below']) { $sub_menu = drupal_render($element ['#below']); } if ($element['#change_location']) { $output = '<a class="hidden-xs" data-trigger-toggle="change-location" title="' . $element ['#title'] . '" href="javascript:;"' . 'data-tracking data-track-action="click" data-track-category="footer" data-track-label="' . strtolower($element ['#title']) . '" data-track-type="event">' . $element ['#title'] . '</a>'; } else { $element['#localized_options']['attributes'] = array( 'data-tracking' => '', 'data-track-action' => 'click', 'data-track-category' => 'footer', 'data-track-label' => strtolower($element ['#title']), 'data-track-type' => 'event', ); $output = l($element ['#title'], $element ['#href'], $element ['#localized_options']); } return $output . $sub_menu; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Menu_Rendering($menu) {\r\n}", "function adwr_menu_link($vars) {\n //gs\n $menu_class = str_replace(' ', '-', strtolower($vars['element']['#original_link']['link_title']));\n $vars['element']['#attributes']['class'][] = 'menu-li-' . $menu_class;\n if (isset($variables['element']['#localized_options'])) {\n $vars['element']['#localized_options']['attributes']['class'][] = 'menu-' . $menu_class;\n }\n return theme_menu_link($vars);\n}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "protected function generateMenu() {}", "function do_menu() {\n print \"\n <a href=\\\"member-index.php\\\">Home</a> |\n <a href=\\\"display-comment.php\\\">Display All Comments</a> |\n <a href=\\\"add-comment.php\\\">Add Comment</a> |\n <a href=\\\"edit-comment.php\\\">Edit Comment</a> |\n <a href=\\\"delete-comment.php\\\">Delete Comment</a> |\n <a href=\\\"logout.php\\\">Logout</a> \n <HR>\n \";\n }", "function log_viewer_add_menu_item() {\n\techo '<li><a href=\"http://localhost/ds-plugins/log-viewer/page.php\">Log Viewer</a></li>';\n}", "function ft_hook_menu() {}", "function susy_menu_link(array $vars) {\n $element = $vars['element'];\n $sub_menu = '';\n\n if ($element['#below']) {\n $sub_menu = drupal_render($element['#below']);\n }\n\n $output = l($element['#title'], $element['#href'], $element['#localized_options']);\n // Adding a class depending on the TITLE of the link (not constant)\n $element['#attributes']['class'][] = drupal_html_id($element['#title']);\n // Adding a class depending on the ENGLISH title of the link (constant)\n $element['#attributes']['class'][] = drupal_html_id($element['#original_link']['link_title']);\n // Adding a class depending on the ID of the link (constant)\n if (isset($element['#original_link']['mlid']) && !empty($element['#original_link']['mlid'])) {\n $element['#attributes']['class'][] = 'mid-' . $element['#original_link']['mlid'];\n }\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "function threed_admin_plugin_menu_links($menu)\n{\n $menu[] = array(\n 'NAME' => 'ThreeD',\n 'URL' => THREED_ADMIN,\n );\n return $menu;\n}", "function gwt_drupal_links__system_main_menu($variables) {\n // $links = $variables['links'];\n $links = menu_tree_all_data('main-menu', null, 4);\n /*\n $test = '<pre>'.print_r($links, 1).'</pre>';\n return $test;\n // */\n\n // heading not needed in main menu\n $heading = $variables['heading'];\n // global $language_url;\n $output = '';\n\n $output .= _gwt_drupal_link_render($links, 0, $variables);\n\n return $output;\n}", "function Htmls_HRef_Menu($id,$title,$links,$titles=array(),$args=array(),$btitles=array())\n {\n $nperline=8;\n if (!empty($args[ \"NPerLine\" ])) { $nperline=$args[ \"NPerLine\" ]; }\n \n $class=\"ptablemenu\";\n if (!empty($args[ \"Class\" ])) { $class=$args[ \"Class\" ]; }\n \n $inactiveclass=\"inactivemenuitem\";\n if (!empty($args[ \"ClassInactive\" ])) { $inactiveclass=$args[ \"ClassInactive\" ]; }\n \n $title=\"menutitle\";\n if (!empty($args[ \"Title\" ])) { $titleclass=$args[ \"Title\" ]; }\n \n $current=\"\";\n if (!empty($args[ \"Current\" ])) { $current=$args[ \"Current\" ]; }\n \n if (is_array($titles) && count($titles)>0)\n {\n $hrefs=\n $this->Htmls_HRef_List\n (\n $links,\n $titles,\n $args=array\n (\n \"Class\" => $class,\n \"ClassInactive\" => $inactiveclass,\n \"Current\" => $current,\n ),\n $btitles\n );\n }\n else\n {\n $hrefs=$links;\n }\n\n $hhrefs=array();\n $rhrefs=array();\n for ($n=0;$n<count($hrefs);$n++)\n {\n if ($nperline>0 && ($n%$nperline)==($nperline-1))\n {\n $list=$rhrefs;\n array_push($list,$hrefs[$n]);\n array_push($hhrefs,$list);\n\n $rhrefs=array();\n }\n else\n {\n array_push($rhrefs,$hrefs[$n]); \n }\n }\n\n if (count($rhrefs)>0)\n {\n array_push($hhrefs,$rhrefs);\n }\n\n ##$hhrefs is now list of lists, max nperline in each\n $html=array();\n\n foreach ($hhrefs as $hrid => $rhrefs)\n {\n $rhtml=array();\n array_push($html,\"[\");\n \n $first=True;\n foreach ($rhrefs as $rhref)\n {\n if (!$first)\n {\n array_push($html,\"|\");\n }\n array_push($html,$rhref);\n $first=False;\n }\n\n #array_push($html,$rhtml); \n array_push($html,\"]\");\n }\n\n return\n $this->Htmls_Tag\n (\n \"CENTER\",\n $html,\n array\n (\n \"ID\" => $id,\n )\n );\n }", "function makeMenu($what)\n{\n global $language;\n if($what==\"header\") {\n echo \"<a href=\\\"index.php?action=home\\\" target=\\\"main\\\"><div align=\\\"center\\\"><img border=\\\"0\\\" src=\\\"\".AdminMenuLogoLocation.\"\\\"></a></div>\\r\\n\";\n echo \"<table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"5\\\">\\r\\n\";\n }\n if($what==\"separator\") {\n echo \"<tr><td></td></tr>\\r\\n\";\n }\n if($what==\"footer\") {\n echo \"<tr><td><hr></td></tr>\\r\\n\";\n echo \"</table>\\r\\n\";\n }\n}", "function tccc_theme_menu_link(array $variables) {\n \n $element = $variables['element'];\n $output = '';\n $sub_menu = '';\n \n if ($element['#below']) {\n $sub_menu = drupal_render($element['#below']);\n }\n \n \n //If dummy output different markup \n if($element['#href'] == 'dummy'){\n $output .= '<div class=\"category-link\">' . $element['#title'] . '</div>';\n }\n \n elseif($element['#href'] == 'column'){\n \n $element['#attributes']['class'][] = 'column';\n $output .= '';\n \n }\n \n else {\n $output .= l($element['#title'], $element['#href'], $element['#localized_options']); \n\n if($element['#original_link']['depth'] == 1){\n $output .= '<div class=\"arrow-pointer\"></div>';\n } \n \n }\n \n \n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "function uwwtd_menu_link__main_menu(&$variables) {\n $element = $variables['element'];\n\n $sub_menu = ($element['#below'] ? drupal_render($element['#below']) : '');\n $depth = $element['#original_link']['depth'] + 1;\n\n $unused = array('leaf', 'first', 'menu-mlid-' . $element['#original_link']['mlid']);\n $element['#attributes']['class'] = array_diff($element['#attributes']['class'], $unused);\n\n $element['#attributes']['class'][] = 'menu-item';\n $element['#attributes']['class'][] = 'menu-item--depth-' . $element['#original_link']['depth'];\n\n $element['#localized_options']['html'] = TRUE;\n $element['#localized_options']['attributes']['class'][] = 'menu-link';\n $element['#localized_options']['attributes']['class'][] = 'menu-link--depth-' . $element['#original_link']['depth'];\n\n if (!empty($sub_menu)) {\n // Wrap menu-level for each level.\n $sub_menu = '<div class=\"menu-level menu-level--' . $depth . '\">' . $sub_menu . '</div>';\n }\n // krumo($element);\n if ($depth == 2 && $element['#below']) {\n $link = l('<span class=\"title\">' . $element['#title'] . ' <i style=\"float:right;line-height:20px;\" class=\"fa fa-caret-down\"></i></span>', $element['#href'], $element['#localized_options']);\n } elseif ($depth == 3 && $element['#below']) {\n $link = l('<span class=\"title\">' . $element['#title'] . ' <i style=\"float:right;line-height:20px;\" class=\"fa fa-caret-right\"></i></span>', $element['#href'], $element['#localized_options']);\n } else {\n $link = l('<span class=\"title\">' . $element['#title'] . '</span>', $element['#href'], $element['#localized_options']);\n }\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $link . $sub_menu . '</li>';\n\n}", "public function admin_menu(&$menu)\n {\n\n\t}", "function ou_df_menu_link(&$variables) {\n $element = $variables['element'];\n $sub_menu = '';\n\n if ($element['#below']) {\n $sub_menu = drupal_render($element['#below']);\n }\n\n $title = $element['#title'];\n if (empty($element['#localized_options']['html'])) {\n $title = check_plain($title);\n }\n $element['#localized_options']['html'] = TRUE;\n $output = l('<span>' . $title . '</span>', $element['#href'], $element['#localized_options']);\n\n if (in_array('active', $element['#attributes']['class']) || in_array('active-trail', $element['#attributes']['class'])) {\n $element['#attributes']['class'][] = 'int-nav-active';\n }\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "public function writeMenu() {}", "function getMenu($links, $vertical) {\n $key=null;$mean=null;\n echo \"<ul>\";\n if($vertical) {\n foreach ($links as $key => $mean) {\n echo \"<li><a href='$mean'>$key</li>\";\n }\n } else {\n foreach ($links as $key => $mean) {\n echo \"<li style='display:inline; margin-right: 10px;'><a href='$mean'>$key</li>\";\n }\n }\n echo \"</ul>\";\n }", "function atwork_menu_link(array $variables) {\n $element = $variables['element'];\n $sub_menu = '';\n\n if ($element['#below']) {\n $sub_menu = drupal_render($element['#below']);\n }\n $output = l($element['#title'], $element['#href'], $element['#localized_options']);\n // Adding a class depending on the TITLE of the link (not constant)\n $element['#attributes']['class'][] = atwork_id_safe($element['#title']);\n // Adding a class depending on the ID of the link (constant)\n $element['#attributes']['class'][] = 'mid-' . $element['#original_link']['mlid'];\n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . \"</li>\\n\";\n}", "function theme_menu() {\n global $theme;\n $content = new UN_Content();\n $cAll = $content->getMenuContent($theme->langid);\n if (is_array($cAll)) {\n $out = '<ul>';\n if ($theme->indexlink == 1) {\n $out .= '<li><a href=\"index.php'.theme_global_url(true).'\"><span>'._('Main Page').'</span></a></li>';\n }\n foreach($cAll as $c) {\n $link = ($c['pagelink']!=\"\") ? $c['pagelink'] : 'index.php?t=page&amp;id='.$c['pageid'];\n $title = ($c['pagelink']!=\"\") ? $c['pagedetail'] : $c['pagetitle'];\n $out .= '<li><a href=\"'.$link.theme_global_url().'\" title=\"'.strip_tags($title).'\"><span>'.$c['pagetitle'].'</span></a></li>';\n }\n $out .= '</ul>';\n }\n echo $out;\n}", "function printMenuLink() {\r\n\tprint '<br><br><a href=\"/menu/menu.php\">Back to Menu</a>';\r\n}", "function PageLink($menutype,$menuid,$parent,$link)\n{\n\tif ($parent==0) $parent='no';\n\t$url=\"\";\n\tswitch ($menutype)\n\t{\n\t\tcase 0: //Muc chinh, trang chu, lien ket den trang index.php\n\t\t\t//$url='index.php?id='.$menuid;\n\t\t\t$url='index.php';\n\t\t\tbreak;\t\t\t\n\t\tcase 1://Muc con, chua tin tuc con 1 newsgroup, lien ket den trang newsgroup.php\n\t\t\t//$url='newsgroup.php?id='.$menuid.'&pr='.$parent; \n\t\t\t$url='groups.php?id='.$menuid.'&p='.$parent; \n\t\t\tbreak; \n\t\tcase 2://Muc con, lien ket den trang noi dung cuc bo content.php\n\t\t\t//$url='content.php?id='.$menuid.'&pr='.$parent; \n\t\t\t$url='view.php?id='.$menuid.'&p='.$parent; \n\t\t\tbreak; \t\t\t\t\t\t\n\t\tcase 3://Muc CHINH, khong co lien ket\n\t\t\t$url=''; \n\t\t\tbreak;\n\t\tcase 4://Muc CHINH, lien ket ngoai\n\t\t\t$url=$link;\n\t\t\tbreak;\t\t\t\t\n\t\tcase 5://Muc CHINH, lien ket den trang noi dung cuc bo content.php\n\t\t\t$url='view.php?id='.$menuid;\n\t\t\tbreak;\n\t\tcase 6://Muc CHINH, lien ket den trang van ban phap luat lawdocument.php\n\t\t\t$url='lawdocument.php?id='.$menuid;\n\t\t\tbreak;\n\t\tcase 7://Muc CHINH, lien ket den trang hoi dap faq.php\n\t\t\t$url='faq.php?id='.$menuid;\n\t\t\tbreak;\n\t\tcase 8://Muc CHINH, lien ket den trang lien he contact.php\n\t\t\t$url='contact.php?id='.$menuid;\n\t\t\tbreak;\t\n\t\tcase 9://Muc CHINH, lien ket den trang so do website webstruct.php\n\t\t\t$url='webstruct.php?id='.$menuid;\n\t\t\tbreak;\t\n\t\tcase 10://Muc CHINH, trang danh muc cac lien ket, lien ket den trang list.php\n\t\t\t$url='list.php?id='.$menuid;\n\t\t\tbreak;\t\t\n\t\tcase 11://Muc CHINH, trang lich cong tac, lien ket den trang timetable.php\n\t\t\t$url='timetable.php?id='.$menuid;\n\t\t\tbreak;\t\t\n\t\tcase 12://Muc CHINH, trang danh ba doanh nghiep, lien ket den trang orglist.php\n\t\t\t$url='orglist.php?id='.$menuid;\n\t\t\tbreak;\t\t\t\t\t\n\t\tcase 13://Muc con, chua tin tuc rss, lien ket den trang rssnews.php\n\t\t\t$url='rssnews.php?id='.$menuid.'&pr='.$parent;\n\t\t\tbreak;\n\t\tcase 14://Muc con, trang san pham\n\t\t\t$url='product.php?id='.$menuid.'&pr='.$parent; \n\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t}\n\treturn $url;\n}", "function makeMenu($menu){\n $output='';\n $list = '<ul>'. PHP_EOL;\n $listClose = '</ul>'. PHP_EOL;\n foreach ($menu as $key => $items) {\n $output.='<li class=\"menu\"> <a href ='.$key.'>'.$items.'</a></li>'. PHP_EOL;\n }\n $finalMenu = $list . $output . $listClose;\n return $finalMenu;\n}" ]
[ "0.696023", "0.6719151", "0.66533846", "0.66533846", "0.66533846", "0.66533846", "0.66533846", "0.66533846", "0.6568166", "0.65402615", "0.6533125", "0.6504315", "0.6470378", "0.6465614", "0.646409", "0.6447996", "0.64235765", "0.64038825", "0.63408864", "0.6336132", "0.63216114", "0.63213193", "0.6320739", "0.6320739", "0.631623", "0.62793165", "0.6258684", "0.62391883", "0.6219151", "0.6218244" ]
0.7640543
0
/ hook menu tree menu header
function v2_mumm_menu_tree__menu_header(&$variables) { return $variables['tree']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function soho_menu_tree__header_menu($variables){\n return '<ul class=\"menu\" id=\"menu-main-menu\">' . $variables['tree'] . '</ul>';\n \n}", "function soho_menu_tree__header_menu_below($variables){\n return '<ul class=\"sub-menu\">' . $variables['tree'] . '</ul>';\n}", "abstract protected function getMenuTree();", "function register_header_menu() {\r\n register_nav_menu('header-menu',__( 'Header Menu' ));\r\n}", "function soho_menu_link__header_menu(array $variables) {\n $output = '';\n unset($variables['element']['#attributes']['class']);\n $element = $variables['element'];\n static $item_id = 0;\n $menu_name = $element['#original_link']['menu_name'];\n\n // set the global depth variable\n global $depth;\n $depth = $element['#original_link']['depth'];\n\n if ( ($element['#below']) && ($depth == \"1\") ) {\n $element['#attributes']['class'][] = 'menu-item-has-children '.$element['#original_link']['mlid'].'';\n }\n \n if ( ($element['#below']) && ($depth >= \"2\") ) {\n $element['#attributes']['class'][] = 'menu-item-has-children';\n }\n \n $sub_menu = $element['#below'] ? drupal_render($element['#below']) : '';\n $output .= l($element['#title'], $element['#href'], $element['#localized_options']);\n // if link class is active, make li class as active too\n if(strpos($output,\"active\")>0){\n $element['#attributes']['class'][] = \"current-menu-parent\";\n }\n \n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . '</li>';\n \n}", "public function admin_head(){\r\n global $submenu;\r\n \r\n if(isset( $submenu[self::menu_tag] ) \r\n &&isset($submenu[self::menu_tag][0])\r\n &&isset($submenu[self::menu_tag][0][2])\r\n &&$submenu[self::menu_tag][0][2]==self::menu_tag){\r\n \r\n unset( $submenu[self::menu_tag][0] );\r\n }\r\n }", "function v2_mumm_menu_link__menu_header(&$variables) {\n\n $element = $variables ['element'];\n $sub_menu = '';\n\n if ($element ['#below']) {\n $sub_menu = drupal_render($element ['#below']);\n }\n\n if (in_array('search-btn', $element['#localized_options']['attributes']['class'])) {\n\n $output = '<button id=\"search-btn\" class=\"icon icon-search-gray search-btn\" data-trigger-toggle=\"search-box\" title=\"\" name=\"search-btn\" type=\"button\"\n data-tracking data-track-action=\"click\" data-track-category=\"header\" data-track-label=\"search\" data-track-type=\"event\">\n </button>';\n }\n else {\n $class = $element['#localized_options']['attributes']['class'];\n $element['#localized_options']['attributes'] = array(\n 'class' =>$class,\n 'data-tracking' => '',\n 'data-track-action' => 'click',\n 'data-track-category' => 'header',\n 'data-track-label' => 'book_a_visit',\n 'data-track-type' => 'event',\n );\n\n $output = l($element ['#title'], $element ['#href'] , $element['#localized_options']);\n }\n return $output;\n}", "protected function actionHeader() {\n Navigation::activateItem($this->navlink);\n $this->setTabNavigationIcon('black');\n $this->addSubNavigation(_('Lesen'), 'show');\n if (Utils\\hasPermission($this->edit_permission)) {\n $this->addSubNavigation(_('Bearbeiten'), 'edit');\n }\n }", "function register_menu() {\n\n register_nav_menu('header-menu',__('Header Menu'));\n\n}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "protected function getModuleMenu() {}", "function header_menu( $data ) {\n\t\t\t\t\t\tif (($locations = get_nav_menu_locations()) && isset($locations[ 'sgn_menu' ])) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Retrieve the menu in location sgn_menu */\n\t\t\t\t\t\t\t$menu = wp_get_nav_menu_object($locations['sgn_menu']);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Create an empty array to store our JSON */\n\t\t\t\t\t\t\t$menuItems = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* If the menu isn't empty, start process of building an array, otherwise return a 404 error */\n\t\t\t\t\t\t\tif (!empty($menu)) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* Assign array of navigation items to $menu_items variable */\n\t\t\t\t\t\t\t\t$menu_items = wp_get_nav_menu_items($menu->term_id);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* if $menu_items isn't empty */\n\t\t\t\t\t\t\t\tif ($menu_items) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/* for each menu item, verify the menu item has no parent and then push the menu item to the $menuItems array */\n\t\t\t\t\t\t\t\t\tforeach ($menu_items as $key => $menu_item) {\n\t\t\t\t\t\t\t\t\t\tif ($menu_item->menu_item_parent == 0) {\n\t\t\t\t\t\t\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t\t\t\t\t\t$menuItems, array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'title' => $menu_item->title,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'url' => $menu_item->url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'slug' => $menu_item->slug\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t\t\t\t'no_menus',\n\t\t\t\t\t\t\t\t\t'Could not find any menus',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'status' => 404\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* Return array of list items with title and url properties */\n\t\t\t\t\t\t\t\treturn $menuItems;\n\t\t\t\t\t}", "function getMenuTitle();", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "public function add_menus()\n {\n }", "function erp_get_menu_headers() {\n $menu = [];\n return apply_filters( 'erp_menu_headers', $menu );\n}", "function ft_hook_menu() {}", "function thiredtheme_menu_item()\n {\n register_nav_menus(\n array(\n 'header'=>__('header menu'),\n 'footer'=>__('footer menu'))); \n }", "function susy_menu_tree__main_menu($vars) {\n return '<ul class=\"menu inline clearfix\">' . $vars['tree'] . '</ul>';\n}", "public function modMenu() {}", "public function modMenu() {}", "public function modMenu() {}", "function dokan_header_user_menu() {\n global $current_user;\n $user_id = $current_user->ID;\n $nav_urls = dokan_get_dashboard_nav();\n\n dokan_get_template_part( 'global/header-menu', '', array( 'current_user' => $current_user, 'user_id' => $user_id, 'nav_urls' => $nav_urls ) );\n}", "public function getMenuTitle(): string;", "function base_registerMenus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' ),\n )\n );\n}", "function erp_add_menu_header( $component, $title, $icon = \"\" ) {\n add_filter('erp_menu_headers', function($menu) use( $component, $title, $icon ) {\n $menu[ $component ] = [ 'title' => $title, 'icon' => $icon ];\n return $menu;\n });\n}", "function latto_menu_tree__menu_block__1($vars) { \n return '<ul class=\"main-menu nav nav-inline\">' . $vars['tree'] . '</ul>';\n}", "function admin_menu()\n {\n }", "function admin_menu()\n {\n }" ]
[ "0.7531755", "0.73295164", "0.7316249", "0.70729876", "0.7012726", "0.70084804", "0.6994885", "0.6941257", "0.6916892", "0.6880645", "0.6880635", "0.6880635", "0.6866265", "0.6832925", "0.674405", "0.6735178", "0.6732258", "0.6716877", "0.66471803", "0.6608329", "0.65676475", "0.6566077", "0.65656304", "0.65616286", "0.6540581", "0.6535288", "0.6535006", "0.6533972", "0.65275127", "0.65275127" ]
0.80148476
0
/ hook menu link menu header
function v2_mumm_menu_link__menu_header(&$variables) { $element = $variables ['element']; $sub_menu = ''; if ($element ['#below']) { $sub_menu = drupal_render($element ['#below']); } if (in_array('search-btn', $element['#localized_options']['attributes']['class'])) { $output = '<button id="search-btn" class="icon icon-search-gray search-btn" data-trigger-toggle="search-box" title="" name="search-btn" type="button" data-tracking data-track-action="click" data-track-category="header" data-track-label="search" data-track-type="event"> </button>'; } else { $class = $element['#localized_options']['attributes']['class']; $element['#localized_options']['attributes'] = array( 'class' =>$class, 'data-tracking' => '', 'data-track-action' => 'click', 'data-track-category' => 'header', 'data-track-label' => 'book_a_visit', 'data-track-type' => 'event', ); $output = l($element ['#title'], $element ['#href'] , $element['#localized_options']); } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_header_menu() {\r\n register_nav_menu('header-menu',__( 'Header Menu' ));\r\n}", "protected function actionHeader() {\n Navigation::activateItem($this->navlink);\n $this->setTabNavigationIcon('black');\n $this->addSubNavigation(_('Lesen'), 'show');\n if (Utils\\hasPermission($this->edit_permission)) {\n $this->addSubNavigation(_('Bearbeiten'), 'edit');\n }\n }", "function theme_hbmode_process_header($app, &$vars) {\n $entries = $app->module('collections')->find(\"main_menu\");\n foreach ($entries as $entry) {\n $vars['links'][$entry['_id']] = [\n 'title' => $entry['title'],\n 'slug' => $entry['link'],\n ];\n }\n}", "function register_menu() {\n\n register_nav_menu('header-menu',__('Header Menu'));\n\n}", "function soho_menu_link__header_menu(array $variables) {\n $output = '';\n unset($variables['element']['#attributes']['class']);\n $element = $variables['element'];\n static $item_id = 0;\n $menu_name = $element['#original_link']['menu_name'];\n\n // set the global depth variable\n global $depth;\n $depth = $element['#original_link']['depth'];\n\n if ( ($element['#below']) && ($depth == \"1\") ) {\n $element['#attributes']['class'][] = 'menu-item-has-children '.$element['#original_link']['mlid'].'';\n }\n \n if ( ($element['#below']) && ($depth >= \"2\") ) {\n $element['#attributes']['class'][] = 'menu-item-has-children';\n }\n \n $sub_menu = $element['#below'] ? drupal_render($element['#below']) : '';\n $output .= l($element['#title'], $element['#href'], $element['#localized_options']);\n // if link class is active, make li class as active too\n if(strpos($output,\"active\")>0){\n $element['#attributes']['class'][] = \"current-menu-parent\";\n }\n \n return '<li' . drupal_attributes($element['#attributes']) . '>' . $output . $sub_menu . '</li>';\n \n}", "function ft_hook_menu() {}", "function thiredtheme_menu_item()\n {\n register_nav_menus(\n array(\n 'header'=>__('header menu'),\n 'footer'=>__('footer menu'))); \n }", "function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}", "function erp_get_menu_headers() {\n $menu = [];\n return apply_filters( 'erp_menu_headers', $menu );\n}", "function adwr_menu_link($vars) {\n //gs\n $menu_class = str_replace(' ', '-', strtolower($vars['element']['#original_link']['link_title']));\n $vars['element']['#attributes']['class'][] = 'menu-li-' . $menu_class;\n if (isset($variables['element']['#localized_options'])) {\n $vars['element']['#localized_options']['attributes']['class'][] = 'menu-' . $menu_class;\n }\n return theme_menu_link($vars);\n}", "function LinkITMenu() {\n add_menu_page('123LinkIt', '123LinkIt', 'manage_options', 'LinkITPluginCentral', 'LinkITPluginCentral', 'http://www.123linkit.com/images/123linkit.favicon.gif', 3);\n }", "function erp_add_menu_header( $component, $title, $icon = \"\" ) {\n add_filter('erp_menu_headers', function($menu) use( $component, $title, $icon ) {\n $menu[ $component ] = [ 'title' => $title, 'icon' => $icon ];\n return $menu;\n });\n}", "function MyMod_Items_Menu_Horisontal($args,$items,$argskey,$idkey=\"ID\",$namekeys=array(),$titlekeys=array(),$title=\"\",$current=0,$anchor=\"\")\n {\n return\n $this->HRefMenu\n (\n $title,\n $this->MyMod_Items_Menu_HRefs\n (\n $args,\n $items,\n $argskey,\n $idkey,\n $namekeys,\n $titlekeys,\n $title,\n $current,\n $anchor\n )\n );\n \n }", "function header_menu( $data ) {\n\t\t\t\t\t\tif (($locations = get_nav_menu_locations()) && isset($locations[ 'sgn_menu' ])) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Retrieve the menu in location sgn_menu */\n\t\t\t\t\t\t\t$menu = wp_get_nav_menu_object($locations['sgn_menu']);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* Create an empty array to store our JSON */\n\t\t\t\t\t\t\t$menuItems = array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* If the menu isn't empty, start process of building an array, otherwise return a 404 error */\n\t\t\t\t\t\t\tif (!empty($menu)) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* Assign array of navigation items to $menu_items variable */\n\t\t\t\t\t\t\t\t$menu_items = wp_get_nav_menu_items($menu->term_id);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* if $menu_items isn't empty */\n\t\t\t\t\t\t\t\tif ($menu_items) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t/* for each menu item, verify the menu item has no parent and then push the menu item to the $menuItems array */\n\t\t\t\t\t\t\t\t\tforeach ($menu_items as $key => $menu_item) {\n\t\t\t\t\t\t\t\t\t\tif ($menu_item->menu_item_parent == 0) {\n\t\t\t\t\t\t\t\t\t\t\tarray_push(\n\t\t\t\t\t\t\t\t\t\t\t\t$menuItems, array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'title' => $menu_item->title,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'url' => $menu_item->url,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'slug' => $menu_item->slug\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treturn new WP_Error(\n\t\t\t\t\t\t\t\t\t'no_menus',\n\t\t\t\t\t\t\t\t\t'Could not find any menus',\n\t\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'status' => 404\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t/* Return array of list items with title and url properties */\n\t\t\t\t\t\t\t\treturn $menuItems;\n\t\t\t\t\t}", "function gwt_drupal_links__system_main_menu($variables) {\n // $links = $variables['links'];\n $links = menu_tree_all_data('main-menu', null, 4);\n /*\n $test = '<pre>'.print_r($links, 1).'</pre>';\n return $test;\n // */\n\n // heading not needed in main menu\n $heading = $variables['heading'];\n // global $language_url;\n $output = '';\n\n $output .= _gwt_drupal_link_render($links, 0, $variables);\n\n return $output;\n}", "function _mai_add_widget_header_menu_args() {\n\tadd_filter( 'wp_nav_menu_args', 'genesis_header_menu_args' );\n\tadd_filter( 'wp_nav_menu', 'genesis_header_menu_wrap' );\n}", "function threed_admin_plugin_menu_links($menu)\n{\n $menu[] = array(\n 'NAME' => 'ThreeD',\n 'URL' => THREED_ADMIN,\n );\n return $menu;\n}", "function lepetitfleur_register_nav_menu() {\n\tregister_nav_menu('primary', 'Header Navigtion Menu' );\n}", "public function admin_menu(&$menu)\n {\n\n\t}", "function getMenuTitle();", "function dokan_header_user_menu() {\n global $current_user;\n $user_id = $current_user->ID;\n $nav_urls = dokan_get_dashboard_nav();\n\n dokan_get_template_part( 'global/header-menu', '', array( 'current_user' => $current_user, 'user_id' => $user_id, 'nav_urls' => $nav_urls ) );\n}", "function base_registerMenus() {\n register_nav_menus(\n array(\n 'header-menu' => __( 'Header Menu' ),\n )\n );\n}", "function log_viewer_add_menu_item() {\n\techo '<li><a href=\"http://localhost/ds-plugins/log-viewer/page.php\">Log Viewer</a></li>';\n}", "public function admin_head(){\r\n global $submenu;\r\n \r\n if(isset( $submenu[self::menu_tag] ) \r\n &&isset($submenu[self::menu_tag][0])\r\n &&isset($submenu[self::menu_tag][0][2])\r\n &&$submenu[self::menu_tag][0][2]==self::menu_tag){\r\n \r\n unset( $submenu[self::menu_tag][0] );\r\n }\r\n }", "function Menu_Rendering($menu) {\r\n}", "function do_menu() {\n print \"\n <a href=\\\"member-index.php\\\">Home</a> |\n <a href=\\\"display-comment.php\\\">Display All Comments</a> |\n <a href=\\\"add-comment.php\\\">Add Comment</a> |\n <a href=\\\"edit-comment.php\\\">Edit Comment</a> |\n <a href=\\\"delete-comment.php\\\">Delete Comment</a> |\n <a href=\\\"logout.php\\\">Logout</a> \n <HR>\n \";\n }", "function makeMenu($what)\n{\n global $language;\n if($what==\"header\") {\n echo \"<a href=\\\"index.php?action=home\\\" target=\\\"main\\\"><div align=\\\"center\\\"><img border=\\\"0\\\" src=\\\"\".AdminMenuLogoLocation.\"\\\"></a></div>\\r\\n\";\n echo \"<table width=\\\"100%\\\" border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"5\\\">\\r\\n\";\n }\n if($what==\"separator\") {\n echo \"<tr><td></td></tr>\\r\\n\";\n }\n if($what==\"footer\") {\n echo \"<tr><td><hr></td></tr>\\r\\n\";\n echo \"</table>\\r\\n\";\n }\n}", "function hook_menu() {\n\t\treturn null;\n\t}", "function init_menu() {\n if (func_num_args()>0) {\n $arg_list = func_get_args();\n }\n\n // menu entries\n module::set_menu($this->module, \"RAD Facility\", \"LIBRARIES\", \"_rad_facility\");\n module::set_menu($this->module, \"RAD DX Codes\", \"LIBRARIES\", \"_rad_dxcodes\");\n module::set_menu($this->module, \"RAD DX Codes\", \"LIBRARIES\", \"_rad_\");\n\n // add more detail\n module::set_detail($this->description, $this->version, $this->author, $this->module);\n\n }", "function in_admin_header()\n {\n }" ]
[ "0.71524006", "0.70759934", "0.70343477", "0.6998449", "0.6996317", "0.69815576", "0.68384844", "0.67936015", "0.678742", "0.6768134", "0.67609215", "0.6731005", "0.6699255", "0.6692182", "0.6667145", "0.6650084", "0.6630511", "0.66275126", "0.6611448", "0.66073996", "0.65861243", "0.65743256", "0.6570577", "0.6564121", "0.65471095", "0.654439", "0.6540949", "0.65366477", "0.65334296", "0.6505638" ]
0.7386077
0
Override webform element text. Hidden parent field (fieldset), set same line for all remain fields. Output a form element in plain text format.
function v2_mumm_webform_element_text($variables) { $element = $variables['element']; $value = $variables['element']['#children']; $output = ''; $is_group = webform_component_feature($element['#webform_component']['type'], 'group'); // Output the element title. if (isset($element['#title'])) { if ($is_group) { // Hidden fieldset. // $output .= '--' . $element['#title'] . '--'; $output .= ''; } elseif (!in_array(drupal_substr($element['#title'], -1), array('?', ':', '!', '%', ';', '@'))) { $output .= $element['#title'] . ': '; } else { $output .= $element['#title']; } } // Wrap long values at 65 characters, allowing for a few fieldset indents. // It's common courtesy to wrap at 75 characters in e-mails. if ($is_group && drupal_strlen($value) > 65) { $value = wordwrap($value, 65, "\n"); $lines = explode("\n", $value); foreach ($lines as $key => $line) { $lines[$key] = '' . $line; } // Remove unused break line. // $value = implode("\n", $lines); } // Add the value to the output. Add a newline before the response if needed. // Remove unused break line. // $output .= (strpos($value, "\n") === FALSE ? ' ' : "\n") . $value; $output .= $value; // Indent fieldsets. if ($is_group) { $lines = explode("\n", $output); foreach ($lines as $number => $line) { if (strlen($line)) { $lines[$number] = '' . $line; } } $output = implode("\n", $lines); // Remove unused break line. // $output .= "\n"; } if ($output) { if (!$is_group) { $output .= "\n"; } } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)\n {\n $html = parent::_getElementHtml($element);\n\t\t$html .= '<input type=\"hidden\" name=\"category_dummy\" id=\"'.$element->getHtmlId().'\" />';\n return $html;\n }", "public function renderElement($element)\r\n\t{\r\n\t\tif ($element instanceof TbFormInputElement) {\r\n\t\t\tif ($element->type === 'hidden') {\r\n\t\t\t\treturn \"<div style=\\\"display:none\\\">\\n\" . $element->renderInput() . \"</div>\\n\";\r\n\t\t\t} else {\r\n\t\t\t\treturn $element->render();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn parent::renderElement($element);\r\n\t}", "public function render(Varien_Data_Form_Element_Abstract $element){\n return $this->toHtml();\n }", "function setNoteText(){\n $html = \"\";\n \n $this->aFields[\"note\"]->editable = true;\n $this->aFields[\"note\"]->value = $html;\n }", "public function html(){\n\t\treturn '<div class=\"form-group\">'.$this->label.$this->input.'</div>';\n\t}", "public function setAsStaticForm() {\n\t\treturn $this->form_tag(implode('<br />', $this->_elements));\n\t}", "public function render(Varien_Data_Form_Element_Abstract $element)\n {\n $html = '<tr style=\"height: 13px;\"><td colspan=\"4\"></td></tr>';\n $html .= '<tr>';\n $html .= '<td colspan=\"4\">';\n $html .= $this->_getElementHtml($element);\n\n if ($element->getComment()) {\n $html .= '<p class=\"note\" style=\"margin-left: 20px; margin-bottom: 15px;\">';\n $html .= '<span>' . $element->getComment() . '</span>';\n $html .= '</p>';\n }\n\n $html .= '</td>';\n $html .= '</tr>';\n\n return $html;\n }", "function render_text() {\n\t\t?><input type=\"text\" id=\"<?php echo $this->slug ?>\" name=\"<?php echo $this->settings_page ?>[<?php echo $this->slug ?>]\" value=\"<?php echo $this->value ?>\" ><?php\n\t}", "protected abstract function printFormElements();", "public function render() {\n $html = str_replace('{text}', $this->text, FORMWIZARD_SEPARATOR);\n $this->html = $html;\n }", "public function pre_out()\n\t{\n\t\t$out = '';\n\t\tif ( !FormControlTextMulti::$outpre ) {\n\t\t\tFormControlTextMulti::$outpre = true;\n\t\t\tif(is_array($this->value)) {\n\t\t\t\t$fieldcount = count($this->value);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$fieldcount = 0;\n\t\t\t}\n\t\t\t// translatable strings\n\t\t\t// very bad practice but the below code is just horrible to read already and heredoc does not support method calls\n\t\t\t$removeitem = _t( 'Remove item' );\n\t\t\t$remove = _t( '[remove]' );\n\t\t\t$removethisitem = _t( 'Remove this item?' );\n\t\t\t$out .= <<< JSCODE\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\tcontrols.textmulti = {\n\t\t\t\t\tadd: function(e, controlname){\n\t\t\t\t\t\t$(e).before('<div><input type=\"text\" name=\"' + controlname + '[]\"> <a href=\"#\" onclick=\"return controls.textmulti.remove(this);\" title=\"{$removeitem}\" class=\"textmulti_remove\">{$remove}</a></div>');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t},\n\t\t\t\t\tremove: function(e) {\n\t\t\t\t\t\tvar item = $(e).prev();\n\t\t\t\t\t\tif (confirm(\"{$removethisitem} \" + item.val())) {\n\t\t\t\t\t\t\titem.parent().remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t\t</script>\nJSCODE;\n\t\t}\n\t\treturn $this->controls_js($out);\n\t}", "function dumpContents()\r\n {\r\n $attributes = $this->_getCommonAttributes();\r\n\r\n $value = ($this->_text != \"\") ? \"value=\\\"\" . $this->_text . \"\\\"\" : \"\";\r\n\r\n echo \"<input type=\\\"$this->_type\\\" id=\\\"$this->_name\\\" name=\\\"$this->_name\\\" $value $attributes />\";\r\n }", "public function render(Varien_Data_Form_Element_Abstract $element)\n {\n $this->setElement($element);\n $this->_setAddButton();\n return $this->toHtml();\n }", "function print_text_field($value){\n\t\techo $this->before_option_title.$value['name'].$this->after_option_title;\n\t\t$input_value = $this->get_field_value($value['id']);\n\t\tif(isset($value['disabled']) && $value['disabled']=='disabled')\n\t\t\t$input_value = $value['std'];\n\t\techo '<input class=\"option-input\" name=\"'.$value['id'].'\" id=\"'.$value['id'].'\" type=\"'.$value['type'].'\" value=\"'.$input_value.'\" '.((isset($value['disabled']) && $value['disabled']=='disabled')?'disabled=\"disabled\"':'').'/>';\n\t\t$this->close_option($value);\n\t}", "function text( $element )\n\t\t{\t\n\t\t\t$extraClass = \"\";\n\t\t\tif(isset($element['class_on_value']) && !empty($element['std'])) $extraClass = \" \".$element['class_on_value'];\n\t\t\t\n\t\t\t$text = '<input type=\"text\" class=\"'.$element['class'].$extraClass.'\" value=\"'.$element['std'].'\" id=\"'.$element['id'].'\" name=\"'.$element['id'].'\"/>';\n\t\t\t\n\t\t\tif(isset($element['simple'])) return $text;\n\t\t\treturn '<span class=\"ace_style_wrap\">'.$text.'</span>';\n\t\t}", "protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)\n {\n \t$_helper = Mage::helper('findologic');\n \t$output = '';\n \t\n \tif($_helper->isAlive(false)) {\n \t\t$output = '<strong style=\"color: green\">' . $this->__('enabled') . '</strong>';\n \t}\n \telse {\n\t\t\t$output = '<strong style=\"color: red\">' . $this->__('disabled') . '</strong>';\n \t if($_helper->getAliveMessage()) {\n \t\t\t$output .= ' <p class=\"note\"><span>' . $_helper->getAliveMessage() . '</span></p>';\n \t\t}\n \t}\n\n \treturn $output;\n\t}", "public function render(): string\n {\n $output = $this->openForm();\n\n foreach($this->options['groups'] as $fieldset_id => $fieldset) {\n if (!empty($fieldset['legend'])) {\n $output .= sprintf('<fieldset id=\"%s\" class=\"%s\">',\n $fieldset_id,\n $fieldset['class'] ?? ''\n );\n $output .= '<legend>'.$fieldset['legend'].'</legend>';\n\n if (!empty($fieldset['description'])) {\n $output .= '<p>'.$fieldset['description'].'</p>';\n }\n }\n\n foreach($fieldset['elements'] as $element_id => $element_info) {\n if (!empty($element_info[1]['belongsTo']))\n $element_id = $element_info[1]['belongsTo'].'_'.$element_id;\n\n if (isset($this->fields[$element_id])) {\n $field = $this->fields[$element_id];\n $output .= $field->render($this->name);\n }\n }\n\n if (!empty($fieldset['legend'])) {\n $output .= '</fieldset>';\n }\n }\n\n $output .= $this->fields[self::CSRF_FIELD_NAME]->render($this->name);\n\n $output .= $this->closeForm();\n return $output;\n }", "protected function _renderElement(\\Zend_Form_Element $element)\n {\n $element->setDecorators([ 'ViewHelper' ]);\n\n return trim($element->render($element->getView()));\n }", "public function getHTML() {\t\n\t\t$html = '';\n\t\tif ($this->type != 'title') $html.= '<p>'.\"\\n\";\n\t\tif ($this->type != 'info' && $this->type != 'system' && $this->type != 'title') \n\t\t\t{\t\t\t\n\t\t\t$html.= '<label id=\"label_for_'. $this->name . '\" name=\"label_for_'. $this->name . '\" for=\"'. $this->name . '\">';\n\t\t\t// special check for files item\n\t\t\tif ($this->type == 'file')\n\t\t\t\t{\n\t\t\t\tif (file_exists($_SERVER['DOCUMENT_ROOT'].'/uploads/' . $this->name))\n\t\t\t\t\t{\n\t\t\t\t\t$html.= '<a href = \"/uploads/'. $this->name .'\">'.$this->label.'</a> \n\t\t\t\t\t\t(<a href=\"javascript:void Messi.ask(\\''.DELETE.' ' .$this->name.' ?\\', \n\t\t\t\t\t\tfunction(val) { if(val==\\'Y\\') formSubmit(\\'delete\\',\\'' . $this->name . '\\');});\">'.DELETE.'</a>)';\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t$html.= $this->label.' ('.NONE.')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t$html.= $this->label;\n\t\t\t\t}\n\t\t\t$html.= '</label>'.\"\\n\";\n\t\t\t}\n\t\t// add dependence of the item for js managing in user interface\n\t\tif ($this->depend != 'none' or $this->depend != '') {\n\t\t\t$html.= '<input type=\"hidden\" id=\"dependance_for_'. $this->name . '\" value=\"'. $this->depend . '\" />'.\"\\n\";\n\t\t}\t\n\t\t$html.= '<input type=\"hidden\" id=\"title_for_'. $this->name . '\" value=\"'. $this->title . '\" />'.\"\\n\";\n\t\tswitch ($this->type)\n\t\t\t{\n\t\t\tcase 'text' : \n\t\t\t\t$html.= '<input id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" \n\t\t\t\t\tonchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'password' : \n\t\t\t\t$html.= '<input type=\"password\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" \n\t\t\t\t\tonchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'checkbox' : \n\t\t\t\t$html.= '<input type=\"checkbox\" id=\"'. $this->name . '\" name=\"'. $this->name . '\"' . ( ($this->value == 'on') ? \" \n\t\t\t\t\tchecked \" : \"\") . ' onchange=\"display_dependance();\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'file' : \n\t\t\t\t$html.= '<input type=\"file\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'. $this->value . '\" />'.\"\\n\";\n\t\t\t\tbreak;\n\n\t\t\tcase 'select' :\n\t\t\t\t$html.= '<select id=\"'. $this->name . '\" name=\"'. $this->name . '\" onchange=\"display_dependance();\" >'.\"\\n\";\n\t\t\t\t$valuesPossible = explode(',',$this->values);\n\t\t\t\tforeach ($valuesPossible as $valuePossible){\n\t\t\t\t\t$html.= '<option value=\"'. $valuePossible . '\" ' . (($valuePossible == $this->value) ? \" selected \" : \"\") . '>'.\n\t\t\t\t\t(($valuePossible == \"none\") ? NONE : $valuePossible) . '</option>'.\"\\n\";\n\t\t\t\t\t}\n\t\t\t\t$html.= '</select><div style=\"clear:both\"></div>'.\"\\n\";\n\t\t\t\tbreak; \n\n\t\t\tcase 'title' : \n\t\t\t\t$html.= \"\\n\". '<h2>'.$this->label.'</h2><hr />'.\"\\n\\n\";\t\t\t\n\t\t\t\tbreak;\n\n\t\t\t// system action items\n\t\t\tcase 'system' : \n\t\t\t\t// a system item will render a button that submit the form with the configured action name in the config-map.php\n\t\t\t\t$html.= '<label></label><input class=\"button\" type=\"button\" id=\"'. $this->name . '\" name=\"'. $this->name . '\" value=\"'.$this->label.'\" \n\t\t\t\tonclick=\"new Messi(\\''.addslashes($this->help).'\\', {\n\t\t\t\t\ttitle: \\''.addslashes($this->label).'?\\', \n\t\t\t\t\tmodal: true, buttons: [{id: 0, label: \\''.YES.'\\', val: \\'Y\\'}, {id: 1, label: \\''.NO.'\\', val: \\'N\\'}], \n\t\t\t\t\tcallback: function(val) { if(val==\\'Y\\') {openTerminal();formSubmit(\\''.$this->values.'\\');}}});\" />';\n\t\t\t\tbreak;\n\n\t\t\tcase 'html' : \n\t\t\t\t// this is only arbitrary html code to display\n\t\t\t\t$html.= $this->value;\t\t\t\n\t\t\t\tbreak;\n\n\t\t\t/**\n\t\t\t * HERE YOU CAN ADD THE TYPE RENDERER YOU NEED\n\t\t\t *\n\t\t\t * case 'YOUR_TYPE' : \n\t\t\t *\t$html.= 'ANY_HTML_CODE_TO_RENDER';\n\t\t\t *\tbreak;\n\t\t\t */\n\n\t\t\tdefault : \n\t\t\t\t$html.= '<b>'.NO_METHOD_TO_RENDER_THIS_ITEM .'</b><br />Item : '.$this->name. '<br />Type : '.$this->type. '<br />'.\"\\n\"; \n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\tif ($this->type != 'title') $html.= '</p>'.\"\\n\"; \t\t\n\t\treturn $html;\n\t}", "public function doRender(){\r\n\t\t$label = ($this->label != '') ? Label::get($this)->doRender() : '';\r\n\r\n\t\treturn\r\n\t\t\t '<div class=\"'.$this->printWrapperClasses().'\">'\r\n\t\t\t\t.$label\r\n\t\t\t\t.'<div class=\"'.parent::WIDGETCLASS.'\">'\r\n\t\t\t\t\t.'<input'\r\n\t\t\t\t\t\t.$this->printId()\r\n\t\t\t\t\t\t.$this->printName()\r\n\t\t\t\t\t\t.' type=\"file\"'\r\n\t\t\t\t\t\t.$this->printTitle()\r\n\t\t\t\t\t\t.$this->printAccept()\r\n\t\t\t\t\t\t.$this->printSize()\r\n\t\t\t\t\t\t.$this->printMaxLength()\r\n\t\t\t\t\t\t.$this->printCssClasses()\r\n\t\t\t\t\t\t.$this->printJavascriptEventHandler()\r\n\t\t\t\t\t\t.$this->printTabindex()\r\n\t\t\t\t\t\t.$this->printReadonly()\r\n\t\t\t\t\t\t.$this->printDisabled()\r\n\t\t\t\t\t\t.$this->masterForm->printSlash()\r\n\t\t\t\t\t.'>'\r\n\t\t\t\t.'</div>'\r\n\t\t\t\t.$this->masterForm->printFloatBreak()\r\n\t\t\t.'</div>'\r\n\t\t;\r\n\t}", "function pmi_form_element($element, $value) {\n $t = get_t();\n\n $output = '<div';\n if (!empty($element['#id'])) {\n $output .= ' id=\"' . $element['#id'] . '-wrapper\"';\n }\n $output .= \">\\n\";\n $required = !empty($element['#required']) ? '<span class=\"form-required\" title=\"' . $t('This field is required.') . '\">*</span>' : '';\n\n if (!empty($element['#title'])) {\n $title = $element['#title'];\n if (!empty($element['#id'])) {\n $output .= ' <label for=\"' . $element['#id'] . '\" class=\"lbl150\">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n else {\n $output .= ' <label class=\"lbl150\">' . $t('!title: !required', array('!title' => filter_xss_admin($title), '!required' => $required)) . \"</label>\\n\";\n }\n }\n\n $output .= \" $value\\n\";\n\n if (!empty($element['#description'])) {\n $output .= ' <div class=\"description\">' . $element['#description'] . \"</div>\\n\";\n }\n\n $output .= \"</div>\\n\";\n\n//echo $output; exit;\n\n return $output;\n}", "public function render(\\Magento\\Framework\\Data\\Form\\Element\\AbstractElement $element) {\n $this->setElement($element);\n\n return $this->toHtml();\n }", "protected function setFormContent()\n {\n\t\t$content = $this->getTitle();\n\t\t\n\t\t$content .= '<p>Your meditation time on <b>';\n\t\t$content .= $this->data['long_date'];\n\t\t$content .= '</b> has been deleted. Would you like to restore it?</p>';\n\t\t\n\t\t$this->Form = new Form;\n\t\t$this->buildForm();\n\t\t$content .= $this->Form->getHtml();\n\t\t\n\t\t// Add the cancel link\n\t\t$content .= $this->cancelLink();\n\t\t\n\t\t$this->content = $content;\n }", "protected function getInput()\n\t{\n\t\tif ($this->form->getValue('id', 0) == 0)\n\t\t{\n\t\t\treturn '<span class=\"readonly\">' . Lang::txt('COM_MENUS_ITEM_FIELD_ORDERING_TEXT') . '</span>';\n\t\t}\n\n\t\treturn parent::getInput();\n\t}", "public function display()\n {\n $output = \"\";\n\n // Ouverture\n /// ID HTML\n $openId = $this->getAttr('container_id');\n /// Classes HTML\n $openClass = [];\n $openClass[] = 'tiFyForm-FieldContainer';\n $openClass[] = 'tiFyForm-FieldContainer--' . $this->getType();\n $openClass[] = 'tiFyForm-FieldContainer--' . $this->getSlug();\n if ($this->getErrors()) :\n $openClass[] = 'tiFyForm-FieldContainer--error';\n endif;\n $openClass[] = $this->getAttr('container_class');\n if ($this->getAttr('required')) :\n $openClass[] = 'tiFyForm-FieldContainer--required';\n endif;\n $output .= $this->form()\n ->factory()\n ->fieldOpen($this, $openId, join(' ', $openClass));\n\n // Contenu du champ\n $output .= $this->type()->_display();\n\n // Fermeture\n $output .= $this->form()->factory()->fieldClose($this);\n\n return $output;\n }", "public function html()\n {\n return ($this->isEncrypted()) ? $this->encryptedField() : $this->regularField();\n }", "function payment_fields() {\n\t\t\tif ($this->description) echo wpautop(wptexturize($this->description));\n\t\t}", "function payment_fields() {\n\t\t\tif ($this->description) echo wpautop(wptexturize($this->description));\n\t\t}", "protected function _getElementHtml(\\Magento\\Framework\\Data\\Form\\Element\\AbstractElement $element)\n{\n$element->setWysiwyg(true);\n// set configuration values\n$element->setConfig($this->wysiwygConfig->getConfig($element));\n\nreturn parent::_getElementHtml($element);\n}", "public function render(Varien_Data_Form_Element_Abstract $element) {\n $this->_element = $element;\n if($this->_element->getValue()) {\n $lockDateTime = Mage::getSingleton('core/date');\n $lockDateTimeValue = $lockDateTime->date(Varien_Date::DATETIME_PHP_FORMAT, $this->_element->getValue());\n $this->_element->setValue($lockDateTimeValue);\n }\n $this->_element->setDisabled('disabled');\n return $this->toHtml();\n }" ]
[ "0.6213272", "0.6134484", "0.6048299", "0.5922234", "0.58740526", "0.5867772", "0.58234364", "0.5759769", "0.5732088", "0.57194567", "0.5701939", "0.5700525", "0.56501794", "0.56415075", "0.5633653", "0.56225306", "0.5610247", "0.5579917", "0.55646205", "0.5558183", "0.55443454", "0.554", "0.55383444", "0.55284625", "0.5521838", "0.5521481", "0.55035484", "0.55035484", "0.5499942", "0.5491698" ]
0.6573549
0
Function to add a new customer to the database Returns customer id for appointment creation
public static function addCustomer() { // We get appointment information then set up our validator $info = Session::get('appointmentInfo'); $validator = Validator::make( array( 'first_name' => $info['fname'], 'last_name' => $info['lname'], 'email' => $info['email'] ), array( 'first_name' => 'exists:customers,first_name', 'last_name' => 'exists:customers,last_name', 'email' => 'exists:customers,email' ) ); // If the validator fails, that means the user does not exist // If any of those three variables don't exist, we create a new user // This is so that families can use the same e-mail to book, but // We stil create a new user for them in the database. if ($validator->fails()) { // Registering the new user return Customer::create(array( 'first_name' => $info['fname'], 'last_name' => $info['lname'], 'contact_number' => $info['number'], 'email' => $info['email'], 'wants_updates' => Session::get('updates') ))->id; } else { return Customer::where('email', $info['email'])->pluck('id'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_customer($params){\n $this->company_db->insert('tbl_customer', $params);\n return $this->company_db->insert_id();\n }", "function add_customer()\n\t{\n\t\t$table = \"customer\";\n\t\t$where = \"customer_email = '\".$this->input->post('user_email').\"'\";\n\t\t$items = \"customer_id\";\n\t\t$order = \"customer_id\";\n\t\t\n\t\t$result = $this->select_entries_where($table, $where, $items, $order);\n\t\t\n\t\tif(count($result) > 0)\n\t\t{\n\t\t\t$customer_id = $result[0]->customer_id;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t'customer_email'=>$this->input->post('user_email'),\n\t\t\t\t'customer_name'=>$this->input->post('seller_name'),\n\t\t\t\t'customer_phone'=>$this->input->post('user_phone')\n\t\t\t);\n\t\t\t\n\t\t\t$table = \"customer\";\n\t\t\t$customer_id = $this->insert($table, $data);\n\t\t}\n\t\t\n\t\treturn $customer_id;\n\t}", "public function insert_customer()\n {\n $this->permission->check_label('add_customer')->create()->redirect();\n\n $customer_id = generator(15);\n //Customer basic information adding.\n $data = array(\n 'customer_id' => $customer_id,\n 'customer_name' => $this->input->post('customer_name',TRUE),\n 'customer_mobile' => $this->input->post('mobile',TRUE),\n 'customer_email' => $this->input->post('email',TRUE),\n 'customer_short_address' => $this->input->post('address',TRUE),\n 'customer_address_1' => $this->input->post('customer_address_1',TRUE),\n 'customer_address_2' => $this->input->post('customer_address_2',TRUE),\n 'city' => $this->input->post('city',TRUE),\n 'state' => $this->input->post('state',TRUE),\n 'country' => $this->input->post('country',TRUE),\n 'zip' => $this->input->post('zip',TRUE),\n 'status' => 1\n );\n\n $result = $this->Customers->customer_entry($data);\n\n if ($result == TRUE) {\n $this->session->set_userdata(array('message' => display('successfully_added')));\n if (isset($_POST['add-customer'])) {\n redirect(base_url('dashboard/Ccustomer/manage_customer'));\n exit;\n } elseif (isset($_POST['add-customer-another'])) {\n redirect(base_url('dashboard/Ccustomer'));\n exit;\n }\n } else {\n $this->session->set_userdata(array('error_message' => display('already_exists')));\n redirect(base_url('dashboard/Ccustomer'));\n }\n }", "public function insert_customer()\n\t{\n\t\t$customer_id=$this->auth->generator(15);\n\n\t \t//Customer basic information adding.\n\t\t$data=array(\n\t\t\t'customer_id' \t\t=> $customer_id,\n\t\t\t'customer_name' \t=> $this->input->post('customer_name'),\n\t\t\t'customer_mobile' \t=> $this->input->post('mobile'),\n\t\t\t'customer_email' \t=> $this->input->post('email'),\n\t\t\t'customer_short_address' => $this->input->post('address'),\n\t\t\t'customer_address_1' => $this->input->post('customer_address_1'),\n\t\t\t'customer_address_2' => $this->input->post('customer_address_2'),\n\t\t\t'city' \t\t\t\t=> $this->input->post('city'),\n\t\t\t'state' \t\t\t=> $this->input->post('state'),\n\t\t\t'country' \t\t\t=> $this->input->post('country'),\n\t\t\t'zip' \t\t\t\t=> $this->input->post('zip'),\n\t\t\t'status' \t\t\t=> 1\n\t\t\t);\n\n\t\t$result=$this->Customers->customer_entry($data);\n\t\t\n\t\tif ($result == TRUE) {\t\t\n\t\t\t$this->session->set_userdata(array('message'=>display('successfully_added')));\n\t\t\tif(isset($_POST['add-customer'])){\n\t\t\t\tredirect(base_url('Ccustomer/manage_customer'));\n\t\t\t\texit;\n\t\t\t}elseif(isset($_POST['add-customer-another'])){\n\t\t\t\tredirect(base_url('Ccustomer'));\n\t\t\t\texit;\n\t\t\t}\n\t\t}else{\n\t\t\t$this->session->set_userdata(array('error_message'=>display('already_exists')));\n\t\t\tredirect(base_url('Ccustomer'));\n\t\t}\n\t}", "public function c_add()\n {\n\t\t$this->getC();\n $customer = $this->Customers->newEntity();\n if ($this->request->is('post')) {\n $customer = $this->Customers->patchEntity($customer, $this->request->data);\n if ($this->Customers->save($customer)) {\n $this->Flash->success('The customer has been saved.');\n return $this->redirect(['action' => 'c_index']);\n } else {\n $this->Flash->error('The customer could not be saved. Please, try again.');\n }\n }\n $this->set(compact('customer'));\n $this->set('_serialize', ['customer']);\n }", "function add_customer()\n\t{\n\t\tglobal $db;\n\n\t\t$vals = array(\n\t\t\t'NULL',\n\t\t\t$this->preorderID,\n\t\t\tmysql_real_escape_string($this->customerinfo['fname']),\n\t\t\tmysql_real_escape_string($this->customerinfo['lname']),\n\t\t\t$this->customerinfo['amountdown'],\n\t\t\tNO\n\t\t);\n\n\t\t$sql = \"INSERT INTO preorder_customers VALUES ('\".implode(\"','\",$vals).\"')\";\n\t\tmysql_query($sql,$db);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t}", "function add_customer($params)\n {\n $this->db->insert('customer',$params);\n return $this->db->insert_id();\n }", "public function add_customer($data){\n\t\t\n\t\t\t$this->db->insert('customers',$data);\n\t\t\tredirect('Customer');\n\t\t\n\t}", "function addNewCustomer($customerName, $mailingAddress1, $mailingAddress2, $mailingCity, $mailingState, $mailingZipcode,\r\n \t\t\t\t\t\t $phoneNumber, $billingAddress1, $billingAddress2, $billingCity, $billingState, $billingZipcode,\r\n \t\t\t\t\t\t $ccType, $ccNumber, $ccCode, $ccExpiration)\r\n {\r\n $q = \"INSERT INTO \".TBL_CUSTOMERS.\" VALUES (NULL, '$customerName', '$mailingAddress1', '$mailingAddress2', \r\n '$mailingCity', '$mailingState', '$mailingZipcode', '$phoneNumber', '$billingAddress1', '$mailingAddress2',\r\n '$billingCity', '$billingState', '$billingZipcode', 'No Status', '$ccType', '$ccNumber', '$ccCode', '$ccExpiration',\r\n $billingZipcode, 'True')\";\r\n return mysql_query($q, $this->connection);\r\n }", "public function addCustomer($data)\n {\n $add = DB::table('customers')->insert($data);\n Session::flash('message','Customer Added Successfully');\n return redirect('flyer-conversion');\n }", "function addCustomer($customerDetailsAry)\n{\n}", "public function storeclient(CustomerRequest $request)\n {\n $customer = $request->all();\n\n // create customer account\n $customer = $this->customer->insert($customer);\n // return the resource just created\n return $this->customer->findBy(\"id\", $customer->id);\n }", "public function getOrCreateCustomer();", "private function saveCustomer($customer){\n \n $customermodel = new CustomerModel();\n $customermodel->save($customer);\n return $this->insertID();\n }", "public function insertCustomer($data){\n // Insert customer data\n $insert = $this->db->insert('customers_data', $data);\n // Return the status\n return $insert?$this->db->insert_id():false;\n }", "public function create()\n\t{\n\t\t// Returning result, so using $result instead of $this->res.\n\t\t$result = '';\n\n\t\t$this->postData();\n\n\t\t$this->getDB()->insert('customers',[\n\t\t\t\t'customer_name'=>$this->getCustomerName(),\n\t\t\t\t'customer_address1'=>$this->getCustomerAddress1(),\n\t\t\t\t'customer_address2'=>$this->getCustomerAddress2(),\n\t\t\t\t'customer_city'=>$this->getCustomerCity(),\n\t\t\t\t'customer_zipcode'=>$this->getCustomerZipcode(),\n\t\t\t\t'customer_state'=>$this->getCustomerState(),\n\t\t\t\t'customer_phone'=>$this->getCustomerPhone(),\n\t\t\t\t'customer_ext'=>$this->getCustomerExt(),\n\t\t\t\t'customer_fax'=>$this->getCustomerFax(),\n\t\t\t\t'customer_email'=>$this->getCustomerEmail(),\n\t\t\t\t'customer_rdp'=>$this->getCustomerRdp(),\n\t\t\t\t'customer_notes'=>$this->getCustomerNotes(),\n\t\t\t\t'flagged'=>$this->getFlag(),\n\t\t\t\t'flag_reason'=>$this->getFlagReason()]);\n\n\t\tif($this->getDB()->lastId() == null)\n\t\t{\n\t\t\techo 'There was an error inserting the event into the calendar!';\n\t\t} else {\n\t\t\t$result = true;\n\t\t}\n\n\t\treturn $result;\n\t}", "function sql_addCustomer($kunde){\r\n\t\t\r\n\t\tglobal $database;\r\n\t\t$id = $database->insert(\"kunden\", [\r\n\t\t\t\t\"name\" => $kunde\r\n\t\t]);\r\n\t\t\r\n\t\treturn $id;\r\n\t\t\r\n\t}", "public function add_new_customer()\n {\n if ($this->input->post())\n {\n $ac_receivable = $this->MSettings->get_by_company_id($this->session->user_company);\n $chart = $this->MAc_charts->get_by_id($ac_receivable['ac_receivable']);\n $siblings = $this->MAc_charts->get_by_parent_id($ac_receivable['ac_receivable']);\n if (count($siblings) > 0)\n {\n $ac_code_temp = explode('.', $siblings['code']);\n $ac_last = count( $ac_code_temp ) - 1;\n $ac_new = (int)$ac_code_temp[$ac_last] + 10;\n $ac_code = $chart['code'] . '.' . $ac_new;\n }\n else\n {\n $ac_code = $chart['code'] . '.10';\n }\n\n $ac_id = $this->MAc_charts->account_create($ac_receivable['ac_receivable'], $ac_code, $this->input->post('name'));\n $insert_id = $this->MCustomers->create(trim($this->input->post('code')), $ac_id);\n $customers = $this->MCustomers->get_all();\n $html = '';\n foreach ($customers as $customer)\n {\n if ($insert_id == $customer['id'])\n {\n $html .= '<option value=\"' . $customer['id'] . '\" selected>' . $customer['name'] . '</option>';\n }\n else\n {\n $html .= '<option value=\"' . $customer['id'] . '\">' . $customer['name'] . '</option>';\n }\n }\n echo $html;\n }\n }", "public function addCustomer()\n\t{\n\t\tdate_default_timezone_set('Asia/Kolkata');\n $timestamp = date('Y-m-d H:i:s');\n \n $phone = $this->security->xss_clean($this->input->post('phone'));\n $name = substr($phone, -4);\n \n $phonecheck = $this->Common->get_details('customers',array('customer_phone'=>$phone));\n if($phonecheck->num_rows()>0)\n {\n $this->session->set_flashdata('alert_type', 'error');\n\t\t\t$this->session->set_flashdata('alert_title', 'Failed');\n\t\t\t$this->session->set_flashdata('alert_message', 'Mobile number already registered..!');\n\t\t\tredirect('admin/bill/retailBill');\n }\n else\n {\n \t $array = [\n \t\t\t\t\t\t\t'name_english' => 'Customer'.$name,\n \t\t\t\t\t\t\t'customer_phone' => $phone,\n \t\t\t\t\t\t\t'customer_image' => 'uploads/admin/customers/user.png',\n \t\t\t\t\t\t\t'status' => '1',\n \t\t\t\t\t\t\t'added_by' => 'admin',\n \t\t\t\t\t\t\t'timestamp' => $timestamp\n \t\t\t\t ];\n \t\tif ($this->Common->insert('customers',$array)) \n \t\t{\n \t\t\t$this->session->set_flashdata('alert_type', 'success');\n \t\t\t$this->session->set_flashdata('alert_title', 'Success');\n \t\t\t$this->session->set_flashdata('alert_message', 'New customer added..!');\n \t\t\tredirect('admin/bill/retailBill');\n \t\t}\n \t\telse \n \t\t{\n \t\t\t$this->session->set_flashdata('alert_type', 'error');\n \t\t\t$this->session->set_flashdata('alert_title', 'Failed');\n \t\t\t$this->session->set_flashdata('alert_message', 'Failed to add customer..!');\n \t\t\tredirect('retailer/bill/retailBill');\n \t\t}\n }\t\n\t}", "public function insert_customer($data)\n\t{\n\t\t$this->db->insert('mcustomer', $data);\n\t\t$id = $this->db->insert_id();\n\t\treturn (isset($id)) ? $id : FALSE;\t\t\n\t}", "public function insertCustomer() {\n $svcReturn = true;\n\n try {\n\n $data = array(\n 'code' => 'I',\n 'firstname' => Input::get('firstname'),\n 'lastname' => Input::get('lastname'),\n 'password' => Hash::make(Input::get('password')),\n 'email' => Input::get('email'),\n 'address' => Input::get('address'),\n 'address2' => Input::get('address2'),\n 'address3' => Input::get('address3'),\n 'postcode' => Input::get('postcode'),\n 'city' => Input::get('city'),\n 'province' => Input::get('province'),\n 'home_no' => Input::get('home_no'),\n 'mobile_no' => Input::get('mobile_no'),\n 'grup' => Input::get('grup'),\n 'ip_address' => Request::getClientIp(),\n 'active' => Input::get('active'),\n );\n\n $customer = new Customer($data);\n $customer->save();\n } catch (RuntimeException $exc) {\n $svcReturn = false;\n echo $exc->getTraceAsString();\n }\n\n return $svcReturn;\n }", "public function addNewCustomer(Customer $customer)\n {\n $isValid = $customer->isValid();\n\n if (!$isValid['status']) {\n return $isValid['message'];\n }\n \n $this->save($customer);\n \n Email::sendEmailNewRegister($customer->name, $customer->email);\n\n return \"Cliente cadastrado com sucesso!\";\n }", "function wiwiPortalCreateCustomerAction() {\n try {\n $request = $this->getApiRequest();\n\n $userId = $this->validateWifiPortalRequestGetUserIdSetBusinessId($request);\n $customersApiService = $this->get('e2w_customers_api_service');\n $response = $customersApiService->createCustomer($userId, $request);\n\n return $this->jsonSuccessResponse($response);\n } catch (\\Exception $e) {\n return $this->jsonErrorResponse($e);\n }\n }", "public function addCustomer($data) {\n\t\t// provide the EziDebit API endpoint\n\t\t$soapclient = new SoapClient($this->nonPci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'YourSystemReference' => $data['systemRef'],\n\t\t\t\t'YourGeneralReference' => $data['generalRef'],\n\t\t\t\t'LastName' => $data['lastName'],\n\t\t\t\t'FirstName' => $data['firstName'],\n\t\t\t\t'AddressLine1' => $data['addressLine1'],\n\t\t\t\t'AddressLine2' => $data['addressLine2'],\n\t\t\t\t'AddressSuburb' => $data['suburb'],\n\t\t\t\t'AddressState' => $data['state'],\n\t\t\t\t'AddressPostCode' => $data['postCode'],\n\t\t\t\t'EmailAddress' => $data['email'],\n\t\t\t\t'MobilePhoneNumber' => $data['phone'],\n\t\t\t\t'ContractStartDate' => $data['startDate'],\n\t\t\t\t'SmsPaymentReminder' => $data['smsReminder'],\n\t\t\t\t'SmsFailedNotification' => $data['smsFailed'],\n\t\t\t\t'SmsExpiredCard' => $data['smsExpired'],\n\t\t\t\t'Username' => $data['username']\n\t\t];\n\n\t\treturn $response = $soapclient->addCustomer($params);\n\t}", "public function customer_create($data){\t\t\t\t\t\t\t\t\n\t\t$params = array(\n\t\t\t'name' => $data['name'],\n\t\t\t'email' => $data['email'],\n\t\t\t'externalId' => $data['externalId']\n\t\t);\t\t\n\t\ttry {\n\t\t\t$flow = $this->send('customer/create', $params, 'POST');\t\n\t\t\t$response = array(\n\t\t\t\t'customerId' => $flow['customerId'], // (string) | Identificador del cliente\n\t\t\t\t'created' => $flow['created'], // (string) | <yyyy-mm-dd hh:mm:ss> | La fecha de creación\n\t\t\t\t'email' => $flow['email'], // (string) | email del cliente\n\t\t\t\t'name' => $flow['name'], // (string) | nombre del cliente\n\t\t\t\t'pay_mode' => $flow['pay_mode'], // (string) | \"auto\" (cargo automático) || \"manual\" (cobro manual)\n\t\t\t\t'creditCardType' => $flow['creditCardType'], // (string) | La marca de la tarjeta de crédito registrada\n\t\t\t\t'last4CardDigits' => $flow['last4CardDigits'], // (string) | Los últimos 4 dígitos de la tarjeta de crédito registrada\n\t\t\t\t'externalId' => $flow['externalId'], // (string) | El identificador del cliente en su negocio\n\t\t\t\t'status' => $flow['status'], // (string) | \"0\" (eliminado) || \"1\" (activo)\n\t\t\t\t'registerDate' => $flow['registerDate'], // (string) | <yyyy-mm-dd hh:mm:ss> | La fecha en que el cliente registro su tarjeta de crédito.\n\t\t\t);\t\t\t\n\t\t\treturn $response;\n\t\t} catch (Exception $e) { return $e->getCode().\" - \".$e->getMessage(); }\n\t}", "public static function add($data, $customerId, $userId) {\n\t\t\t\n\t\t\t$data['customer_id'] = $customerId;\n\t\t\t$data['user_id'] = $userId;\n\t\t\tCustomer::create($data);\n\t\t}", "function insertCustomer($customer) {\n //define the query\n $sql = \"INSERT INTO `customers`(`package_id`, `fname`, `lname`, `phone`, `email`, `state`)\n VALUES (:package_id, :fname, :lname, :phone, :email, :state)\";\n\n //Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //Bind the parameters\n $statement->bindParam(':package_id', $customer->getPackageId(), PDO::PARAM_STR);\n $statement->bindParam(':fname', $customer->getFname(), PDO::PARAM_STR);\n $statement->bindParam(':lname', $customer->getLname(), PDO::PARAM_STR);\n $statement->bindParam(':phone', $customer->getPhone(), PDO::PARAM_STR);\n $statement->bindParam(':email', $customer->getEmail(), PDO::PARAM_STR);\n $statement->bindParam(':state', $customer->getState(), PDO::PARAM_STR);\n\n //Execute\n $statement->execute();\n }", "private function createCustomer(CustomerRequest $request){\n\n $customer = Customer::create($request->all());\n\n $this->uploadLogo($customer, $request);\n\n $this->uploadSlides($customer, $request);\n\n $customer->services()->sync($request->input('service_list'));\n\n return $customer;\n }", "public function add_customer($order) {\n\n $customerData = array(\n 'name' => $order->billing_first_name,\n 'last_name' => $order->billing_last_name,\n 'email' => $order->billing_email,\n 'requires_account' => false,\n 'phone_number' => $order->billing_phone, \n );\n\n if($this->hasAddress($order)) {\n $customerData['address'] = array(\n 'line1' => substr($order->billing_address_1, 0, 200),\n 'line2' => substr($order->billing_address_2, 0, 50),\n 'line3' => '',\n 'state' => $order->billing_state,\n 'city' => $order->billing_city,\n 'postal_code' => $order->billing_postcode,\n 'country_code' => $order->billing_country\n );\n }\n \n $response = $this->openpay_request($customerData, 'customers');\n\n if (!isset($response->error_code)) {\n // Store the ID on the user account\n if (is_user_logged_in()) {\n update_user_meta(get_current_user_id(), '_openpay_customer_id', $response->id);\n }\n\n // Store the ID in the order\n update_post_meta($order->id, '_openpay_customer_id', $response->id);\n\n return $response->id;\n } else {\n $msg = $this->handleRequestError($response->error_code);\n return new WP_Error('error', __($response->error_code.' '.$msg, 'openpay-woosubscriptions'));\n }\n }", "public function addCustomer(CustomerModel $custData)\n {\n try \n {\n \n //define the query to search the database for the credentials\n $this->dbQuery = \"INSERT INTo customer\n (FirstName, LastName)\n VALUES \n ('{$custData->getFirstName()}', '{$custData->getLastName()}')\";\n //if the selected query returns a resultset\n //$result = mysqli_query($this->conn,$this->dbQuery);\n \n if( $this->dbObj->query($this->dbQuery))\n {\n // $this->conn->closeDbConnect();\n return true;\n }\n else\n {\n $this->conn->closeDbConnect();\n return false;\n }\n } catch (Exception $e) \n {\n echo $e->getMessage();\n }\n \n }" ]
[ "0.7540544", "0.7501426", "0.7476336", "0.7297128", "0.7260823", "0.7233852", "0.7174463", "0.71472234", "0.7080077", "0.70112634", "0.68023676", "0.6711746", "0.6711415", "0.6703683", "0.6683012", "0.6674407", "0.66472894", "0.66294324", "0.66287255", "0.6628496", "0.66247356", "0.66208464", "0.6556492", "0.6503113", "0.64839983", "0.64697725", "0.64035946", "0.6403586", "0.63822454", "0.6364285" ]
0.799979
0
Specifies the Person that is legally accountable for the CreativeWork.
public function setAccountablePerson($accountablePerson) { $this->properties['accountablePerson'] = $accountablePerson; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setOrganization() {}", "public function getLegalPersonTypeAllowableValues()\n {\n return [\n self::LEGAL_PERSON_TYPE_BUSINESS,\n self::LEGAL_PERSON_TYPE_ORGANIZATION,\n self::LEGAL_PERSON_TYPE_SOLETRADER,\n ];\n }", "public function person()\n {\n return $this->hasMany('App\\Models\\PersonalAccount','work_site_id','account_data');\n }", "public function is_needed() {\n\t\tif ( ( $this->context->site_represents === 'person' ) || is_author() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function insuredPerson()\n {\n return $this->belongsTo('App\\Models\\Api\\v1\\Person', 'n_OwnerId_FK')->withDefault();\n }", "function dataObjectEffect() {\n\t\t$galleyId = (int)$this->getDataObjectId();\n\t\tif (!$galleyId) return AUTHORIZATION_DENY;\n\n\t\t// Need a valid submission in request.\n\t\t$submission =& $this->getAuthorizedContextObject(ASSOC_TYPE_SUBMISSION);\n\t\tif (!is_a($submission, 'Submission')) return AUTHORIZATION_DENY;\n\n\t\t// Make sure the galley belongs to the submission.\n\t\t$articleGalleyDao = DAORegistry::getDAO('ArticleGalleyDAO');\n\t\t$galley = $articleGalleyDao->getById($galleyId, $submission->getId());\n\t\tif (!is_a($galley, 'ArticleGalley')) return AUTHORIZATION_DENY;\n\n\t\t// Save the Galley to the authorization context.\n\t\t$this->addAuthorizedContextObject(ASSOC_TYPE_GALLEY, $galley);\n\t\treturn AUTHORIZATION_PERMIT;\n\t}", "public function canAddUnknownPerson();", "function myAccount($ar=NULL){\n $ar['oid']=XUser::get_current_user_uid();\n if(!is_array($ar['fieldssec'])){\n foreach(array('DATET','DATEF','alias','GRP','GRPA','BO','bohome') as $f){\n $ar['fieldssec'][$f]='ro';\n }\n }\n return $this->edit($ar);\n }", "function canEdit($user) {\n if($user->getId() == $this->getId()) {\n return true; // user can change his own account\n } // if\n\n return $user->isCompanyManager($this->getCompany());\n }", "public function belongingToUserLicense(UserLicense $account);", "public function setPerson($person) {\n $this->person = $person;\n return $this;\n }", "public function getOwnedByAttribute()\n {\n return $this->site->company;\n }", "public function hire(Person $person)\r\n {\r\n $this->staff->add($person);\r\n\r\n }", "public function setPersonality($personality)\n {\n return $this->set('personality', $personality);\n }", "public function bank_accountable()\n {\n return $this->morphTo();\n }", "function canAdd($user, $to_company) {\n return $user->isAdministrator() || $user->isPeopleManager() || $user->isCompanyManager($to_company);\n }", "public function isAllowedToApplyLoan()\n {\n return $this->getAge() >= 18;\n }", "public function getTargetPersonAllowableValues()\n {\n return [\n self::TARGET_PERSON_JEMAND_ANDEREN,\n self::TARGET_PERSON_MICH,\n ];\n }", "function setPersonTypeAdmin( $value )\n {\n $this->PersonTypeAdmin = $value;\n }", "public function canSetCreatable();", "function opcion__personalizable()\n\t{\n\t\t$proyecto = $this->get_proyecto();\n\n\t\tif (!$proyecto->tiene_clases_extendidas('toba')) {\n\t\t\t$mensaje = \"Debe extender las clases de toba primero con el comando \";\n\t\t\t$mensaje .= \"toba proyecto extender_clases_toba\";\n\t\t\t$this->consola->mensaje($mensaje);\n\t\t\treturn;\n\t\t}\n\t\t$this->hacer_personalizable();\n\t\t$proyecto->generar_autoload($this->consola);\n\n\t\t$mensaje = \"El proyecto ya es personalizable. Ahora debe revincular las clases con el comando toba proyecto revincular\";\n\t\t$this->consola->mensaje($mensaje);\n\t}", "function Legal_init()\n{\n\tpnModSetVar('legal', 'termsofuse', true);\n\tpnModSetVar('legal', 'privacypolicy', true);\n\tpnModSetVar('legal', 'accessibilitystatement', true);\n\tpnModSetVar('legal', 'refundpolicy', true);\n\n\t// Initialisation successful\n return true;\n}", "function firstentity_addperson($form , &$form_state , $personality) {\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => 'name'\n );\n\n $person = new stdClass();\n $person->personality = $personality;\n $person->id = 0;\n\n $form['person'] = array(\n '#type' => 'value',\n '#value' => $person\n );\n // validations requires is element\n $form['personality'] = array(\n '#type' => 'value',\n '#value' => $personality\n );\n // attach form elements for attached fields\n field_attach_form( 'person' , $person , $form , $form_state );\n \n $form['actions'] = array('#type' => 'actions');\n $form['actions']['add'] = array(\n '#type' => 'submit',\n '#value' => 'add'\n );\n return $form;\n}", "function canEdit($user) {\n return $user->isCompanyManager($this);\n }", "function apply_add_profile(&$character, $profile)\n {\n $err = array();\n if (is_valid_pname($profile, $err))\n if ($character->GrantAccessTo($profile))\n return true;\n return false;\n }", "public function __construct($person)\n {\n $this->person = $person;\n }", "public function testCopyleftWhenAuthorshipOptionEnabled()\n {\n $this->service->assignCopyleft($this->author, $this->resource, new Authorship(1));\n\n // use black box approach by testing transformation result\n $doc = new Document();\n $this->resource->build()->transform($doc);\n\n $body = $doc->getEntity('resource')->property('body')->getValue();\n\n $this->assertEquals(\n 1,\n preg_match('~' . $this->author->getFullName() . ', ' . self::AGENCY_NAME . '?\\.$~', strip_tags($body)),\n 'Author doesn\\'t exists in article copyleft'\n );\n }", "public function __construct(User $person)\n \t{\n \t$this->person = $person;\n \t}", "public function addProfessional()\n {\n }", "public function editAccount($person,$oldname);" ]
[ "0.5279523", "0.5055829", "0.48960966", "0.48917207", "0.4855706", "0.48531544", "0.48522052", "0.48257673", "0.48243573", "0.48158532", "0.47968724", "0.47782022", "0.47192824", "0.4697842", "0.46956098", "0.46796346", "0.46668786", "0.46606812", "0.46530122", "0.46436417", "0.46422184", "0.46394396", "0.46339187", "0.46263492", "0.46238962", "0.46231768", "0.46169686", "0.4613477", "0.4609353", "0.4601155" ]
0.5720123
0
Indicates whether this content is family friendly.
public function setIsFamilyFriendly($isFamilyFriendly) { $this->properties['isFamilyFriendly'] = $isFamilyFriendly; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isFamily()\n {\n if (! isset($this->isFamily)) {\n $this->isFamily = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getIsFamilyQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->isFamily;\n }", "protected function getIsFamilyQuery()\n {\n return $this->isFamilyQuery;\n }", "public function isFriend()\n {\n if (! isset($this->isFriend)) {\n $this->isFriend = (($nodeList = $this->getDomXPath($this->getDomDocument())->query($this->getIsFriendQuery())) && $nodeList->length)\n ? $nodeList->item(0)->value\n : null;\n }\n return $this->isFriend;\n }", "public function hasFaction(){\r\n return $this->_has(1);\r\n }", "public function supportsVisibleFederation() {\n \treturn $this->manager->supportsVisibleFederation();\n\t}", "public function getFamily() {}", "public static function has_grandfathered_front_page_meta() {\n\t\treturn ! self::is_enabled_jetpack_seo() && get_option( self::GRANDFATHERED_META_OPTION );\n\t}", "public function providerHasFriends(): bool;", "public function isFriend();", "public function getFamily()\n {\n return $this->family;\n }", "public function isStaff()\n {\n if($this->hasRole(\"ROLE_STAFF\"))\n {\n return true;\n } else {\n return false;\n }\n }", "function getFamily() { return $this->_family; }", "public function hasSex(){\n return $this->_has(2);\n }", "public function hasSex(){\n return $this->_has(2);\n }", "public function providerHasFriends(): bool\n {\n return $this->providerHasFriends;\n }", "public function getFamily()\n {\n return $this->family;\n }", "public function hasSex(){\r\n return $this->_has(6);\r\n }", "public function hasSex(){\n return $this->_has(3);\n }", "function tp_is_person() {\n\t$known = array('msie', 'mozilla', 'firefox', 'safari', 'webkit', 'opera', 'netscape', 'konqueror', 'gecko');\n\n\t$agent = strtolower($_SERVER['HTTP_USER_AGENT']);\n\n\tforeach ($known as $browser) {\n\t\tif (strpos($agent, $browser) !== false) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}", "public function isstaff()\n {\n return $this->hasuser() && $this->user()->isstaff();\n }", "public function isStaff() {\n// return Roles::isStaff($this->role_id);\n if (isset($this->rRole)) {\n return $this->rRole->isStaffRole();\n }\n return false;\n }", "public function is_needed() {\n\t\tif ( ( $this->context->site_represents === 'person' ) || is_author() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isWoman()\n {\n return !$this->isMan();\n }", "public function isStaff()\n {\n return (boolean) $this->_getVar('user_staff');\n }", "public function hasNature() {\n return $this->_has(13);\n }", "public function staff() : bool\n {\n\n return $this->validate() && $this->isStaff;\n\n\n }", "public function hasGender() {\n return $this->_has(1);\n }", "public function hasMotherClubBonus()\n {\n $node = $this->getXml()->getElementsByTagName('MotherClubBonus');\n if ($node->length) {\n return strtolower($node->item(0)->nodeValue) == 'true';\n }\n return false;\n }", "public function hasGarden(){\n return $this->_has(17);\n }", "public function isSupplier(){\n\n\t\t$result = false;\n\n\t\tif ($this->getLevelId() == 4)\n\t\t\t$result = true;\n\n\t\treturn $result;\n\t}" ]
[ "0.69142777", "0.61498505", "0.5772595", "0.56778234", "0.5652514", "0.56293917", "0.56122726", "0.5602396", "0.5571141", "0.5570921", "0.5557934", "0.5499016", "0.5497179", "0.5497179", "0.5492663", "0.54885864", "0.5455753", "0.5443753", "0.5390063", "0.5306887", "0.52856505", "0.5282655", "0.5257933", "0.5255678", "0.52276564", "0.5224413", "0.5224408", "0.5204818", "0.51811004", "0.51724195" ]
0.6241293
1
Show the official website's customer password modification page.
public function get_changepassword(){ if (Auth::check()){ $customer_id = Auth::user()->customer_id; $this->layout->content = View::make('frontend.customers.changepassword') ->with('title', 'Change Password') ->with('customer', Customer::find($customer_id)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display_account_password( ){\n\t\tif( $this->is_page_visible( \"password\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_password.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_password.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_password.php' );\n\t\t}\n\t}", "public function passwordPage() {\n return view('admin.account.change_password');\n }", "public function adminPasswordClient()\n {\n return View ('authpages.adminpasswordclient');\n }", "public function display_account_forgot_password( ){\n\t\tif( $this->is_page_visible( \"forgot_password\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_forgot_password.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_forgot_password.php' );\n\t\t\telse\n\t\t\t\tinclude( WP_PLUGIN_DIR . \"/\" . EC_PLUGIN_DIRECTORY . '/design/layout/' . get_option( 'ec_option_latest_layout' ) . '/ec_account_forgot_password.php' );\n\t\t}\n\t}", "public function editPassword()\n\t{\n\t\t$data['active'] = 9;\n\t\t$this->load->view('skin/front_end/header_company_page_topbar');\n\t\t$this->load->view('skin/front_end/navbar_company_page', $data);\n\t\t$this->load->view('content_front_end/company_password_page');\n\t\t$this->load->view('skin/front_end/footer_company_page');\n\t}", "function change_password_url() {\n return null;\n }", "public function change_password() {\n\t\treturn view( 'provider.profile.change_password' );\n\t}", "public function showpassword()\n\t\t{\n\t\t\tif(Auth::check()) {\n\t\t\t\treturn View::make('updatepassword');\n\t\t\t} else {\n\t\t\t\tApp::abort(403);\n\t\t\t}\n\t\t}", "public function viewChangePassword()\n {\n // header and module properties\n\t\t$this->data['page_module'] = MY_ACCOUNT_MODULE;\n\t\t$this->data['page_title'] = CHANGE_PASSWORD_TITLE;\n\t\t\n // to preserve previous url, check if the validation failed\n if (!Session::has('danger')) {\n $this->setPreviousListURL(strtolower(CHANGE_PASSWORD_TITLE)); \n \n // also remove the user_photo session\n Session::forget('user_photo');\n }\n\n // load the show form\n return View::make('my_account.change_password')->with('data', $this->data);\n }", "public function displayForgotPassword()\n {\n $this->render('forgot-password', ['head'=>['title'=>'Mot de passe oublié', 'meta_description'=>'']]);\n }", "public function changePassowrdShow(){\n return view(\"pages.changepassword\");\n }", "public function showResetPassword() {\n\t\treturn view(\"pages.passwordreset.resetpassword\");\n\t}", "public function actionChangePassword()\n {\n $this->render('changePassword');\n }", "protected function password_reset() {\n return \"password_reset page\";\n }", "public static function option_neopress_password() {\n printf(\n '<input type=\"password\" id=\"neopress_password\" name=\"neopress_password\" value=\"%s\" />',\n get_option('neopress_password')\n );\n }", "public function change_password()\n\t{\n\t \n\t \n \t\t/* Breadcrumb Setup Start */\n\t\t\n\t\t$link = breadcrumb();\n\t\t\n\t\t$data['breadcrumb'] = $link;\n\t\t\n\t\t/* Breadcrumb Setup End */\n\t\n\t\t$data['page_content']\t=\t$this->load->view('changepwd',$data,true);\n\t\t$this->load->view('page_layout',$data);\n\t}", "public function showEditPassword()\n {\n return view('pages.settings.password.index');\n }", "protected function _toHtml()\n {\n if (!$this->_authorization->isAllowed('Actiview_SetCustomerPassword::set_password')) {\n return;\n }\n\n return parent::_toHtml();\n }", "public function changePassword()\n {\n $breadCrumb = $this->userEngine->breadcrumbGenerate('change-password');\n\n return $this->loadPublicView('user.change-password', $breadCrumb['data']);\n }", "public function changePassword()\n {\n if( ! Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $user = User::find(Session::getCurrentUserID());\n\n View::make('templates/front/change-password.php',array());\n }", "private function update_password_content()\n\t{\n\t\treturn $this->load->view('user_account/partials/user_password_edit', FALSE, TRUE);\n\t}", "public function displayResetPassword()\n {\n $this->render('reset-password', ['head'=>['title'=>'Réinitialisation de votre mot de passe', 'meta_description'=>'']]);\n }", "function forgot_password() {\n $datos['titulo'] = \"Restablecer Contraseña\";\n $this->render_page('usuarios/forgot_password', $datos);\n }", "function changepassword() \n\t{\n // on the action being rendered\n $this->viewData['navigationPath'] = $this->getNavigationPath('users');\n $this->viewData['hash'] =User::userid();\n // Render the action with template\n $this->renderWithTemplate('users/changepassword', 'AdminPageBaseTemplate');\n }", "public function showPasswordForm()\n {\n return view('parameters.users.change_password');\n }", "public function password_reset_builder_page() {\n\t\tif ( isset( $_GET['action'] ) && $_GET['action'] == 'edit' && wp_verify_nonce( $_GET['_wpnonce'], 'pp_edit_pass' ) ) {\n\n\t\t\t// save password reset edit. note: method called before the static edit page\n\t\t\t// so generated error will display at the top of page\n\t\t\t$this->save_add_edit_password_reset_builder( 'edit', absint( $_GET['password-reset'] ) );\n\n\t\t\t$this->password_reset_builder_edit_page();\n\n\t\t}\n\n\t\telseif ( isset( $_GET['password-reset-builder'] ) && $_GET['password-reset-builder'] == 'new' ) {\n\n\t\t\t$this->save_add_edit_password_reset_builder( 'add' );\n\n\t\t\t$this->password_reset_builder_add_page();\n\t\t} // if we are not in edit state, display the table\n\t\telse {\n\t\t\tself::password_reset_builder_index_page();\n\t\t}\n\t}", "public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-customer-edit-page.php';\n }", "function change_password_url() {\n return new moodle_url($this->config->changepasswordurl);\n }", "public function change_password()\n {\n return view('backend.profile.change-password');\n }", "public function editPasswordAdmin()\n {\t\n \treturn view('setting.edit-password-admin');\n }" ]
[ "0.7035958", "0.69246453", "0.6820135", "0.6764243", "0.670467", "0.66100836", "0.6597302", "0.65646", "0.65638286", "0.6552018", "0.6527928", "0.65043706", "0.6493847", "0.6493477", "0.64900535", "0.6476638", "0.6456349", "0.64230424", "0.64101946", "0.63956374", "0.6385962", "0.63697004", "0.63448477", "0.6337372", "0.6320483", "0.6310104", "0.6297149", "0.6296227", "0.6294495", "0.62912095" ]
0.70057374
1
Validate and update the customer password.
public function put_updatepassword(){ $customer_id = Input::get('customer_id'); $customer = Customer::find($customer_id); $validation = Customer::validate_changepassword(); if($validation->fails()) { return Redirect::back() ->withErrors($validation); } else { if (Hash::check(Input::get('customer_old_password'), $customer->customer_password)) { Customer::find($customer_id)->update(array( 'customer_password'=>Hash::make(Input::get('customer_new_password')), )); return Redirect::route('customer_profile') ->with('message', 'The password was updated successfully!'); } else { return Redirect::route('change_customer_profile_password') ->with('error-message', 'The old password inputted is not correct!'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function c_changepass(){\n\t\t\n\t\t$this->getC();\n\t\t$this->layout = false;\n\t\tif ($this->request->is('post')) {\n\t\t\t$customers = $this->Customers->get($this->request->session()->read('id'), [\n\t\t\t\t'contain' => []\n\t\t\t]);\n\t\t\t$pass = $this->request->data['data']['Customers']['oldpassword'];\n\t\t\t$new = $this->request->data['data']['Customers']['password'];\n\t\t\tif(!empty($customers)){\n\t\t\t\n\t\t\t\tif($this->request->data['data']['Customers']['cpassword']==$this->request->data['data']['Customers']['oldpassword']){\n\t\t\t\t\t$this->request->data['password']=$new;\n\t\t\t\t\t$customer = $this->Customers->patchEntity($customers, $this->request->data);\n\t\t\t\t\t\n\t\t\t\t\tif ($this->Customers->save($customer)) {\n\t\t\t\t\t\t$this->Flash->success('Password has been successfully updated.');\n\t\t\t\t\t\treturn $this->redirect(['action' => 'c_index']);\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$this->Flash->success('Wrong Password. Please try again.');\n\t\t\t\t\treturn $this->redirect(['action' => 'c_index']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->Flash->success('Wrong Password. Please try again.');\n\t\t\t\treturn $this->redirect(['action' => 'c_index']);\n\t\t\t}\n\t\t}\n\t}", "function update_password()\n {\n }", "function update_paypassword()\n {\n }", "protected function changePassword() {}", "public function testUpdatePasswordNotGiven(): void { }", "public function updateAccountPassword($customerId, $data) {\n\t\t$updateData = array(\n\t\t\t\t'customer_password' => password_hash($data['newPasswordParam'], PASSWORD_DEFAULT)\n\t\t);\n\t\t$this->db->where('customer_id', $customerId);\n\t\t$this->db->update('customer', $updateData);\n\t}", "public function cbc_changepassword() {\n\n try {\n\t\t\n\t\t\t\t $username =$this->Session->read('Auth.Member.vc_username');\n\t\t\t\t$newpassword = $this->data['Customer']['vc_password'];\n\t\t\t\tlist( $selectedType, $type, $selectList ) = $this->getRFATypeDetail($this->Session->read('Auth.Member.vc_comp_code'));\n\n if (!empty($this->data) && $this->RequestHandler->isPost()) {\n\n $this->Customer->set($this->data);\n\n /**************** Use this before any validation *********************************** */\n\n $setValidates = array(\n 'vc_old_password',\n 'vc_password',\n 'vc_comp_code',\n 'vc_confirm_password');\n\n /** ************************************************************************************* */\n if ( $this->Customer->validates(array('fieldList' => $setValidates)) ) {\n\n\n $this->Member->validate = null;\n\t\t\t\t\t\n $updateData['Member']['vc_password'] = $this->Auth->password(trim($this->data['Customer']['vc_password']));\n\n $updateData['Member']['dt_user_modified'] = date('Y-m-d H:i:s');\n\n $updateData['Member']['vc_user_no'] = $this->Session->read('Auth.Member.vc_user_no');\n\n if ($this->Member->save($updateData)) {\n\n $this->data = NUll;\n\n $this->Session->setFlash('Your password has been changed successfully !!', 'success');\n\t\t\t\t\t\t \n\t\t\t\t\t\t /********************************** Email shoot **********************************/\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t$this->Email->from = $this->AdminName . '<' . $this->AdminEmailID . '>';\n\n\t\t\t\t\t\t\t\t$this->Email->to = trim($this->Session->read('Auth.Member.vc_email_id'));\n\n\t\t\t\t\t\t\t\t$this->Email->subject = strtoupper($selectedType) . \" Password Changed \";\n\n\t\t\t\t\t\t\t\t$this->Email->template = 'registration';\n\n\t\t\t\t\t\t\t\t$this->Email->sendAs = 'html';\n\n\t\t\t\t\t\t\t\t$this->set('name', ucfirst(trim($this->Session->read('Auth.Member.vc_user_firstname'))) . ' ' . ucfirst(trim($this->Session->read('Auth.Member.vc_user_lastname'))));\n\n\t\t\t\t\t\t\t\t$this->Email->delivery = 'smtp';\n\n\t\t\t\t\t\t\t\t$mesage = \" You have recently changed password on RFA portal ( \".strtoupper($selectedType).\" Section ). Please use the credentials mentioned below to login : \";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$mesage .= \"<br> Username : \".trim($username);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$mesage .= \"<br> Password : \".trim($newpassword);\n\n\t\t\t\t\t\t\t\t$this->Email->send($mesage);\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/******************************** End *********************************/\n\n\n $this->redirect($this->referer());\n\t\t\t\t\t\t\n } else {\n\n $this->data = NUll;\n\n $this->Session->setFlash('Your password could not be changed, please try later', 'error');\n }\n\t\t\t\t\t\n }\n\t\t\t\t\n }\n\t\t\t\n $this->set('title_for_layout',\"Change Password \");\n\t\t\t\n\t\t\t\n } catch (Exception $e) {\n\n echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\n exit;\n }\n }", "public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }", "public function setPassword($newPassword);", "public function password(){\r\n\r\n\t\t\t$user_info = Helper_User::get_user_by_id($this->user_id);\r\n\r\n\t\t\tif($_POST){\r\n\r\n\t\t\t\t$formdata = form_post_data(array(\"old_password\", \"new_password\", \"repeat_new_password\"));\r\n\t\t\t\t\r\n\t\t\t\t$old_password = trim($formdata[\"old_password\"]);\r\n\t\t\t\t$new_password = trim($formdata[\"new_password\"]);\r\n\t\t\t\t$repeat_new_password = trim($formdata[\"repeat_new_password\"]);\r\n\r\n\t\t\t\t$error_flag = false;\r\n\r\n\t\t\t\tif(strlen($old_password) <= 0){\r\n\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the old password\");\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif(strlen($new_password) > 0 && strlen($repeat_new_password) > 0){\r\n\t\t\t\t\t\t// if both fields are not empty\r\n\r\n\t\t\t\t\t\tif(strlen($new_password) < 6){\r\n\t\t\t\t\t\t\t// the password cannot be less than 6 characters\r\n\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\tTemplate::notify(\"error\", \"Too short password. Password must be at least 6 characters long.\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// now compare the two new passwords\r\n\t\t\t\t\t\t\tif(strcmp($new_password, $repeat_new_password) !== 0){\r\n\t\t\t\t\t\t\t\t// both passwords are not same\r\n\t\t\t\t\t\t\t\t$error_flag = true;\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"error\", \"New Passwords do not match. Please try again.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Please enter the new password\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(!$error_flag){\r\n\t\t\t\t\t// means there are no any errors\r\n\t\t\t\t\t// get the current user account from the database\r\n\t\t\t\t\t// if the old password matches with the one that the user entered\r\n\t\t\t\t\t// change the password, else throw an error\r\n\r\n\t\t\t\t\t$old_password_hash = Config::hash($old_password);\r\n\r\n\t\t\t\t\tif(strcmp($old_password_hash, trim($user_info->password)) === 0){\r\n\r\n\t\t\t\t\t\t\tif($this->change_password($new_password, $user_info)){\r\n\t\t\t\t\t\t\t\tTemplate::notify(\"success\", \"Password changed successfully\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tredirect(Config::url(\"account\"));\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tTemplate::notify(\"error\", \"Wrong Old Password. Please try again\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tConfig::set(\"active_link\", \"password\");\r\n\t\t\tConfig::set(\"page_title\", \"Change Account Password\");\r\n\r\n\t\t\t$view_data[\"user_info\"] = $user_info;\r\n\r\n\t\t\tTemplate::setvar(\"page\", \"account/password\");\r\n\t\t\tTemplate::set(\"account/template\", $view_data);\r\n\t\t}", "public function password()\n {\n $this->isUser();\n\n $this->data['noCabinetOrAdmin'] = true;\n\n if ($_POST) {\n\n if (!$_POST['old-password'] && !$_POST['new-password']) {\n\n $userModel = new UserModel();\n\n $validateResult = $userModel->validate($_POST);\n\n if ($validateResult === true) {\n\n $checkPassword = $userModel->checkOldPassword($_POST['old-password']);\n\n if ($checkPassword) {\n\n if ($userModel->refreshPassword($_POST)) {\n\n $this->data['success'] = 'Пароль успешно изменен';\n\n } else {\n\n $this->data['warning'] = 'Произошла ошибка';\n }\n\n } else {\n\n $this->data['warning'] = 'Старый пароль введен не правильно';\n }\n\n } else {\n\n $this->data['warning'] = $validateResult;\n }\n\n } else {\n\n $this->data['warning'] = 'Все поля должны быть заполнены';\n }\n }\n\n $this->render('password');\n }", "public function testUpdateCPasswordNotGiven(): void { }", "function update_pass() {\n\n global $conn;\n\n $stmt = $conn->prepare('\n UPDATE Customer SET Pass = :Pass\n WHERE Customer_id = :Customer_id\n ');\n\n $encrypted_pass = sha1($this->Pass);\n\n $stmt->bindParam(':Pass', $encrypted_pass);\n $stmt->bindParam(':Customer_id', $this->Customer_id);\n\n return $stmt->execute();\n }", "function savePassword()\n {\n // get real current password from database\n $realPassword = null;\n $dataReturn = $this->model->khachhang->getCustomerPassword($_SESSION['idUser']);\n if (!empty($dataReturn)) {\n $realPassword = $dataReturn['matKhau'];\n }\n // data user enter in form change password\n $currentPasswordText = isset($_POST['customer_password_current']) ? $_POST['customer_password_current'] : '';\n // kiem tra mat khau hien tai nhap vao co giong voi mat khau trong CSDL la $realPassword hay khong ?\n if (!password_verify(addslashes($currentPasswordText . $_SESSION['email']), $realPassword)) {\n // neu khong trung khop\n $_SESSION['error-changePassCustomer'] = 'Mật khẩu hiện tại không đúng !';\n redirect('user/changePassword');\n } else {\n $newPasswordText = isset($_POST['customer_password_new']) ? $_POST['customer_password_new'] : '';\n $resultUpdate = $this->model->khachhang->updateCustomerPassword($_SESSION['idUser'], $newPasswordText);\n if ($resultUpdate) {\n // neu luu mat khau moi thanh cong\n $_SESSION['success-changePassCustomer'] = 'Đổi mật khẩu mới thành công !';\n redirect('user/index');\n } else {\n\n }\n }\n }", "public function setPassword($newPassword){\n\t}", "public function validatePassword()\n {\n /* @var $user User */\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->oldPassword)) {\n $this->addError('oldPassword', 'Incorrect old password.');\n }\n }", "public function setPassword($value);", "public function updateCustomerPassword()\n {\n $sess_array = $this->session->userdata('sess_array');\n $party_id = $sess_array['party_id'];\n\n $model_data = array(\n 'currentpwd' => $this->input->post('currentpwd'),\n 'newpwd' => $this->input->post('newpwd'),\n 'confirmnewpwd' => $this->input->post('confirmnewpwd'),\n );\n\n if ($model_data['newpwd'] != $model_data['confirmnewpwd']) {\n $this->session->set_flashdata('error_msg', 'A senha e a confirmação da senha não correspondem');\n redirect('home/customer_dashboard?profile_tab=change_password');\n }\n\n $state = $this->party_helper->checkPassword($party_id,$model_data['currentpwd']);\n if(!$state)\n {\n $this->session->set_flashdata('error_msg', 'Digite uma senha atual válida');\n redirect('home/customer_dashboard?profile_tab=change_password');\n }\n\n $state1 = $this->party_helper->checkPassword($party_id,$model_data['newpwd']);\n if($state1)\n {\n $this->session->set_flashdata('error_msg', 'A senha e a nova senha não podem ser iguais');\n redirect('home/customer_dashboard?profile_tab=change_password');\n }\n\n $this->load->model('authentication/authentication_helper');\n $status = $this->authentication_helper->changepassword($model_data);\n\n if ($status == 1) {\n $this->session->set_flashdata('success_msg', 'Senha alterada com sucesso');\n $this->session->unset_userdata('sess_array');\n redirect('home/Entrar');\n }\n }", "public function validatePassword()\n {\n if (!$this->hasErrors()) {\n if (!$this->user->validatePassword($this->old_password)) {\n $this->addError('old_password', 'Incorrect email or password.');\n }\n }\n }", "public function validatePassword() {\n if (!$this->hasErrors()) {\n $user = Yii::$app->user->identity;\n if (!$user || !$user->validatePassword($this->password_old)) {\n // $this->addError('password_old', 'Incorrect current password.');\n }\n }\n }", "public function updatePassword()\n {\n $user = User::find(Database::connection(), $_SESSION['id']);\n\n // Update password\n return $user->updatePassword(Database::connection(), $_POST['password']);\n }", "public function post_password()\n\t{\n\t\t$input = Input::all();\n\t\t$rules = array(\n\t\t\t'current_password' => array(\n\t\t\t\t'required',\n\t\t\t),\n\t\t\t'new_password' => array(\n\t\t\t\t'required',\n\t\t\t\t'different:current_password',\n\t\t\t),\n\t\t\t'confirm_password' => array(\n\t\t\t\t'same:new_password',\n\t\t\t),\n\t\t);\n\n\t\tif (Auth::user()->id !== $input['id']) return Response::error('500');\n\n\t\t$val = Validator::make($input, $rules);\n\n\t\tif ($val->fails())\n\t\t{\n\t\t\treturn Redirect::to(handles('orchestra::account/password'))\n\t\t\t\t\t->with_input()\n\t\t\t\t\t->with_errors($val);\n\t\t}\n\n\t\t$msg = Messages::make();\n\t\t$user = Auth::user();\n\n\t\tif (Hash::check($input['current_password'], $user->password))\n\t\t{\n\t\t\t$user->password = $input['new_password'];\n\n\t\t\ttry\n\t\t\t{\n\t\t\t\tDB::transaction(function () use ($user)\n\t\t\t\t{\n\t\t\t\t\t$user->save();\n\t\t\t\t});\n\n\t\t\t\t$msg->add('success', __('orchestra::response.account.password.update'));\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$msg->add('error', __('orchestra::response.db-failed'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg->add('error', __('orchestra::response.account.password.invalid'));\n\t\t}\n\n\t\treturn Redirect::to(handles('orchestra::account/password'));\n\t}", "function update_buyer_password() {\n\n\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t$this->form_validation->set_rules('password', 'Password', 'required|min_length[4]|max_length[20]|matches[password_confirmation]');\n\t\t$this->form_validation->set_rules('password_confirmation', 'Password Confirmation', 'required');\n\t\t\n\t if ($this->form_validation->run() == true) {\n\t \t \n\t\t $password = $this->input->post('password');\n\t\t $user_id = $this->input->post('user_id');\n\n\t\t\tif ($this->ion_auth->update_buyer_password($password,$user_id)) {\n\t\t\t\tredirect('site/buyer_update_success');\n\t\t\t} else {\n\t\t\t\tredirect('site/account_management_buyer');\n\t\t\t}\n\n\t\t} else {\n\t\t\t\n\t\t\t$user_id = $this->session->userdata('user_id');\n\t\t\t$this->load->model('data_model');\n\t\t\t$data['buyers_account_data'] = $this->data_model->get_buyers_account_data($user_id);\n\t\t\t$this->load->view('account_management_buyer_view', $data);\n\t }\n}", "public function changePass(Request $request, $id)\n {\n //\n $data = customer::where('Customer_ID', $id)->get();\n $validatedPass = $request->Customer_Passwordo;\n $length = strlen($request->Customer_Password);\n foreach($data as $data1){\n $data2 = $data1->Customer_Password;\n }\n //Verify the password\n $verify = password_verify($validatedPass,$data2);\n if ( $verify) {\n if($length>=8){\n //Encrypt the password\n $validatedData = Hash::make($request->Customer_Password);\n \n DB::select(\"UPDATE customers set Customer_Password = '$validatedData' where Customer_ID = ?\",[$id]);\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"Password is successful updated.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.CustomerProfileInterface', compact(\"data\"));\n }\n else {\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"Minimum password length of eight (8) is required. \";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.ChangePasswordInterface', compact(\"data\"));\n }\n \n } \n else {\n $data = customer::where('Customer_ID', $id)->get();\n $message = \"Old password incorrect please try again.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.ChangePasswordInterface', compact(\"data\"));\n }\n }", "protected function afterValidate()\n {\n \tparent::afterValidate();\n \tif(!$this->hasErrors())\n \t\t$this->password = $this->hashPassword($this->password);\n }", "public function setPassword(){\n\t}", "public static function password() {\n if ( !isset($_POST['email']) ) {\n return;\n }\n \n $password = substr(Helper::hash(rand(0,16^32).$_POST['email']),0,12);\n \n $result = Database::checkUser($_POST['email']);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Unbekannter Benutzer!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n return;\n }\n \n $id = $result[0]['id'];\n $passwordold = $result[0]['password'];\n \n $pw = Helper::hash($password.$_POST['email']);\n \n $success = Database::setPassword($id,$passwordold,$pw);\n if ( $success !== false ) {\n self::passwordMail($_POST['email'],$password);\n self::setError('Ein neues Passwort wurde dir zugeschickt!<br>');\n } else {\n self::setError('Schwerer Datenbankfehler, bitte kontaktiere einen Administrator!<br>');\n }\n }", "protected function _updatePassword() {\n\t\tif(!check($this->_userid)) return;\n\t\tif(!check($this->_username)) return;\n\t\tif(!check($this->_newPassword)) return;\n\t\tif($this->_md5Enabled) {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'username' => $this->_username,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = [dbo].[fn_md5](:newpassword, :username) WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t} else {\n\t\t\t$data = array(\n\t\t\t\t'userid' => $this->_userid,\n\t\t\t\t'newpassword' => $this->_newPassword\n\t\t\t);\n\t\t\t$query = \"UPDATE \"._TBL_MI_.\" SET \"._CLMN_PASSWD_.\" = :newpassword WHERE \"._CLMN_MEMBID_.\" = :userid\";\n\t\t}\n\t\t\n\t\t$result = $this->db->query($query, $data);\n\t\tif(!$result) return;\n\t\t\n\t\treturn true;\n\t}", "function passwd($pass,$newpass){\n\t\tif($this->ctrl == SESSION_CTRL_CUSTOMER){\n\t\t\t$pass = call_user_func(esnc_passwd_encode,$pass);\n\t\t\t$newpass = call_user_func(esnc_passwd_encode,$newpass);\n\t\t\t$sql = \"UPDATE `\".DB_TABLE_PREFIX.\"customer` SET `password` = '{$newpass}' WHERE `id`={$this->id} AND `email`='{$this->email}' AND `password`='{$pass}'\";\n\t\t\tmysql_query($sql);\n\t\t\treturn (bool)(mysql_affected_rows());\n\t\t}\n\t}", "public function password_update(Request $request)\n {\n if(Setting::get('demo_mode', 0) == 1) {\n return back()->with('flash_error','Disabled for demo purposes! Please contact us at [email protected]');\n }\n\n $this->validate($request,[\n 'old_password' => 'required',\n 'password' => 'required|min:6|confirmed',\n ]);\n\n try {\n\n $Account = Account::find(Auth::guard('account')->user()->id);\n\n if(password_verify($request->old_password, $Account->password))\n {\n $Account->password = bcrypt($request->password);\n $Account->save();\n\n return redirect()->back()->with('flash_success','Password Updated');\n }\n } catch (Exception $e) {\n return back()->with('flash_error','Something Went Wrong!');\n }\n }" ]
[ "0.71529937", "0.7088309", "0.7068977", "0.6989629", "0.69753814", "0.6903448", "0.68893903", "0.6887201", "0.68864095", "0.68816286", "0.6829387", "0.67919093", "0.675894", "0.6707644", "0.66502804", "0.66418254", "0.6631461", "0.66262984", "0.66259164", "0.6619807", "0.6583234", "0.65633595", "0.6560287", "0.6546015", "0.651559", "0.64965737", "0.6485137", "0.64823186", "0.6478198", "0.6471946" ]
0.7194367
0
Enable all fields in the "Fields" subdirectory
function fields() { foreach(glob(ALERTS_PLUGIN_DIR . 'lib/fields/*.php') as $field) { include($field); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_fields() {\n\n\t\t$this->fields = Pngx__Meta__Fields::get_fields();\n\t}", "function install_fields() {\n $db = DB::getInstance();\n if(!$db->query(file_get_contents(CORE_INSTALLER_FILES_PATH.'/db/fields.sql'))->error()) {\n return true;\n }\n else {\n System::addMessage('error', rt('An error occurred during the creation of the default content type fields'));\n }\n return false;\n}", "public function useAllFields() {\n $this->__onlyFields = array();\n }", "public function settings_fields() {\n\t\t$this->create_sections();\n\t\t$this->create_fields();\n\t\tregister_setting( $this->token, $this->token, array( $this, 'validate_fields' ) );\n\t}", "public function init_form_fields() {\n\t\t$this->form_fields = include( 'settings-xendit.php' );\n\t}", "protected function renderFields(): void\n {\n foreach ($this->getFields() as $field) {\n $fieldId = $this->getFieldId($field->getSlug());\n $value = $this->wpOptions->getByPage($this, $field->getSlug());\n\n $field->renderConfig($fieldId, $value);\n }\n }", "private function loadFields(){\n\t\t$this->fields = $this->wpdb->get_results($this->wpdb->prepare(\"\n\t\t\tSELECT\n\t\t\t\t`field`.`id` \t\t\t'field_id',\n\t\t\t\t`type`.`name` \t\t\t'type',\n\t\t\t\t`field`.`name`\t\t\t'name',\n\t\t\t\t`field`.`label`\t\t\t'label',\n\t\t\t\t`field`.`default`\t\t'default',\n\t\t\t\t`field`.`required`\t\t'required',\n\t\t\t\t`field`.`depends_id`\t'depends_id',\n\t\t\t\t`field`.`depends_value`\t'depends_value',\n\t\t\t\t`field`.`placeholder`\t'placeholder'\n\t\t\tFROM `mark_reg_fields` `field`\n\t\t\tLEFT JOIN `mark_reg_field_types` `type` ON `type`.`id` = `field`.`type_id`\n\t\t\tWHERE\n\t\t\t\t`field`.`enabled` = 1\n\t\t\t\tAND `field`.`form_id` = %d\n\t\t\t\tAND `field`.`backend_only` = 0\n\t\t\tORDER BY\n\t\t\t\t`field`.`order`\n\t\t\", $this->form_id));\n\t}", "function init_form_fields() {\n\n \tinclude ( SUMO_SAGEPLUGINPATH . 'includes/sagepay-form-admin.php' );\n\n }", "public function include_fields()\n {\n }", "public function init_form_fields() {\n\t\t$this->form_fields = include( 'data/data-settings.php' );\n\t}", "function init_form_fields() {\n\t\t\t\n\t\t\t$abs_path = str_replace('/wp-admin', '', getcwd());\n\t\t\n\t\t\t$this->form_fields = array(\n\t\t\t\t'enabled' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Activer/Désactiver:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'checkbox', \n\t\t\t\t\t\t\t\t'label' => __( 'Activer le module de paiement Atos.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => 'yes'\n\t\t\t\t\t\t\t), \n\t\t\t\t'title' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Nom:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Intitulé affiché à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __( 'Paiement sécurisé par carte bancaire', 'woothemes' )\n\t\t\t\t\t\t\t),\n\t\t\t\t'description' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Description:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Description affichée à l\\'utilisateur lors de la commande.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Payez en toute sécurité grâce à notre système de paiement Atos.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'merchant_id' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Identifiant commerçant:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Identifiant commerçant fourni par votre banque. Ex: 014295303911112', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('014295303911112', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'pathfile' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier pathfile:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier de configuration \"pathfile\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/param/pathfile', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'request_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier request:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"request\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/request', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'response_file' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Chemin du fichier response:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Chemin absolu vers le fichier exécutable \"response\" du kit de paiement, sans le / final', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __($abs_path . '/atos/bin/response', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'payment_means' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Cartes acceptées:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Moyens de paiement acceptés. Ex pour CB, Visa et Mastercard: CB,2,VISA,2,MASTERCARD,2', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('CB,2,VISA,2,MASTERCARD,2', 'woothemes')\n\t\t\t\t\t\t\t),\n\n\t\t\t\t'currency_code' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Devise:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'select', \n\t\t\t\t\t\t\t\t'description' => __( 'Veuillez sélectionner une devise pour les paiemenents.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => '978',\n\t\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'840' => 'USD',\n\t\t\t\t\t\t\t\t\t'978' => 'EUR',\n\t\t\t\t\t\t\t\t\t'124' => 'CAD',\n\t\t\t\t\t\t\t\t\t'392' => 'JPY',\n\t\t\t\t\t\t\t\t\t'826' => 'GBP',\n\t\t\t\t\t\t\t\t\t'036' => 'AUD' \n\t\t\t\t\t\t\t\t ) \t\t\t\t\t\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\n\t\t\t\t'paybtn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton qui redirige vers le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Régler la commande.', 'woothemes')\n\t\t\t\t\t\t\t),\n\t\t\t\t'paymsg' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Message page de paiement:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'textarea', \n\t\t\t\t\t\t\t\t'description' => __( 'Message affiché sur la page de commande validée, avant passage sur le terminal de paiement.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Merci pour votre commande. Veuillez cliquer sur le bouton ci-dessous pour effectuer le règlement.', 'woothemes')\n\t\t\t\t\t\t\t)\n\t\t\t\t/*'payreturn' => array(\n\t\t\t\t\t\t\t\t'title' => __( 'Texte bouton retour:', 'woothemes' ), \n\t\t\t\t\t\t\t\t'type' => 'text', \n\t\t\t\t\t\t\t\t'description' => __( 'Texte affiché sur le bouton de retour ver la boutique.', 'woothemes' ), \n\t\t\t\t\t\t\t\t'default' => __('Retour', 'woothemes')\n\t\t\t\t\t\t\t)*/\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t);\n\t\t\n\t\t}", "public static function loadPlugins()\n\t{\n\t\tforeach (JFolder::listFolderTree(JPATH_PLUGINS . '/fields', '.', 1) as $folder)\n\t\t{\n\t\t\tif (!JPluginHelper::isEnabled('fields', $folder['name']))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tJFactory::getLanguage()->load('plg_fields_' . strtolower($folder['name']), JPATH_ADMINISTRATOR);\n\t\t\tJFactory::getLanguage()->load('plg_fields_' . strtolower($folder['name']), $folder['fullname']);\n\t\t\tJFormHelper::addFieldPath($folder['fullname'] . '/fields');\n\t\t}\n\t}", "public function setFields($fields = []);", "private function setFields(): void\n {\n $fields = acf_get_block_fields(array('name' => 'acf/' . strtolower(str_replace('-', '', $this->getId()))));\n if (!empty($fields)) {\n if ('data' === $fields[0]['name']) {\n $parsedFields = $this->parseField($fields[0]);\n if (!empty($parsedFields['data'])) {\n $this->fields = $parsedFields['data'];\n }\n }\n }\n }", "public function configureFields(string $pageName): iterable\n {\n $entityId = '';\n if (Crud::PAGE_INDEX !== $pageName && Crud::PAGE_NEW !== $pageName) {\n /** @var Ulid $entityId */\n $entityId = $this->adminContextProvider->getContext()->getEntity()->getInstance()->getId();\n $entityId = $entityId->toBinary();\n }\n\n //# FIELDS INITIALIZATION:\n [$id, $createdAt, $updatedAt] = CrudDefaults::getAdminFields();\n $lvl = IntegerField::new('level')\n ->setLabel('Level')\n ->setFormTypeOption('disabled', 'disabled')\n ;\n $left = IntegerField::new('left')\n ->setLabel('Left')\n ->setFormTypeOption('disabled', 'disabled')\n ;\n $right = IntegerField::new('right')\n ->setLabel('Right')\n ->setFormTypeOption('disabled', 'disabled')\n ;\n $root = AssociationField::new('root')\n ->setCrudController(__CLASS__)\n ->setLabel('Root')\n ->setFormTypeOption('disabled', 'disabled')\n ;\n $name = TextField::new('name')\n ->setLabel('Имя')\n ;\n $project = AssociationField::new('project')\n ->setCrudController(ProjectCrudController::class)\n ->autocomplete()\n ->setLabel('Проект')\n ->setRequired(true)\n ;\n $keywords = AssociationField::new('keywords')\n ->setCrudController(KeywordCrudController::class)\n // ->autocomplete()\n ->setLabel('Ключи')\n ->setCustomOption('by_reference', false)\n ;\n // $subgroupsOnEdit = AssociationField::new('subgroups')\n // ->setCrudController(__CLASS__)\n // // ->autocomplete()\n // ->setLabel('Включает подгруппы')\n // ->setFormTypeOptions([\n // 'query_builder' => function (KeywordGroupRepository $repo) use ($entityId) {\n // return $repo->findAllExcludingAllSub($entityId);\n // },\n // ])\n // ->setHelp('Указывайте только дочернюю группу, без полной вложенности')\n// ->setQueryBuilder()\n ;\n // $supergroupOnEdit = AssociationField::new('supergroup')\n // ->setCrudController(__CLASS__)\n // // ->autocomplete()\n // ->setLabel('Входит в группы')\n // ->setFormTypeOptions([\n // 'query_builder' => function (KeywordGroupRepository $repo) use ($entityId) {\n // return $repo->findAllExcludingAllSuper($entityId);\n // },\n // ])\n // ->setHelp('Указывайте только родительскую группу, без полной вложенности')\n// ->setFormTypeOption('disabled', 'disabled')\n ;\n $subgroups = AssociationField::new('subgroups')\n ->setCrudController(__CLASS__)\n ->setLabel('Включает подгруппы')\n ;\n $supergroup = AssociationField::new('supergroup')\n ->setCrudController(__CLASS__)\n // ->autocomplete()\n ->setLabel('Родительская группа')\n ;\n // $nestingLvl = IntegerField::new('nestingLvl')\n // ->setLabel('Уровень вложенности группы')\n // ->setFormTypeOption('disabled', 'disabled')\n // ;\n // $isExcludedAsSub = BooleanField::new('isExcludedAsSub')\n // ->setLabel('Запретить как подгруппу')\n // ->setHelp('Исключить из списка при добавлении подгруппы в группах ключей')\n // ;\n\n //# FIELDS GROUPS (ORDER: index, new, details, form):\n $adminFieldsOnDetail = [\n FormField::addPanel('Информация для администратора'),\n $id,\n $root,\n // $depth,\n $createdAt,\n $updatedAt,\n ];\n $commonFormFields = [\n $name,\n $project,\n $keywords,\n $supergroup,\n $subgroups,\n ];\n //# FIELDS DISPLAY RULES PER PAGE NAME:\n if (Crud::PAGE_INDEX === $pageName) {\n return [\n ...$commonFormFields,\n // $isExcludedAsSub->setLabel('Корневая'),\n // $nestingLvl->setLabel('Вложенность'),\n $root,\n $createdAt,\n $updatedAt,\n ];\n }\n if (Crud::PAGE_NEW === $pageName) {\n return [\n ...$commonFormFields,\n // $isExcludedAsSub,\n ];\n }\n if (Crud::PAGE_EDIT === $pageName) {\n return [\n // $subgroupsOnEdit,\n // $supergroupOnEdit,\n // $name,\n // $project,\n // $keywords,\n ...$commonFormFields,\n // $isExcludedAsSub,\n $root,\n $lvl,\n $left,\n $right,\n ...$adminFieldsOnDetail,\n ];\n }\n\n return [\n ...$commonFormFields,\n // $isExcludedAsSub,\n $root,\n $lvl,\n $left,\n $right,\n ...$adminFieldsOnDetail,\n ];\n }", "public function field_groups() {\n\t\tinclude_once KCN_PATH . '/includes/fields/acf-sample-options.php';\n\t}", "protected function _updatefields() {}", "private function registerUsableFields(): void\n {\n $this->attributeList = $this->filterSystemControlFields(\n \\get_object_vars($this)\n );\n }", "function getEnableFieldsToBeIgnored() ;", "public function init_fields() {\n\t\t// Override this function in your class and assign the array of sections to $this->fields.\n\t\t_e( 'Override init_fields() in your class.', '{plugin_jump_starter_textdomain}' );\n\t}", "public function defineFormFields()\n {\n return 'fields.yaml';\n }", "public function addReadOnlyFields(array $fields)\n {\n foreach($fields as $fieldName)\n {\n $this->_handleReadOnlyFields($fieldName);\n }\n }", "protected abstract function setFields();", "public function register_all()\n {\n foreach (self::$available_fields as $available_field) {\n $this->register_field($available_field);\n }\n }", "private function setFields($fields)\n\t{\n\n\t\tforeach ($fields as $field) {\n\t\t\tif (!\\vtlib\\Functions::getModuleId($field[28]) || $this->checkFieldExists($field[28], $field[2], $field[3])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$moduleInstance = \\vtlib\\Module::getInstance($field[28]);\n\t\t\t$blockInstance = \\vtlib\\Block::getInstance($field[25], $moduleInstance);\n\t\t\tif (!$blockInstance) {\n\t\t\t\tApp\\Log::error(\"No block found to create a field, you will need to create a field manually. Module: {$field[28]}, field name: {$field[6]}, field label: {$field[7]}\");\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$fieldInstance = new \\vtlib\\Field();\n\t\t\t$fieldInstance->column = $field[2];\n\t\t\t$fieldInstance->name = $field[6];\n\t\t\t$fieldInstance->label = $field[7];\n\t\t\t$fieldInstance->table = $field[3];\n\t\t\t$fieldInstance->uitype = $field[5];\n\t\t\t$fieldInstance->typeofdata = $field[15];\n\t\t\t$fieldInstance->readonly = $field[8];\n\t\t\t$fieldInstance->displaytype = $field[14];\n\t\t\t$fieldInstance->masseditable = $field[19];\n\t\t\t$fieldInstance->quickcreate = $field[16];\n\t\t\t$fieldInstance->columntype = $field[24];\n\t\t\t$fieldInstance->presence = $field[9];\n\t\t\t$fieldInstance->maximumlength = $field[11];\n\t\t\t$fieldInstance->quicksequence = $field[17];\n\t\t\t$fieldInstance->info_type = $field[18];\n\t\t\t$fieldInstance->helpinfo = $field[20];\n\t\t\t$fieldInstance->summaryfield = $field[21];\n\t\t\t$fieldInstance->generatedtype = $field[4];\n\t\t\t$fieldInstance->defaultvalue = $field[10];\n\t\t\t$fieldInstance->fieldparams = $field[22];\n\t\t\t$blockInstance->addField($fieldInstance);\n\t\t\tif ($field[26] && ($field[5] == 15 || $field[5] == 16 || $field[5] == 33 )) {\n\t\t\t\t$fieldInstance->setPicklistValues($field[26]);\n\t\t\t}\n\t\t\tif ($field[27] && $field[5] == 10) {\n\t\t\t\t$fieldInstance->setRelatedModules($field[27]);\n\t\t\t}\n\t\t}\n\t}", "function _set_editable_fields()\n\t{\n\t\tif (empty($this->fields))\n\t\t{\n\t\t\t// pull the fields dynamically from the database\n\t\t\t$this->db->cache_on();\n\t\t\t$this->fields = $this->db->list_fields($this->primary_table);\n\t\t\t$this->db->cache_off();\n\t\t}\n\t}", "public function updateSettingsFields($fields) {\n\n\t\t$fields->addFieldToTab('Root.Misdirection', HeaderField::create(\n\t\t\t'VanityHeader',\n\t\t\t'Vanity'\n\t\t));\n\t\tif($this->owner->VanityMapping()->RedirectPageID != $this->owner->ID) {\n\n\t\t\t// The mapping may have been pointed to another page.\n\n\t\t\t$this->owner->VanityMappingID = 0;\n\t\t}\n\t\t$fields->addFieldToTab('Root.Misdirection', TextField::create(\n\t\t\t'VanityURL',\n\t\t\t'URL',\n\t\t\t$this->owner->VanityMapping()->MappedLink\n\t\t)->setDescription('Mappings with higher priority will take precedence over this'));\n\n\t\t// Allow extension customisation.\n\n\t\t$this->owner->extend('updateSiteTreeMisdirectionExtensionSettingsFields', $fields);\n\t}", "function set_fields($fields) {\n\t\t$this->fields = $fields;\n\t}", "private function setFields($fields = [])\n {\n foreach ($fields as $key => $input) {\n $name = array_key_exists('name', $input) ? $input['name'] : $key;\n $type = array_key_exists('type', $input) ? $input['type'] : Mystique::TEXT;\n $type_fallback = array_key_exists('type_fallback', $input) ? $input['type_fallback'] : false;\n\n $field = $input;\n if(array_key_exists('type', $field)) {\n unset($field['type']);\n }\n\n if(strpos($type, 'Inputfield') === false) {\n $type = 'Inputfield' . ucfirst($type);\n }\n if($type_fallback && strpos($type_fallback, 'Inputfield') === false) {\n $type_fallback = 'Inputfield' . ucfirst($type_fallback);\n }\n\n if($this->modules->isInstalled($type)) {\n $field['type'] = $type;\n } else if($this->modules->isInstalled($type_fallback)) {\n $field['type'] = $type_fallback;\n }\n\n if(array_key_exists('type', $field)) {\n\n if(array_key_exists('useLanguages', $field) && $field['useLanguages']) {\n $this->languageFields[] = $name;\n }\n\n if(!$type != Mystique::FIELDSET && !$type != Mystique::MARKUP) {\n $value = array_key_exists('value', $field) ? $field['value'] : '';\n if(!$value && array_key_exists('defaultValue', $field)) {\n $value = $field['defaultValue'];\n }\n $this->inputFields[$name] = $value;\n }\n\n if ($type == Mystique::CHECKBOX || $type == Mystique::TOGGLE_CHECKBOX) {\n $this->checkboxFields[] = $name;\n }\n\n if(array_key_exists('children', $field)) {\n $this->setFields($field['children']);\n }\n }\n }\n }", "private function setFields($fields) {\n $this->fields = $fields;\n }" ]
[ "0.63337296", "0.6290754", "0.6273008", "0.61357677", "0.6134318", "0.61341137", "0.6130644", "0.6060578", "0.60574555", "0.60170877", "0.5960542", "0.59536767", "0.59391075", "0.59093595", "0.58668447", "0.58292365", "0.58272773", "0.582668", "0.58213514", "0.58211595", "0.581772", "0.58092314", "0.57862324", "0.5772297", "0.57632476", "0.57600546", "0.5754041", "0.57422435", "0.5728518", "0.5717709" ]
0.6639678
0
Setup validation rules hook. User defined rules override in this method
public function setupValidatorRules() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setupRules()\n {\n // Validator::extend('rule', 'App\\Support\\Rules\\Rule@validate');\n // Validator::replacer('rule', 'App\\Support\\Rules\\Rule@message');\n }", "abstract protected function setValidationRules(): array;", "protected function setupValidation()\n {\n }", "protected function get_validation_rules()\n {\n }", "public function validateRules();", "protected function preValidate() {}", "abstract protected function getValidationRules();", "abstract protected function validationRules() : array;", "protected function setUpValidationRules()\n {\n $statuses = array_keys(static::$statuses);\n\n static::$rules = [\n 'title' => 'required',\n 'slug' => 'required|unique:pages,slug,' . $this->id,\n 'status' => 'in:' . implode(',', $statuses),\n ];\n }", "function validation_rules()\n\t{\n\t\t// validation rules for create\n\t\t$this->create_validation_rules = array(\n\t\t\tarray(\n\t \t'field' => 'product_id',\n\t \t'rules' => 'required'\n\t ),\n\t array(\n\t \t'field' => 'user_id',\n\t \t'rules' => 'required'\n\t )\n );\n\n\t}", "public function defineValidationRules()\n {\n return [];\n }", "protected function setupValidation()\n\t{\n\t\t$this->setInputFactory(new InputFactory(new Builder));\n\t\t$this->setValidator(new Validator\\Illuminate(App::make('validator')));\n\t}", "public function validate()\n {\n foreach ( $this->rules as $key => $rules ) {\n foreach ( $rules as $type => $rule ) {\n if ( $this->hasErrors( $key ) )\n break;\n $this->validateRule( $key, $type, $rule );\n }\n }\n }", "protected function configureValidations()\n {\n }", "public function rules()\n {\n }", "function addValidationRules(){\n\t\t$this->registerRule('validDate','function','validDate');\n\t\t$this->registerRule('validPeriod','function','validPeriod');\n\t\t$this->registerRule('existe','function','existe');\n\t\t$this->registerRule('number_range','function','number_range');\n\t\t$this->registerRule('validInterval','function','validInterval');\n\t\t$this->registerRule('couple_not_null','function','couple_not_null');\n\t\t$this->registerRule('validParam','function','validParam');\n\t\t$this->registerRule('validUnit_existe','function','validUnit_existe');\n\t\t$this->registerRule('validUnit_required','function','validUnit_required');\n\t\t$this->addRule('dats_title','Data description: Metadata informative title is required','required');\n\t\t$this->addRule('dats_title','Data description: Dataset name exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$this->addRule('dats_date_begin','Temporal coverage: Date begin is not a date','validDate');\n\t\t$this->addRule('dats_date_end','Temporal coverage: Date end is not a date','validDate');\n\t\t$this->addRule(array('dats_date_begin','dats_date_end'),'Temporal coverage: Date end must be after date begin','validPeriod');\n\t\tif ($this->dataset->dats_id == 0){\n\t\t\t$this->addRule('dats_title','Data description: A dataset with the same title exists in the database','existe',array('dataset','dats_title'));\n\t\t}\n\t\t\n\t\tif (isset($this->dataset->data_policy) && !empty($this->dataset->data_policy) && $this->dataset->data_policy->data_policy_id > 0){\n\t\t\t$this->getElement('new_data_policy')->setAttribute('onfocus','blur()');\n\t\t}\n\t\t$this->addRule('new_data_policy','Data use information: Data policy exceeds the maximum length allowed (100 characters)','maxlength',100);\t\n\t\t$attrs = array();\n\t\tif (isset($this->dataset->database) && !empty($this->dataset->database) && $this->dataset->database->database_id > 0){\n\t\t\t//$this->getElement('new_database')->setAttribute('onfocus','blur()');\n\t\t\t//$this->getElement('new_db_url')->setAttribute('onfocus','blur()');\n\t\t\t$this->disableElement('new_database');\n\t\t\t$this->disableElement('new_db_url');\n\t\t}\n\t\t/*else {\n\t\t\t//$this->addRule('new_database','A database with the same title already exists','existe',array('database','database_name'));\n\t\t}*/\n\t\t$this->addRule('new_database','Data use information: Database name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t$this->addRule('new_db_url','Data use information: Database url exceeds the maximum length allowed (250 characters)','maxlength',250);\t\n\t\t//Formats\n\t\tfor ($i = 0; $i < $this->dataset->nbFormats; $i++){\n\t\t\t$this->addRule('data_format_'.$i,'Data use information: Format name '.($i+1).' exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t\tif (isset($this->dataset->data_formats[$i]) && !empty($this->dataset->data_formats[$i]) && $this->dataset->data_formats[$i]->data_format_id > 0){\n\t\t\t\t//$this->getElement('new_data_format_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('new_data_format_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('new_data_format_'.$i,'Data format '.($i+1).': This format already exists in the database','existe',array('data_format','data_format_name'));\n\t\t\t}*/\n\t\t}\n\t\t//Contacts\n\t\t$this->addRule('pi_0','Contact 1 is required','couple_not_null',array($this,'pi_name_0'));\n\t\t$this->addRule('organism_0','Contact 1: organism is required','couple_not_null',array($this,'org_sname_0'));\n\t\t$this->addRule('email1_0','Contact 1: email1 is required','required');\t\n\t\tfor ($i = 0; $i < $this->dataset->nbPis; $i++){\n\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': Name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 is incorrect','email');\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 is incorrect','email');\n\t\t\t$this->addRule('org_fname_'.$i,'Contact '.($i+1).': Organism full name exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('org_sname_'.$i,'Contact '.($i+1).': Organism short name exceeds the maximum length allowed (50 characters)','maxlength',50);\n\t\t\t$this->addRule('org_url_'.$i,'Contact '.($i+1).': Organism url exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email1_'.$i,'Contact '.($i+1).': email1 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\t$this->addRule('email2_'.$i,'Contact '.($i+1).': email2 exceeds the maximum length allowed (250 characters)','maxlength',250);\n\t\t\tif (isset($this->dataset->originators[$i]) && !empty($this->dataset->originators[$i]) && $this->dataset->originators[$i]->pers_id > 0){\n\t\t\t\t//$this->getElement('pi_name_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email1_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('email2_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('organism_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('pi_name_'.$i);\n\t\t\t\t$this->disableElement('email1_'.$i);\n\t\t\t\t$this->disableElement('email2_'.$i);\n\t\t\t\t$this->disableElement('organism_'.$i);\n\t\t\t}\n\t\t\t/*else{\n\t\t\t\t//$this->addRule('pi_name_'.$i,'Contact '.($i+1).': A contact with the same name is already present in the database. Select it in the drop-down list.','existe',array('personne','pers_name'));\n\t\t\t}*/\n\t\t\tif (isset($this->dataset->originators[$i]->organism) && !empty($this->dataset->originators[$i]->organism) && $this->dataset->originators[$i]->organism->org_id > 0){\n\t\t\t\t//$this->getElement('org_sname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_fname_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t//$this->getElement('org_url_'.$i)->setAttribute('onfocus','blur()');\n\t\t\t\t$this->disableElement('org_sname_'.$i);\n\t\t\t\t$this->disableElement('org_fname_'.$i);\n\t\t\t\t$this->disableElement('org_url_'.$i);\n\t\t\t}\n\t\t\tif ($i != 0){\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': email1 is required','contact_email_required',array($this,$i));\n\t\t\t\t$this->addRule('pi_name_'.$i,'Contact '.($i+1).': organism is required','contact_organism_required',array($this,$i));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Add validation rules\n\t\t$this->AddModValidationRules();\n\t\t$this->AddSatValidationRules();\n\t\t$this->AddInstruValidationRules();\n\n\t\t//$this->addRule('grid_type','Coverage: Grid type exceeds the maximum length allowed (100 characters)','maxlength',100);\n\t\t$this->addVaValidationRulesResolution('Coverage');\n\t\t//$this->addRule('sensor_resol_temp','Coverage: Temporal resolution is incorrect','validDate');\n\t\t$this->addRule('sensor_resol_tmp','Coverage: temporal resolution is incorrect','regex',\"/^[0-9]{2}[:][0-9]{2}[:][0-9]{2}$/\");\n\t\t$this->addValidationRulesGeoCoverage();\n\t\t//PARAMETER\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->addValidationRulesVariable($i,$i,'Parameter '.($i+1));\n\t\t}\n\t\t\n\t}", "public function validate()\n {\n $loader = new FileLoader(new Filesystem, 'lang');\n $translator = new Translator($loader, 'en');\n $validation = new Factory($translator, new Container);\n\n $rules = $this->rules();\n\n $this->_applyCustomValidationRules($validation);\n\n $validation->validate($this->attributes, $rules, $this->messages);\n }", "public function registerRules(){\n \t// $this->applyValidationDateRange('start_event', 'end_event', 'editable_cierre');\n \t// $this->applyValidationTextMemo('desc_sol_comun', 3000, 0);\n \t$this->applyValidationClear('desc_sol_comun', 3000, 0);\n\t}", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n //\n }", "function before_validation(){}", "public function setRules() {\n }", "public function rules()\n {\n return [\n 'f_name' => 'required',\n 'l_name' => 'required',\n 'dob' => 'required|date_format:\"d/m/Y\"',\n 'entry_date' => 'required|date_format:\"d/m/Y\"|after:dob',\n 'position' => 'required|string',\n 'post' => 'required|string',\n 'passed_date' => 'required|date_format:\"d/m/Y\"|after:entry_date',\n 'note' => 'max:500',\n 'team_id' => 'required|exists:teams,id'\n ];\n }", "public function initRules()\n {\n $this->rules['email'] = V::email();\n $this->rules['password'] = V::alnum()->noWhitespace()->length(4, 20)->setName('Password');\n $this->rules['first_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('First name');\n $this->rules['last_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('Last name');\n }", "public function validate(){\n\t\t// Loop through model's rules array.\n\t\tforeach($this->rules() as $field => $rules){\n\t\t\t// Take the value of field this rule is for.\n\t\t\t$value = $this->{$field};\n\t\t\t// Loop through all rules for this field.\n\t\t\tforeach($rules as $rule){\n\t\t\t\t$ruleType = $rule;\n\t\t\t\t// If the rule is an array, not string, read its type from first index.\n\t\t\t\tif(is_array($ruleType)){\n\t\t\t\t\t$ruleType = $ruleType[0];\n\t\t\t\t}\n\n\t\t\t\t// Rule: field is required.\n\t\t\t\tif($ruleType === 'required' && !$value){\n\t\t\t\t\t$this->addError($field, 'required', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: field value must validate as email.\n\t\t\t\telse if($ruleType === 'email' && !filter_var($value, FILTER_VALIDATE_EMAIL)){\n\t\t\t\t\t$this->addError($field, 'email', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: string length comparisons.\n\t\t\t\telse if($ruleType === 'length'){\n\t\t\t\t\t// String has rule for minimum length.\n\t\t\t\t\tif(array_key_exists('min', $rule) && $rule['min'] > strlen($value)){\n\t\t\t\t\t\t$this->addError($field, 'min', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// String has rule for maximum length.\n\t\t\t\t\tif(array_key_exists('max', $rule) && $rule['max'] < strlen($value)){\n\t\t\t\t\t\t$this->addError($field, 'max', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// String has rule for exact length.\n\t\t\t\t\tif(array_key_exists('equal', $rule) && $rule['equal'] != strlen ($value)){\n\t\t\t\t\t\t$this->addError($field, 'equal', $rule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Rule: field value must match comparison field's value.\n\t\t\t\telse if($ruleType === 'compare' && $value != $this->{$rule['field']}){\n\t\t\t\t\t$this->addError($field, 'compare', $rule);\n\t\t\t\t}\n\t\t\t\t// Rule: number comparisons.\n\t\t\t\telse if($ruleType === 'numeric'){\n\t\t\t\t\t// Value must validate to an integer number.\n\t\t\t\t\tif(array_key_exists('integer', $rule) && $rule['integer'] && filter_var($value, FILTER_VALIDATE_INT) === FALSE){\n\t\t\t\t\t\t$this->addError($field, 'integer', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value must validate to float number.\n\t\t\t\t\telse if((!array_key_exists('integer', $rule) || (array_key_exists('integer', $rule) && !$rule['integer'])) && filter_var($value, FILTER_VALIDATE_FLOAT) === FALSE){\n\t\t\t\t\t\t$this->addError($field, 'numeric', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value must be at least a minimum number.\n\t\t\t\t\tif(array_key_exists('min', $rule) && $rule['min'] > floatval($value)){\n\t\t\t\t\t\t$this->addError($field, 'numericmin', $rule);\n\t\t\t\t\t}\n\t\t\t\t\t// Value cannot be larger than a maximum number.\n\t\t\t\t\tif(array_key_exists('max', $rule) && $rule['max'] < floatval($value)){\n\t\t\t\t\t\t$this->addError($field, 'numericmax', $rule);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Rule: unique database entry.\n\t\t\t\telse if($ruleType === 'unique'){\n\t\t\t\t\t// Check for match in database.\n\t\t\t\t\t$found = $this->findOne([\"$field\" => \"$value\"]);\n\t\t\t\t\tif($found){\n\t\t\t\t\t\t$this->addError($field, 'unique', $rule);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t// Rule: on action only.\n\t\t\t\telse if($ruleType === 'on'){\n\t\t\t\t\t// If field is used on create only and request is not for create, field is not used.\n\t\t\t\t\tif($rule['action'] === 'create' && !$this->isCreate()){\n\t\t\t\t\t\t$this->ignoreFields[] = $field;\n\t\t\t\t\t}\n\t\t\t\t\t// IF field is used on update only and request is not for update, field is not used.\n\t\t\t\t\telse if($rule['action'] === 'update' && !$this->isUpdate()){\n\t\t\t\t\t\t$this->ignoreFields[] = $field;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn empty($this->errors);\n\t}", "protected function addValidatorRules()\n {\n Validator::extend('jwt', function ($attribute, $value, $parameters) {\n return (new ValidJWT(Arr::first($parameters)))->passes($attribute, $value);\n });\n }", "public function validationRules()\n {\n return [];\n }", "protected function _validate() {\n\t}", "public function beforeValidate() {\n return parent::beforeValidate();\n }", "public function setValidationRules($validationRules)\n {\n }" ]
[ "0.7873743", "0.7539429", "0.7488328", "0.7474278", "0.7397229", "0.7386316", "0.7314234", "0.72395444", "0.72065735", "0.71552396", "0.7146794", "0.70905954", "0.70653665", "0.7038177", "0.70157105", "0.70144886", "0.6987463", "0.69813", "0.6974042", "0.6962235", "0.695694", "0.6939228", "0.69238037", "0.6893855", "0.6867038", "0.68436444", "0.6841804", "0.6804467", "0.67968935", "0.6793034" ]
0.7955413
0
Set default rule for some field
public function setDefaultRule($field, $value) { $this->defaultsRules[$field] = $value; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setDefaultRule()\n\t{\n\t\tif (Yii::$app->authManager->getRule(RouteRule::RULE_NAME) === null) {\n\t\t\tYii::$app->authManager->add(Yii::createObject([\n\t\t\t\t\t'class' => RouteRule::className(),\n\t\t\t\t\t'name' => RouteRule::RULE_NAME]\n\t\t\t));\n\t\t}\n\t}", "public static function set_default_values() {\n\t\t?>\n\t\tcase \"nu_phone\" :\n\t\t\tfield.label = \"Phone\";\n\t\t\tfield.isRequired = true;\n\t\t\tfield.description = \"Numbers only. e.g. 8885551212\";\n\t\t\tbreak;\n\t\t<?php\n\t}", "public function delegateFieldSetDefault(DbalSchema $dbal_schema, $drupal_table_name, $field_name, $default);", "protected function setupDefaultsRules()\n { }", "private function setRule()\n\t{\n\t\t$this->rule = ( $this->timber->security->isAuth() && $this->timber->security->isClient() ) ? 'client' : $this->rule;\n\t\t$this->rule = ( $this->timber->security->isAuth() && $this->timber->security->isStaff() ) ? 'staff' : $this->rule;\n\t\t$this->rule = ( $this->timber->security->isAuth() && $this->timber->security->isAdmin() ) ? 'admin' : $this->rule;\n\t}", "abstract protected function prepareFieldValidationRule($field_validation_rule);", "public function default($rule)\n {\n $this->type = 'property';\n $this->data = ['default_target' => $rule];\n return $this;\n }", "protected function setDefaultRules()\n\t{\n\t\tif(empty($this->rules['FileExtension']['allowed']))\n\t\t\t$this->rules['FileExtension']['allowed'] = ['jpeg', 'jpg', 'png', 'gif'];\n\t}", "protected function set_inputs_rules($val){ $this->input ['inputs_rules'] = $val;}", "public function setRules() {\n }", "public static function setDefaultFieldResolver(callable $fn) : void\n {\n }", "function field__default( $rg, $var, $post, $fn__desc, $fn__field ){\n\t\t\t$_style = ( $rg->type === 'text' && false === strpos($rg->attr, 'style=') ) ? ' style=\"width:100%;\"' : '';\n\n\t\t\treturn $var->title . $fn__field( '<input '. $rg->attr . $var->class . $var->pholder . $_style .' type=\"'. $rg->type .'\" id=\"'. $rg->id .'\" name=\"'. $var->name .'\" value=\"'. esc_attr($rg->val) .'\">'. $fn__desc() );\n\t\t}", "public function addRule(string $field, IValidationRule $rule): void;", "public function changeFieldDefaultValue($field)\n {\n\tPerfORMController::getBuilder()->changeFieldsDefault($field);\n\t$this->updateFieldSync($field);\n }", "protected function initial_set_default() {\n\t\tif ( isset( $this->field[ 'config' ][ 'default' ] ) ) {\n\t\t\t$this->default = $this->field[ 'config' ][ 'default' ];\n\t\t} else {\n\t\t\t$this->default = '';\n\t\t}\n\t}", "public function initRules()\n {\n $this->rules['email'] = V::email();\n $this->rules['password'] = V::alnum()->noWhitespace()->length(4, 20)->setName('Password');\n $this->rules['first_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('First name');\n $this->rules['last_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('Last name');\n }", "public function setModelDefaults() \n {\n if (!empty($this->model->defaultFieldValues())) {\n \n foreach($this->model->defaultFieldValues() as $field => $defaultValue) {\n\n $this->model->$field = $defaultValue;\n }\n } \n }", "public function rules()\n {\n $rules = parent::rules();\n $rules [] = array('list_holder_id', 'default', 'setOnEmpty' => true, 'value' => null);\n return $rules;\n }", "public function setCustomRule(string $name, Validatable $rule): ValidatorInterface;", "abstract protected function setValidationRules(): array;", "public function delegateFieldSetNoDefault(DbalSchema $dbal_schema, $drupal_table_name, $field_name);", "protected function setValidationRule($field_name, $rule_str) {\n\n //separate the rule to get the ones that have association with the db\n $rules = explode(\":\", $rule_str);\n\n if(in_array($rules[0], ['exists', 'unique'])) {\n\n //set the keyword\n $rule_keyword = $rules[0];\n\n //set the table\n $db_table = $rules[1];\n\n //set the validation rule\n $rule = Rule::$rule_keyword($db_table);\n\n if($rule_keyword == 'unique' && !empty($this->model_instance)) \n $rule = $rule->ignore($this->model_instance);\n\n $this->validation_rules[$field_name][] = $rule;\n\n } else {\n\n $this->validation_rules[$field_name][] = $rule_str;\n\n }\n\n }", "public function setRule($rule) {\n\t\t$this->rule = $rule;\n\n\t\tif (!isset($this->rules[$rule])) {\n\t\t\t$this->rules[$rule] = [\n\t\t\t\t'constraints' => [],\n\t\t\t\t'filters' => [],\n\t\t\t\t'is_valid' => true\n\t\t\t];\n\t\t}\n\n\t\treturn $this;\n\t}", "protected function getDefaultFieldNamePrefix() {}", "protected function getDefaultFieldNamePrefix() {}", "private function setupRules()\n {\n // Validator::extend('rule', 'App\\Support\\Rules\\Rule@validate');\n // Validator::replacer('rule', 'App\\Support\\Rules\\Rule@message');\n }", "function form_rule($field = '')\n {\n if (FALSE === ($OBJ =& _get_validation_object()))\n {\n return '';\n }\n\n return $OBJ->rule($field);\n }", "public function onBeforeWrite()\n {\n foreach (self::$defaults as $field => $value) {\n if (empty($this->$field)) {\n $this->$field = $value;\n }\n }\n //TODO: prevent non-heirarichal entries, eg country = '*', then state = 'blah'\n parent::onBeforeWrite();\n }", "public function __construct(){\n # parent::__construct();\n $this->rule_add = ['name'=>'required|unique:group_rule', 'description'=>'required'];\n $this->rule_update = ['name'=>'required', 'description'=>'required'];\n }", "public function jquery__get_rule_definition() {\n\t\treturn 'required';\n\t}" ]
[ "0.65538466", "0.6526952", "0.64806664", "0.644944", "0.6361351", "0.62723076", "0.61537415", "0.6085955", "0.5923342", "0.58611894", "0.5839392", "0.5829776", "0.5804857", "0.56696284", "0.5656611", "0.56333", "0.56049925", "0.5581493", "0.5577974", "0.5567161", "0.55461663", "0.5528205", "0.55172753", "0.5499977", "0.5499977", "0.5491843", "0.5488204", "0.54615074", "0.5441834", "0.54413694" ]
0.666283
0
Setup filter rules hook. User defined rules override in this method
public function setupFilterRules() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beforeFilter() {\n }", "protected function preValidate()\n {\n $this->setFilter( preg_quote($this->getFilter()) );\n }", "public function addFilters()\n {\n }", "public static function filter($rules)\n\t{ \n\t\tstatic::$filters[] = $rules;\n\t}", "public function beforeFilter()\n\t{\n\n\t}", "public function beforeFilter() {\n\t}", "private function filters() {\n\n\n\t}", "abstract public function prepareFilters();", "public function register_filters() {\n\n\t\t}", "function beforeFilter() {\r\n parent::beforeFilter();\r\n }", "function beforeFilter() {\n parent::beforeFilter();\n }", "public function addFilters() {\n\t\t\tadd_filter( 'muut_validate_setting', array( $this, 'validateSettings' ), 10, 2 );\n\t\t}", "public function beforeFilter()\r\n\t {\r\n\t parent::beforeFilter();\r\n\t }", "private function setup_filters() {\n\n\t\tadd_filter( 'pre_option_posts_per_page', array( $this, 'filter_posts_per_page' ) );\n\n\t\tadd_filter( 'plugins_url', array( $this, 'filter_plugins_url' ) );\n\n\t}", "function beforeFilter(){\n\t\tparent::beforeFilter(); \n\t}", "public function afterFilter()\n\t{\n\n\t}", "public function beforeRules(): void\n {\n }", "abstract public function filters();", "function add_filters()\n {\n }", "public function setFilter($filter){ }", "public function beforeFilter() {\n parent::beforeFilter();\n $this->Auth->allow('indexOfMember', 'search');\n }", "public function __construct()\n {\n $this->rules = array(\n new ezcDocumentOdtEmphasisStyleFilterRule(),\n new ezcDocumentOdtListLevelStyleFilterRule(),\n );\n }", "public function beforeFilter()\n {\n parent::beforeFilter();\n }", "public function beforeFilter()\n {\n parent::beforeFilter();\n }", "public function initRules() {\n $config = Context::$appConfig;\n if (isset($config->interceptRules['pre'])) {\n $this->preRules = $config->interceptRules['pre'];\n }\n if (isset($config->interceptRules['post'])) {\n $this->postRules = $config->interceptRules['post'];\n }\n }", "public function __construct()\n {\n $this->beforeFilter(function()\n {\n\n });\n }", "abstract protected function getFilters();", "function beforeFilter() {\r\n $this->Auth->mapActions(\r\n array(\r\n 'create' => array('index', 'save_api', 'setGeneralOption'),\r\n )\r\n );\r\n parent::beforeFilter();\r\n }", "public function __construct()\n {\n $this->setupFilters();\n }", "public static function initialize() {\r\n\t\t/*\r\n\t\t * The filters are only useful in the admin section; exit if in the \"front-end\" posts/pages. \r\n\t\t */\r\n\t\tif ( ! is_admin() )\r\n\t\t\treturn;\r\n\r\n\t\tadd_filter( 'mla_mapping_settings', 'MLAHierarchicalMappingExample::mla_mapping_settings', 10, 4 );\r\n\t\tadd_filter( 'mla_mapping_exif_value', 'MLAHierarchicalMappingExample::mla_mapping_exif_value', 10, 5 );\r\n\t\tadd_filter( 'mla_mapping_updates', 'MLAHierarchicalMappingExample::mla_mapping_updates', 10, 5 );\r\n\t}" ]
[ "0.69546634", "0.67810273", "0.6774493", "0.6758745", "0.6717176", "0.671316", "0.670728", "0.6663506", "0.652919", "0.65026444", "0.64986396", "0.6469668", "0.6433312", "0.64266247", "0.64166725", "0.6379295", "0.6372237", "0.6331557", "0.63045144", "0.63021225", "0.6283267", "0.62212074", "0.6193272", "0.6193272", "0.61842597", "0.6178656", "0.6170818", "0.61707026", "0.6168578", "0.6160554" ]
0.8648846
0
Setup default rules hook. User defined rules override in this method
protected function setupDefaultsRules() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function setupRules()\n {\n // Validator::extend('rule', 'App\\Support\\Rules\\Rule@validate');\n // Validator::replacer('rule', 'App\\Support\\Rules\\Rule@message');\n }", "public function beforeRules(): void\n {\n }", "public function setRules() {\n }", "public function initRules() {\n $config = Context::$appConfig;\n if (isset($config->interceptRules['pre'])) {\n $this->preRules = $config->interceptRules['pre'];\n }\n if (isset($config->interceptRules['post'])) {\n $this->postRules = $config->interceptRules['post'];\n }\n }", "protected abstract function rules();", "public function setupValidatorRules()\n { }", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "public function rules()\n {\n }", "public function buildRules(): void\n {\n }", "public function rules();", "public function rules();", "public function rules();", "protected function _generateRules()\n {\n }", "public static function allRules()\n {\n }", "protected function processRules() {\n $this->rules = array(\n 'dang-ky' => 'auth/register',\n 'lay-lai-mat-khau' => 'auth/forgotpassword',\n 'tim-kiem-san-pham' => 'product/search',\n 'tin-tuc/gioi-thieu' => 'site/about',\n 'doi-tac' => 'partner/index',\n 'tuyen-dung' => 'recruitment/list',\n 'dai-ly' => 'agency/list',\n 'tin-tuc/<title>-<id:\\d+>' => 'news/list',\n 'tin-tuc' => 'news/list',\n 'tin-tuc/chi-tiet/<title>-<id:\\d+>' => 'news/detail',\n 'lien-he' => 'site/contact',\n 'danh-muc-san-pham/<title>-<id:\\d+>-<sort>' => 'product/catalog',\n 'danh-muc-san-pham/<title>-<id:\\d+>' => 'product/catalog',\n 'nhan-hang/<name>-<id:\\d+>-<mid:\\d+>-<sort>' => 'product/manufacture',\n 'nhan-hang/<name>-<id:\\d+>-<mid:\\d+>' => 'product/manufacture',\n 'san-pham/<title>-<id:\\d+>' => 'product/detail',\n 'gio-hang' => 'shoppingcart/order',\n 'gio-hang/them-<id:\\d+>' => 'shoppingcart/add',\n \n '<controller:\\w+>/<id:\\d+>' => '<controller>/view',\n '<controller:\\w+>/<action:\\w+>/<id:\\d+>' => '<controller>/<action>',\n '<controller:\\w+>/<action:\\w+>' => '<controller>/<action>',\n );\n // Run parent\n parent::processRules();\n }", "public function rules()\n {\n //\n }", "abstract function rules();", "public function initRules()\n {\n $this->rules['email'] = V::email();\n $this->rules['password'] = V::alnum()->noWhitespace()->length(4, 20)->setName('Password');\n $this->rules['first_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('First name');\n $this->rules['last_name'] = V::alpha()->noWhitespace()->length(4, 20)->setName('Last name');\n }", "protected function defineRules()\n {\n return [];\n }", "public function afterRules(): void\n {\n }", "abstract protected function getRules();", "public function setupFilterRules()\n { }", "public function rules(): array\n {\n }", "abstract protected function setValidationRules(): array;", "public function getRules() {}", "protected function customRules()\n {\n return [\n ['company', 'validateExpenseType'],\n ]; // todo\n }", "abstract public function rules(): array;" ]
[ "0.78479826", "0.76717967", "0.7567336", "0.74653274", "0.72759455", "0.7257625", "0.7098612", "0.7098612", "0.7098612", "0.7098612", "0.7011071", "0.6992647", "0.6953926", "0.6953926", "0.6953926", "0.6916104", "0.6893561", "0.6876817", "0.6839362", "0.68129206", "0.67757434", "0.66932553", "0.6685453", "0.66771376", "0.65911436", "0.6531916", "0.64179444", "0.64175427", "0.6406975", "0.6402074" ]
0.78622955
0
Get cascade filter rules on add
public function getFilterCascadeRulesOnAdd() { if (!$this->filterCascadeRulesOnAdd) { $this->setupFilterCascadeRules(); } return $this->filterCascadeRulesOnAdd; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilterCascadeRulesOnUpdate()\n {\n if (!$this->filterCascadeRulesOnUpdate) {\n $this->setupFilterCascadeRules();\n }\n\n return $this->filterCascadeRulesOnUpdate;\n }", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "public function setupFilterRules()\n { }", "public function addFilters()\n {\n }", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'rights', // perform access control for CRUD operations\n\t\t);\n\t}", "public function filters()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'rights', // perform access control for CRUD operations\r\n\t\t);\r\n\t}", "abstract protected function getFilters();", "public function filters(){\r\r\n\t\treturn CMap::mergeArray(parent::filters(),array(\r\r\n\t\t\t\r\r\n\t\t));\r\r\n\t}", "public function rules() {\n\t\t// 全リクエスト共通ルールと継承先ルールのマージ\n\t\t// 同一のキーがあれば継承先ルールで上書き\n\t\treturn array_merge($this->__base_rules, $this->rules);\n }", "public function getCreateRules()\n {\n return [];\n }", "public function getRules(): Collection;", "public function rules() {\n return $this->get_from_model(__FUNCTION__);\n }", "public function getFilters(): FilterCollection;", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "protected static function getAddQuestionRules()\n {\n return parent::getAddQuestionRules();\n }", "public function getRules() {}", "public function getFilters();", "public function filters()\n {\n return [\n \n ];\n }", "public static function filter($rules)\n\t{ \n\t\tstatic::$filters[] = $rules;\n\t}", "public function getRules();", "protected function getActiveCascadingDeletes(){\n return array_filter($this->getCascadingDeletes(), function ($relationship) {\n return ! is_null($this->{$relationship});\n });\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "private function filters() {\n\n\n\t}", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'accessControl', // perform access control for CRUD operations\n\t\t);\n\t}", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'accessControl', // perform access control for CRUD operations\n\t\t);\n\t}", "public function getRules()\n\t{\n\t\t\n\t\t$rules = array();\n\t\t\n\t\tforeach ( $this->getFields() as $field )\n\t\t{\n\t\t\t$rules = array_merge( $rules, $field->getRules() );\n\t\t}\n\t\t\n\t\treturn $rules;\n\t}", "public function commonRules() {\n \n $rules = [];\n \n return $rules;\n }", "public function getRules()\n {\n }" ]
[ "0.7267701", "0.60244393", "0.60244393", "0.59668934", "0.5922865", "0.5885551", "0.5846449", "0.5796171", "0.5780541", "0.5776938", "0.57538325", "0.574064", "0.565488", "0.56052756", "0.55917126", "0.558654", "0.5560652", "0.5535454", "0.5533218", "0.54929405", "0.54794115", "0.54699785", "0.5450823", "0.5444544", "0.54293585", "0.54194", "0.54194", "0.54093564", "0.54072934", "0.540663" ]
0.82928276
0
Get cascade filter rules on update
public function getFilterCascadeRulesOnUpdate() { if (!$this->filterCascadeRulesOnUpdate) { $this->setupFilterCascadeRules(); } return $this->filterCascadeRulesOnUpdate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFilterCascadeRulesOnAdd()\n {\n if (!$this->filterCascadeRulesOnAdd) {\n $this->setupFilterCascadeRules();\n }\n\n return $this->filterCascadeRulesOnAdd;\n }", "public function getRulesForUpdate()\r\n\t{\r\n\t \treturn $this->rules_for_update ? $this->rules_for_update : array();\r\n\t}", "public function getValidationRulesUpdate(): array;", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function getValidationUpdateRules(): array\n {\n }", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function getPivotUpdateRules() : array\n {\n return $this->getFields()\n ->mapWithKeys(function (Field $field) {\n return [$field->getName() => $field->getUpdateRules()];\n })\n ->toArray();\n }", "public function rules()\n {\n if ($this->isMethod('PATCH')) {\n return $this->filterWithModelConfiguration(I18nLang::class, I18nLang::getPatchRules());\n } elseif ($this->isMethod('PUT')) {\n return $this->filterWithModelConfiguration(I18nLang::class, I18nLang::getPutRules());\n } else {\n // @fixme Api documentation generator method \"GET\" for update... return PUT method rules\n return $this->filterWithModelConfiguration(I18nLang::class, I18nLang::getPutRules());\n }\n }", "public function rules()\n {\n $rules = Prestacion::$updateRules;\n\n $rules['nombre'] = [\n 'string',\n Rule::unique('prestaciones')->ignore($this->prestacion),\n 'min:1',\n 'max:50'\n ];\n\n return $rules;\n }", "public function rules() {\n return $this->get_from_model(__FUNCTION__);\n }", "protected function updateRules(): array\n {\n return [];\n }", "public function getUpdateRules()\n {\n return [\n \"id\" => \"required\"\n ];\n }", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'rights', // perform access control for CRUD operations\n\t\t);\n\t}", "protected function getActiveCascadingDeletes(){\n return array_filter($this->getCascadingDeletes(), function ($relationship) {\n return ! is_null($this->{$relationship});\n });\n }", "public function rules() {\n\t\t// 全リクエスト共通ルールと継承先ルールのマージ\n\t\t// 同一のキーがあれば継承先ルールで上書き\n\t\treturn array_merge($this->__base_rules, $this->rules);\n }", "public function rules()\n\t{\n\t\tif($projects = $this->projects){\n\n\t\t\t// Validate on updating\n\t\t}\n\n\t\treturn $this->rules;\n\t}", "public function filters()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'rights', // perform access control for CRUD operations\r\n\t\t);\r\n\t}", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n return $this->is('admin/movies/store') ? $this->createRules() : $this->updateRules();\n }", "protected function getFilterForUpdate() \n\t{\n\t\t\n\t\t$inputFilter = new InputFilter();\n\t\t$factory = new InputFactory();\n\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'user_login',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'user_password',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t)\n \t\t)));\n\t\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'organisation_id',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'organisation_name',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'application_id',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'server_id',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'updated_password',\n\t\t\t'required' => false,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'WS_server_id',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\t\t\n\t\t$inputFilter->add($factory->createInput(array(\n\t\t\t'name' => 'WS_server_ip',\n\t\t\t'required' => true,\n\t\t\t'filters' => array(\n\t\t\t\tarray('name' => 'StringTrim'),\n\t\t\t),\n\t\t)));\n\t\t\n\t\t\n\t\treturn $inputFilter;\n\t}", "public function rules()\n\t{\n if($this->route('id'))\n {\n return $this->update();\n }\n\n return $this->store();\n\t}", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public static function rules($update = false, $id = null) {\n $commun = [\n 'name' => 'required',\n 'driverName' => 'required',\n 'parent_id' => 'nullable',\n 'place' => 'required'\n ];\n\n if ($update) {\n return $commun;\n }\n\n return array_merge($commun, [\n 'name' => 'required',\n 'driverName' => 'required',\n 'parent_id' => 'nullable',\n 'place' => 'required'\n ]);\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n return [\n 'status' => 'boolean',\n ];\n break;\n case 'POST':\n return [\n 'after_sale_id' => 'required|string|max:255',\n 'refund_party' => 'required|string|max:255',\n 'refund_party_name' => 'string',\n 'refund_amount' => 'integer',\n 'status' => 'boolean',\n ];\n break;\n case 'PATCH':\n return [\n 'id' => [\n 'integer',\n Rule::exists('after_sale_refund', 'id'),\n ],\n 'after_sale_id' => 'string|max:255',\n 'refund_party' => 'string|max:255',\n 'refund_party_name' => 'string',\n 'refund_amount' => 'integer',\n 'status' => 'boolean',\n ];\n break;\n }\n }", "private function updateRules()\n {\n return [\n 'data.type' => 'required|in:events',\n 'data.attributes.name' => 'max:30|min:5',\n 'data.attributes.description' => 'min:1|max:255',\n 'data.attributes.date' => 'date',\n 'data.relationships.users' => 'required_with:data.relationships',\n 'data.relationships.users.data.*.type' => 'required_with:data.relationships|in:users',\n 'data.relationships.users.data.*.id' => 'required_with:data.relationships|numeric'\n ];\n }" ]
[ "0.73526454", "0.6507408", "0.60507125", "0.5797273", "0.5797273", "0.578298", "0.57729775", "0.5720857", "0.57158077", "0.56766295", "0.56107473", "0.5597074", "0.5582021", "0.5563095", "0.554915", "0.5543232", "0.55427855", "0.5517676", "0.549633", "0.5491389", "0.5480864", "0.54301196", "0.54041713", "0.5365975", "0.5363333", "0.53373134", "0.53258085", "0.5318222", "0.52897114", "0.52865106" ]
0.82461643
0
Listar todos preventivos por secretarias
public function by_secretarias(Request $request){ $reg = Preventivo::selectRaw('*, if(id_ubimen is not null, round(id_ubimen/7*100), if(id_ubidir is not null, round(id_ubidir/9*100), null)) as porcent') ->leftJoin('tipo', 'preventivo.id_tipo', '=', 'tipo.id_tipo') ->leftJoin('secretaria', 'preventivo.id_secretaria', '=', 'secretaria.id_secretaria') ->leftJoin('unidad', 'preventivo.id_unidad', '=', 'unidad.id_unidad') ->Secretaria($request->get('se')) ->Unidad($request->get('un')) ->Tipo($request->get('t')) ->Ubicacion($request->get('t'), $request->get('ub')) ->Preven($request->get('search')) ->orderBy('preventivo') ->paginate(25); $secre = Secretaria::all(); $unidades = null; if ($request->get('se')){ $unidades = Unidad::where('id_secretaria', $request->get('se'))->get(); } $ubicaciones_men = UbicacionMen::pluck('ubicacion', 'id_ubicacion'); $ubicaciones_dir = UbicacionDir::pluck('ubicacion', 'id_ubicacion'); return view('by_secretarias', compact('reg', 'secre', 'unidades', 'ubicaciones_men', 'ubicaciones_dir')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listarS(){\n $secretarios = User::orderBy('id','ASC')->where('category', 'secretario')->where('colegio_id', Auth::user()->colegios->id )->paginate(10);\n return view('Rector.views.secretarios')->with('secretarios',$secretarios);\n }", "function ListarPermiso()\n\t{\n\t\t$sql = \"SELECT * FROM permiso\";\n\t\treturn EjecutarConsulta($sql);\n\t}", "public function listar(){\n\n $sql = \"SELECT * FROM buro_credito\";\n\n return $this->mysql->getRows($sql);\n\n }", "function getAllAuth(){\n return ['none','clickLicense','registration','duaIndividual','duaInstitution'];\n}", "public function fellows() {\n\t\t$list = array();\n\t\t$db = Db::getInstance();\n\t\t$req = $db->prepare('SELECT IdSeguace FROM Seguaci WHERE IdUtente = :id');\n\t\t$req->execute(array('id' => $this->id()));\n\t\tforeach ($req->fetchAll() as $result) {\n\t\t\t$list[] = $result['IdSeguace'];\n\t\t}\n\t\treturn $list;\n\t}", "function listarPerfilPrivilegios($url, $id = 0){\n\t\t$s = 'SELECT p.oid,p.nomb,prv.oid AS oidp,prv.id, prv.nomb AS bnom, COALESCE(upp.visi,0) AS visi\n\t\t\t\tFROM space.privilegio prv\n\t\t\t\tJOIN space.menu_accion ma ON prv.para=ma.url\n\t\t\t\tJOIN space.perfil_privilegio pp ON pp.oidpr=prv.oid\n\t\t\t\tJOIN space.perfil p ON p.oid=pp.oidp\n\t\t\t\tLEFT JOIN space.usuario_perfil up on p.oid=up.oidp\n\t\t\t\tLEFT JOIN space.usuario u ON u.id=up.oidu\n\t\t\t\tLEFT JOIN space.usuario_perfil_privilegio upp ON \n\t\t\t\tupp.oidu = u.id AND\n\t\t\t\tupp.oidp = p.oid AND\n\t\t\t\tupp.oidpr = prv.oid\n\t\t\t\tWHERE ma.url=\\'' . $url . '\\' AND u.id=' . $id;\n\n\t\t\n\t\t//echo $s;\n\t\t$obj = $this->DBSpace->consultar($s);\n\n\t\t$lst = array();\n\t\t$lstp = array();\n\t\tif($obj->cant == 0 ){\n\t\t\t$s = 'SELECT p.oid,p.nomb,prv.oid AS oidp,prv.id, prv.nomb AS bnom, prv.visi\n\t\t\t\tFROM space.privilegio prv\n\t\t\t\tJOIN space.menu_accion ma ON prv.para=ma.url\n\t\t\t\tJOIN space.perfil_privilegio pp ON pp.oidpr=prv.oid\n\t\t\t\tJOIN space.perfil p ON p.oid=pp.oidp\n\t\t\t\tWHERE ma.url=\\'' . $url . '\\'';\n\t\t\t$obj = $this->DBSpace->consultar($s);\n\t\t\tif($obj->cant == 0 )return $lst;\n\t\t}\n\t\t\n\t\t$perfil = $obj->rs[0]->nomb;\n\t\tforeach ($obj->rs as $clv => $v) {\n\t\t\tif($perfil != $v->nomb){\n\t\t\t\t$lst[$perfil] = $lstp;\n\t\t\t\t$perfil = $v->nomb;\n\t\t\t\t$lstp = null;\n\t\t\t}\n\t\t\t$lstp[] = array(\n\t\t\t\t'oidp' => $v->oid,\n\t\t\t\t'cod'=> $v->oidp,\n\t\t\t\t'nomb' => $v->bnom,\n\t\t\t\t'visi' => $v->visi\n\t\t\t);\n\t\t}\n\t\t$lst[$perfil] = $lstp;\n\t\t\n\t\treturn $lst;\n\t}", "private function getPermisosBotonera()\n\t{\n\t\t$auth = new Zend_Session_Namespace('veoliaZend_Auth');\t\n\t\t$rol = Zend_Registry::get('role');\n\t\t$permisos = array();\n\t\t$permisos[\"edit\"] = ($auth->_acl->isAllowed($rol,\"default:tipoagrupacion\",\"edit\"))? true : false;\n\t\t$permisos[\"add\"] = ($auth->_acl->isAllowed($rol,\"default:tipoagrupacion\",\"add\"))? true : false;\n\t\t$permisos[\"delete\"] = ($auth->_acl->isAllowed($rol,\"default:tipoagrupacion\",\"delete\"))? true : false;\n\t\t$permisos[\"menulateral\"] = ($auth->_acl->isAllowed($rol,\"default:tipoagrupacion\",\"menulateral\"))? true : false;\n\t\t$permisos[\"detail\"] = ($auth->_acl->isAllowed($rol,\"default:tipoagrupacion\",\"detail\"))? true : false;\n\t\treturn $permisos;\n\t}", "public static function getList(){\n\t\t\t$sql = new sql();\n\n\t\t\treturn $sql->select(\"SELECT * FROM tb_usuarios ORDER BY deslogim\");\n\t\t}", "function desList(){\n\t$sql = 'SELECT * FROM votos';\n\t$resultado = mysql_query($sql);\n\t\n\twhile($row = mysql_fetch_array($resultado)){\n\t\toculta( $row['cancion'] );\n \t}\n}", "public function listarUsuarios()\r\n\t{\r\n\t\t$administradores=array();\r\n\t\ttry{\r\n\t\t\t//realizamos la consulta de todos los items\r\n\t\t\t$consulta = $this->db->prepare(\"select * from administrador\");\r\n\t\t\t$consulta->execute();\r\n\t\t\tfor($i=0; $row = $consulta->fetch(); $i++)\r\n\t\t\t{\r\n\t\t $fila['admin_cedula']=$row['ADMIN_CEDULA'];\r\n\t\t\t$fila['admin_login']=$row['ADMIN_LOGIN'];\r\n\t\t\t$fila['admin_nombre']=$row['ADMIN_NOMBRE'];\r\n\t\t\t$fila['admin_apellido']=$row['ADMIN_APELLIDO'];\r\n\t\t\t$fila['admin_status']=$row['ADMIN_STATUS'];\r\n\t\t\t$administradores[]=$fila;\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tcatch(PDOException $e)\r\n\t\t{\r\n\t\t\techo $e;\r\n\t\t}\r\n\t\treturn $administradores;\t\t\r\n\t}", "static function listHiddenExhibit(){\n\t\t$res = requete_sql(\"SELECT id FROM exhibit WHERE visible = FALSE ORDER BY creation_date ASC\");\n\t\t$res = $res->fetchAll(PDO::FETCH_ASSOC);\n\t\t$list = array();\n\t\tforeach ($res as $exhibit) {\n\t\t\t$exhibit = new Exhibit($exhibit['id']);\n\t\t\tarray_push($list, $exhibit);\n\t\t}\n\t\treturn $list;\n\t}", "public function getList()\n\t{\n\t\t$this->methodNotAllowed();\t\t\n\t}", "private function metodo_privado() {\n }", "function getAllAccess() {\n return ['download', 'remoteAccess', 'remoteService', 'enclave','notAvailable'];\n}", "public function getAutoposList(){\n return $this->_get(2);\n }", "static function listaSkripti(){\n\t\t$skripte=\"\";\n\t\treturn $skripte;\n\t}", "public function giveListBlockedEventsIds(){\r\n $query = \"SELECT id FROM \".$this->tables['eventoTable'].\r\n \" WHERE blocked = TRUE\";\r\n\t\t$result = self::$conn->query($query);\r\n $list = array();\r\n if($result->num_rows == 0)\r\n return $list;\r\n if($result){\r\n while ($row = $result->fetch_assoc()) \r\n $list[] = $row['id'];\r\n $result->free();\r\n }\r\n return $list;\r\n }", "public function consultar_configuracion(){\n $listado = [];\n #Recorro la jornada....\n $resultados = $this->mongo_db->order_by(array('_id' => 'DESC'))->where(array('eliminado'=>false))->get(\"configuracion_reservaciones\");\n foreach ($resultados as $clave => $valor) {\n $valores = $valor;\n $listado[]= $valores;\n }\n return $valores;\n }", "public function allAnnonce(){\n $annonces=$this->repAnnonce->findBy(['disponibilite' =>'1']);\n return $annonces;\n }", "public function deleteList()\n {\n if (!request()->ajax()) {\n return response()->json(['error' => 1, 'msg' => 'Method not allow!']);\n } else {\n $ids = request('ids');\n $arrID = explode(',', $ids);\n $arrDontPermission = [];\n foreach ($arrID as $key => $id) {\n if(!$this->checkPermisisonItem($id)) {\n $arrDontPermission[] = $id;\n }\n }\n if (count($arrDontPermission)) {\n return response()->json(['error' => 1, 'msg' => sc_language_render('admin.remove_dont_permisison') . ': ' . json_encode($arrDontPermission)]);\n }\n AdminCmsContent::destroy($arrID);\n sc_clear_cache('cache_cms_content');\n return response()->json(['error' => 0, 'msg' => '']);\n }\n }", "private static function notAllowed() : array\n\t{\n\t\t$return = [];\n\n\t\t$aeSettings = \\MarkNotes\\Settings::getInstance();\n\n\t\t$return['count'] = 0;\n\t\t$return['status'] = 0;\n\t\t$return['message'] = $aeSettings->getText('not_authenticated');\n\n\t\t/*<!-- build:debug -->*/\n\t\tif ($aeSettings->getDebugMode()) {\n\t\t\t$return['debug'] = 'The show_login settings is set to ' .\n\t\t\t\t'1 and the user isn\\'t yet connected. In that case, ' .\n\t\t\t\t'the list of files should be keept hidden';\n\t\t}\n\t\t/*<!-- endbuild -->*/\n\n\t\treturn $return;\n\t}", "public static function getRotasPermitidas(){\n $usucpf = $_SESSION['usucpf'];\n $sisid = $_SESSION['sisid'];\n $perfis = $_SESSION['perfil'][$usucpf][$sisid];\n\n $arrTmp = array();\n if(!empty($perfis)){\n $rotas = Rota::select('ds_rota')\n ->join('seguranca.tb_rota_perfil','seguranca.tb_rota_perfil.co_rota','=','seguranca.tb_rota.co_rota')\n ->where('sisid',$sisid)\n ->where('seguranca.tb_rota_perfil.st_habilitado',true)\n ->whereIn('seguranca.tb_rota_perfil.pflcod',$perfis)->get();\n\n\n\n if(!empty($rotas)){\n foreach ($rotas as $rota)\n $arrTmp[] = $rota->ds_rota;\n }\n }\n return $arrTmp;\n }", "public function clientList()\n\t{\n\t\treturn $this->client()->latest()\n\t\t\t->where('password_client', true)\n\t\t\t->where('revoked', false)->get()\n\t\t\t->makeVisible('secret');\n\t}", "private function getListaUsuarioAutorizado()\r\n\t {\r\n\t \treturn [\r\n\t \t\t'adminteq',\r\n\t \t\t'pfranco',\r\n\t \t\t'kperez',\r\n\t \t];\r\n\t }", "function show_deny() {\n\t\t\tshow_error(\n\t\t\t\t'403 Forbidden',\n\t\t\t\t'You do not have sufficient clearance to view this page.'\n\t\t\t);\n\t\t}", "public function listar(){\n require_once 'models/Nota.php';\n \n //Lógica acción controlador\n $nota = new Nota();\n \n $notas = $nota->conseguirTodos('notas');\n \n //Vista\n require_once 'views/nota/listar.php';\n \n }", "public function list(){\n\n $urls = Urls::all();\n \n $capturas = array();\n foreach($urls as $key=>$val){\n $status = $this->status_url($val['url']);\n $conteudo = $this->content_url($val['url']);\n /* bem simples. salva os dados no banco */\n $capturas[] = array('conteudo' => $conteudo, 'status' => $status, 'url_id' => $val['id']);\n }\n\n $this->salvar($capturas);\n }", "public function getListadoObligacioness() {\n return $this->conexionObligaciones->listaLlaves(\"CARNET\", \"ASC\");\n }", "public function listarComentariosAceitos(){\n $this->validaAutenticacao();\n $comentario = Container::getModel('Comentarios');\n $comentario->__set('idVitima', $_POST['idVitima']);\n\n echo (json_encode($comentario->getComentariosAprovadosDashboard()));\n }", "public function getAllRights(){\r\n // ziskam vsechna prava z DB razena dle ID a vratim je\r\n $rights = $this->selectFromTable(TABLE_PRAVO);\r\n return $rights;\r\n }" ]
[ "0.6037511", "0.5771561", "0.5634377", "0.5563751", "0.5501835", "0.5465665", "0.54615456", "0.544945", "0.54405", "0.5425232", "0.5376538", "0.53717947", "0.5350987", "0.5350898", "0.5336071", "0.5335473", "0.5328501", "0.53245723", "0.531855", "0.5312479", "0.5312399", "0.52958566", "0.5290965", "0.52881694", "0.52291447", "0.5225429", "0.5224229", "0.52237785", "0.52191824", "0.5210336" ]
0.61045814
0
Constructs a new GiftAttributeValueEvent.
public function __construct(GiftAttributeValueInterface $attribute_value) { $this->attributeValue = $attribute_value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function fromAttributeValue(AttributeValue $value): self\n {\n return self::create(AttributeType::create($value->oid()), $value);\n }", "public function createAttribute()\n\t{\n\n\t\t$this->createCustomAttribute($this->attributeName, $this->arguments);\n\n\t}", "public function createAttributeValue($value)\n {\n $av = new NumberValue();\n $av->setValue($value);\n\n return $av;\n }", "protected function _construct()\n\n\t{\n\n\t\t$this->_init('eav_attribute', 'attribute_id');\n\n\t}", "public function getBonusAttInstance()\n {\n return new BonusAttribute();\n }", "public function addAttributes($attr, $event)\n\t{\n\t\t$attributes = $event->eventType->eventAttributes;\n\t\t$allowed = array();\n\t\tforeach ($attributes as $attribute){\n\t\t\t$allowed[] = $attribute->idEventAttribute;\n\t\t}\n\t\tforeach (array_keys($attr) as $id){\n\t\t\tif (in_array($id, $allowed)){\n\t\t\t\t// later also get the value type from the event attribute and validate input data to that defined type\n\t\t\t\t// also needs error checking and handling\n\t\t\t\t$eav = new EventAttributeValue();\n\t\t\t\t$eav->eventId = $event->idEvent;\n\t\t\t\t$eav->eventAttributeId = $id;\n\t\t\t\t$eav->value = $attr[$id];\n\t\t\t\t$eav->save();\n\t\t\t} else {\n\t\t\t\t//Possible hacking attempt\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "protected function generateAttribute($attribute, $varValue)\n\t{\n\t\t$strBuffer = '';\n\t\t$arrData = $GLOBALS['TL_DCA']['tl_iso_products']['fields'][$attribute];\n\n\t\t// Return the IsotopeGallery object\n\t\tif ($arrData['inputType'] == 'mediaManager')\n\t\t{\n\t\t\treturn $this->$attribute;\n\t\t}\n\n\t\t// Calculate the prices\n\t\telseif ($attribute == 'price')\n\t\t{\n\t\t\t$fltPrice = $varValue;\n\t\t\t$fltOriginalPrice = $this->original_price;\n\n\t\t\tif ($this->arrCache['from_price'] !== null)\n\t\t\t{\n\t\t\t\t$fltPrice = $this->Isotope->calculatePrice($this->arrCache['from_price'], $this, 'price', $this->arrData['tax_class']);\n\t\t\t\t$fltOriginalPrice = $this->Isotope->calculatePrice($this->arrCache['from_price'], $this, 'original_price', $this->arrData['tax_class']);\n\n\t\t\t\t$strBuffer = sprintf($GLOBALS['TL_LANG']['MSC']['priceRangeLabel'], $this->Isotope->formatPriceWithCurrency($fltPrice));\n\t\t\t\t$strOriginalPrice = sprintf($GLOBALS['TL_LANG']['MSC']['priceRangeLabel'], $this->Isotope->formatPriceWithCurrency($fltOriginalPrice));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$strBuffer = $this->Isotope->formatPriceWithCurrency($fltPrice);\n\t\t\t\t$strOriginalPrice = $this->Isotope->formatPriceWithCurrency($fltOriginalPrice);\n\t\t\t}\n\n\t\t\tif ($fltPrice != $fltOriginalPrice)\n\t\t\t{\n\t\t\t\t$strBuffer = '<div class=\"original_price\"><strike>' . $strOriginalPrice . '</strike></div><div class=\"price\">' . $strBuffer . '</div>';\n\t\t\t}\n\t\t}\n\n\t\t// Calculate base price\n\t\telseif ($attribute == 'baseprice')\n\t\t{\n\t\t\tif (is_array($varValue) && $varValue['unit'] > 0 && $varValue['value'] != '')\n\t\t\t{\n\t\t\t\t$objBasePrice = $this->Database->execute(\"SELECT * FROM tl_iso_baseprice WHERE id=\" . (int) $varValue['unit']);\n\n\t\t\t\tif ($objBasePrice->numRows)\n\t\t\t\t{\n\t\t\t\t\t$strBuffer = sprintf($this->Isotope->translate($objBasePrice->label), $this->Isotope->formatPriceWithCurrency($this->price / $varValue['value'] * $objBasePrice->amount), $varValue['value']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Convert line breaks in textarea to <br> tags\n\t\telseif ($arrData['inputType'] == 'textarea' && $arrData['eval']['rte'] == '')\n\t\t{\n\t\t\t$strBuffer = nl2br($varValue);\n\t\t}\n\n\t\t// Generate download attributes\n\t\telseif ($arrData['inputType'] == 'downloads')\n\t\t{\n\t\t\t$this->import('IsotopeFrontend');\n\t\t\t$strBuffer = $this->IsotopeFrontend->generateDownloadAttribute($attribute, $arrData, $varValue);\n\t\t}\n\n\t\t// Generate a HTML table for associative arrays\n\t\telseif (is_array($varValue) && !array_is_assoc($varValue) && is_array($varValue[0]))\n\t\t{\n\t\t\t$arrFormat = $GLOBALS['TL_DCA']['tl_iso_products']['fields'][$attribute]['tableformat'];\n\n\t\t\t$last = count($varValue[0])-1;\n\n\t\t\t$strBuffer = '\n<table class=\"'.$attribute.'\">\n <thead>\n <tr>';\n\n\t\t\tforeach (array_keys($varValue[0]) as $i => $name)\n\t\t\t{\n\t\t\t\tif ($arrFormat[$name]['doNotShow'])\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$label = $arrFormat[$name]['label'] ? $arrFormat[$name]['label'] : $name;\n\n\t\t\t\t$strBuffer .= '\n <th class=\"head_'.$i.($i==0 ? ' head_first' : '').($i==$last ? ' head_last' : ''). (!is_numeric($name) ? ' '.standardize($name) : '').'\">' . $label . '</th>';\n\t\t\t}\n\n\t\t\t$strBuffer .= '\n </tr>\n </thead>\n <tbody>';\n\n\t\t\tforeach ($varValue as $r => $row)\n\t\t\t{\n\t\t\t\t$strBuffer .= '\n <tr class=\"row_'.$r.($r==0 ? ' row_first' : '').($r==$last ? ' row_last' : '').' '.($r%2 ? 'odd' : 'even').'\">';\n\n \t\t\t$c = -1;\n\n \t\t\tforeach ($row as $name => $value)\n \t\t\t{\n \t\t\t\tif ($arrFormat[$name]['doNotShow'])\n \t\t\t\t{\n \t\t\t\t\tcontinue;\n \t\t\t\t}\n\n \t\t\t\tif ($arrFormat[$name]['rgxp'] == 'price')\n \t\t\t\t{\n \t\t\t\t\t$value = $this->Isotope->formatPriceWithCurrency($this->Isotope->calculatePrice($value, $this, 'price_tiers', $this->arrData['tax_class']));\n \t\t\t\t}\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t$value = $arrFormat[$name]['format'] ? sprintf($arrFormat[$name]['format'], $value) : $value;\n \t\t\t\t}\n\n \t\t\t\t$strBuffer .= '\n <td class=\"col_'.++$c.($c==0 ? ' col_first' : '').($c==$i ? ' col_last' : '').' '.standardize($name).'\">' . $value . '</td>';\n \t\t\t}\n\n \t\t\t$strBuffer .= '\n </tr>';\n\t\t\t}\n\n\t\t\t$strBuffer .= '\n </tbody>\n</table>';\n\t\t}\n\n\t\t// Generate ul/li listing for simpley arrays\n\t\telseif (is_array($varValue))\n\t\t{\n\t\t\t$strBuffer = '\n<ul>';\n\n\t\t\t$current = 0;\n\t\t\t$last = count($varValue)-1;\n\t\t\tforeach( $varValue as $value )\n\t\t\t{\n\t\t\t\t$class = trim(($current == 0 ? 'first' : '') . ($current == $last ? ' last' : ''));\n\n\t\t\t\t$strBuffer .= '\n <li'.($class != '' ? ' class=\"'.$class.'\"' : '').'>' . $value . '</li>';\n\t\t\t}\n\n\t\t\t$strBuffer .= '\n</ul>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$strBuffer = $this->Isotope->formatValue('tl_iso_products', $attribute, $varValue);\n\t\t}\n\n\t\t// !HOOK: allow for custom attribute types to modify their output\n\t\tif (isset($GLOBALS['ISO_HOOKS']['generateAttribute']) && is_array($GLOBALS['ISO_HOOKS']['generateAttribute']))\n\t\t{\n\t\t\tforeach ($GLOBALS['ISO_HOOKS']['generateAttribute'] as $callback)\n\t\t\t{\n\t\t\t\t$this->import($callback[0]);\n\t\t\t\t$strBuffer = $this->$callback[0]->$callback[1]($attribute, $varValue, $strBuffer, $this);\n\t\t\t}\n\t\t}\n\n\t\t// Apply <div> ID to variant attributes so we can replace it with javascript/ajax\n\t\tif (in_array($attribute, $this->arrVariantAttributes))\n\t\t{\n\t\t\treturn '<div class=\"iso_attribute ' . $attribute . '\" id=\"' . $this->formSubmit . '_' . $attribute . '\">' . $strBuffer . '</div>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $strBuffer;\n\t\t}\n\t}", "public static function purifyHtmlEventAttributes($value)\n\t{\n\t\tif (preg_match('#<([^><]+?)([^a-z_\\\\-]on\\\\w*|xmlns)(\\\\s*=\\\\s*[^><]*)([>]*)#i', $value) || preg_match('/\\\\b(' . static::$htmlEventAttributes . ')\\\\s*=/i', $value) || preg_match('/javascript:[\\w\\.]+\\(/i', $value)) {\n\t\t\t\\App\\Log::error('purifyHtmlEventAttributes: ' . $value, 'IllegalValue');\n\t\t\tthrow new Exceptions\\IllegalValue('ERR_NOT_ALLOWED_VALUE||' . $value, 406);\n\t\t}\n\t}", "public function __construct($attributeName, $attributeValue)\n {\n $this->attributeName = $attributeName;\n $this->attributeValue = $attributeValue;\n }", "protected function createdAt(): Attribute\n {\n return new Attribute(\n get: fn ($value) => Carbon::parse($value)->format('Y-m-d H:i'),\n );\n }", "function CreateValue($AttributeName,$AttributeValue)\r\n{\r\n $var = new ODSubmission_Var;\r\n\t$var->attribute = $AttributeName;\r\n\t$var->simpleValue = utf8_encode($AttributeValue);\r\n\t$var->type = 'TYPE_STRING';\r\n\treturn $var;\r\n}", "protected function castAttribute($key, $value)\n {\n return new $this->casts[$key]($value);\n }", "public function getAttributeValue() {\n return $this->attributeValue;\n }", "protected function getValueAttribute() {}", "protected function fromValueObject($key, $value, $class)\n {\n if (! ($value instanceof $class)) {\n throw new \\InvalidArgumentException(\"Attribute '{$key}' must be an instance of {$class}\");\n }\n\n $this->attributes[$key] = $value->getNativeValue();\n\n return $this;\n }", "public function createContextAttribute($contextName, $attributeName);", "public function getCollectedAttribute()\n {\n // FIXME\n return 0;\n }", "public function attributeValues()\n {\n return $this->morphMany(AttributeValue::class, 'attributable')\n ->with('attribute');\n }", "public static function addAttributeValue(ProductAttribute $attribute, string $valueCode, string $valueName = null)\n {\n global $db, $user;\n\n //====================================================================//\n // Ensure Service Init\n self::init();\n\n //====================================================================//\n // Create New Attribute\n $value = new ProductAttributeValue($db);\n $value->fk_product_attribute = $attribute->id;\n $value->ref = strtoupper($valueCode);\n $value->value = is_string($valueName) ? $valueName : $valueCode;\n\n if ($value->create($user) < 0) {\n return Splash::log()->errTrace(\n \"Unable to Create Product Attribute Value (\".$valueCode.\"@\".$attribute->ref.\").\"\n );\n }\n\n //====================================================================//\n // Reload Load Attributes Values Cache\n self::loadAttributeValues($attribute->id);\n\n return $value;\n }", "public function createCustomevent(): self\n {\n $this->event_type = debug_backtrace()[1]['function'];\n $attr = $this->getAttributes();\n $dirty = $this->getDirty();\n $original = $this->getOriginal();\n // dd($attr, $dirty, $original);\n\n $details = [];\n foreach ($attr as $property => $value) {\n if (array_key_exists($property, $dirty) or !$dirty) {\n $details[] = [\n $property,\n $original[$property] ?? FALSE,\n $dirty[$property] ?? FALSE,\n ];\n }\n }\n\n Customevent::create([\n 'user_id' => auth()->user() ? auth()->user()->id : User::SYSUID,\n 'model' => $this->getTable(),\n 'model_id' => $this->id,\n 'model_name' => $this->name,\n 'type' => $this->event_type,\n 'description' => $this->event_description ?? FALSE,\n 'details' => serialize($details) ?? '',\n ]);\n return $this;\n }", "protected function getRandomInstance()\n {\n $eventLine = new EventTag();\n $this->fillThing($eventLine);\n\n return $eventLine;\n }", "protected function createValue($AttributeName,$AttributeValue){\n\t\t$var = new ODSubmission_Var;\n\t\t$var->attribute = $AttributeName;\n\t\t$var->simpleValue = utf8_encode($AttributeValue);\n\t\t$var->type = 'TYPE_STRING';\n\t\treturn $var;\n\t}", "public function getAttributeValue($index = null);", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "public function createEvent()\n {\n return new Event();\n }", "public function store(Request $request)\n {\n abort_if(Gate::denies('Attributevalue_create'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n $Attribute = AttributeValue::create([\n 'attribute_id' => $request->attribute_id,\n 'value' => $request->value,\n 'code' => $request->code,\n ]);\n return (new Attribute_valueResource($Attribute))\n ->response()\n ->setStatusCode(Response::HTTP_CREATED);\n }", "function generateVariationsFromAttributes(ProductAttributeType $attributetype, array $values){\r\n\r\n\t\t//TODO: introduce transactions here, in case objects get half made etc\r\n\r\n\t\t//if product has variation attribute types\r\n\t\tif(is_array($values)){\r\n\t\t\t//TODO: get values dataobject set\r\n\t\t\t$avalues = $attributetype->convertArrayToValues($values);\r\n\t\t\t$existingvariations = $this->owner->Variations();\r\n\t\t\tif($existingvariations->exists()){\r\n\t\t\t\t//delete old variation, and create new ones - to prevent modification of exising variations\r\n\t\t\t\tforeach($existingvariations as $oldvariation){\r\n\t\t\t\t\t$oldvalues = $oldvariation->AttributeValues();\r\n\t\t\t\t\tif($oldvalues) {\r\n\t\t\t\t\t\tforeach($avalues as $value){\r\n\t\t\t\t\t\t\t$newvariation = $oldvariation->duplicate();\r\n\t\t\t\t\t\t\t$newvariation->InternalItemID = $this->owner->InternalItemID.'-'.$newvariation->ID;\r\n\t\t\t\t\t\t\t$newvariation->AttributeValues()->addMany($oldvalues);\r\n\t\t\t\t\t\t\t$newvariation->AttributeValues()->add($value);\r\n\t\t\t\t\t\t\t$newvariation->write();\r\n\t\t\t\t\t\t\t$existingvariations->add($newvariation);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$existingvariations->remove($oldvariation);\r\n\t\t\t\t\t$oldvariation->AttributeValues()->removeAll();\r\n\t\t\t\t\t$oldvariation->delete();\r\n\t\t\t\t\t$oldvariation->destroy();\r\n\t\t\t\t\t//TODO: check that old variations actually stick around, as they will be needed for past orders etc\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif($avalues) {\r\n\t\t\t\t\tforeach($avalues as $value){\r\n\t\t\t\t\t\t$variation = new ProductVariation();\r\n\t\t\t\t\t\t$variation->ProductID = $this->owner->ID;\r\n\t\t\t\t\t\t$variation->Price = $this->owner->Price;\r\n\t\t\t\t\t\t$variation->write();\r\n\t\t\t\t\t\t$variation->InternalItemID = $this->owner->InternalItemID.'-'.$variation->ID;\r\n\t\t\t\t\t\t$variation->AttributeValues()->add($value); //TODO: find or create actual value\r\n\t\t\t\t\t\t$variation->write();\r\n\t\t\t\t\t\t$existingvariations->add($variation);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function getProductsVariantsAttributeValueRequest($attribute_id)\n {\n // verify the required parameter 'attribute_id' is set\n if ($attribute_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $attribute_id when calling getProductsVariantsAttributeValue'\n );\n }\n if ($attribute_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$attribute_id\" when calling DefaultApi.getProductsVariantsAttributeValue, must be bigger than or equal to 1.');\n }\n $resourcePath = '/product-attributes/{attributeId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // path params\n if ($attribute_id !== null) {\n $resourcePath = str_replace(\n '{' . 'attributeId' . '}',\n ObjectSerializer::toPathValue($attribute_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "protected function getProductsVariantsAttributeValue_0Request($attribute_id, $attribute_value_id, $include = null)\n {\n // verify the required parameter 'attribute_id' is set\n if ($attribute_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $attribute_id when calling getProductsVariantsAttributeValue_0'\n );\n }\n if ($attribute_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$attribute_id\" when calling DefaultApi.getProductsVariantsAttributeValue_0, must be bigger than or equal to 1.');\n }\n // verify the required parameter 'attribute_value_id' is set\n if ($attribute_value_id === null) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $attribute_value_id when calling getProductsVariantsAttributeValue_0'\n );\n }\n if ($attribute_value_id < 1) {\n throw new \\InvalidArgumentException('invalid value for \"$attribute_value_id\" when calling DefaultApi.getProductsVariantsAttributeValue_0, must be bigger than or equal to 1.');\n }\n $resourcePath = '/product-attributes/{attributeId}/values/{attributeValueId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($include !== null) {\n $queryParams['include'] = ObjectSerializer::toQueryValue($include);\n }\n // path params\n if ($attribute_id !== null) {\n $resourcePath = str_replace(\n '{' . 'attributeId' . '}',\n ObjectSerializer::toPathValue($attribute_id),\n $resourcePath\n );\n }\n // path params\n if ($attribute_value_id !== null) {\n $resourcePath = str_replace(\n '{' . 'attributeValueId' . '}',\n ObjectSerializer::toPathValue($attribute_value_id),\n $resourcePath\n );\n }\n // body params\n $_tempBody = null;\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n \n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n \n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getCustomAttributesAttribute()\n {\n return $this->custom_attributes()->get();\n }" ]
[ "0.5482293", "0.5174365", "0.49501112", "0.4897669", "0.47513238", "0.47161725", "0.47056282", "0.4698236", "0.4682944", "0.46490794", "0.46372426", "0.46105185", "0.45910355", "0.4562178", "0.45293403", "0.45104438", "0.44829175", "0.44669187", "0.44576022", "0.44397858", "0.44383723", "0.44171542", "0.44083875", "0.44037908", "0.43932492", "0.4389584", "0.43894523", "0.43804565", "0.4366687", "0.4363242" ]
0.62003654
0
Gets the gift attribute value.
public function getAttributeValue() { return $this->attributeValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValue() {\n return $this->attributes['value'];\n }", "function getValue()\n {\n return $this->getAttribute(\"value\");\n }", "public function getValue(string $attr)\n {\n $this->checkAttribute($attr);\n return $this->attributes[$attr];\n }", "public function getAttribute(): string\n {\n return $this->attribute;\n }", "public function getAttr(): string\r\n {\r\n return $this->attr;\r\n }", "public function getAttribute()\n {\n return $this->attribute;\n }", "public function getAttribute()\n {\n return $this->attribute;\n }", "public function getValue(): string\n {\n return $this->getAttribute('value');\n }", "protected function getValueAttribute() {}", "public function getValue() {\n\t\t$db = Loader::db();\n\t\t$value = $db->GetOne('select value from atDefault where avID = ?', array($this->getAttributeValueID()));\n\t\t\n\t\t$jsonHelper = Loader::helper('json');\n\t\treturn $jsonHelper->decode($value);\n\t}", "public function getValue(): string\n {\n return $this->fusionValue('value') ?? '';\n }", "public function getValueFormattedAttribute()\n {\n return DataHelper::getFloat2Real($this->getAttribute('value'));\n }", "public function getValue() {\n\t\treturn $this->data[\"value\"];\n\t}", "public function getValue()\n\t{\n\t\treturn $this->data['value'];\n\t}", "public function getValue()\n {\n return $this->get(self::_VALUE);\n }", "public function getValue()\n {\n return $this->get(self::_VALUE);\n }", "public function getAttribute(): string|null\n {\n return $this->attribute;\n }", "protected function _getAttributeValue($attribute)\n {\n $entry = $this->getEntry();\n $attributeArr = $entry->getGbaseAttribute($attribute);\n if (is_array($attributeArr) && is_object($attributeArr[0])) {\n return $attributeArr[0]->getText();\n }\n return null;\n }", "public function getValue()\n {\n return $this->get(self::VALUE);\n }", "public function getValue()\n {\n return $this->get(self::VALUE);\n }", "public function get()\n\t{\n\t\treturn $this->_value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this->value;\n\t}", "public function getValue() {\n\t\treturn $this -> value;\n\t}", "public function getValue()\n {\n\t\treturn $this->value;\n\t}", "public function get()\n {\n return $this->value;\n }" ]
[ "0.707214", "0.6749503", "0.66779745", "0.66291416", "0.6616211", "0.65846014", "0.65846014", "0.65426826", "0.6431293", "0.64220107", "0.63723105", "0.6287378", "0.62606466", "0.6237991", "0.6215489", "0.6215489", "0.6197989", "0.61887074", "0.61862296", "0.61862296", "0.61824584", "0.61731327", "0.61731327", "0.61731327", "0.61731327", "0.61731327", "0.61731327", "0.61679745", "0.6160942", "0.614592" ]
0.71333665
0
Creates complete names by inserting an array of the person's data. Supported field names: firstname, lastname, academicTitle, additionalTitle, gender If some of the fields shouldn't go into the processed name, just leave them out of $arrData
public function createNameByFields(string $language, array $data) { if ($language) { /** @var System $system */ $system = $this->framework->getAdapter(System::class); $system->loadLanguageFile('default', $language, true); } $name = ''; if ($data['firstname']) { $name = $data['firstname'].($data['lastname'] ? ' '.$data['lastname'] : ''); } elseif ($data['lastname']) { $name = $data['lastname']; } if ($name && $data['academicTitle']) { $name = $data['academicTitle'].' '.$name; } if ($name && $data['additionalTitle']) { $name = $data['additionalTitle'].' '.$name; } if ($data['lastname'] && $data['gender'] && ('en' != $language || !$data['academicTitle'])) { $gender = $GLOBALS['TL_LANG']['MSC']['haste_plus']['gender'.('female' == $data['gender'] ? 'Female' : 'Male')]; $name = $gender.' '.$name; } if ($language) { $system->loadLanguageFile('default', $GLOBALS['TL_LANGUAGE'], true); } return $name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processEmployee() {\r\n // Names the array as `first intial+last name` of employee. ????\r\n // Sends the array to the `employee_arrays.php` file to be pushed to $employeeDatabase.\r\n // From there, the new array gets passed through the `addToDatabase()` function. \r\n }", "function _create_proper_name_field() {\r\n global $locale;\r\n $full_name = $locale->getLocaleFormattedName($this->first_name, $this->last_name, $this->salutation);\r\n $this->name = $full_name;\r\n $this->full_name = $full_name; \r\n\r\n\t}", "private function register_person_fields() {\n\n // Name fields\n $name_children = [\n 'prefix' => new \\Fieldmanager_Textfield( esc_html__( 'Prefix', 'pedestal' ), [\n 'name' => 'prefix',\n ] ),\n 'first' => new \\Fieldmanager_Textfield( esc_html__( 'First Name', 'pedestal' ), [\n 'name' => 'first',\n 'required' => true,\n 'validation_rules' => 'required',\n 'validation_messages' => esc_html__( 'Required', 'pedestal' ),\n ] ),\n 'middle' => new \\Fieldmanager_Textfield( esc_html__( 'Middle Name', 'pedestal' ), [\n 'name' => 'middle',\n ] ),\n 'nickname' => new \\Fieldmanager_Textfield( esc_html__( 'Nickname', 'pedestal' ), [\n 'name' => 'nickname',\n ] ),\n 'last' => new \\Fieldmanager_Textfield( esc_html__( 'Last Name', 'pedestal' ), [\n 'name' => 'last',\n 'required' => true,\n 'validation_rules' => 'required',\n 'validation_messages' => esc_html__( 'Required', 'pedestal' ),\n ] ),\n 'suffix' => new \\Fieldmanager_Textfield( esc_html__( 'Suffix', 'pedestal' ), [\n 'name' => 'suffix',\n ] ),\n ];\n $name = new \\Fieldmanager_Group( false, [\n 'name' => 'person_name',\n 'children' => $name_children,\n 'serialize_data' => false,\n ] );\n\n // Biographical Details fields\n $details_children = [\n 'known_for' => new \\Fieldmanager_Textfield( esc_html__( 'Known For', 'pedestal' ), [\n 'name' => 'known_for',\n ] ),\n 'url' => new \\Fieldmanager_Link( esc_html__( 'Website URL', 'pedestal' ), [\n 'name' => 'url',\n 'required' => false,\n ] ),\n 'dob' => new \\Fieldmanager_Datepicker( esc_html__( 'Birthdate', 'pedestal' ), [\n 'js_opts' => [\n 'changeMonth' => true,\n 'changeYear' => true,\n 'firstDay' => 0,\n // Last 100 years\n // https://api.jqueryui.com/datepicker/#option-yearRange\n 'yearRange' => '-100:+0',\n ],\n ] ),\n ];\n $details = new \\Fieldmanager_Group( false, [\n 'name' => 'person_details',\n 'children' => $details_children,\n 'serialize_data' => false,\n ] );\n\n // Social media fields\n $social_children = [\n 'twitter' => new \\Fieldmanager_Link( esc_html__( 'Twitter URL', 'pedestal' ), [\n 'name' => 'twitter',\n 'attributes' => [\n 'placeholder' => 'https://twitter.com/someone',\n 'size' => 50,\n ],\n ] ),\n 'instagram' => new \\Fieldmanager_Link( esc_html__( 'Instagram URL', 'pedestal' ), [\n 'name' => 'instagram',\n 'attributes' => [\n 'placeholder' => 'https://www.instagram.com/someone/',\n 'size' => 50,\n ],\n ] ),\n 'linkedin' => new \\Fieldmanager_Link( esc_html__( 'LinkedIn URL', 'pedestal' ), [\n 'attributes' => [\n 'placeholder' => 'https://www.linkedin.com/in/someone',\n 'size' => 50,\n ],\n ] ),\n ];\n $social = new \\Fieldmanager_Group( false, [\n 'name' => 'person_social',\n 'children' => $social_children,\n 'serialize_data' => false,\n ] );\n\n $name->add_meta_box( esc_html__( 'Name', 'pedestal' ), [ 'pedestal_person' ], 'normal', 'high' );\n $details->add_meta_box( esc_html__( 'Biographical Details', 'pedestal' ), [ 'pedestal_person' ], 'normal', 'high' );\n $social->add_meta_box( esc_html__( 'Social Media URLs', 'pedestal' ), [ 'pedestal_person' ], 'normal', 'high' );\n\n }", "public function addPlaceName($data, $place, $noun, $leadfirstName, $adjective)\n {\n \n $totalNames = count($data);\n $randomNumber = rand(1, $totalNames);\n\n $array = array();\n for ($i=1; $i <= $randomNumber; $i++) { \n # code...\n $array[$i] = $i; \n }\n\n $returnArray = array();\n $place = ($place) ? $place : $adjective;\n $noun = ($noun) ? $noun : $adjective;\n\n foreach ($data as $key => $value) {\n # code...\n if($key%5 == 0):\n if($key%10 == 0) :\n $returnArray[$key]['names'] = $value['names'].' '.$noun;\n else:\n $returnArray[$key]['names'] = $value['names'].' '.$place;\n endif;\n else :\n $returnArray[$key]['names'] = $value['names'].' '.$adjective;\n endif; \n }\n\n return $returnArray;\n // echo \"<pre>\";\n // print_r($returnArray);\n // exit;\n\n }", "private function getPersonDataArray()\n {\n $names = ['Jane', 'Joe', 'Bill', 'John'];\n $counter = $this->personCounter;\n if ($counter > (count($names)-1)) {\n $counter = 0;\n $this->personCounter = 0;\n } else {\n $this->personCounter++;\n }\n return [\n 'name' => $names[$counter],\n 'age' => rand(18, 50)\n ];\n }", "public function generateData($field, $name)\n\t\t{\n\n\t\t\tif(!empty($field)) {\n\t\t\t\t?>\n\t\t\t\t<input type=\"hidden\" name=\"<?php echo esc_attr( $name );?>[]\" value=\"\"/>\n\t\t\t\t<?php\n\t\t\t\tforeach ($field as $key => $tweet) {\n\t\t\t\t\tif(!empty($tweet)) {\n\t\t\t\t\t ?>\n\t\t\t\t\t\t<div class=\"profile current\">\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"<?php echo esc_attr( $name ); ?>[]\" value=\"<?php echo esc_attr( json_encode($tweet) ); ?>\">\n\t\t\t\t\t\t\t<img width=\"80\" src=\"<?php echo $tweet['profile_image_url']; ?>\">\n\t\t\t\t\t\t\t<p><strong>ID</strong>: <?php echo $tweet['id']; ?></p>\n\t\t\t\t\t\t\t<p><strong>Name</strong>: <?php echo $tweet['name']; ?></p>\n\t\t\t\t\t\t\t<p><strong>Screen Name</strong>: <?php echo $tweet['screen_name']; ?></p>\n\t\t\t\t\t\t\t<p><strong>Description</strong>: <?php echo substr($tweet['description'], 0, 50); ?></p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<?php\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "function generate_search_data_fields($name, $dexnum, $type1, $type2, $region, $specialform, $tier) {\n $specialform = $specialform ? 'true' : 'false';\n\n if ($type1 === 'No Secondary') {\n $type1 = 'notype';\n }\n\n if ($type2 === 'No Secondary') {\n $type2 = 'notype';\n }\n \n $fields = [\n $name,\n \"num=$dexnum\",\n \"dexnum=$dexnum\",\n \"type=$type1\",\n \"type=$type2\",\n \"type1=$type1\",\n \"type2=$type2\",\n \"region=$region\",\n \"specialform=$specialform\",\n \"tier=$tier\"\n ];\n\n return strtolower(implode(' ', $fields));\n}", "public function getFormData($data, $extra_info=array())\n {\n $tags = array();\n if (isset($data['tag'])) {\n foreach ($data['tag'] as $tag) {\n $tags[] = array(\n 'contact_id' => $data['contact_id'],\n 'tag_name' => $tag\n );\n }\n }\n\n $extra_fields = array();\n foreach ($extra_info as $field) {\n $dummy = $field['field'];\n $dummy['extra_value'] = isset($data[$field['name']]) ? $data[$field['name']] : '';\n $extra_fields[] = $dummy;\n }\n\n\n if (isset($data['person_birthday']) && !empty($data['person_birthday'])) {\n $dt = Carbon::createFromFormat($this->app['translator']->trans('DATE_FORMAT'), $data['person_birthday']);\n $birthday = $dt->toDateTimeString();\n }\n else {\n $birthday = '0000-00-00';\n }\n\n\n return array(\n 'contact' => array(\n 'contact_id' => $data['contact_id'],\n 'contact_type' => 'PERSON',\n 'contact_status' => isset($data['contact_status']) ? $data['contact_status'] : 'ACTIVE',\n 'contact_name' => isset($data['contact_name']) ? $data['contact_name'] : null,\n 'contact_login' => isset($data['contact_login']) ? $data['contact_login'] : null\n ),\n 'category' => array(\n array(\n 'contact_id' => $data['contact_id'],\n 'category_type_name' => isset($data['category']) ? $data['category'] : ''\n )\n ),\n 'tag' => $tags,\n 'person' => array(\n array(\n 'person_id' => $data['person_id'],\n 'contact_id' => $data['contact_id'],\n 'person_gender' => $data['person_gender'],\n 'person_title' => isset($data['person_title']) && !empty($data['person_title']) ? $data['person_title'] : 'NO_TITLE',\n 'person_first_name' => $data['person_first_name'],\n 'person_last_name' => $data['person_last_name'],\n 'person_birthday' => $birthday\n )\n ),\n 'communication' => array(\n array(\n // email\n 'communication_id' => $data['email_id'],\n 'contact_id' => $data['contact_id'],\n 'communication_type' => 'EMAIL',\n 'communication_usage' => 'PRIMARY',\n 'communication_value' => $data['email']\n ),\n array(\n // phone\n 'communication_id' => $data['phone_id'],\n 'contact_id' => $data['contact_id'],\n 'communication_type' => 'PHONE',\n 'communication_usage' => 'PRIMARY',\n 'communication_value' => $data['phone']\n ),\n array(\n // cell\n 'communication_id' => $data['cell_id'],\n 'contact_id' => $data['contact_id'],\n 'communication_type' => 'CELL',\n 'communication_usage' => 'PRIMARY', //'PRIVATE',\n 'communication_value' => $data['cell']\n ),\n array(\n // fax\n 'communication_id' => $data['fax_id'],\n 'contact_id' => $data['contact_id'],\n 'communication_type' => 'FAX',\n 'communication_usage' => 'PRIMARY', //'PRIVATE',\n 'communication_value' => $data['fax']\n ),\n ),\n 'address' => array(\n array(\n 'address_id' => $data['address_id'],\n 'contact_id' => $data['contact_id'],\n 'address_type' => 'PRIMARY', //'PRIVATE',\n 'address_street' => $data['address_street'],\n 'address_zip' => $data['address_zip'],\n 'address_city' => $data['address_city'],\n 'address_area' => $data['address_area'],\n 'address_state' => $data['address_state'],\n 'address_country_code' => $data['address_country']\n )\n ),\n 'note' => array(\n array(\n 'note_id' => $data['note_id'],\n 'contact_id' => $data['contact_id'],\n 'note_title' => 'Remarks',\n 'note_type' => 'TEXT',\n 'note_content' => $data['note']\n )\n ),\n 'extra_fields' => $extra_fields\n );\n }", "function faculty_get_display_name( $metaArray ) {\n $name = '';\n\n if ( $metaArray['name_0_prefix'][0] ) {\n $name = $metaArray['name_0_prefix'][0] . ' ';\n }\n\n $name .= $metaArray['name_0_first'][0] . ' ' . $metaArray['name_0_last'][0];\n\n if ( $metaArray['name_0_suffix'][0] ) {\n $name .= ' '.$metaArray['name_0_suffix'][0];\n }\n\n return $name;\n}", "function formatName(array $name)\r\n {\r\n return $name['last_name'] . ' ' . preg_replace('/\\b([A-Z]).*?(?:\\s|$)+/','$1',$name['first_name']);\r\n }", "protected function _formatNameString( array $data )\n\t{\n\t\t$langString = '';\n\t\t$seeMoreLink = 'app=core&amp;module=global&amp;section=like&amp;do=more';\n\t\t\n\t\tif ( ! is_array( $data['names'] ) OR ! count( $data['names'] ) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t/* Format up the names */\n\t\t$i = 0;\n\t\t$_names = array();\n\t\t\n\t\tforeach( $data['names'] as $name )\n\t\t{\n\t\t\tif ( $this->memberData['member_id'] AND $this->memberData['member_id'] == $name['id'] )\n\t\t\t{\n\t\t\t\t$_names[$i] = $name['name'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_names[$i] = IPSMember::makeProfileLink($name['name'], $name['id'], $name['seo'] );\n\t\t\t}\n\t\t\t\n\t\t\t$i++;\n\t\t}\n\n\t\t/* More than one? */\n\t\tif ( $data['totalCount'] > 1 )\n\t\t{\n\t\t\t/* Joe and Matt love you */\n\t\t\tif ( $data['totalCount'] == 2 )\n\t\t\t{\n\t\t\t\t$_n = $_names[0] . ' ' . $this->lang->words['fave_and'] . ' ' . $_names[1];\n\t\t\t\t\n\t\t\t\t$langString = sprintf( $this->lang->words['fave_formatted_many'], $_n );\n\t\t\t}\n\t\t\t/* Joe, Matt and Mike love you more */\n\t\t\telse if ( $data['totalCount'] == 3 )\n\t\t\t{\n\t\t\t\t$_n = $_names[0] . ', ' . $_names[1] . ' ' . $this->lang->words['fave_and'] . ' ' . $_names[2];\n\t\t\t\t\n\t\t\t\t$langString = sprintf( $this->lang->words['fave_formatted_many'], $_n );\n\t\t\t}\n\t\t\t/* Joe, Matt, Mike and 1 more love you */\n\t\t\telse if ( $data['totalCount'] == 4 )\n\t\t\t{\n\t\t\t\t$_n = $_names[0] . ', ' . $_names[1] . ' ' . $this->lang->words['fave_and'] . ' ' . $_names[2];\n\t\t\t\t\n\t\t\t\t$langString = sprintf( $this->lang->words['fave_formatted_one_more'], $_n, $seeMoreLink );\n\t\t\t}\n\t\t\t/* Joe, Matt, Mike and 5 more are indifferent to your redonkulous comments */\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_n = $_names[0] . ', ' . $_names[1] . ', ' . $_names[2];\n\t\t\t\t\n\t\t\t\t$langString = sprintf( $this->lang->words['fave_formatted_more'], $_n, $seeMoreLink, $data['othersCount'] );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Just the one and it might be you! */\t\n\t\t\tif ( $data['names'][0]['id'] == $this->memberData['member_id'] )\n\t\t\t{\n\t\t\t\t$langString = $this->lang->words['fave_formatted_me'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$langString = sprintf( $this->lang->words['fave_formatted_one'], $_names[0] );\n\t\t\t}\n\t\t}\n\n\t\treturn $langString;\n\t}", "public function run()\n {\n\t\t$data = [];\n\t\t$firstName = [\n\t\t'王','李' ,'张' ,'刘', '陈', '杨', '赵', '黄', '周', '吴 ',\n\t\t'徐', '孙', '胡', '朱', '高', '林', '何', '郭', '马', '罗',\n\t\t'程', '曹', '袁', '邓', '许', '傅', '沈', '曾', '彭', '吕',\n\t\t'苏', '卢', '蒋', '蔡', '贾', '丁', '魏', '薛', '叶', '阎',\n\t\t'余', '潘', '杜', '戴', '夏', '锺', '汪', '田', '任', '姜',\n\t\t'范', '方', '石', '姚', '谭', '廖', '邹', '熊', '金', '陆',\n\t\t'郝', '孔', '白', '崔', '康', '毛', '邱', '秦', '江', '史',\n\t\t'顾', '侯', '邵', '孟', '龙', '万', '段', '雷', '钱', '汤',\n\t\t'尹', '黎', '易', '常', '武', '乔', '贺', '赖', '龚', '文'];\n\t\t$lastName = [\n\t\t\t'伟', '芳', '娜', '秀英', '敏', '静', '丽', '强', '磊', '军',\n\t\t\t'洋', '勇', '艳', '杰', '娟', '涛', '明', '超', '秀兰', '霞',\n\t\t\t'平', '刚', '桂英'];\n\t\t$sex = ['f','m'];\n\t\t$hoby = ['篮球','足球','排球','游泳'];\n\t\t$status = [0,1];\n\t\t$str = [1,2,3,4,5,6,7,8,9,0,'a','b','c','d','e'.'f','g','h','i','j','k','l','m','n','o','p','q'];\n\t\t$str2 = ['a','b','c','d','e'.'f','g','h','i','j','k','l','m','n','o','p','q'];\n\t\t$lastPre = ['com','cn','net','org'];\n\t\tfor($i=1;$i<=40;$i++){\n\t\t\t$itemCname = $firstName[array_rand($firstName,1)].$firstName[array_rand($lastName,1)];\n\t\t\t$emailRandKey = array_rand($str,rand(2,count($str)));\n\t\t\t$userEmail = '';\n\t\t\tforeach($emailRandKey as $val){\n\t\t\t\t$userEmail .= $str[$val];\n\t\t\t}\n\t\t\t$doMain = '';\n\t\t\tforeach(array_rand($str2,5) as $domain){\n\t\t\t\t$doMain .= $str2[$domain];\n\t\t\t}\n\t\t\t$itemEmail = $userEmail.'@'.$doMain.'.'.$lastPre[array_rand($lastPre,1)];\n\t\t\t\n\t\t\t$itemSex = $sex[array_rand($sex,1)];\n\t\t\t\n\t\t\t$randNum = rand(1,count($hoby));\n\t\t\t$itemHobyKey = array_rand($hoby,$randNum);\n\t\t\t$itemHoby = '';\n\t\t\tif(is_array($itemHobyKey)){\n\t\t\t\tforeach($itemHobyKey as $v){\n\t\t\t\t\t$itemHoby .= $hoby[$v].',';\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$itemHoby .= $hoby[$itemHobyKey];\n\t\t\t}\n\t\t\t\n\t\t\t$itemStatus = array_rand($status,1);\n\t\t\t$now = date('Y-m-d:H:i:s');\n\t\t\t$data[] = [\n\t\t\t\t'user' => $itemCname,\n\t\t\t\t'email' => $itemEmail,\n\t\t\t\t'sex' => $itemSex,\n\t\t\t\t'hoby' => trim($itemHoby,','),\n\t\t\t\t'status' => $itemStatus,\n\t\t\t\t'created_at' => $now,\n\t\t\t\t'updated_at' => $now\n\t\t\t];\n\t\t}\n\t\t// var_dump($data);\n\t\t\\Illuminate\\Support\\Facades\\DB::table('tests')->insert($data);\n }", "abstract function prepare_data(&$data_arr);", "function returnFakeDataRow($focus, $field_array, $rowsToReturn = 5)\n{\n if (empty($focus) || empty($field_array)) {\n return ;\n }\n\n // include the file that defines $sugar_demodata\n include('install/demoData.en_us.php');\n\n $person_bean = false;\n if (isset($focus->first_name)) {\n $person_bean = true;\n }\n\n global $timedate;\n $returnContent = '';\n $counter = 0;\n $new_arr = array();\n\n // iterate through the record creation process as many times as defined. Each iteration will create a new row\n while ($counter < $rowsToReturn) {\n $counter++;\n // go through each field and populate with dummy data if possible\n foreach ($field_array as $field_name) {\n if (empty($focus->field_defs[$field_name]) || empty($focus->field_defs[$field_name]['type'])) {\n // type is not set, fill in with empty string and continue;\n $returnContent .= '\"\",';\n continue;\n }\n $field = $focus->field_defs[$field_name];\n\n // fill in value according to type\n $type = $field['type'];\n\n switch ($type) {\n case \"id\":\n case \"assigned_user_name\":\n // return new guid string\n $returnContent .= '\"' . create_guid() . '\",';\n break;\n case \"int\":\n // return random number`\n $returnContent .= '\"' . mt_rand(0, 4) . '\",';\n break;\n case \"name\":\n // return first, last, user name, or random name string\n if ($field['name'] == 'first_name') {\n $count = count($sugar_demodata['first_name_array']) - 1;\n $returnContent .= '\"' . $sugar_demodata['last_name_array'][mt_rand(0, $count)] . '\",';\n } elseif ($field['name'] == 'last_name') {\n $count = count($sugar_demodata['last_name_array']) - 1;\n $returnContent .= '\"' . $sugar_demodata['last_name_array'][mt_rand(0, $count)] . '\",';\n } elseif ($field['name'] == 'user_name') {\n $count = count($sugar_demodata['first_name_array']) - 1;\n $returnContent .= '\"' . $sugar_demodata['last_name_array'][mt_rand(0, $count)] .\n '_' . mt_rand(1, 111) . '\",';\n } else {\n // return based on bean\n if ($focus->module_dir =='Accounts') {\n $count = count($sugar_demodata['company_name_array']) - 1;\n $returnContent .= '\"'.$sugar_demodata['company_name_array'][mt_rand(0, $count)].'\",';\n } elseif ($focus->module_dir =='Bugs') {\n $count = count($sugar_demodata['bug_seed_names']) - 1;\n $returnContent .= '\"'.$sugar_demodata['bug_seed_names'][mt_rand(0, $count)].'\",';\n } elseif ($focus->module_dir =='Notes') {\n $count = count($sugar_demodata['note_seed_names_and_Descriptions']) - 1;\n $returnContent .= '\"' .\n $sugar_demodata['note_seed_names_and_Descriptions'][mt_rand(0, $count)] . '\",';\n } elseif ($focus->module_dir =='Calls') {\n $count = count($sugar_demodata['call_seed_data_names']) - 1;\n $returnContent .= '\"'.$sugar_demodata['call_seed_data_names'][mt_rand(0, $count)].'\",';\n } elseif ($focus->module_dir =='Tasks') {\n $count = count($sugar_demodata['task_seed_data_names']) - 1;\n $returnContent .= '\"'.$sugar_demodata['task_seed_data_names'][mt_rand(0, $count)].'\",';\n } elseif ($focus->module_dir =='Meetings') {\n $count = count($sugar_demodata['meeting_seed_data_names']) - 1;\n $returnContent .= '\"'.$sugar_demodata['meeting_seed_data_names'][mt_rand(0, $count)].'\",';\n } elseif ($focus->module_dir =='ProductCategories') {\n $count = count($sugar_demodata['productcategory_seed_data_names']) - 1;\n $returnContent .=\n '\"' . $sugar_demodata['productcategory_seed_data_names'][mt_rand(0, $count)] . '\",';\n } elseif ($focus->module_dir =='ProductTypes') {\n $count = count($sugar_demodata['producttype_seed_data_names']) - 1;\n $returnContent .=\n '\"' . $sugar_demodata['producttype_seed_data_names'][mt_rand(0, $count)] . '\",';\n } elseif ($focus->module_dir =='ProductTemplates') {\n $count = count($sugar_demodata['producttemplate_seed_data']) - 1;\n $returnContent .=\n '\"' . $sugar_demodata['producttemplate_seed_data'][mt_rand(0, $count)] . '\",';\n } else {\n $returnContent .= '\"Default Name for '.$focus->module_dir.'\",';\n }\n }\n break;\n case \"relate\":\n if ($field['name'] == 'team_name') {\n // apply team names and user_name\n $teams_count = count($sugar_demodata['teams']) - 1;\n $users_count = count($sugar_demodata['users']) - 1;\n $returnContent .= '\"' . $sugar_demodata['teams'][mt_rand(0, $teams_count)]['name'] . ',' .\n $sugar_demodata['users'][mt_rand(0, $users_count)]['user_name'] . '\",';\n } else {\n // apply GUID\n $returnContent .= '\"' . create_guid() . '\",';\n }\n break;\n case \"bool\":\n // return 0 or 1\n $returnContent .= '\"' . mt_rand(0, 1) . '\",';\n break;\n case \"text\":\n // return random text\n $returnContent .= '\"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas' .\n ' porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus' .\n ' malesuada libero, sit amet commodo magna eros quis urna\",';\n break;\n case \"team_list\":\n $teams_count = count($sugar_demodata['teams']) - 1;\n // give fake team names (East,West,North,South)\n $returnContent .= '\"' . $sugar_demodata['teams'][mt_rand(0, $teams_count)]['name'] . '\",';\n break;\n case \"date\":\n // return formatted date\n $timeStamp = strtotime('now');\n $value = date($timedate->dbDayFormat, $timeStamp);\n $returnContent .= '\"'.$timedate->to_display_date_time($value).'\",';\n break;\n case \"datetime\":\n case \"datetimecombo\":\n // return formatted date time\n $timeStamp = strtotime('now');\n // Start with db date\n $value = date($timedate->dbDayFormat.' '.$timedate->dbTimeFormat, $timeStamp);\n // use timedate to convert to user display format\n $value = $timedate->to_display_date_time($value);\n // finally format the am/pm to have a space so it can be recognized as a date field in excel\n $value = preg_replace('/([pm|PM|am|AM]+)/', ' \\1', $value);\n $returnContent .= '\"' . $value . '\",';\n break;\n case \"phone\":\n $value = '(' . mt_rand(300, 999) . ') ' . mt_rand(300, 999) . '-' . mt_rand(1000, 9999);\n $returnContent .= '\"' . $value . '\",';\n break;\n case \"varchar\":\n // process varchar for possible values\n if ($field['name'] == 'first_name') {\n $count = count($sugar_demodata['first_name_array']) - 1;\n $returnContent .= '\"'.$sugar_demodata['last_name_array'][mt_rand(0, $count)].'\",';\n } elseif ($field['name'] == 'last_name') {\n $count = count($sugar_demodata['last_name_array']) - 1;\n $returnContent .= '\"'.$sugar_demodata['last_name_array'][mt_rand(0, $count)].'\",';\n } elseif ($field['name'] == 'user_name') {\n $count = count($sugar_demodata['first_name_array']) - 1;\n $returnContent .=\n '\"'.$sugar_demodata['last_name_array'][mt_rand(0, $count)] . '_' . mt_rand(1, 111) . '\",';\n } elseif ($field['name'] == 'title') {\n $count = count($sugar_demodata['titles']) - 1;\n $returnContent .= '\"'.$sugar_demodata['titles'][mt_rand(0, $count)].'\",';\n } elseif (strpos($field['name'], 'address_street') > 0) {\n $count = count($sugar_demodata['street_address_array']) - 1;\n $returnContent .= '\"'.$sugar_demodata['street_address_array'][mt_rand(0, $count)].'\",';\n } elseif (strpos($field['name'], 'address_city') > 0) {\n $count = count($sugar_demodata['city_array']) - 1;\n $returnContent .= '\"'.$sugar_demodata['city_array'][mt_rand(0, $count)].'\",';\n } elseif (strpos($field['name'], 'address_state') > 0) {\n $state_arr = array('CA', 'NY', 'CO', 'TX', 'NV');\n $count = count($state_arr) - 1;\n $returnContent .= '\"'.$state_arr[mt_rand(0, $count)].'\",';\n } elseif (strpos($field['name'], 'address_postalcode') > 0) {\n $returnContent .= '\"'.mt_rand(12345, 99999).'\",';\n } else {\n $returnContent .= '\"\",';\n }\n break;\n case \"url\":\n $returnContent .= '\"https://www.sugarcrm.com\",';\n break;\n case \"enum\":\n // get the associated enum if available\n global $app_list_strings;\n\n if (isset($focus->field_defs[$field_name]['type']) &&\n !empty($focus->field_defs[$field_name]['options'])\n ) {\n if (!empty($app_list_strings[$focus->field_defs[$field_name]['options']])) {\n // put the values into an array\n $dd_values = $app_list_strings[$focus->field_defs[$field_name]['options']];\n $dd_values = array_values($dd_values);\n\n // grab the count\n $count = count($dd_values) - 1;\n\n // choose one at random\n $returnContent .= '\"' . $dd_values[mt_rand(0, $count)] . '\",';\n } else {\n // name of enum options array was found but is empty, return blank\n $returnContent .= '\"\",';\n }\n } else {\n // name of enum options array was not found on field, return blank\n $returnContent .= '\"\",';\n }\n break;\n default:\n // type is not matched, fill in with empty string and continue;\n $returnContent .= '\"\",';\n } // switch\n }\n $returnContent .= \"\\r\\n\";\n }\n return $returnContent;\n}", "function generateHeroName()\n\t{\n\t\t//some cool name generator based on race?\n\t\t$f_max = 3;\n\t\t$l_max = 3;\n\t\tif ($this->Name == \"Human\")\n\t\t{\n\t\t\t$f_pre = array(\"saint-\", \"jon\", \"\", \"\", \"\", \"\", \"\", \"\");\n\t\t\t$f_mid = array(\"pet\", \"jac\", \"cob\", \"er\", \"ic\", \"stef\", \"fan\", \"mer\", \"ril\", \"ley\");\n\t\t\t$f_suf = array(\"of\", \"met\", \"ic\", \"im\", \"rum\", \"\", \"\", \"\", \"\");\n\n\t\t\t$l_pre = array(\"O\", \"mac\", \"free\", \"\", \"\", \"\", \"\");\n\t\t\t$l_mid = array(\"smi\", \"ith\", \"co\", \"be\", \"er\", \"rob\", \"bert\", \"frank\", \"anne\");\n\t\t\t$l_suf = array(\"son\", \"er\", \"well\", \"s\", \"\", \"\", \"\", \"\");\n\t\t}\n\t\telse if ($this->Name == \"Dwarf\")\n\t\t{\n\t\t\t$f_pre = array(\"yun\", \"magh\", \"\", \"\", \"\", \"\", \"\", \"\");\n\t\t\t$f_mid = array(\"thros\", \"grul\", \"lim\", \"dic\", \"haf\", \"af\", \"jim\");\n\t\t\t$f_suf = array(\"of\", \"met\", \"ic\", \"im\", \"rum\", \"beard\", \"\", \"\", \"\");\n\n\t\t\t$l_pre = array(\"von \", \"\", \"\", \"\", \"\", \"\", \"\");\n\t\t\t$l_mid = array(\"kim\", \"graf\", \"fit\", \"von\", \"bilt\", \"mar\", \"gold\");\n\t\t\t$l_suf = array(\"mace\", \"maker\", \"forge\", \"\", \"\", \"\", \"\", \"\", \"\");\n\t\t}\n\t\telse if ($this->Name == \"Elf\")\n\t\t{\n\t\t\t$f_pre = array(\"cap\", \"col\", \"fli\", \"\", \"\", \"\", \"\", \"\");\n\t\t\t$f_mid = array(\"per\", \"mop\", \"flip\", \"don\", \"has\", \"gift\", \"ron\", \"san\");\n\t\t\t$f_suf = array(\"on\", \"ine\", \"flew\", \"jon\", \"\", \"\", \"\", \"\", \"\");\n\n\t\t\t$l_pre = array(\"feather\", \"light\", \"\", \"\", \"\", \"\", \"\");\n\t\t\t$l_mid = array(\"cap\", \"per\", \"soft\", \"tree\", \"mel\", \"plum\", \"fart\");\n\t\t\t$l_suf = array(\"foot\", \"sky\", \"trot\", \"\", \"\", \"\", \"\", \"\", \"\");\n\t\t}\n\t\telse if ($this->Name == \"Halfling\")\n\t\t{\n\t\t\t$f_pre = array(\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\");\n\t\t\t$f_mid = array(\"bil\", \"fro\", \"mul\", \"ber\", \"ry\", \"grem\", \"mil\", \"at\", \"et\");\n\t\t\t$f_suf = array(\"o the\");\n\n\t\t\t$l_pre = array(\"\");\n\t\t\t$l_mid = array(\"spoon\", \"hat\", \"bag\", \"word\", \"sword\", \"hobbit\", \"mead\", \"fly\", \"hog\", \"wolf\", \"badger\");\n\t\t\t$l_suf = array(\"-fearer\", \"-worthy\", \"-slayer\", \"-drinker\", \"\", \"\", \"\", \"\", \"\", \"\");\n\t\t\t$l_max = 1;\n\t\t}\n\t\treturn $this->makeParts($f_max, $f_pre, $f_mid, $f_suf)\n\t\t\t. ' ' . \n\t\t\t$this->makeParts($l_max, $l_pre, $l_mid, $l_suf);\n\t}", "public function prepare_field_data( &$data, $name ) {\n\t\t$default_atts = [\n\t\t\t'label' => '',\n\t\t\t'id' => $this->meta_box['id'].'_'.$name,\n\t\t\t'type' => 'text',\n\t\t\t'default' => '',\n\t\t\t'sanitize' => null,\n\t\t\t'escape_func' => null,\n\t\t\t'file' => 'field-text.php',\n\t\t];\n\t\t$data = wp_parse_args( $data, $default_atts );\n\t\t$data['name'] = $name;\n\t\treturn $data;\n\t}", "abstract protected function createFields();", "public function setPayerName($data=null) {\n if(!is_array($data)) {\n $b = $this->getBilling();\n $data = array(\n 'FIRSTNAME' => $b['firstName'],\n 'LASTNAME' => $b['lastName']\n );\n }\n $this->_payerName = $data;\n }", "static function getFullName(&$rsData)\n {\n return $rsData['firstname'] . ' ' . $rsData['surname'];\n }", "public function createNames()\n {\n $required = [\n 'name',\n 'singular',\n 'plural',\n 'slug',\n ];\n\n foreach ($required as $key) {\n // if the name is set, assign it\n if (isset($this->names[$key])) {\n $this->$key = $this->names[$key];\n continue;\n }\n\n // if the key is not set and is singular or plural\n if (in_array($key, ['singular', 'plural'])) {\n // create a human friendly name\n $name = ucwords(strtolower(str_replace(['-', '_'], ' ', $this->names['name'])));\n }\n\n if ($key === 'slug') {\n // create a slug friendly name\n $name = strtolower(str_replace([' ', '_'], '-', $this->names['name']));\n }\n\n // if is plural or slug, append an 's'\n if (in_array($key, ['plural', 'slug'])) {\n $name .= 's';\n }\n\n // asign the name to the PostType property\n $this->$key = $name;\n }\n }", "public function beforeSave() {\n\t\tif(isset(Yii::app()->params->admin)) {\n\t\t\t$admin = Yii::app()->params->admin;\n\t\t\tif(!empty($admin->contactNameFormat)) {\n\t\t\t\t$str = $admin->contactNameFormat;\n\t\t\t\t$str = str_replace('firstName',$this->firstName,$str);\n\t\t\t\t$str = str_replace('lastName',$this->lastName,$str);\n\t\t\t} else {\n\t\t\t\t$str = $this->firstName.' '.$this->lastName;\n\t\t\t}\n\t\t\tif($admin->properCaseNames)\n\t\t\t\t$str = $this->ucwords_specific($str,array('-',\"'\",'.'),'UTF-8');\n\t\t\t\n\t\t\t$this->name = $str;\n\t\t}\n\t\t\n\t\treturn parent::beforeSave();\n\t}", "private function getFormData(Person $per = null)\r\n {\r\n $data = [\r\n ['attr' => 'Person[nickname]', 'attr_dot'=> 'Person.nickname', 'name' => 'Nickname', 'ori' => $per?$per->nickname:''],\r\n ['attr' => 'Person[email]', 'attr_dot' => 'Person.email', 'name' => 'E-Mail 地址', 'ori' => $per?$per->email:''],\r\n ];\r\n $oj = ['HDU', 'Codeforces', 'POJ', 'VJUDGE'];\r\n foreach ($oj as $cur){\r\n array_push($data, ['attr' => \"OJ[$cur]\", 'attr_dot'=>\"OJ.$cur\", 'name' => $cur . '用户名', 'ori'=>'']);\r\n }\r\n if($per){\r\n foreach ($per->accounts as $acc) {\r\n for ($i = 0; $i < count($data); $i++) {\r\n if ($data[$i]['attr'] == \"OJ[$acc->oj]\")\r\n {\r\n if ($data[$i]['ori'] != '')\r\n $data[$i]['ori'] .= '|' . $acc->username;\r\n else\r\n $data[$i]['ori'] = $acc->username;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return $data;\r\n }", "public static function parse_name($full_name) {\n # Remove leading/trailing whitespace\n $full_name = trim($full_name);\n # Setup default vars\n extract(array('salutation' => '', 'fname' => '', 'initials' => '', 'lname' => '', 'suffix' => ''));\n # If name contains professional suffix, assign and remove it\n $professional_suffix = self::get_pro_suffix($full_name);\n if ($professional_suffix) {\n # Remove the suffix from full name\n $full_name = str_replace($professional_suffix, '', $full_name);\n # Remove the preceeding comma and space(s) from suffix\n $professional_suffix = preg_replace(\"/, */\", '', $professional_suffix);\n # Normalize the case of suffix if found in dictionary\n foreach (self::$dict['suffixes']['prof'] as $prosuffix) {\n if (strtolower($prosuffix) === strtolower($professional_suffix)) {\n $professional_suffix = $prosuffix;\n }\n }\n }\n # Deal with nickname, push to array\n $has_nick = self::get_nickname($full_name);\n if ($has_nick) {\n # Remove wrapper chars from around nickname\n $name['nickname'] = substr($has_nick, 1, (strlen($has_nick) - 2));\n # Remove the nickname from the full name\n $full_name = str_replace($has_nick, '', $full_name);\n # Get rid of consecutive spaces left by the removal\n $full_name = str_replace(' ', ' ', $full_name);\n }\n # Grab a list of words from name\n $unfiltered_name_parts = self::break_words($full_name);\n # Is first word a title or multiple titles consecutively?\n while ($s = self::is_salutation($unfiltered_name_parts[0])) {\n $salutation .= \"$s \";\n array_shift($unfiltered_name_parts);\n }\n $salutation = trim($salutation);\n # Is last word a suffix or multiple suffixes consecutively?\n while ($s = self::is_suffix($unfiltered_name_parts[count($unfiltered_name_parts)-1], $full_name)) {\n $suffix .= \"$s \";\n array_pop($unfiltered_name_parts);\n }\n $suffix = trim($suffix);\n # If suffix and professional suffix not empty, add comma\n if (!empty($professional_suffix) && !empty($suffix)) {\n $suffix .= ', ';\n }\n # Concat professional suffix to suffix\n $suffix .= $professional_suffix;\n # set the ending range after prefix/suffix trim\n $end = count($unfiltered_name_parts);\n # concat the first name\n for ($i=0; $i<$end-1; $i++) {\n $word = $unfiltered_name_parts[$i];\n # move on to parsing the last name if we find an indicator of a compound last name (Von, Van, etc)\n # we use $i != 0 to allow for rare cases where an indicator is actually the first name (like \"Von Fabella\")\n if (self::is_compound($word) && $i != 0) {\n break;\n }\n # is it a middle initial or part of their first name?\n # if we start off with an initial, we'll call it the first name\n if (self::is_initial($word)) {\n # is the initial the first word?\n if ($i == 0) {\n # if so, do a look-ahead to see if they go by their middle name\n # for ex: \"R. Jason Smith\" => \"Jason Smith\" & \"R.\" is stored as an initial\n # but \"R. J. Smith\" => \"R. Smith\" and \"J.\" is stored as an initial\n if (self::is_initial($unfiltered_name_parts[$i+1])) {\n $fname .= \" \".strtoupper($word);\n }\n else {\n $initials .= \" \".strtoupper($word);\n }\n }\n # otherwise, just go ahead and save the initial\n else {\n $initials .= \" \".strtoupper($word);\n }\n }\n else {\n $fname .= \" \".self::fix_case($word);\n }\n }\n # check that we have more than 1 word in our string\n if ($end-0 > 1) {\n # concat the last name\n for ($i; $i < $end; $i++) {\n $lname .= \" \".self::fix_case($unfiltered_name_parts[$i]);\n }\n }\n else {\n # otherwise, single word strings are assumed to be first names\n $fname = self::fix_case($unfiltered_name_parts[$i]);\n }\n # return the various parts in an array\n $name['salutation'] = $salutation;\n $name['fname'] = trim($fname);\n $name['initials'] = trim($initials);\n $name['lname'] = trim($lname);\n $name['suffix'] = $suffix;\n return $name;\n }", "protected static function getNames($array, $split)\n {\n if (empty($array['firstname'])) {\n if (!empty($array['lastname'])) {\n if ($split) {\n $array = self::splitNames($array['lastname']);\n }\n }\n }\n if (empty($array['lastname'])) {\n if (!empty($array['firstname'])) {\n if ($split) {\n $array = self::splitNames($array['firstname']);\n }\n }\n }\n if (empty($array['lastname'])) {\n $array['lastname'] = '__';\n }\n if (empty($array['firstname'])) {\n $array['firstname'] = '__';\n }\n return $array;\n }", "protected function fieldData()\n {\n if ($this->field_data_fetched === false) {\n $this->field_data = array(\n 'label' => 'Your date of birth',\n 'description' => 'Please enter your date of birth',\n 'placeholder' => 'dd/mm/yyyy',\n 'size' => 50,\n 'maxlength' => 10\n );\n\n $this->field_data_fetched = true;\n }\n }", "function zg_ai_name() {\n\n $first = [\n 'Michael',\n 'Christopher',\n 'Matthew',\n 'Joshua',\n 'Daniel',\n 'David',\n 'James',\n 'Robert',\n 'John',\n 'Joseph',\n 'Andrew',\n 'Ryan',\n 'Brandon',\n 'Jason',\n 'Justin',\n 'William',\n 'Jonathan',\n 'Brian',\n 'Nicholas',\n 'Anthony',\n 'Eric',\n 'Adam',\n 'Kevin',\n 'Steven',\n 'Thomas',\n 'Jessica',\n 'Ashley',\n 'Jennifer',\n 'Amanda',\n 'Sarah',\n 'Stephanie',\n 'Nicole',\n 'Heather',\n 'Elizabeth',\n 'Megan',\n 'Melissa',\n 'Christina',\n 'Rachel',\n 'Laura',\n 'Lauren',\n 'Amber',\n 'Brittany',\n 'Danielle',\n 'Kimberly',\n 'Amy',\n 'Crystal',\n 'Michelle',\n 'Tiffany',\n 'Emily',\n 'Rebecca',\n ];\n\n $last = [\n 'Smith',\n 'Johnson',\n 'Williams',\n 'Brown',\n 'Jones',\n 'Miller',\n 'Davis',\n 'Wilson',\n 'Anderson',\n 'Thomas',\n 'Taylor',\n 'Moore',\n 'Jackson',\n 'Thompson',\n 'White',\n 'Harris',\n 'Clark',\n 'Lewis',\n 'Robinson',\n 'Walker',\n 'Young',\n 'Allen',\n 'King',\n 'Wright',\n 'Scott',\n 'Hill',\n 'Green',\n 'Adams',\n 'Baker',\n 'Hall',\n 'Campbell',\n 'Mitchell',\n 'Carter',\n 'Turner',\n 'Parker',\n 'Edwards',\n 'Collins',\n 'Stewart',\n 'Morris',\n 'Morales',\n 'Cook',\n 'Rogers',\n 'Cooper',\n 'Peterson',\n 'Bailey',\n 'Reed',\n 'Howard',\n 'Ward',\n 'Richardson',\n 'Watson',\n ];\n\n return $first[mt_rand(0, count($first) - 1)] . ' '\n . $last[mt_rand(0, count($last) - 1)];\n}", "function getPersonName($user) {\n if ($user==null || (!isset($user[\"lastname\"]) && !isset($user[\"firstname\"])) )\n return '';\n $ret =\"\";\n if (isset($user[\"title\"]))\n $ret = $user[\"title\"].' ';\n $ret .= $user[\"lastname\"].\" \".$user[\"firstname\"];\n if (isset($user[\"birthname\"]) && trim($user[\"birthname\"])!=\"\")\n $ret .= \" (\".trim($user[\"birthname\"]).\")\";\n return $ret;\n}", "public function add_on_profile( $fields ) {\n\t\t$fields = self::get_fields();\n\t\tunset( $fields['first_name'], $fields['last_name'] );\n\n\t\tforeach ( $fields as $id => $field ) {\n\t\t\t$fields[ $id ] = $field['title'];\n\t\t}\n\n\t\treturn $fields;\n\t}", "function process_data($arrData)\n{\n\t\n\t// 1) sql connection\n\t$conn = new mysqli(SRVRNAME, USERNAME, PASSWORD, DATABASE);\n\t// Check connection\n\tif ($conn->connect_error) {\ndie(\"Connection failed: \" . $conn->connect_error);\n\t} \n\t\n\t$stmt = $conn->stmt_init();\n\t\n\t// 2) insert new record into Person\n\t// Prepared statement, stage 1: prepare \n\tif (!($stmt->prepare(\"INSERT INTO Person(fname,mi,lname,title,degrees,cell,email,preferred_email,addr1,addr2,city,state,zip,pro_titles,specialty,state_licensed,license_number,HCP_NCI_number,Payment_Mailing_Addr_1,Payment_Mailing_Addr_2,Payment_Mailing_City,Payment_Mailing_State,Payment_Mailing_Zip) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\"))) {\n$db_errmsg = \"Person Table-INSERT:Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\nreturn $db_errmsg;\n\t}\n\t\n\t// Prepared statement, stage 2: bind and execute \n\tif (!$stmt->bind_param(\"sssssssssssssssssssssss\", $arrData['fname'],$arrData['middle_initial'],$arrData['lname'],$arrData['title'],$arrData['degrees'],$arrData['cell'],$arrData['email'],$arrData['email_preferred'],$arrData['addr1'],$arrData['addr2'],$arrData['city'],$arrData['state'],$arrData['zip'],$arrData['pro_titles'],$arrData['specialty'],$arrData['state_licensed'],$arrData['license_number'],$arrData['HCP_NCI_number'],$arrData['pay_addr1'],$arrData['pay_addr2'],$arrData['pay_city'],$arrData[',pay_state'],$arrData['pay_zip'])) \n\t{\n$db_errmsg = \"Person Table-INSERT:Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\nreturn $db_errmsg;\n\t}\n\t\n\t// If error, return to regis page with message, close cxn\n\tif (!$stmt->execute()) {\n$db_errmsg = \"Person Table-INSERT:Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\nreturn $db_errmsg;\n\t}\n\t\n\t// 3) select new pid from Person table\n\tif (!($stmt->prepare(\"SELECT pid FROM Person WHERE email = (?)\"))) {\n$db_errmsg = \"Person Table-SELECT:Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\nreturn $db_errmsg;\n\t}\n\n\t// If error, return to regis page with message, close cxn\n\tif (!$stmt->bind_param(\"s\", $arrData['email']))\n\t{\n\t\t$db_errmsg = \"Person Table-SELECT:Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t\treturn $db_errmsg;\n\t}\n\n\t\t\t// If error, return to regis page with message, close cxn\n\tif (!$stmt->execute()) {\n\t\t$db_errmsg = \"Person Table-SELECT:Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t\treturn $db_errmsg;\n\t}\n\t\n\t/* bind result variables */\n $stmt->bind_result($pID);\n\t$stmt->fetch();\n\t\n\t\n\t// 4) select eid from Event table\n\tif (!($stmt->prepare(\"SELECT eid FROM Event\"))) {\n\t\t$db_errmsg = \"Event Table-SELECT: Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t\treturn $db_errmsg;\n\t}\n\n\t// If error, return to regis page with message, close cxn\n\tif (!$stmt->execute()) {\n\t\t$db_errmsg = \"Event Table-SELECT: Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t\treturn $db_errmsg;\n\t}\n\t\n\t/* bind result variables */\n $stmt->bind_result($eID);\n\t$stmt->fetch();\n\t\n\t// If error, return to regis page with message, close cxn\n\t\t\t\n\t// 5) insert records into P-E table\n\tif (!($stmt->prepare(\"INSERT INTO `Person-Event` (pid,eid,org_name,org_addr1,org_addr2,org_city,org_state,org_zip,emergency_contact_name,emergency_contact_phone,emergency_contact_email,hotel,comments,special_needs,display_name) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\"))) \n\t{\n\t\t$db_errmsg = \"Person-Event Table-INSERT: Prepare failed: (\" . $mysqli->errno . \") \" . $mysqli->error;\n\t\treturn $db_errmsg;\n\t}\n\n\n\t// Prepared statement, stage 2: bind and execute \n\tif (!$stmt->bind_param(\"iisssssssssssss\", $pID,$eID,$arrData['org_name'],$arrData['org_addr1'],$arrData['org_addr2'],$arrData['org_city'],$arrData['org_state'],$arrData['org_zip'],$arrData['emergency_contact_name'],$arrData['emergency_contact_phone'],$arrData['emergency_contact_email'],$arrData['hotel'],$arrData['comments'],$arrData['special_needs'],$arrData['Name_In_Print'])) \n\t{\n\t\t$db_errmsg = \"Person-Event Table-INSERT: Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t\treturn $db_errmsg;\n\t}\n\n\t// If error, return to regis page with message, close cxn\n\tif (!$stmt->execute()) \n\t{\n\t\t$db_errmsg = \"Person-Event Table-INSERT:Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\n\t\treturn $db_errmsg;\n\t}\n\t\t\t\n\t// 6) close connection \n\t$stmt->close();\n\t$conn->close();\n\treturn true;\n\t\n}", "public function addDataReturnsRecordTitleForInputTypeDataProvider() {}" ]
[ "0.5971066", "0.5927828", "0.5893293", "0.5763572", "0.56527025", "0.5540382", "0.55108595", "0.54054636", "0.5389388", "0.53673047", "0.53497666", "0.53135186", "0.5288644", "0.52637595", "0.5213517", "0.51999176", "0.5192636", "0.51846516", "0.5180356", "0.517683", "0.51767755", "0.5176302", "0.5165824", "0.51586854", "0.51575476", "0.5155202", "0.51525086", "0.51242954", "0.5119461", "0.51191485" ]
0.61523634
0
Cleans the number and removes any spaces surrounding it.
protected function clean(string $number): string { $number = preg_replace('#[^\d]#', '', $number); return trim($number); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cardNumberClean($number)\n {\n return preg_replace(\"/[^0-9]/\", \"\", $number);\n }", "public function cleanNumber($value) {\n $data = trim($value);\n\n // Removes Unwanted Characters\n $data = filter_var($data, FILTER_SANITIZE_NUMBER_INT);\n\n // Sanitizes HTML Characters\n $data = htmlspecialchars_decode($data, ENT_QUOTES);\n\n return $data;\n }", "function clean_number($phone_number){\n\treturn preg_replace(\"/[^0-9]/\", \"\", $phone_number);\n}", "protected function cleanCardNumber($number) {\n\t\t$result = preg_replace('/\\D/', '', $number);\n\t\treturn $result;\n\t}", "public static function clean($number)\n {\n $number = (string)$number;\n\n // don't clean numbers without dot\n if (strpos($number, '.') === false) {\n return $number;\n }\n\n // remove zeros from end of number ie. 140.00000 becomes 140.\n $clean = rtrim($number, '0');\n // remove zeros from front of number ie. 0.33 becomes .33\n $clean = ltrim($clean, '0');\n\n // everything has been cleaned\n if ($clean == '.') {\n return '0';\n }\n\n // remove decimal point if an integer ie. 140. becomes 140\n $clean = rtrim($clean, '.');\n\n return $clean[0] == '.' ? '0' . $clean : $clean;\n }", "protected function numbersOnly( $value )\n {\n return preg_replace('/[^0-9]/', '', $value);\n }", "function tc_sanitize_number( $value) {\r\n $value = esc_attr( $value); // clean input\r\n $value = (int) $value; // Force the value into integer type.\r\n return ( 0 < $value ) ? $value : null;\r\n }", "function trimPhone($phone){\n\treturn preg_replace('/[^+0-9]/', '', $phone);\n}", "public function sanitize($value): string\n {\n $renavam = parent::sanitize((string) $value);\n if (preg_match(\"/^([0-9]{9})$/\", $renavam)) {\n $renavam = '00' . $renavam;\n }\n\n if (preg_match(\"/^([0-9]{10})$/\", $renavam)) {\n $renavam = '0' . $renavam;\n }\n\n return $renavam;\n }", "function format_phone_plain($number) {\n return preg_replace('/[^0-9]/', '', $number);\n}", "public function phoneClean():string\n {\n $phone = '';\n if (!empty($this->phone)) {\n $phone = preg_replace('#[^\\d\\+]#si', '', $this->phone);\n }\n return $phone;\n }", "public function sanitizeNumber($data){\n $data = filter_var($data, FILTER_SANITIZE_NUMBER_INT);\n return $data;\n }", "function clean_no ($cc_no)\t{\n\t\treturn ereg_replace ('[^0-9]+', '', $cc_no); \n\t}", "function justNumbers($var)\n{\n return preg_replace('/[^0-9]/', '', $var);\n}", "public static function filterNumber($value)\n {\n return preg_replace('/[^0-9]/', '', $value);\n }", "function number_trim($str_number) {\n $str_number = \\strval($str_number);\n if (\\strpos($str_number, \".\") !== false)\n $str_number = \\rtrim(\\rtrim($str_number, \"0\"), \".\");\n $str_number = \\ltrim($str_number, \"0\");\n if ($str_number == \"\" || $str_number[0] == \".\")\n $str_number = \"0$str_number\";\n return $str_number;\n}", "function clean_phone($phone_number){\n $clean = str_replace(array('+','(',')','-',' '),'',$phone_number);\n return $clean;\n }", "public function stripZero($number)\n\t\t{\n\t\t\t$answNumber = \"\";\n\t\t\t$strNumber = \"\" . $number;\n\t\t\tif (substr($strNumber, strlen($strNumber) - 2) !== '.0')\n\t\t\t\treturn $number;\n\t\t\t$answNumber .= substr($strNumber, 0, strlen($strNumber) - 2);\n\n\t\t\treturn $answNumber;\n\t\t}", "function unify_number($number){\n $number = str_replace([\" \", \"-\"], \"\", $number); // Android likes to put those in\n if( strpos($number, \"00\") === 0 )\n return \"+\".substr($number, 2);\n if( strpos($number, \"0\") === 0 )\n return \"+49\".substr($number, 1);\n if( strpos($number, \"+\") === 0 ){\n return $number;\n }\n return \"+496659\".$number;\n}", "protected function strip_non_numeric($cardno) {\n return preg_replace('/[^0-9]/', null, $cardno);\n }", "function clean_iptc_value($value)\n{\n\t// strip leading zeros (weird Kodak Scanner software)\n\twhile ( isset($value[0]) and $value[0] == chr(0)) {\n\t\t$value = substr($value, 1);\n\t}\n\t// remove binary nulls\n\t$value = str_replace(chr(0x00), ' ', $value);\n\n\treturn $value;\n}", "public function cleanSmsSender($number) {\n if ((int)substr($number, 0, 1) === 0) {//Starts with 0\n return '44' . substr($number, 1);\n }//E# if statement\n\n return $number;\n }", "function squish(){\n\t\t$out = $this->trim();\n\t\treturn $out->gsub('/\\s+/',' ');\n\t}", "public function filter($value)\n {\n $value = preg_replace(\"/\\([^)]+\\)/\", \"\", $value);\n $numeric = preg_replace(\"/[^0-9]/\", \"\", $value);\n\n if (strpos($numeric, '00') === 0 && (strlen($numeric) === 12 || strlen($numeric) === 13)) {\n $numeric = ltrim($numeric, '0');\n }\n\n if ((strpos($numeric, '06') === 0 && strlen($numeric) === 10) || (strpos($numeric, '6') && strlen($numeric) === 9)) {\n $numeric = '31' . ltrim($numeric, '0');\n }\n\n return (string)$numeric;\n }", "function PhoneClean($PhoneClean)\n {\n // Es gibt unzählige Varianten. Wenigstens die Gebräuchlichsten davon sollen erkannt und bereinigt werden\n\n // Ersetze 00 oder (00 oder ( 00 durch ein + ,\n // was der Internationalen Vorwahl entspricht\n $PhoneClean = eregi_replace(\"^(00|\\(00|\\( 00)\", \"+\", $PhoneClean);\n\n // Hat jemand 2x hintereinander ein + eingegeben,\n // ersetze es durch ein einzelnes +\n $PhoneClean = eregi_replace(\"\\+\\+\", \"+\", $PhoneClean);\n\n // Hat da jemand ein oder zwei Leerzeichen nach dem Plus eingegeben,\n // dann entferne auch diese.\n $PhoneClean = eregi_replace(\"^(\\+ |\\+ )\", \"+\", $PhoneClean);\n\n // Wenn es Ländervorwal hat, beginnt diese nun mit einem +\n // Hat es ein Plus am Anfang ? Wenn ja,(0)entfernen.\n // (Diese wird bei Ortsvorwahlen gerne als Lesehilfe hinzugefügt)\n if (ereg (\"^\\+\", $PhoneClean))\n $PhoneClean = trim(eregi_replace(\"\\(0)\", \"\", $PhoneClean));\n\n // Alle typischen Zeichen ausser den Numerischen und dem Plus durch Leerzeichen ersetzen,\n // entferne anschliessend unbekannte Zeichen und ersetze doppelte Leerzeichen duch einfache\n $PhoneClean = eregi_replace(\"\\(|)|/|\\.\", \" \", $PhoneClean);\n $PhoneClean = trim(eregi_replace(\"[^0-9\\+[:space:]]\", null, $PhoneClean));\n $PhoneClean = trim(preg_replace(\"/ +/\", ' ', $PhoneClean));\n return $PhoneClean;\n }", "protected function cleanValue()\n {\n return str_replace([\n '%',\n '-',\n '+',\n ], '', $this->condition->value);\n }", "function clean($value) {\n if (get_magic_quotes_gpc()) $value = stripslashes($value);\n if (!is_numeric($value)) $value = addslashes($value);\n return $value;\n}", "function soNumero($str) {\r\nreturn preg_replace(\"/[^0-9]/\", \"\", $str);\r\n\r\n}", "function sanitize_phone($value, bool $preserveSpaces): string\n{\n if(isNullOrEmpty($value)){\n return '';\n }\n\n $startsWithPlus = starts_withEx($value, '+');\n\n $phone = mb_ereg_replace('([^\\d\\(\\)' . ($preserveSpaces ? '[:space:]' : '') . '])', $preserveSpaces ? ' ' : '', $value);\n $phone = trim($phone);\n\n //revert initial + if needed\n if ($startsWithPlus) {\n $phone = '+' . $phone;\n }\n\n //check for illegal parenthesis\n if ((strpos($phone, '(') !== false || strpos($phone,\n ')') !== false) && !preg_match('/.*\\([[:space:]0-9]{1,}\\)[[:space:]0-9]{1,}/', $phone)\n ) {\n $phone = str_replace(['(', ')'], $preserveSpaces ? ' ' : '', $phone);\n }\n\n //remove multiple spaces\n $phone = str_replace_multiple_spaceEx($phone);\n\n //remove spaces into and around ()\n $phone = str_replace(['( ', ' )', ' (', ') '], ['(', ')', '(', ')'], $phone);\n\n $phone = trim($phone);\n\n return $phone;\n}", "function removerMascaraCpf($valor)\n{\n return preg_replace([\"/\\\\D+/\"], [''], $valor);\n}" ]
[ "0.73357236", "0.73177266", "0.6943687", "0.6891283", "0.669165", "0.649616", "0.64943045", "0.6437673", "0.640825", "0.6396689", "0.638609", "0.637747", "0.63772386", "0.63426954", "0.6330114", "0.6267231", "0.62286705", "0.6221756", "0.6169539", "0.615727", "0.61476725", "0.6120449", "0.6111171", "0.6103438", "0.60914207", "0.6083267", "0.6027702", "0.6021614", "0.6006602", "0.60037374" ]
0.74052095
0
Calculates the Luhn checksum of a personal no.
public function luhnChecksum(string $number): int { $number = $this->clean($number); // Reverse the string $number = strrev($number); $total = 0; // From the rightmost digit, which is the check digit, // and moving left, double the value of every second digit. for ($i = 0; $i <= strlen($number) - 1; $i++) { $val = (int) $number[$i]; $val = ($i & 1) ? $val * 2 : $val; // If the result of this doubling operation is // greater than 9 then subtract 9 from the product if ($val > 9) { $val -= 9; } // Take the sum of all the digits $total += $val; } return $total % 10; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getChecksum(): int\n {\n $this->generateChecksum(true);\n return ((($this->base) - ($this->luhnValue % $this->base)) % $this->base);\n }", "public function calculateLuhn(string $partialNumber): int {\n $checkDigit = $this->luhnChecksum(intval($partialNumber) * 10);\n return $checkDigit === 0 ? $checkDigit : 10 - $checkDigit;\n }", "private function verifyByLuhnAlgorithm($number){ }", "function ean_checksum2($ean){\n $ean=(string)$ean;\n $even=true; $esum=0; $osum=0;\n for ($i=strlen($ean)-1;$i>=0;$i--){\n\tif ($even) $esum+=$ean[$i];\telse $osum+=$ean[$i];\n\t$even=!$even;\n }\n \n return (10-((3*$esum+$osum)%10))%10;\n}", "function checksum_generate($number)\n{\n $stack = 0;\n $digits = str_split(strrev($number), 1);\n foreach ($digits as $key => $value) {\n if ($key % 2 === 0) {\n $value = array_sum(str_split($value * 2, 1));\n }\n $stack += $value;\n }\n $stack %= 10;\n if ($stack !== 0) {\n $stack -= 10;\n }\n return (int)(implode('', array_reverse($digits)) . abs($stack));\n}", "public function calculateLuhn($credit_card) {\n // largo del string\n $length = strlen($credit_card);\n // tarjeta de credito sin el digito de chequeo\n $credit_card_user = substr($credit_card, 0, $length - 1);\n\n $values = []; // array temporal\n // duplico los numeros en indices pares\n for ($i = $length - 2; $i >= 0; $i--) {\n if ($i % 2 == 0) {\n // sumo cada uno de los digitos devueltos al duplicar\n array_push($values, $this->sumDigits((string) ($credit_card_user[$i] * 2)));\n } else {\n array_push($values, (int) $credit_card_user[$i]);\n }\n }\n\n return ($this->checkDigit(array_sum($values)) == $credit_card[$length - 1]);\n }", "private function luhnOddDigit($n){\n\t\treturn ($n >= 5) ? 2 * $n - 9 : 2 * $n;\n\t}", "public static function luhn_check( $str ) {\n\t\t$odd = (strlen( $str ) % 2);\n\t\t$sum = 0;\n\n\t\tfor( $i = 0; $i < strlen( $str ); $i++ ) {\n\t\t\tif ( $odd ) {\n\t\t\t\t$sum += $str[$i];\n\t\t\t} else {\n\t\t\t\tif ( ( $str[$i] * 2 ) > 9 ) {\n\t\t\t\t\t$sum += $str[$i] * 2 - 9;\n\t\t\t\t} else {\n\t\t\t\t\t$sum += $str[$i] * 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$odd = !$odd;\n\t\t}\n\t\treturn( ( $sum % 10 ) == 0 );\n\t}", "abstract protected function calculateCheckDigit(AccountNumber $number): string;", "protected function calculateChecksum() {\r\n // Calculating Checksum\r\n // Consider the right-most digit of the message to be in an \"odd\" position,\r\n // and assign odd/even to each character moving from right to left\r\n // Odd Position = 3, Even Position = 1\r\n // Multiply it by the number\r\n // Add all of that and do 10-(?mod10)\r\n $odd = true;\r\n $this->checksumValue = 0;\r\n $c = strlen($this->text);\r\n for ($i = $c; $i > 0; $i--) {\r\n if ($odd === true) {\r\n $multiplier = 3;\r\n $odd = false;\r\n } else {\r\n $multiplier = 1;\r\n $odd = true;\r\n }\r\n\r\n if (!isset($this->keys[$this->text[$i - 1]])) {\r\n return;\r\n }\r\n\r\n $this->checksumValue += $this->keys[$this->text[$i - 1]] * $multiplier;\r\n }\r\n\r\n $this->checksumValue = (10 - $this->checksumValue % 10) % 10;\r\n }", "public function calculateChecksum() {}", "public function calculateChecksum() {}", "function check_armstrong($number){\r\n$n=$number;\r\n$total_sum=0;\r\nwhile($n!=0){\r\n\t$rem=$n%10;\r\n\t$n=$n/10;\r\n\t$sum=1;\r\n\tfor($i=0; $i<3; $i++){\r\n\t\t$sum*=$rem;\r\n\t}\r\n\t$total_sum+=$sum;\r\n\t$sum=1;\r\n}\r\nif($total_sum==$number){\r\n\techo \"It is an armstrong number\".$total_sum;\r\n}\r\nelse{\r\n\techo \"It is not armstrong number\";\r\n\r\n}\r\n}", "private function luhn_check($number) {\r\n\r\n\t\t// Set the string length and parity\r\n\t\t$number_length=strlen($number);\r\n\t\t$parity=$number_length % 2;\r\n\r\n\t\t// Loop through each digit and do the maths\r\n\t\t$total=0;\r\n\t\tfor ($i=0; $i<$number_length; $i++) {\r\n\t\t\t$digit=$number[$i];\r\n\t\t\t// Multiply alternate digits by two\r\n\t\t\tif ($i % 2 == $parity) {\r\n\t\t\t\t$digit*=2;\r\n\t\t\t\t// If the sum is two digits, add them together (in effect)\r\n\t\t\t\tif ($digit > 9) {\r\n\t\t\t\t\t$digit-=9;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Total up the digits\r\n\t\t\t$total+=$digit;\r\n\t\t}\r\n\r\n\t\t// If the total mod 10 equals 0, the number is valid\r\n\t\treturn ($total % 10 == 0) ? TRUE : FALSE;\r\n\r\n\t}", "protected function generateCardNum(int $prefix, int $length)\n\t{\n\t\t$pos = mb_strlen($prefix);\n\t\t$finalDigit = 0;\n\t\t$sum = 0;\n\n\t\t// Fill in the first values of the string based on $prefix\n\t\t$string = str_split($prefix);\n\n\t\t// Pad out the array to the appropriate length\n\t\t$string = array_pad($string, $length, 0);\n\n\t\t// Fill all of the remaining values with random numbers, except the last one.\n\t\twhile ($pos < $length - 1)\n\t\t{\n\t\t\t$string[$pos ++] = random_int(0, 9);\n\t\t}\n\n\t\t// Calculate the Luhn checksum of the current values.\n\t\t$lenOffset = ($length + 1) % 2;\n\t\tfor ($pos = 0; $pos < $length - 1; $pos ++)\n\t\t{\n\t\t\tif (($pos + $lenOffset) % 2)\n\t\t\t{\n\t\t\t\t$temp = $string[$pos] * 2;\n\t\t\t\tif ($temp > 9)\n\t\t\t\t{\n\t\t\t\t\t$temp -= 9;\n\t\t\t\t}\n\n\t\t\t\t$sum += $temp;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sum += $string[$pos];\n\t\t\t}\n\t\t}\n\n\t\t// Make the last number whatever would cause the entire number to pass the checksum\n\t\t$finalDigit = (10 - ($sum % 10)) % 10;\n\t\t$string[$length - 1] = $finalDigit;\n\n\t\treturn implode('', $string);\n\t}", "public static function calculateChecksum($number, $length = 0) {\n\t\t$number = strval(self::toInteger($number));\n\n\t\tif ($length === 0) {\n\t\t\t$length = strlen($number);\n\t\t}\n\n\t\t$checkSum = 0;\n\n\t\t// Start at the next last digit\n\t\tfor ($i = $length - 2; $i >= 0; $i -= 2) {\n\t\t\t// Multiply number with 2\n\t\t\t$tmp = intval($number[$i]) * 2;\n\n\t\t\t// If a 2 digit number, split and add togheter\n\t\t\tif ($tmp > 9) {\n\t\t\t\t$tmp = ($tmp / 10) + ($tmp % 10);\n\t\t\t}\n\n\t\t\t// Sum it upp\n\t\t\t$checkSum += $tmp;\n\t\t}\n\n\t\t// Start at the next last digit\n\t\tfor ($i = $length - 1; $i >= 0; $i -= 2) {\n\t\t\t// Sum it upp\n\t\t\t$checkSum += intval($number[$i]);\n\t\t}\n\n\t\treturn $checkSum;\n\t}", "private function generateChecksum(bool $excluding = false): void\n {\n $sum = 0;\n $reverse = array_reverse($this->numberArray);\n $length = count($reverse);\n\n $i = 1;\n if ($excluding === true) {\n $res = $reverse[0] * 2;\n if ($res >= $this->base) {\n $res -= ($this->base - 1);\n }\n $sum += $res;\n $i++;\n }\n\n for (; $i < $length; $i += 2) {\n $res = $reverse[$i] * 2;\n if ($res >= $this->base) {\n $res -= ($this->base - 1);\n }\n $sum += $res;\n\n $res = $reverse[$i - 1];\n if ($res >= $this->base) {\n $res -= ($this->base - 1);\n }\n $sum += $res;\n }\n\n if ($i === $length) {\n $res = $reverse[$i - 1];\n $sum += $res;\n }\n\n $this->luhnValue = $sum;\n }", "function checksum_validate($number)\n{\n $original = substr($number, 0, strlen($number) - 1);\n return checksum_generate($original) === $number;\n}", "function formIsCreditNumber( $number ) { \r\n \r\n $tmp = $number; \r\n $number = preg_replace( \"/[^0-9]/\", \"\", $tmp ); \r\n\r\n if ( preg_match( \"/[^\\d\\s]/\", $number ) ) return 0; \r\n if ( strlen($number) < 13 && 0+$number ) return 0; \r\n\r\n for ($i = 0; $i < strlen($number) - 1; $i++) { \r\n $weight = substr($number, -1 * ($i + 2), 1) * (2 - ($i % 2)); \r\n $sum += (($weight < 10) ? $weight : ($weight - 9)); \r\n } \r\n\r\n if ( substr($number, -1) == (10 - $sum % 10) % 10 ) return $number; \r\n return $number; \r\n}", "public function isValidChecksum()\n\t{\n\t\t$length = strlen($this->number);\n\t\t$value = $this->ccNumber;\n\t\t$sum = 0;\n $weight = 2;\n\n for ($i = $length - 2; $i >= 0; $i--) {\n $digit = $weight * $value[$i];\n $sum += floor($digit / 10) + $digit % 10;\n $weight = $weight % 2 + 1;\n }\n\n if ((10 - $sum % 10) % 10 != $value[$length - 1]) {\n return false;\n }\n\n return true;\n\t}", "function calculateChecksum(string $data): string\n{\n $checksum = '';\n while (strlen($checksum) % 2 === 0) {\n $checksum = '';\n $length = strlen($data);\n for ($i = 0; $i < $length - 1; $i += 2) {\n if ($data[$i] === $data[$i + 1]) {\n $checksum .= '1';\n } else {\n $checksum .= '0';\n }\n }\n $data = $checksum;\n }\n return $checksum;\n}", "public static function calculateCheckDigit($number) {\n\t\t// Get the checksum\n\t\t$checkSum = strval(self::calculateChecksum($number . 0));\n\t\t// Get the last digit of the checksum\n\t\t$checkDigit = intval($checkSum[strlen($checkSum) - 1]);\n\n\t\t// If the checkdigit is not 0, then subtract the value from 10\n\t\treturn $checkDigit === 0 ? $checkDigit : 10 - $checkDigit;\n\t}", "public static function generateLuhnNumber($partialValue)\n {\n if (!preg_match('/^\\d+$/', $partialValue)) {\n throw new InvalidArgumentException('Argument should be an integer.');\n }\n return $partialValue . Luhn::computeCheckDigit($partialValue);\n }", "function generateNubanAccountNumber()\n {\n $grammar = new Hoa\\File\\Read('hoa://Library/Regex/Grammar.pp');\n\n $ast = Hoa\\Compiler\\Llk\\Llk::load($grammar)->parse('[0-9]{10}');\n\n $generator = new Hoa\\Regex\\Visitor\\Isotropic(new Hoa\\Math\\Sampler\\Random());\n\n try {\n do {\n $number = $generator->visit($ast);\n } while (Account::where('number', $number)->exists());\n\n return $number;\n } catch (Throwable $exception) {\n Log::error($exception);\n }\n }", "function sri_checksum($input)\n{\n $algorithm = settings::algorithm();\n $hash = hash($algorithm, $input, true);\n $hash_base64 = base64_encode($hash);\n\n return \"$algorithm-$hash_base64\";\n}", "protected function calculateChecksum($value): int\n {\n $checksum = 0;\n\n // chars without check digit in reverse\n $chars = array_reverse(str_split(substr($value, 0, -1)));\n\n foreach ($chars as $key => $char) {\n $multiplier = $key % 2 ? 1 : 3;\n $checksum += intval($char) * $multiplier;\n }\n\n $remainder = $checksum % 10;\n\n if ($remainder === 0) {\n return 0;\n }\n\n return 10 - $remainder;\n }", "abstract public function checksum($barcode);", "private function getChecksum($countryCode, $bankCode, $accountNumber)\n {\n $iban = $this->convertStringToNumber($bankCode . $accountNumber . $countryCode) . '00';\n $checksum = 98 - $this->bcmod($iban, 97);\n return $this->prependNumber($checksum, 2);\n }", "public function getChecksum();", "function verify_creditcard_mod10($strccno = '')\n {\n if (empty($strccno))\n {\n return false;\n }\n $len = mb_strlen($strccno);\n if ($len < 13 OR $len > 16)\n {\n return false;\n }\n $checkdig = (int)$strccno[--$len];\n for ($i=--$len, $sum = 0, $dou = true; $i >= 0; $i--, $dou =! $dou)\n {\n $curdig = (int)$strccno[$i];\n if ($dou)\n {\n $curdig *= 2;\n if ($curdig > 9) $curdig-=9;\n }\n $sum += $curdig;\n }\n if (($checkdig + $sum) % 10 == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n }" ]
[ "0.7103682", "0.68381286", "0.6740685", "0.6577468", "0.6355316", "0.625983", "0.619785", "0.619401", "0.6107352", "0.607724", "0.6034228", "0.6034228", "0.60248333", "0.59134376", "0.588082", "0.5880558", "0.5822288", "0.5815708", "0.5685192", "0.56728697", "0.56599736", "0.5640608", "0.5593522", "0.5591883", "0.55917376", "0.55751425", "0.5544", "0.54698044", "0.5449039", "0.5446374" ]
0.72316176
0
/ RD Blog Tab Fix
function rd_fix_blog_tab_on_cpt($classes, $item, $args) { if (!is_singular('post') && !is_category() && !is_tag()) { $blog_page_id = intval(get_option('page_for_posts')); if ($blog_page_id != 0) { if ($item->object_id == $blog_page_id) { unset($classes[array_search('current_page_parent', $classes)]); } } } return $classes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restore_current_blog()\n {\n }", "function get_posts_tabs() { ?>\n\t<div id=\"custom-post-tabs\">\n\t<ul class=\"tab-links\">\n\t <li><a href=\"#recommended-posts\">Recommended Posts</a></li>\n\t <li><a href=\"#popular-posts\">Popular Posts</a></li>\n\t <li><a href=\"#latest-posts\">Latest Posts</a></li>\n\t <?php \n\t get_recommended_posts();\n\t get_popular_posts();\n\t get_latest_posts();\n\t ?>\n \t</ul>\n\t</div>\n<?php }", "function voa_intro_fix_styles() {\n\n?>\n\n<style type=\"text/css\">\n/* .post ul li, .page ul li { list-style: none inside !important } */\ndiv.content_column2_1 { width: 998px; overflow: hidden }\ndiv.content_column2_2 { display: none }\ndiv.articleContent { width: 974px; }\n/*\n#mainNav li { float: left }\na.tabOn { background-color: #374EC5; color: white; padding:5px }\n*/\n\n\n<?php /*\n#blogNav {\n\ttext-align: justify;\n\tmin-width: 500px;\n\n\tfont-size: 1px;\n}\n#blogNav:after {\n\tcontent: '';\n\tdisplay: inline-block;\n\twidth: 100%;\n}\n\n#blogNav li {\n\tdisplay: inline-block;\n\n\tpadding: 10px 0;\n}\n\n#blogNav li a {\n\txxxxdisplay: block;\n\twidth: 100%;\n\n\tdisplay: inline;\n\tbackground-color: #F4F4F4;\n\tborder-bottom: 4px solid #DFDFDF;\n\tborder-top: 1px solid #DFDFDF;\n\tpadding: 10px 15px;\n}\n\n#blogNav li a:hover {\n\tbackground: #999;\n\tborder-bottom: 4px solid #999;\n\tcolor: #fff;\n\ttext-decoration: none;\n}\n\n#blogNav li a.list-head {\n\tbackground: #374EC5;\n\tborder-color: #374EC5;\n\tcolor: #fff;\n}\n\n#blogNav li a.tabOn,\n#blogNav li a.tabOn:hover {\n\tbackground: #EDEDED;\n\tborder-bottom: 4px solid #999;\n\tcolor: #374EC5;\n}\n\n*/ ?>\n\n#blogNav {\n\ttext-align: justify;\n\tmin-width: 500px;\n\n\tbackground: #F4F4F4 url(<?php echo get_stylesheet_directory_uri(); ?>/img/blogNav-bg.png) left bottom repeat-x;\n\tfont-size: 1px;\n}\n#blogNav:after {\n\tcontent: '';\n\tdisplay: inline-block;\n\twidth: 100%;\n}\n\n#blogNav a {\n\tborder-bottom: 4px solid #DFDFDF;\n\tdisplay: inline-block;\n\tfont-size: 15px;\n\tpadding: 8px 15px 7px;\n\ttext-decoration: none;\n}\n\n#blogNav a:hover {\n\tbackground: #EDEDED;\n\tborder-bottom: 4px solid #374EC5;\n\tcolor: #374EC5;\n}\n\n#blogNav a.tabOn {\n\tbackground: #374EC5;\n\tborder-color: #374EC5;\n\tcolor: #fff;\n}\n\n.voa_wp_clear {\n\theight: 60px;\n}\n\n.blog-block {\n\tfloat: left;\n\tmargin-bottom: 45px;\n\tpadding: 0;\n\twidth: 475px;\n}\n\n.left-block {\n\tclear: left;\n\tpadding-right: 24px;\n}\n\n.blog-block h1 {\n\tmargin: 0;\n\tpadding: 0;\n}\n\n.blog-block p {\n\ttext-align: left;\n\tpadding: 6px;\n\tcolor: #666;\n\tborder-bottom: 1px solid #ccc;\n\tline-height: 140%;\n\tfont-style: normal;\n\tmargin: 0 0 12px 0;\n\twidth: 461px;\n\tfont-size: 12px;\n}\n\n.blog-block h1 img {\n\twidth: 475px;\n}\n\n.blog-block ul > li {\n\tcolor: #666;\n\tlist-style: circle outside none;\n\tmargin-bottom: 6px;\n\tmargin-left: 20px;\n\tpadding-left: 0;\n}\n\n\n\n@media only screen and (max-width: 500px) {\n\n\thtml#html1, body#bd1 {\n\t\tmin-width: 100%;\n\t\toverflow-x: hidden;\n\t\twidth: 100%;\n\t}\n\n\tdiv.articleContent,\n\t.content_centered,\n\tdiv.content_column2_1 {\n\t\twidth: 100%;\n\t}\n\n\t#top_bar, \n\t#top_bar_expanded,\n\t#header_services,\n\tul.header_navigation,\n\t#footerServices {\n\t\tdisplay: none;\n\t\tvisibility: hidden;\n\t}\n\n\t.columns {\n\t\tpadding-top: 0;\n\t}\n\n\t#header {\n\t\tbackground: none;\n\t\theight: 70px !important;\n\t}\n\n\t#header .content_centered {\n\t\theight: auto;\n\t}\n\n\t#header .content_centered h2#header_logo {\n\t\tbackground-image: url( <?php echo get_stylesheet_directory_uri(); ?>/img/VOA_en-US-top_logo_blog-mobile.gif);\n\t\tbackground-size: contain;\n\t\theight: auto;\n\t\tmax-width: 90%;\n\t\twidth: 90%;\n\t}\n\n\t#header .content_centered h2#header_logo a {\n\t\tmargin-top: 0;\n\t}\n\n\t#blogNav {\n\t\tbackground-image: none;\n\t\tmin-width: 100%;\n\t}\n\n\t#blogNav a, #blogNav a:hover {\n\t\tborder: 0;\n\t\tfont-size: 14px;\n\t}\n\n\t.blog-block {\n\t\tclear: both;\n\t\tfloat: none;\n\t\twidth: 100%;\n\t}\n\n\t.left-block {\n\t\tclear: both;\n\t\tpadding-right: 0;\n\t}\n\n\t.blog-block h1 img {\n\t\twidth: 100%;\n\t}\n\n\t.blog-block p {\n\t\tfont-size: 1em;\n\t\tpadding: .5em 0;\n\t\twidth: 100%;\n\t}\n\n\t.voa_wp_clear {\n\t\theight: 2em;\n\t}\n\n\t#footer #footerLinks {\n\t\tborder-top: 2px #2C45C3 solid;\n\t}\n\n}\n\n</style>\n\n<meta name=\"viewport\" content=\"initial-scale=1\">\n\n<?php\n\n}", "function cs_pb_blog($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$blog_element_size = '50';\n\t\t$cs_blog_title_db = '';\n\t\t$cs_blog_view_db = '';\n\t\t$cs_blog_view_all_db = '';\n\t\t$cs_blog_view_all_url_db = '';\n\t\t$cs_blog_cat_db = '';\n\t\t$cs_blog_excerpt_db = '255';\n\t\t$cs_blog_num_post_db = get_option(\"posts_per_page\");\n\t\t$cs_blog_pagination_db = '';\n\t\t$cs_post_description_db = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$blog_element_size = $cs_node->blog_element_size;\n\t\t\t$cs_blog_title_db = $cs_node->cs_blog_title;\n\t\t\t$cs_blog_view_db = $cs_node->cs_blog_view;\n\t\t\t$cs_blog_view_all_db = $cs_node->cs_blog_view_all;\n\t\t\t$cs_blog_view_all_url_db = $cs_node->cs_blog_view_all_url;\n\t\t\t$cs_blog_cat_db = $cs_node->cs_blog_cat;\n\t\t\t$cs_blog_excerpt_db = $cs_node->cs_blog_excerpt;\n\t\t\t$cs_blog_num_post_db = $cs_node->cs_blog_num_post;\n\t\t\t$cs_blog_pagination_db = $cs_node->cs_blog_pagination;\n\t\t\t$cs_blog_description_db = $cs_node->cs_blog_description;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $blog_element_size?>\" item=\"blog\" data=\"<?php echo element_size_data_array_index($blog_element_size)?>\" >\n\t\t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"blog_element_size[]\" class=\"item\" value=\"<?php echo $blog_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a>\n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp;\n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Blog Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n \t<ul class=\"form-elements\">\n <li class=\"to-label\"><label>Blog Header Title</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_blog_title[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($cs_blog_title_db)?>\" />\n <p>Please enter Blog header title.</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>View All Title</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_blog_view_all[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($cs_blog_view_all_db)?>\" />\n <p>Please enter the title.</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>View All URL</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_blog_view_all_url[]\" class=\"txtfield\" value=\"<?php echo htmlspecialchars($cs_blog_view_all_url_db)?>\" />\n <p>Please enter the URL for view all.</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Select View</label></li>\n <li class=\"to-field\">\n <select name=\"cs_blog_view[]\" class=\"dropdown\">\n \t<option <?php if($cs_blog_view_db==\"blog-large\")echo \"selected\";?> value=\"blog-large\">Blog Large Image</option>\n <option <?php if($cs_blog_view_db==\"blog-small\")echo \"selected\";?> value=\"blog-small\">Blog Small Image</option>\n \t<option <?php if($cs_blog_view_db==\"blog-masonry\")echo \"selected\";?> value=\"blog-masonry\">Blog Masonry</option>\n </select>\n <p>3 and 4 column with both sidebars will display 2 column</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Choose Category</label></li>\n <li class=\"to-field\">\n <select name=\"cs_blog_cat[]\" class=\"dropdown\">\n \t<option value=\"0\">-- Select Category --</option>\n\t\t\t\t\t\t\t<?php show_all_cats('', '', $cs_blog_cat_db, \"category\");?>\n </select>\n <p>Please select category to show posts.</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Post Description</label></li>\n <li class=\"to-field\">\n <select name=\"cs_blog_description[]\" class=\"dropdown\" >\n <option <?php if($cs_blog_description_db==\"yes\")echo \"selected\";?> value=\"yes\">Yes</option>\n <option <?php if($cs_blog_description_db==\"no\")echo \"selected\";?> value=\"no\">No</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Length of Excerpt</label></li>\n <li class=\"to-field\">\n <input type=\"text\" name=\"cs_blog_excerpt[]\" class=\"txtfield\" value=\"<?php echo $cs_blog_excerpt_db;?>\" />\n <p>Enter number of character for short description text.</p>\n </li> \n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Pagination</label></li>\n <li class=\"to-field\">\n <select name=\"cs_blog_pagination[]\" class=\"dropdown\" >\n <option <?php if($cs_blog_pagination_db==\"Show Pagination\")echo \"selected\";?> >Show Pagination</option>\n <option <?php if($cs_blog_pagination_db==\"Single Page\")echo \"selected\";?> >Single Page</option>\n </select>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>No. of Post Per Page</label></li>\n <li class=\"to-field\">\n \t<input type=\"text\" name=\"cs_blog_num_post[]\" class=\"txtfield\" value=\"<?php echo $cs_blog_num_post_db; ?>\" />\n <p>To display all the records, leave this field blank.</p>\n </li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"blog\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "function show_normal_tabs() {\n //$this->log(\"show_normal_tabs() top\", LOG_DEBUG);\n $this->show_tabs(Configure::read('tabs_order_default'));\n }", "function udesign_blog_entry_top() {\r\n do_action('udesign_blog_entry_top');\r\n}", "function udesign_blog_entry_before() {\r\n do_action('udesign_blog_entry_before');\r\n}", "public function getTabTitle()\n {\n return Mage::helper('blog')->__('Comment Information');\n }", "function udesign_blog_post_content_before() {\r\n do_action('udesign_blog_post_content_before');\r\n}", "function thb_remove_blog_grid_options() {\n\t\tif ( thb_get_admin_template() == 'template-blog-grid.php' ) {\n\t\t\t$fields_container = thb_theme()->getPostType( 'page' )->getMetabox( 'layout' )->getTab( 'blog_loop' )->getContainer( 'loop_container' );\n\t\t\t$fields_container->removeField( 'thumbnails_open_post' );\n\t\t}\n\t}", "function cs_pb_tabs($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$tabs_element_size = '50';\n\t\t$tab_title = '';\n\t\t$tab_text = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$tabs_element_size = $cs_node->tabs_element_size;\n\t\t\t$tab_title = $cs_node->tab_title;\n\t\t\t$tab_text = $cs_node->tab_text;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $tabs_element_size?>\" item=\"tabs\" data=\"<?php echo element_size_data_array_index($tabs_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"tabs_element_size[]\" class=\"item\" value=\"<?php echo $tabs_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Tabs Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n\t\t\t\t<div class=\"wrapptabbox\">\n <div class=\"clone_append\">\n <?php\n\t\t\t\t\t\t$tabs_num = 0;\n if ( isset($cs_node) ){\n\t\t\t\t\t\t\t$tabs_num = count($cs_node->tab);\n foreach ( $cs_node->tab as $tab ){\n\t\t\t\t\t\t\t\tif ( $tab->tab_active == \"yes\" ) { $tab_active = \"selected\"; }\n\t\t\t\t\t\t\t\telse { $tab_active = \"\"; }\n\t\t\t\t\t\t\t\techo \"<div class='clone_form'>\";\n\t\t\t\t\t\t\t\t\techo \"<a href='#' class='deleteit_node'>Delete it</a>\";\n\t\t\t\t\t\t\t\t\techo '<label>Tab Title:</label> <input class=\"txtfield\" type=\"text\" name=\"tab_title[]\" value=\"'.$tab->tab_title.'\" />';\n\t\t\t\t\t\t\t\t\techo '<label>Tab Text:</label> <textarea class=\"txtfield\" name=\"tab_text[]\">'.$tab->tab_text.'</textarea>';\n\t\t\t\t\t\t\t\t\techo '<label>Title Icon:</label> <input class=\"txtfield\" type=\"text\" name=\"tab_title_icon[]\" value=\"'.$tab->tab_title_icon.'\" />';\n\t\t\t\t\t\t\t\t\techo '<label>Active:</label> <select name=\"tab_active[]\"><option>no</option><option '.$tab_active.'>yes</option></select> ';\n\t\t\t\t\t\t\t\techo \"</div>\";\n }\n }\n ?>\n </div>\n <div class=\"opt-conts\">\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label></label></li>\n <li class=\"to-field\"><a href=\"#\" class=\"addedtab\">Add Tab</a></li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n <input type=\"hidden\" name=\"tabs_num[]\" value=\"<?php echo $tabs_num?>\" class=\"fieldCounter\" />\n <input type=\"hidden\" name=\"cs_orderby[]\" value=\"tabs\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n \t</div>\n \n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "function switch_to_main_blog() {\n\t$network_id = get_network()->site_id;\n\t// @codingStandardsIgnoreStart (fine for VIP Go)\n\tswitch_to_blog( $network_id );\n\t// @codingStandardsIgnoreEnd\n}", "abstract protected function tabs();", "public function getTabTitle()\n {\n return Mage::helper('magna_news')->__('Content');\n }", "function bd_custom_tabs(){\n\t\n\n\twp_enqueue_script( 'jquery-ui-tabs' );\n\n\tglobal $wpdb, $post;\n\t\n\t$args1 = array( \n\t\t'post_type' => array('post'),\n\t\t'posts_per_page' => 3,\n\t\t'meta_key' => '_thumbnail_id',\n\t\t'ignore_sticky_posts' => 1,\n\t);\n\t$args2 = array( \n\t\t'post_type' => array('post') ,\n\t\t'orderby' => 'comment_count',\n\t\t'meta_key' => '_thumbnail_id',\n\t\t'posts_per_page' => 3,\n\t\t'ignore_sticky_posts' => 1,\n\t);\n\n\t$loop1 = new WP_Query($args1);\n\t$loop2 = new WP_Query($args2);\n\t?>\n\t<script type=\"text/javascript\"> jQuery(function($){ $( \".widget_custom_tabs .bd-tabgroup\" ).tabs(); });</script>\n\t<div class=\"bd-tabgroup\">\n\t\t<ul class=\"tabs-menu\" style=\"margin-top:0\">\n\t\t\t<li><a href=\"#tab-1\"><?php _e('Recent', 'wolf'); ?></a></li>\n\t\t\t<li><a href=\"#tab-2\"><?php _e('Popular', 'wolf'); ?></a></li>\n\t\t\t<li><a href=\"#tab-3\"><?php _e('Comments', 'wolf'); ?></a></li>\n\t\t</ul>\n\t\t<div style=\"clear:both;\"></div>\n\n\t\t<div class=\"widget-custom-tabs-container\">\n\t\t\t<div id=\"tab-1\">\n\t\t\t\t<div class=\"widget-thumbnails-list\">\n\t\t\t\t\t<?php while ($loop1->have_posts()) : $loop1->the_post(); ?>\n\t\t\t\t\t<article>\n\t\t\t\t\t\t<a href=\"<?php esc_url(the_permalink()); ?>\" class=\"widget-thumb-link\">\n\t\t\t\t\t\t\t<?php the_post_thumbnail('mini', array('title' => \"\")); ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<span class=\"entry-title\"><a href=\"<?php esc_url(the_permalink()); ?>\" title=\"<?php printf(__('Permanent Link to %s', 'wolf'), get_the_title()); ?>\"><?php echo wolf_sample(get_the_title(), 40); ?></a></span>\n\t\t\t\t\t\t\t<br>\n\t\t\t\t\t\t<span class=\"time\"><?php echo get_the_date( get_option('date_format') ); ?></span><br>\n\t\t\t\t\t\t<span class=\"comment-count\">\n\t\t\t\t\t\t\t<?php if ( comments_open() ) : ?>\n\t\t\t\t\t\t\t\t<?php comments_popup_link( '<span class=\"leave-reply\">' . __( 'Leave a comment', 'wolf' ) . '</span>', __( 'One comment so far', 'wolf' ), __( 'View all % comments', 'wolf' ) ); ?>\n\t\t\t\t\t\t\t<?php endif; // comments_open() ?>\n\t\t\t\t\t\t</span>\n\t\t\n\t\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t\t</article>\n\t\t\t\t\t<?php endwhile; ?>\n\t\t\t\t</div>\n\n\t\t\t</div>\n\n\t\t\t<div id=\"tab-2\">\n\t\t\t\t<div class=\"widget-thumbnails-list\">\n\t\t\t\t<?php while ($loop2->have_posts()) : $loop2->the_post(); ?>\n\t\t\t\t<article>\n\t\t\t\t\t<a href=\"<?php esc_url(the_permalink()); ?>\" class=\"widget-thumb-link\">\n\t\t\t\t\t\t<?php the_post_thumbnail('mini', array('title' => \"\")); ?>\n\t\t\t\t\t</a>\n\t\t\t\t\t<span class=\"entry-title\"><a href=\"<?php esc_url(the_permalink()); ?>\" title=\"<?php printf(__('Permanent Link to %s', 'wolf'), get_the_title()); ?>\"><?php echo wolf_sample(get_the_title(), 40); ?></a></span>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t<span class=\"time\"><?php echo get_the_date( get_option('date_format') ); ?></span><br>\n\t\t\t\t\t<span class=\"comment-count\"><?php bd_comment_number(); ?></span>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</article>\n\t\t\t\t<?php endwhile; ?>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div id=\"tab-3\">\n\t\t\t<?php \n\t\t\t/**\n\t\t\t* bd_recent_comments() is used from the recent-comments-widget.php file\n\t\t\t*/\n\t\t\tif(function_exists('bd_recent_comments'))\n\t\t\t\tbd_recent_comments(3); \n\t\t\t?>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\t<?php\t\n}", "function childtheme_override_blogtitle() { ?>\n\t\t\n\t\t<div id=\"blog-title\"><span><a href=\"<?php bloginfo('url') ?>/\" title=\"<?php bloginfo('name') ?>\" rel=\"home\"><span class=\"name\">Naomi Ture</span> <span class=\"portfolio\">Portfolio</span></a></span></div>\n\t\t\n<?php\n}", "public function remove_help_tabs()\n {\n }", "function tptn_on_delete_blog( $tables ) {\n\tglobal $wpdb;\n\n\t$tables[] = $wpdb->prefix . 'top_ten';\n\t$tables[] = $wpdb->prefix . 'top_ten_daily';\n\n\treturn $tables;\n}", "function disqus_override_tabs($tabs){\r\n if ( has_filter( 'comments_template', 'dsq_comments_template' ) ){\r\n remove_filter( 'comments_template', 'dsq_comments_template' );\r\n add_filter('comments_template', 'dsq_comments_template',90);//higher priority, so the filter is called after woocommerce filter\r\n }\r\n return $tabs;\r\n}", "function remove_thematic_blogtitle() {\n\n remove_action('thematic_header','thematic_blogtitle', 3);\n\n}", "public function display_tablenav( $which ) \n{\n ?>\n <div class=\"tablenav <?php echo esc_attr( $which ); ?>\">\n\n <div class=\"alignleft actions\">\n <?php $this->bulk_actions(); ?>\n </div>\n <?php\n $this->extra_tablenav( $which );\n $this->pagination( $which );\n ?>\n <br class=\"clear\" />\n </div>\n <?php\n}", "function choose_primary_blog()\n {\n }", "function udesign_blog_entry_bottom() {\r\n do_action('udesign_blog_entry_bottom');\r\n}", "function wp_cache_switch_to_blog($blog_id)\n {\n }", "function torch_tabs_latest_posts( $instance ) \r\n{\r\n\textract( $instance );\r\n\t$the_query = new WP_Query('showposts='. $recent_num .'&orderby=post_date&order=desc');\r\n\t\r\n\twhile ($the_query->have_posts()) : $the_query->the_post(); \r\n\t?>\r\n\t<li>\r\n <?php \r\n if ( has_post_thumbnail() ) {\r\n the_post_thumbnail(\"side-slider\");\r\n } \r\n ?>\r\n <div class=\"tab-inner-box\">\r\n <div><a title=\"<?php the_title(); ?>\" href=\"<?php the_permalink() ?>\"><?php the_title(); ?></a></div>\r\n <div><i class=\"fa fa-comments\"></i>&nbsp;&nbsp;<?php the_date(\"M d.Y\")?></div>\r\n </div>\r\n\t\t <div class=\"clear\"></div>\r\n </li>\r\n\t<?php\r\n\tendwhile; \r\n\twp_reset_postdata() ;\r\n}", "function bd_custom_tabs_Widget(){\n\n\t\t// Widget settings\n\t\t$ops = array('classname' => 'widget_custom_tabs', 'description' => __('3 tabs: last posts, popular posts, and last comments', 'wolf'));\n\n\t\t/* Create the widget. */\n\t\tparent::__construct( 'widget_custom_tabs', __('Custom tabs', 'wolf'), $ops );\n\t\t\n\t}", "function __construct() {\n\n $options = array('classname' => 'tab_post_widget', 'description' => \"Theme styled recent and popular posts, comments and tags to be displayed in a preview tabs\");\n $controls = array('width' => 250, 'height' => 200);\n parent::__construct('tab_posts', 'J&W - Tab Posts Widget', $options, $controls);\n }", "private function help_style_tabs() {\n $help_sidebar = $this->get_sidebar();\n\n $help_class = '';\n if ( ! $help_sidebar ) :\n $help_class .= ' no-sidebar';\n endif;\n\n // Time to render!\n ?>\n <div id=\"screen-meta\" class=\"tr-options metabox-prefs\">\n\n <div id=\"contextual-help-wrap\" class=\"<?php echo esc_attr( $help_class ); ?>\" >\n <div id=\"contextual-help-back\"></div>\n <div id=\"contextual-help-columns\">\n <div class=\"contextual-help-tabs\">\n <ul>\n <?php\n $class = ' class=\"active\"';\n $tabs = $this->get_tabs();\n foreach ( $tabs as $tab ) :\n $link_id = \"tab-link-{$tab['id']}\";\n $panel_id = (!empty($tab['url'])) ? $tab['url'] : \"#tab-panel-{$tab['id']}\";\n ?>\n <li id=\"<?php echo esc_attr( $link_id ); ?>\"<?php echo $class; ?>>\n <a href=\"<?php echo esc_url( \"$panel_id\" ); ?>\">\n <?php echo esc_html( $tab['title'] ); ?>\n </a>\n </li>\n <?php\n $class = '';\n endforeach;\n ?>\n </ul>\n </div>\n\n <?php if ( $help_sidebar ) : ?>\n <div class=\"contextual-help-sidebar\">\n <?php echo $help_sidebar; ?>\n </div>\n <?php endif; ?>\n\n <div class=\"contextual-help-tabs-wrap\">\n <?php\n $classes = 'help-tab-content active';\n foreach ( $tabs as $tab ):\n $panel_id = \"tab-panel-{$tab['id']}\";\n ?>\n\n <div id=\"<?php echo esc_attr( $panel_id ); ?>\" class=\"inside <?php echo $classes; ?>\">\n <?php\n // Print tab content.\n echo $tab['content'];\n\n // If it exists, fire tab callback.\n if ( ! empty( $tab['callback'] ) )\n call_user_func_array( $tab['callback'], array( $this, $tab ) );\n ?>\n </div>\n <?php\n $classes = 'help-tab-content';\n endforeach;\n ?>\n </div>\n </div>\n </div>\n </div>\n <?php\n }", "function refresh_blog_details($blog_id = 0)\n {\n }", "function udesign_blog_entry_after() {\r\n do_action('udesign_blog_entry_after');\r\n}" ]
[ "0.640637", "0.6355451", "0.6301398", "0.6243702", "0.62283534", "0.6220925", "0.6162747", "0.6018418", "0.6014887", "0.5853601", "0.5835325", "0.58337396", "0.581074", "0.5779311", "0.5776533", "0.5753841", "0.5748536", "0.57484657", "0.5747365", "0.57317597", "0.57316715", "0.5728817", "0.5710362", "0.5706549", "0.57045877", "0.5703358", "0.5639576", "0.5633052", "0.5630061", "0.56252986" ]
0.6794077
0
Verifica che la stringa $telefono contenga un numero di telefono valido.
function checkPhoneNumber($telefono): bool { return is_string($telefono) and preg_match("/^([+][0-9]{1,3})?[0-9]{4,13}$/", $telefono); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function comprobarTelefono($telefono){\r\n if(!preg_match(\"/^[0-9]{9}$/\", $telefono)){\r\n return false;\r\n }\r\n return true;\r\n}", "private function checkNumero($tel)\n {\n $pattern = '/\\+\\d{2}+[0-9]{9,15}|[0-9]{9,15}/';\n if (!preg_match($pattern, $tel)){\n echo \"<br>ERRORE nel numero di telefono : \".$tel;\n throw new InvalidArgumentException();\n }\n else return true;\n }", "public function validarTelefono($texto){\n $patron = \"/[0-9]{9}/\";\n return preg_match_all($patron, $texto);\n }", "function validPhone($phone)\r\n {\r\n return strlen((string)$phone) == 10 && is_numeric($phone);\r\n }", "function comprobar_telefono()\n\t{\n\n\t$correcto = true; //variable booleana que comprueba si el atributo cuumple o no lo especificado\n\t\t\n\t//si los atributos estan vacios\n\tif (strlen($this->telefono) == 0)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"telefono\", \"codigoincidencia\" => \"00001\" ,\"mensajeerror\" => \"telefono vacio\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\n\t//si los atributos estan vacios\n\tif (strlen($this->telefono) > 11)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"telefono\", \"codigoincidencia\" => \"00002\" ,\"mensajeerror\" => \"telefono demasiado largo, maximo 10 caracteres\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\treturn $correcto;\n}", "function validPhone($phone)\r\n {\r\n\r\n return !empty($phone) && ctype_digit($phone);\r\n\r\n }", "function validate_phone($phone)\n{\n $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n // Check the lenght of number\n // This can be customized if you want phone number from a specific country\n if (strlen($filtered_phone_number) != 12) {\n return false;\n } else {\n return true;\n }\n}", "function validate_phone_num($nr)\n{\n $tel = preg_replace('/\\D+/', '', $nr);\n if (substr($tel, 0, 1) !== '0') {\n $int = substr_replace($tel, \"0\", 0, 0);\n }\n $tel = substr_replace($tel, \" 0 \", 0, 1);\n $tel = wordwrap($tel, 3, ' ', true);\n if (strlen($tel) != 13) {\n $status['sta'] = \"has-warning\";\n $status['err'] = 1;\n $_SESSION['message'] = \"Atentie! Numarul de telefon trebuie sa aiba exact 10 cifre\";\n $_SESSION['status'] = \"warning\";\n $_SESSION['icon'] = \"glyphicon-phone-alt\";\n } else {\n $status['sta'] = \"has-success\";\n $status['err'] = null;\n }\n $status['tel'] = $tel;\n return $status;\n}", "public static function validate_telephone($number){\r\n if(!preg_match('/^0([1-9]{2,3})[-. ]([0-9]{5,7})$/', $number)) return FALSE;\r\n return TRUE;\r\n }", "function validate_phone_number($phone)\n\t\t{\n\t\t\t// Allow +, - and . in phone number\n\t\t\t$filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n\t\t\t// Remove \"-\" from number\n\t\t\t$phone_to_check = str_replace(\"-\", \"\", $filtered_phone_number);\n\t\t\t// Check the lenght of number\n\t\t\t// This can be customized if you want phone number from a specific country\n\t\t\tif (strlen($phone_to_check) < 9 || strlen($phone_to_check) > 14) {\n\t\t\treturn false;\n\t\t\t} else {\n\t\t\treturn true;\n\t\t\t}\n\t\t}", "function validPhone($phone)\n {\n //phone number should not be empty and can contain only numbers\n return !empty($phone) && filter_var($phone,FILTER_SANITIZE_NUMBER_INT);\n }", "function phone_validation($num)\n{\n return preg_match(\"/^[0-9]+$/\", $num);\n}", "private static function validate_number(&$phone)\n\t{\n\t\tif (substr($phone, 0, 1) == '+') {\n\t\t\t$phone = substr($phone, 1);\n\t\t}\n\n\n\t\tif (is_numeric($phone)) {\n\n\t\t\t// test if there's a 1 prepended.\n\t\t\tif (strlen($phone) === 11 && $phone[0] == 1) {\n\t\t\t\t//pop 1 off. \n\t\t\t\t$phone = substr($phone, 1);\n\t\t\t\treturn true;\n\n\t\t\t} elseif (strlen($phone) === 10) {\n\t\t\t\t// it's a 10 digit number... I guess that works.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// is invalid if no return by here. \n\t\treturn false;\n\t}", "function validateTelNum($num)\r\n {\r\n preg_match_all($this->re, $num, $matches, PREG_SET_ORDER, 0);\r\n if (empty($matches)) {\r\n $this->invalid_number[] = $num;\r\n return \"invalid number\";\r\n } else {\r\n return $num;\r\n }\r\n }", "private function valid_mobile() {\n return (strlen($this->mobile) == 10 && is_numeric($this->mobile));\n }", "public function is_phonenumber($contact_no){\t\t\n\t\tif (!empty($contact_no) && !ctype_digit($contact_no)){\n\t\t\treturn true;\n\t\t}\n }", "public function is_phonenumber($contact_no){\t\t\n\t\tif (!empty($contact_no) && !ctype_digit($contact_no)){\n\t\t\treturn true;\n\t\t}\n }", "function validar_dni($dni){\n $letra = substr($dni, -1);\n $numeros = substr($dni, 0, -1);\n if ( substr(\"TRWAGMYFPDXBNJZSQVHLCKE\", $numeros%23, 1) == $letra && strlen($letra) == 1 && strlen ($numeros) == 8 ){\n echo 'valido';\n }else{\n echo 'no valido';\n }\n}", "public function testPhone()\n {\n $this->assertTrue(RuValidation::phone('+7 (342) 1234567'));\n $this->assertTrue(RuValidation::phone('+7 (41144) 1234'));\n }", "public static function checkPhone($phone)\n {\n if (strlen($phone) >= 10) {\n return true;\n }\n return false;\n }", "function validate($phoneNumber)\n {\n // Let's fix issue of V2: we remove spaces for validation.\n $phoneNumber = str_replace(' ', '', $phoneNumber);\n\n return strlen($phoneNumber) == 10 && is_numeric($phoneNumber);\n }", "public function testPhone()\n {\n $this->assertFalse(BrValidation::phone('teststring'));\n $this->assertFalse(BrValidation::phone('1-(33)-(333)-(4444)'));\n $this->assertFalse(BrValidation::phone('1-(33)-3333-4444'));\n $this->assertFalse(BrValidation::phone('1-(33)-33-4444'));\n $this->assertFalse(BrValidation::phone('1-(33)-3-44444'));\n $this->assertFalse(BrValidation::phone('1-(33)-3-444'));\n $this->assertFalse(BrValidation::phone('1-(33)-3-44'));\n $this->assertFalse(BrValidation::phone('2345678'));\n\n // with the wrong extra digit\n $this->assertFalse(BrValidation::phone('55 (48) 12345 6789'));\n $this->assertFalse(BrValidation::phone('+55 (48) 22345 6789'));\n $this->assertFalse(BrValidation::phone('+55 (048) 32345 6789'));\n $this->assertFalse(BrValidation::phone('+55 (48) 42345-6789'));\n $this->assertFalse(BrValidation::phone('+55 (48) 52345.6789'));\n $this->assertFalse(BrValidation::phone('(48) 12345 6789'));\n\n $this->assertTrue(BrValidation::phone('55 (48) 2345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 2345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (048) 2345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 2345-6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 2345.6789'));\n $this->assertTrue(BrValidation::phone('(48) 2345 6789'));\n $this->assertTrue(BrValidation::phone('2345-6789'));\n $this->assertTrue(BrValidation::phone('2345.6789'));\n $this->assertTrue(BrValidation::phone('23456789'));\n\n // // with the extra digit\n $this->assertTrue(BrValidation::phone('55 (48) 92345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 92345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (048) 92345 6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 92345-6789'));\n $this->assertTrue(BrValidation::phone('+55 (48) 92345.6789'));\n $this->assertTrue(BrValidation::phone('(48) 92345 6789'));\n $this->assertTrue(BrValidation::phone('92345-6789'));\n $this->assertTrue(BrValidation::phone('92345.6789'));\n $this->assertTrue(BrValidation::phone('923456789'));\n }", "function isValidPhoneNumber(string $phoneNumber): bool{\n return !!preg_match('#\\(\\d{3}\\) \\d{3}-\\d{4}#', $phoneNumber);\n}", "function is_valid_mobile($mobile)\n{\n if (is_null($mobile) || strlen($mobile) != 11)\n {\n return false;\n }\n $pattern = \"/^1(3|4|5|7|8)\\d{9}$/\";\n return preg_match($pattern, $mobile) == 1;\n}", "public function validate(string $number): bool;", "public static function is_e123_phone($in) {\r\n\t\t$regex = '@' . self::e123_phone_regex() . '@';\r\n\t\treturn preg_match($regex, $in);\r\n\t}", "public function validarCampo($tipo,$campo){\n $valido = false;\n \n switch ($tipo) {\n case 'telefono':\n if (preg_match(\"/[+]{1}[0-9]{11}/i\", $campo)) {\n $valido = true;\n } else {\n $valido = false;\n }\n break;\n case 'correo':\n $valido = (!preg_match(\"/^([a-z0-9ÁéÉíÍóÓúÚñÑ\\+_\\-]+)(\\.[a-z0-9ÁéÉíÍóÓúÚñÑ\\+_\\-]+)*@([a-z0-9ÁéÉíÍóÓúÚñÑ\\-]+\\.)+[a-z]{2,6}$/ix\", $campo)) ? FALSE : TRUE;\n break;\n case 'rut':\n $rut = preg_replace('/[^k0-9]/i', '', $campo);\n $dv = substr($rut, -1);\n $numero = substr($rut, 0, strlen($rut) - 1);\n $i = 2;\n $suma = 0;\n foreach (array_reverse(str_split($numero)) as $v) {\n if ($i == 8)\n $i = 2;\n $suma += $v * $i;\n ++$i;\n }\n $dvr = 11 - ($suma % 11);\n\n if ($dvr == 11)\n $dvr = 0;\n if ($dvr == 10)\n $dvr = 'K';\n\n if ($dvr == strtoupper($dv)){\n $valido = true;\n }\n else{\n $valido = false;\n }\n\n ////\n break;\n }\n\n return $valido;\n }", "static function is_phone($phone) {\n $stripped=preg_replace(\"(\\(|\\)|\\-|\\.|\\+|[ ]+)\",\"\",$phone);\n return (!is_numeric($stripped) || ((strlen($stripped)<7) || (strlen($stripped)>16)))?false:true;\n }", "private function checkPhone($data) {\n\t\t$data = trim(str_replace(\" \", \"\", $data)); // Remove spaces: \"+1 (212) 555 1337\" ->\"+1(212)5551337\"\n\t\tif(substr($data,0,1)==\"+\") {$data = substr($data,1);} // Remove plus: \"1(212)5551337\"\n\t\t$data = str_replace(\"(\",\"\",$data);\t\t// Remove start parenthesis: \"1212)5551337\"\n\t\t$data = str_replace(\")\",\"\",$data);\t\t// Remove end parenthesis: \"12125551337\"\n\t\tif(is_numeric($data)) {return true;}\t// If it is numeric now, it is a valid phone number\n\t\treturn false;\n\t}", "private function hasNumber(): bool\n {\n if (1 == preg_match('/\\d/', $this->password)) {\n return true;\n }\n array_push($this->errorMessages, \"Number missing.\");\n return false;\n }" ]
[ "0.7884953", "0.7626425", "0.7275663", "0.6961081", "0.69101065", "0.6652029", "0.6640723", "0.65941364", "0.6582804", "0.656772", "0.65542686", "0.6552192", "0.6525625", "0.64793575", "0.6436841", "0.63547516", "0.63547516", "0.63456565", "0.6339082", "0.63307625", "0.6319819", "0.6278855", "0.62601304", "0.6229001", "0.621371", "0.61927575", "0.61812705", "0.6180458", "0.61638916", "0.6161321" ]
0.7695608
1
/ | | | | | Check Maintainance Mode | | | | METHOD : _get_maintainance Is to check maintainance whether site offline or online | |
function _get_maintainance() { return $this->admin_setting_model->get_maintainance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function inMaintenanceMode() {\n $settings = self::getSettings();\n return $settings->maintenance;\n }", "public static function maintenance_mode()\n\t{\n\t\t$maintenance_mode = Config::get('site.maintenance_mode', FALSE);\n\t\t$message = Config::get('site.offline_message', FALSE);\n\t\t$message = (empty($message) OR ! $message) ? Gleez::MAINTENANCE_MESSAGE : $message;\n\t\t$request = Request::initial();\n\n\t\tif ($maintenance_mode AND ($request instanceof Request) AND ($request->controller() != 'user' AND $request->action() != 'login') AND !ACL::check('administer site') AND $request->controller() != 'media')\n\t\t{\n\t\t\tthrow HTTP_Exception::factory(503, __($message));\n\t\t}\n\t}", "public function getSiteStatus();", "function site_maintenance(){\n\t\t/********* If page is active that means the site for temporarily down for maintenance *******************/\n\t\t$path_parts = pathinfo($_SERVER['PHP_SELF']);\n\n\t\t//echo $path_parts[\"dirname\"] . \"\\n\";\n\t\t//echo $path_parts[\"basename\"] . \"\\n\";\n\t\t//exit();\n\t\tif($path_parts[\"basename\"]!=\"site_down.php\"){\n\t\t\t$sql=\"select status from yp_site_down\";\n\t\t\t$page_status=getSingleResult($sql);\n\t\t\tif($page_status=='Inactive'){\n\t\t\t\theader(\"Location: site_down.php\");\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\t/********* End ***********/\n\t}", "public function isVersionActivelyMaintained() {}", "public function testMaintenanceModeTrue()\n {\n $lock = $this->util->getMaintenanceLock();\n $lock->lock();\n\n $result = $this->object->reverseMaintenanceMonitor();\n $this->assertFalse($result);\n }", "public function setStatusOffline()\r\n {\r\n return $this->exec('status_offline');\r\n }", "public function IsInMaintenanceMode(){\n\n\t\t// Obtain maintenance_mode index from config file\n $config_maintenance = $this->instance->config->item(\"maintenance_mode\");\n\n // validate if it's true\n if( $config_maintenance ){\n\n \t// load view and terminate output\n echo $this->instance->load->view('system/maintenance_mode', false, true);\n die();\n }\n }", "function check() {\r\n global $db;\r\n if (!isset($this->_check)) {\r\n $check_query = $db->Execute(\"select configuration_value from \" . TABLE_CONFIGURATION . \" where configuration_key = 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STATUS'\");\r\n $this->_check = $check_query->RecordCount();\r\n }\r\n return $this->_check;\r\n }", "public function isOnline() {}", "function moduleFunctionalCheck() {\n\tglobal $fmdb, $__FM_CONFIG;\n\t$html_checks = null;\n\t\n\t/** Count active name servers */\n\t$checks[] = (basicGetList('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'servers', 'server_id', 'server_', 'active')) ? null : sprintf('<p>' . _('You currently have no active servers defined. <a href=\"%s\">Click here</a> to define one or more to manage.') . '</p>', getMenuURL(_('Servers')));\n\t\n\t/** Count global options */\n\t$checks[] = (basicGetList('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'config', 'cfg_id', 'cfg_')) ? null : sprintf('<p>' . __('You currently have no global options defined for named.conf. <a href=\"%s\">Click here</a> to define one or more.') . '</p>', getMenuURL(__('Options')));\n\t\n\t/** Count zones */\n\t$checks[] = (basicGetList('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'domains', 'domain_id', 'domain_')) ? null : sprintf('<p>' . __('You currently have no zones defined. <a href=\"%s\">Click here</a> to define one or more.') . '</p>', getMenuURL(__('Zones')));\n\t\n\tforeach ($checks as $val) {\n\t\t$html_checks .= $val;\n\t}\n\t\n\treturn $html_checks;\n}", "function check() {\n\n global $db;\n\n if (!isset($this->_check)) {\n $check_query = $db->Execute(\"select configuration_value from \" . TABLE_CONFIGURATION . \" where configuration_key = 'MODULE_PAYMENT_CCBILL_STATUS'\");\n $this->_check = $check_query->RecordCount();\n }// end if\n\n return $this->_check;\n\n }", "function setMaintenance()\r\n{\r\n\tglobal $pdo;\r\n\t\r\n\t$isMaintenance = getConfig(\"isMaintenance\");\r\n\tif($isMaintenance == 'yes')\r\n\t{\r\n\t\tif(getConfig(\"maintenance_ip\") == '')\r\n\t\t{\r\n\t\t\techo getConfig(\"message_maintenance\");\r\n\t\t\texit;\r\n\t\t}\r\n\t\telse if($_SERVER['REMOTE_ADDR'] != getConfig(\"maintenance_ip\"))\r\n\t\t{\r\n\t\t\techo getConfig(\"message_maintenance\");\r\n\t\t\texit;\r\n\t\t}\r\n\t}\r\n}", "function wp_is_maintenance_mode()\n {\n }", "private function get_availability()\n\t{\n\t\treturn $this->m_availability;\n\t}", "function check() {\n $model = & $this->getModel('update');\n $view = & $this->getView('check', 'raw');\n $view->setModel($model, true);\n\n // Purge updates\n $model->purge();\n $model->enableSites();\n\n // Get the caching duration\n jimport('joomla.application.component.helper');\n $component = JComponentHelper::getComponent('com_installer');\n $params = $component->params;\n $cache_timeout = $params->get('cachetimeout', 6, 'int');\n $cache_timeout = 3600 * $cache_timeout;\n\n // Find updates\n $result = $model->findUpdates(0, $cache_timeout);\n \n // Display the view\n $view->display();\n }", "public function isOnline() {\n }", "public function isDownForMaintenance() {\n return false;\n }", "public function isOffline()\n {\n return $this->offline;\n }", "public static function isMaintenance()\n {\n if(!self::$maintenance)\n {\n $self = self::getInstance();\n self::$maintenance\n = CAT_Registry::get('maintenance_mode') == 'true'\n ? true\n : false;\n }\n return self::$maintenance;\n }", "function ms_site_check()\n {\n }", "public function getIsInMaintenanceMode(): bool\n {\n /** @var WebApplication|ConsoleApplication $this */\n return (bool)$this->getInfo()->maintenance;\n }", "public function findOnline() {}", "public function testMaintenanceModeFalse()\n {\n $lock = $this->util->getMaintenanceLock();\n $lock->unlock();\n\n $result = $this->object->reverseMaintenanceMonitor();\n $this->assertTrue($result);\n }", "function check() {\n global $db;\n if (!isset($this->_check)) {\n $check_query = $db->Execute(\"select configuration_value from \" . TABLE_CONFIGURATION . \" where configuration_key = 'MODULE_PAYMENT_PAYMENTECH_STATUS'\");\n $this->_check = $check_query->RecordCount();\n }\n return $this->_check;\n }", "public function appIsInMaintenance()\n {\n return $this->app_in_maintenance;\n }", "public function getTotalOfflineRefunded();", "public function maintenanceMode($args){\n\n if(empty($args[0])){\n $mode = \\Disco\\manage\\Manager::maintenanceMode();\n echo 'MAINTENANCE_MODE : ' . (($mode) ? 'true' : 'false') .PHP_EOL;\n exit;\n }//if\n else if($args[0] != 'true' && $args[0] != 'false'){\n echo 'Maintenance Mode takes one of two values: true | false' . PHP_EOL . 'Please supply a correct value' . PHP_EOL;\n exit;\n }//if\n\n \\Disco\\manage\\Manager::maintenanceMode(($args[0] == 'true') ? true : false);\n echo 'MAINTENANCE_MODE now set to: ' . $args[0] . PHP_EOL;\n if($args[0] == 'true'){\n echo 'Users will being seeing the result of the file' . PHP_EOL . ' - app/maintenance.php' . PHP_EOL;\n }//if\n\n }", "public function notificationsafeenvrnmnt(){\n $this->load->model('resident/maintainsafeenvironment_model', 'seadl');\n return $this->seadl->safeenvrnmntnotifications();\n //return false;\n }", "protected function checkDashboard()\n {\n if (LOCATION == 'Live') {\n $this->markTestSkipped('Cannot run in Live environment');\n return;\n }\n $this->dashboardPage->isLoaded()\n ->checkPageTitle('overview')\n ->setDefaultTimeoutForFinds($this->upperTimeoutForFinds)\n ->verifyElecGraphPartial()\n ->verifyGasGraphPartial()\n ->setDefaultTimeoutForFinds($this->defaultTimeoutForFinds)\n ->checkMeterReadPartialHeading()\n ->checkLatestBillPartialHeading()\n ->checkMyTariffPartialHeading()\n ->checkAccountId()\n ->checkMobilePromoBox()\n ->navigateToElecUsageGraph()\n ->open()\n ->navigateToGasUsageGraph()\n ->open()\n ->navigateToViewPreviousReads()\n ->open()\n ->navigateToSubmitReading()\n ->open()\n ->navigateToViewBills()\n ->open()\n ->navigateToManualPayment()\n ->open()\n ->navigateToFullTariffInfo()\n ->open()\n ->navigateToContactUsViaSideButton();\n\n }" ]
[ "0.6238346", "0.60999656", "0.58208376", "0.56865066", "0.56841785", "0.5644382", "0.5626493", "0.56097376", "0.5579961", "0.55650413", "0.5546696", "0.55393016", "0.5526776", "0.55167824", "0.55153435", "0.54988074", "0.5497206", "0.54932386", "0.5485371", "0.54719275", "0.5471832", "0.546388", "0.54507995", "0.544147", "0.5409967", "0.54066986", "0.5402277", "0.5400746", "0.5361681", "0.5352809" ]
0.7365725
0
Check if there's only one page.
public function hasOnlyOnePage(): bool { return $this->number_of_records <= $this->per_page; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isFirstPage()\n {\n return $this->getPage() == 1;\n }", "public function isFirstPage(): bool\n {\n return $this->current === 1;\n }", "public function isOnepage()\r\n {\r\n if($this->_params['layout'] != 'onepage'){\r\n return false;\r\n }\r\n return true;\r\n }", "public function isFirstPage()\n {\n return ($this->currentPage == 1) ? true : false;\n }", "public function getIsFirstPage(): bool\n {\n return $this->pageIndex === 0;\n }", "public function isFirstPage()\n {\n if (!$this->getLimitPerPage()) {\n return true;\n }\n\n return $this->getCollection()->getCurPage() == 1;\n }", "public function onFirstPage()\n {\n return is_null($this->cursor) || ($this->cursor->pointsToPreviousItems() && ! $this->hasMore);\n }", "protected function isSinglePage()\n {\n return ($this->request->view == 'products' && $this->request->task == 'view');\n }", "public function currentIsFirstPage() {\n return $this->getCurPage() == self::FIRST_PAGE;\n }", "public function hasPageNumber(){\n return $this->_has(2);\n }", "public function hasPages();", "public function hasPages();", "public function hasPages()\n {\n return $this->lastPage() > 1;\n }", "public function is_page();", "public function getIsValidPage(): bool\n {\n $pageCount = $this->getPageCount();\n\n if ($pageCount === 0 && $this->pageIndex === 0) {\n // If there are no results, but this is the first page,.\n return true;\n }\n\n return $this->pageIndex >= 0 && $this->pageIndex <= ($pageCount - 1);\n }", "public static function isPage();", "protected function get_firstpage() {\n $pages = $this->load_all_pages();\n if (count($pages) > 0) {\n foreach ($pages as $page) {\n if ((int)$page->prevpageid === 0) {\n return $page;\n }\n }\n }\n return false;\n }", "public function onFirstPage(): bool\n {\n if ( ! isset($this->results)) {\n return false;\n }\n\n return $this->results->onFirstPage();\n }", "function isSinglepage($page_name)\n{\n $sp = getSinglepages();\n foreach($sp as $p) {\n if ($p[\"name\"] == $page_name) {\n return true;\n }\n }\n return false;\n}", "public function hasPages()\n {\n return ! $this->onFirstPage() || $this->hasMorePages();\n }", "public function isMain() {\n\t\treturn $this->_page == null;\n\t}", "public function getFirstPage();", "public function isPossibleOnepageCheckout()\n {\n return $this->helper('checkout')->canOnepageCheckout() && !$this->getQuote()->getHasError();\n }", "function hasPage($page)\n\t\t{\n\t\t\tif($page < 1)\n\t\t\t\treturn false;\n\t\t\t\t\n\t\t\t//if($page == 1)\n\t\t\t//\treturn true;\n\t\t\t\t\n\t\t\tif($page > $this->numberOfPages()) {\n\t\t\t\t// FIXME: Check whether the page is out of bounds, number of records\n\t\t\t\t// might be inaccurate\n\t\t\t\t//throw new Exception(\"Page out of bounds\");\n\t\t\t}\n\t\t\t\n\t\t\t// ASSUME! the page is present...\n\t\t\treturn true;\n\t\t}", "public function isFirst() {\r\n return key($this->collection) == 0;\r\n }", "function is_paginated() {\n\tglobal $wp_query;\n\t\n\treturn ( $wp_query->max_num_pages > 1 );\n\t\n}", "public function validPage():bool\r\n\t{\r\n\t\t$page=$this->_vars['current_page'];\r\n\t\treturn $page > 0 AND $page <= $this->_vars['total_pages'];\r\n\t}", "function hasNextPage() {\n\t\treturn $this->hasPage($this->p + 1);\n\t}", "function isOnPage(){\n return $this->on_page != 'f';\n\t}", "function get_one_page(){\n\t\t$this->m_n_current_page_number = gf_get_value_n('v_current_page_number');\n\t}" ]
[ "0.7768475", "0.7542049", "0.74768126", "0.73306036", "0.7218736", "0.71453303", "0.713806", "0.70983225", "0.69714266", "0.68039596", "0.67506355", "0.67506355", "0.67407125", "0.6708764", "0.66515553", "0.6627673", "0.6610982", "0.65441734", "0.65403754", "0.6339329", "0.6336639", "0.63200575", "0.63163495", "0.6299965", "0.6277943", "0.6264181", "0.6261225", "0.6255575", "0.6249309", "0.6225244" ]
0.7684597
1
Set number of pages.
private function setNumberOfPages(): void { $this->number_of_pages = (int)ceil($this->number_of_records / $this->per_page); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function SetNumPages()\n\t\t{\n\t\t\t$this->_pricenumpages = ceil($this->GetNumProducts() / GetConfig('CategoryProductsPerPage'));\n\t\t}", "function MyMod_Paging_NPages_Set()\n {\n if ($this->NumberOfItems>$this->NItemsPerPage)\n {\n $this->MyMod_Paging_N=intval($this->NumberOfItems/$this->NItemsPerPage);\n $res=$this->NumberOfItems % $this->NItemsPerPage;\n if ($res>0) { $this->MyMod_Paging_N++; }\n }\n elseif ($this->NumberOfItems>0)\n {\n $this->MyMod_Paging_N=1;\n }\n else\n {\n $this->MyMod_Paging_N=0;\n }\n }", "public function setPageNum($num) {\n\t\t$this->pageNum = (int) $num;\t\n\t}", "function setPageSize($value)\n {\n $this->_props['PageSize'] = $value;\n }", "public function setPageLimit($number = null);", "private function setTotalPages()\n {\n $this->totalPages = ceil($this->totalData / $this->limit);\n }", "private function refreshNbPages()\n {\n $this->_nbPages = $this->_limit ? ceil($this->_count/$this->_limit) : 0;\n }", "public function setPageNumber($pageNumber);", "public function setPage(int $page)\n {\n $this->page = $page;\n }", "function MyMod_Paging_NItemsPerPage_Set()\n {\n $val=$this->CGI_VarValue($this->ModuleName.\"_NItemsPerPage\");;\n if (!empty($val) && preg_match('/^\\d+$/',$val))\n {\n $this->NItemsPerPage=$val;\n }\n }", "function set_num_items($num){\n $this -> num_of_items = $num;\n }", "public function setPage(int $page): void\n {\n $this->page = $page;\n }", "function setRecordsPerPage($count) {\n $this->records_per_page = $count;\n}", "public function page($num){\r\n $this->page = $num;\r\n return $this;\r\n }", "public function setPageNumber($page) {\n $this->page_ = (0 < $page ? $page : 1);\n $this->results_ = null;\n }", "public function set_posts_per_page(int $number) {\n\t\t$this->posts_per_page = $number;\n\t}", "public function setElementsPerPage($count);", "private function setTotalPages()\r\n\t{\r\n\t\t$this->total_pages = ceil($this->num_rows / $this->rows_per_page);\r\n\t}", "private function getNumPages() {\n //display all in one page\n if (($this->limit < 1) || ($this->limit > $this->itemscount)) {\n $this->numpages = 1;\n } else {\n //Calculate rest numbers from dividing operation so we can add one\n //more page for this items\n $restItemsNum = $this->itemscount % $this->limit;\n //if rest items > 0 then add one more page else just divide items\n //by limit\n $restItemsNum > 0 ? $this->numpages = intval($this->itemscount / $this->limit) + 1 : $this->numpages = intval($this->itemscount / $this->limit);\n }\n }", "public function set_page($page);", "public function setNbPerPage($nbPerPage)\n {\n $this->nbPerPage = $nbPerPage;\n $this->calcNbPages();\n }", "public function setPageNumber(int $pageNumber): void\n {\n $this->pageNumber = $pageNumber;\n }", "private function setPageCount($pageCount) {\n $this->pageCount = $pageCount;\n }", "public function setPage($page)\n {\n $this->page = intval($page);\n \n if ($this->page == 0) {\n $this->page = 1;\n }\n }", "public function setPageItems($intValue) {\r\n\t\t$this->__pageItems = $intValue;\r\n\r\n\t\t$this->setCurrentPage();\r\n\t\t$this->seek($this->pageStart() - 1);\r\n\t}", "public function set_page($page) {\n $this->list_page = (int) $page;\n }", "public function setPerPage($value){\n setcookie($this->main->module_mode.'_list_per_page_limit', $value, time() + 3600 * 24 * 365, '/admin/');\n $this->per_page = $value;\n }", "public function setPageSize(int $pageSize): void\n {\n $this->pageSize = $pageSize;\n }", "public function setPages($pages)\n\t{\n\t\t$this->pages = $pages;\n\t}", "public function setCurrentPage($number)\n\t{\n\t\t$this->_currentPage = (int) $number;\n\t\treturn $this;\n\t}" ]
[ "0.8135322", "0.79876363", "0.75676495", "0.7414022", "0.73889637", "0.7300218", "0.724321", "0.7106223", "0.70268685", "0.70162743", "0.70079577", "0.6910613", "0.6894291", "0.6875591", "0.6835551", "0.68248254", "0.68202585", "0.68021345", "0.6797488", "0.6754072", "0.67535394", "0.67412126", "0.6736951", "0.67292655", "0.6726042", "0.66393656", "0.6576433", "0.65549064", "0.6521223", "0.64875007" ]
0.87577003
0
Check if current page is the first one.
public function isFirstPage(): bool { return $this->current === 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isFirstPage()\n {\n return $this->getPage() == 1;\n }", "public function currentIsFirstPage() {\n return $this->getCurPage() == self::FIRST_PAGE;\n }", "public function isFirstPage()\n {\n return ($this->currentPage == 1) ? true : false;\n }", "public function getIsFirstPage(): bool\n {\n return $this->pageIndex === 0;\n }", "public function isFirstPage()\n {\n if (!$this->getLimitPerPage()) {\n return true;\n }\n\n return $this->getCollection()->getCurPage() == 1;\n }", "public function onFirstPage()\n {\n return is_null($this->cursor) || ($this->cursor->pointsToPreviousItems() && ! $this->hasMore);\n }", "protected function get_firstpage() {\n $pages = $this->load_all_pages();\n if (count($pages) > 0) {\n foreach ($pages as $page) {\n if ((int)$page->prevpageid === 0) {\n return $page;\n }\n }\n }\n return false;\n }", "public function onFirstPage(): bool\n {\n if ( ! isset($this->results)) {\n return false;\n }\n\n return $this->results->onFirstPage();\n }", "static public function getFirstPage() {\n\t\treturn self::$first_page;\n\t}", "public function isFirst(): bool\n {\n $parent = $this->parent();\n $children = $parent ? $parent->children() : null;\n if ($children instanceof FlexCollectionInterface) {\n $children = $children->withKeyField();\n }\n\n return $children instanceof PageCollectionInterface ? $children->isFirst($this->getKey()) : true;\n }", "public function getFirstPage();", "public function isMain() {\n\t\treturn $this->_page == null;\n\t}", "function firstPage()\n\t\t{\n\t\t\t$this->currentPage = 1;\n\t\t}", "public function isOnepage()\r\n {\r\n if($this->_params['layout'] != 'onepage'){\r\n return false;\r\n }\r\n return true;\r\n }", "protected function isSinglePage()\n {\n return ($this->request->view == 'products' && $this->request->task == 'view');\n }", "public function isFirst() {\r\n return key($this->collection) == 0;\r\n }", "public function isCurrentPage($page);", "function FirstPage ( $isRefresh=false )\n{\n if ( $isRefresh || ($this->_CurrentPage <> 1) || $this->_need_refresh_() ) {\n $cSQL = $this->_SQL_FirstPage();\n $this->_ReversedRecord = false;\n $this->_new_page_(1,$cSQL);\n }\n}", "function isFirstStep()\r\n {\r\n $steps = array_keys($this->_steps);\r\n return count($steps) > 0 && $steps[0] == $this->getStepName();\r\n }", "public function first()\n {\n return ($this->pointer == 0);\n }", "public function isFirst()\n {\n return $this->getSortableRank() == 1;\n }", "function isCurrent() {\r\n if ($this->_link == $_SERVER['PHP_SELF']) {\r\n return true;\r\n }\r\n elseif ($this->_link == str_replace('index.php', '', $_SERVER['PHP_SELF'])) {\r\n return true;\r\n }\r\n elseif ($this->_link == $_SERVER['REQUEST_URI']) {\r\n return true;\r\n }\r\n return false;\r\n }", "protected function is_current_screen_page() {\n\n\t\tif ( Settings::PAGE_ID !== Framework\\SV_WC_Helper::get_requested_value( 'page' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// assume we are on the Connection tab by default because the link under Marketing doesn't include the tab query arg\n\t\t$tab = Framework\\SV_WC_Helper::get_requested_value( 'tab', 'connection' );\n\n\t\treturn ! empty( $tab ) && $tab === $this->get_id();\n\t}", "public function hasFirstItem() {}", "protected function isPageActive()\n {\n if($this->url->getTarget()->id == Page::id()) return true;\n return false;\n }", "private function loading_first_page() {\n\t\tglobal $frm_vars;\n\t\t$ajax_now = ! FrmAppHelper::doing_ajax();\n\t\tif ( ! $ajax_now && isset( $frm_vars['inplace_edit'] ) && $frm_vars['inplace_edit'] ) {\n\t\t\t$ajax_now = true;\n\t\t}\n\t\treturn $ajax_now;\n\t}", "public function getFirstPage()\n {\n if ($this->getReverseOrder()) {\n return $this->getNumberOfTotalPages();\n }\n return 1;\n }", "public function is_front_page()\n {\n }", "public function isFirstStep();", "public function hasFirst()\n\t{\n\t\treturn ($this->blnShowFirstLast && $this->intItem > 2) ? true : false;\n\t}" ]
[ "0.8596047", "0.85819775", "0.8262948", "0.80356556", "0.79444623", "0.7847717", "0.7741727", "0.72756505", "0.71827626", "0.7005138", "0.6859501", "0.6842288", "0.6789275", "0.6776054", "0.6708755", "0.6687117", "0.6680137", "0.6602533", "0.65884", "0.6582312", "0.6576167", "0.6526814", "0.64517325", "0.64127797", "0.63966", "0.6395124", "0.63779265", "0.6344747", "0.633858", "0.63367087" ]
0.87393767
0
Check if current page is the last one.
public function isLastPage(): bool { return $this->current === $this->number_of_pages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function currentIsLastPage() {\n return $this->getCurPage() == $this->getTotalPage();\n }", "public function isLastPage()\n {\n return ($this->currentPage == $this->lastPage) ? true : false;\n }", "public function getIsLastPage(): bool\n {\n $pageCount = $this->getPageCount();\n\n if ($pageCount === 0 && $this->pageIndex === 0) {\n return true;\n }\n\n return $this->pageIndex === ($pageCount - 1);\n }", "protected function get_lastpage() {\n $pages = $this->load_all_pages();\n if (count($pages) > 0) {\n foreach ($pages as $page) {\n if ((int)$page->nextpageid === 0) {\n return $page;\n }\n }\n }\n return false;\n }", "public function isLast() {\r\n return key($this->collection) == (count($this->collection) - 1);\r\n }", "public function onLastPage(): bool\n {\n if ( ! isset($this->results)) {\n return false;\n }\n\n return $this->results->onLastPage();\n }", "public function isLast(): bool\n {\n $parent = $this->parent();\n $children = $parent ? $parent->children() : null;\n if ($children instanceof FlexCollectionInterface) {\n $children = $children->withKeyField();\n }\n\n return $children instanceof PageCollectionInterface ? $children->isLast($this->getKey()) : true;\n }", "function LastPage ( )\n{\n if ( $this->_need_refresh_() || $this->CurrentPage() < $this->PageCount() ) {\n if ( $this->PageCount() > 1 ) {\n $cSQL = $this->_SQL_LastPage();\n $this->_ReversedRecord = true;\n $this->_new_page_($this->PageCount(),$cSQL);\n } else {\n $this->FirstPage();\n }\n }\n}", "public function last()\n {\n return ($this->pointer == $this->count);\n }", "public function hasLast()\n\t{\n\t\treturn ($this->blnShowFirstLast && $this->intItem < ($this->intTotalItems - 1)) ? true : false;\n\t}", "public function IsLast()\n {\n return ($this->Length()) == $this->getItemPointer();\n }", "public function hasPages()\n {\n return $this->lastPage() > 1;\n }", "function isLastStep()\r\n {\r\n $steps = array_keys($this->_steps);\r\n return count($steps) > 0 && array_pop($steps) == $this->getStepName();\r\n }", "public function getIsLastStep()\r\n {\r\n return (($this->stepCount-1) == array_search($this->_currentStep, array_values($this->_steps)));\r\n }", "public function isLastStep();", "public static function is_last_page( $form, $mode = 'submit' ) {\n\n\t\t$page_number = self::get_source_page( $form['id'] );\n\t\t$field_values = GFForms::post( 'gform_field_values' );\n\t\t$target_page = self::get_target_page( $form, $page_number, $field_values );\n\n\t\tif ( $mode == 'render' ) {\n\t\t\t$is_valid = rgars( self::$submission, \"{$form['id']}/is_valid\" );\n\t\t\t$is_last_page = $is_valid && $target_page == self::get_max_page_number( $form );\n\t\t} else {\n\t\t\t$is_last_page = (string) $target_page === '0';\n\t\t}\n\n\t\treturn $is_last_page;\n\t}", "private function lastPage() {\n $this->currentPageNumber--;\n $this->currentPage = $this->pages[$this->currentPageNumber];\n $this->vOffset = $this->lastPage[\"vOffset\"];\n $this->hOffset = $this->lastPage[\"hOffset\"];\n }", "public function isLastChild(): bool\n {\n return $this->is_last_child;\n }", "public function getLastPage();", "function lastPage()\n\t\t{\n\t\t\t$this->currentPage = $this->numberOfPages();\n\t\t}", "private function isNextPage() {\n return isset($this->pages[$this->currentPageNumber + 1]);\n }", "public function getLastPage() {}", "static public function getLastPage() {\n\t\treturn self::$last_page;\n\t}", "public function has_next_page() {\n\t\t\treturn $this->next_page > $this->page;\n\t\t}", "static function getLastPage()\r\n {\r\n return $_SESSION[\"last_page\"];\r\n }", "public function hasPrevious()\n {\n return $this->curPage > 1;\n }", "protected function lastPage()\n {\n return $this->paginator->lastPage();\n }", "protected function lastPage()\n {\n return $this->paginator->lastPage();\n }", "protected function lastPage()\n {\n return $this->paginator->lastPage();\n }", "public function getLastPage()\n {\n if ($this->getReverseOrder()) {\n return 1;\n }\n return max(1, $this->getNumberOfTotalPages());\n }" ]
[ "0.8584557", "0.8198797", "0.8180836", "0.752843", "0.7439109", "0.72987545", "0.72507143", "0.7162668", "0.7096697", "0.709211", "0.7050119", "0.6963756", "0.696118", "0.6878974", "0.6871154", "0.6853866", "0.67071724", "0.6698531", "0.6671391", "0.6668857", "0.6630819", "0.6595212", "0.65889704", "0.65715075", "0.6551695", "0.6525983", "0.6521805", "0.6521805", "0.6521805", "0.65071416" ]
0.86572033
0
Set query without page key.
private function setQueryWithoutPageKey(): void { $this->query_without_page_key = array_filter( $this->request->query(), function ($key) { return $key !== $this->key; }, ARRAY_FILTER_USE_KEY ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function unsetQuery($key = null) {\n if (!isset($key)) {\n $this->query = array();\n }\n else {\n unset($this->query[$key]);\n }\n }", "protected function resetQuery()\n {\n array_forget($this->query, ['start', 'end']);\n }", "public static function ClearParamsQuery(){\n \tself::SetParam('limit', 0);\n \tself::SetParam('sort', '');\n \tself::SetParam('dir', '');\n }", "public function resetQuery()\n {\n $_GET = array();\n return $this;\n }", "public function set_default_query($query){\n $this->default_query = $query;\n }", "public function resetQuery(): void\n\t{\n\t\t$this->state = new State();\n\t\t$this->explain = FALSE;\n\t}", "function remove_query_arg($key, $query = \\false)\n {\n }", "public function setQuery($query);", "function discardQuery() {}", "private function resetQuery() {\r\n\t\tunset($this->query);\r\n\t\t$this->query = $this->createQuery();\r\n\t\tunset($this->queryConstraints);\r\n\t\t$this->queryConstraints = array();\r\n\t}", "public static function setQuery(string $query)\n {\n self::$__query = $query;\n }", "public function setQuery(?string $value): void {\n $this->getBackingStore()->set('query', $value);\n }", "private function resetShowQueries(): void\n {\n if ($this->showQueries === self::SHOW_QUERIES_RESET) {\n return;\n }\n if ($this->showQueries) {\n $_REQUEST['showqueries'] = $this->showQueries;\n } else {\n unset($_REQUEST['showqueries']);\n }\n $this->showQueries = self::SHOW_QUERIES_RESET;\n }", "public function setQuery($query) {\r\n $this->query = $query;\r\n }", "function set_query($query) {\n\t\t\t// it just sets the query with which to get a recordset\n\t\t\t$this->query = $query;\n\t\t}", "public function setQuery( $query ){\n \n $this->query = $query;\n \n }", "protected function resetLastQuery(): void\n {\n $this->lastQuery = null;\n }", "function set_query_args($query)\n {\n if ($query->get('datamapper')) {\n $query->query_vars = $this->object->_query_args;\n }\n $filter = isset($query->query_vars['suppress_filters']) ? $query->query_vars['suppress_filters'] : FALSE;\n $query->query_vars['suppress_filters'] = apply_filters('wpml_suppress_filters', $filter);\n }", "public function setQuery($query)\n {\n $this->parameters['query'] = $query;\n }", "public function setQuery($query)\n {\n $this->query = $query;\n }", "protected function resetQuery()\n {\n $this->bindings = [];\n $this->types = [];\n }", "public function setQuery($query)\n\t{\n\t\t$query = trim($query);\n\t\t$query = preg_replace('# {2,}#', ' ', $query);\n\t\t$query = Strings::utf8_strtolower($query);\n\t\t$query = Strings:: utf8_accents_to_ascii($query);\n\n\t\t$this['query'] = $query;\n\t}", "function remove_query( $key, $value ) {\r\n\t\t\t$this->current_url = remove_query_arg( $key, $this->current_url );\r\n\t\t\treturn $this->current_url;\r\n\t\t}", "public function set_query_var($key, $value)\n {\n }", "public function setQueryVar($query = true){\n\t\t$this->queryVar = $query;\n\t}", "public function setQUERY($QUERY)\n {\n $this->QUERY = $QUERY;\n }", "public static function setQueryString(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$queryString = substr(static::$fullUrl, strpos(static::$fullUrl, '?') + 1, strlen(static::$fullUrl));\n\t\t} else {\n\t\t\tstatic::$queryString = '';\n\t\t}\n\n\t}", "public function setQuery($query)\n {\n $oldQuery = parent::setQuery($query);\n\n if (! $this->_useSquareBracketNotation) {\n $this->_query = preg_replace('#%5B.*?%5D#', '', $this->_query);\n }\n\n return $oldQuery;\n }", "public function clear() {\n\t\t$this->expected_query = '';\n\t}", "public function setQuery(string $key, $value = null)\n {\n $this->env['QUERY'][$key] = $value;\n\n return $this;\n }" ]
[ "0.7006655", "0.6761284", "0.6729426", "0.6503151", "0.6465434", "0.64021605", "0.63543004", "0.6346254", "0.6323558", "0.6236223", "0.6208222", "0.6201642", "0.61909586", "0.61877304", "0.6186107", "0.6160415", "0.61580193", "0.6142437", "0.6126047", "0.6112235", "0.60993046", "0.6099033", "0.6082692", "0.6068143", "0.6036439", "0.6024216", "0.599661", "0.59944165", "0.5930705", "0.59264535" ]
0.8650994
0