query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get the output for the recommandation categories list for a category
function getCategoryRecommandationListOutput($outputMode = 'pictos', $selectedRecommandationCategory = '', $arguments = array()) { $categoryListOutput = ''; $categoryList = evaRecommandationCategory::getCategoryRecommandationList(); $specific_container = !empty($arguments) && !empty($arguments['form_container']) ? $arguments['form_container'] . '_' : ''; if ($outputMode == 'pictos') { $i = 0; foreach($categoryList as $category) { $recommandationMainPicture = evaPhoto::checkIfPictureIsFile($category->photo, TABLE_CATEGORIE_PRECONISATION); if (!$recommandationMainPicture) { $recommandationMainPicture = ''; } else { $checked = $selectedClass = ''; if (($selectedRecommandationCategory != '') && ($selectedRecommandationCategory == $category->id)) { $checked = ' checked="checked" '; $selectedClass = 'recommandationCategorySelected'; } $recommandationMainPicture = ' <div class="alignleft recommandationCategoryBloc ' . $selectedClass . '" > <label for="' . $specific_container . 'recommandationCategory' . $category->id . '" > <img class="recommandationDefaultPictosList" src="' . $recommandationMainPicture . '" alt="' . ucfirst(strtolower($category->nom)) . '" title="' . ELEMENT_IDENTIFIER_P . $category->id . '&nbsp;-&nbsp;' . ucfirst(strtolower($category->nom)) . '" /> </label> <input class="hide ' . $specific_container . 'recommandationCategory" type="radio" ' . $checked . ' id="' . $specific_container . 'recommandationCategory' . $category->id . '" name="recommandationCategory" value="' . $category->id . '" /> </div>'; } $categoryListOutput .= $recommandationMainPicture; $i++; } } else if ($outputMode == 'selectablelist') { $categoryListOutput = EvaDisplayInput::afficherComboBox($categoryList, 'recommandationCategory', __('Cat&eacute;gorie', 'evarisk'), 'recommandationCategory', "", ""); } return $categoryListOutput; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function retrieve_category_description() {\n\t\treturn $this->retrieve_term_description();\n\t}", "function getCategoryRecommandationList(){\r\n\t\tglobal $wpdb;\r\n\r\n\t\t$query = $wpdb->prepare(\r\n\t\t\t\"SELECT RECOMMANDATION_CAT.*, PIC.photo\r\n\t\t\tFROM \" . TABLE_CATEGORIE_PRECONISATION . \" AS RECOMMANDATION_CAT\r\n\t\t\t\tLEFT JOIN \" . TABLE_PHOTO_LIAISON . \" AS LINK_ELT_PIC ON ((LINK_ELT_PIC.idElement = RECOMMANDATION_CAT.id) AND (tableElement = '\" . TABLE_CATEGORIE_PRECONISATION . \"') AND (LINK_ELT_PIC.isMainPicture = 'yes'))\r\n\t\t\t\tLEFT JOIN \" . TABLE_PHOTO . \" AS PIC ON ((PIC.id = LINK_ELT_PIC.idPhoto))\r\n\t\t\tWHERE RECOMMANDATION_CAT.status = 'valid'\r\n\t\t\t\tGROUP BY RECOMMANDATION_CAT.id\", \"\");\r\n\r\n\t\t$CategoryRecommandationList = $wpdb->get_results($query);\r\n\r\n\t\treturn $CategoryRecommandationList;\r\n\t}", "public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public function getCategory() {}", "public function getCategoryList()\n {\n $this->db->select(\"tc_category\");\n $this->db->from(\"ims_hris.training_category\");\n $this->db->where(\"COALESCE(tc_status,'N') = 'Y'\");\n $this->db->order_by(\"1\");\n $q = $this->db->get();\n \n return $q->result_case('UPPER');\n }", "function tc_category_list() {\r\n $post_terms = apply_filters( 'tc_cat_meta_list', $this -> _get_terms_of_tax_type( $hierarchical = true ) );\r\n $html = false;\r\n if ( false != $post_terms) {\r\n foreach( $post_terms as $term_id => $term ) {\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\"> %4$s </a>',\r\n apply_filters( 'tc_category_list_class', 'btn btn-mini' ),\r\n get_term_link( $term_id , $term -> taxonomy ),\r\n esc_attr( sprintf( __( \"View all posts in %s\", 'customizr' ), $term -> name ) ),\r\n $term -> name\r\n );\r\n }//end foreach\r\n }//end if $postcats\r\n return apply_filters( 'tc_category_list', $html );\r\n }", "function getAllCategories()\n {\n // Get list of categories using solr\n $metadataDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"category\");\n $enabledDao = MidasLoader::loadModel('Metadata')->getMetadata(MIDAS_METADATA_TEXT, \"mrbextrator\", \"slicerdatastore\");\n $terms = array(); \n if($metadataDao)\n {\n $db = Zend_Registry::get('dbAdapter');\n $results = $db->query(\"SELECT value, itemrevision_id FROM metadatavalue WHERE metadata_id='\".$metadataDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n foreach($results as $result)\n {\n $arrayTerms = explode(\" --- \", $result['value']);\n foreach($arrayTerms as $term)\n { \n if(strpos($term, \"zzz\") === false) continue;\n $tmpResults = $db->query(\"SELECT value FROM metadatavalue WHERE itemrevision_id='\".$result['itemrevision_id'].\"' AND metadata_id='\".$enabledDao->getKey().\"' order by value ASC\")\n ->fetchAll();\n if(empty($tmpResults))continue;\n $term = trim(str_replace('zzz', '', $term));\n if(!isset($terms[$term]))\n {\n $terms[$term] = 0;\n }\n $terms[$term]++;\n }\n } \n }\n ksort($terms);\n return $terms;\n }", "public function catCompare() {\n\t\tglobal $db;\n\t\t$user = new User;\n\t\t$lang = new Language;\n\t\t$where = \"WHERE category_author = '{$user->_user()}'\";\n\t\tif ( $user->can( 'manage_user_items' ) ) {\n\t\t\t$where = null;\n\t\t}\n\t\t$get = $db->customQuery( \"SELECT category_id,category_name FROM {$db->tablePrefix()}categories $where\" );\n\t\t$return = '';\n\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '0'\" );\n\t\t$countLinks = $getLinks->fetch_row();\n\t\t$return .= \"['{$lang->_tr( 'Without Category', 1 )}', {$countLinks[0]}],\";\n\t\t$countLinks = $getLinks->fetch_row();\n\t\twhile ( $array = $get->fetch_array() ) {\n\t\t\t$getLinks = $db->customQuery( \"SELECT COUNT(*) FROM {$db->tablePrefix()}links WHERE link_category = '{$array['category_id']}'\" );\n\t\t\t$countLinks = $getLinks->fetch_row();\n\t\t\t$return .= \"['{$array['category_name']}', {$countLinks[0]}],\";\n\t\t}\n\t\treturn $return;\n\t}", "public function getCategories();", "public function getCategories();", "public function getCategory();", "public function getCategory();", "function GetCategories(){\n\t\t\tglobal $wpdb;\n\n\t\t\t$categories = get_all_category_ids();\n\t\t\t$separator = '|';\n\t\t\t$output = array();\n\t\t\tif($categories){\n\t\t\t\tforeach($categories as $category) {\n\t\t\t\t\t$temp_catname = get_cat_name($category);\n\t\t\t\t\tif ($temp_catname !== \"Uncategorized\"){\n\t\t\t\t\t\t$output[$category] = $temp_catname;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$output = 'test';\n\t\t\t}\n\t\t\treturn $output;\n\t\t}", "public function getCategories() {\n $sql = \"SELECT * FROM categories\";\n //Commit the query\n $result = $this->connection->query($sql);\n //Parse result to JSON list\n $answer = '{\"categories\": [';\n if ($result->num_rows > 0) {\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $answer = $answer . '{\"ID\":\"' . $row[\"category_ID\"] . '\",' .\n '\"Name\": \"' . $row[\"category_Name\"] .'\"},' ;\n }\n //Trim the last comma\n $answer=rtrim($answer,\", \");\n //Finish parsing\n $answer=$answer . \"]}\";\n //Retrun the list as a string\n return $answer;\n } else {\n echo \"0 results\";\n }\n\n\n }", "public function getCategoryList()\n {\n global $user;\n\n $returned=array();\n\n if($this->options['galleryRoot'])\n {\n $startLevel=1;\n }\n else\n {\n $startLevel=0;\n }\n\n $sql=\"SELECT DISTINCT pct.id, pct.name, pct.global_rank AS `rank`, pct.status\n FROM \".CATEGORIES_TABLE.\" pct \";\n\n switch($this->options['filter'])\n {\n case self::FILTER_PUBLIC :\n $sql.=\" WHERE pct.status = 'public' \";\n break;\n case self::FILTER_ACCESSIBLE :\n if(!is_admin())\n {\n $sql.=\" JOIN \".USER_CACHE_CATEGORIES_TABLE.\" pucc\n ON (pucc.cat_id = pct.id) AND pucc.user_id='\".$user['id'].\"' \";\n }\n else\n {\n $sql.=\" JOIN (\n SELECT DISTINCT pgat.cat_id AS catId FROM \".GROUP_ACCESS_TABLE.\" pgat\n UNION DISTINCT\n SELECT DISTINCT puat.cat_id AS catId FROM \".USER_ACCESS_TABLE.\" puat\n UNION DISTINCT\n SELECT DISTINCT pct2.id AS catId FROM \".CATEGORIES_TABLE.\" pct2 WHERE pct2.status='public'\n ) pat\n ON pat.catId = pct.id \";\n }\n\n break;\n }\n $sql.=\"ORDER BY global_rank;\";\n\n $result=pwg_query($sql);\n if($result)\n {\n while($row=pwg_db_fetch_assoc($result))\n {\n $row['level']=$startLevel+substr_count($row['rank'], '.');\n\n /* rank is in formated without leading zero, giving bad order\n * 1\n * 1.10\n * 1.11\n * 1.2\n * 1.3\n * ....\n *\n * this loop cp,vert all sub rank in four 0 format, allowing to order\n * categories easily\n * 0001\n * 0001.0010\n * 0001.0011\n * 0001.0002\n * 0001.0003\n */\n $row['rank']=explode('.', $row['rank']);\n foreach($row['rank'] as $key=>$rank)\n {\n $row['rank'][$key]=str_pad($rank, 4, '0', STR_PAD_LEFT);\n }\n $row['rank']=implode('.', $row['rank']);\n\n $row['name']=GPCCore::getUserLanguageDesc($row['name']);\n\n $returned[]=$row;\n }\n }\n\n if($this->options['galleryRoot'])\n {\n $returned[]=array(\n 'id' => 0,\n 'name' => l10n('All the gallery'),\n 'rank' => '0000',\n 'level' => 0,\n 'status' => 'public',\n 'childs' => null\n );\n }\n\n usort($returned, array(&$this, 'compareCat'));\n\n if($this->options['tree'])\n {\n $index=0;\n $returned=$this->buildSubLevel($returned, $index);\n }\n else\n {\n //check if cats have childs & remove rank (enlight the response)\n $prevLevel=-1;\n for($i=count($returned)-1;$i>=0;$i--)\n {\n unset($returned[$i]['rank']);\n if($returned[$i]['status']=='private')\n {\n $returned[$i]['status']='0';\n }\n else\n {\n $returned[$i]['status']='1';\n }\n\n if($returned[$i]['level']>=$prevLevel)\n {\n $returned[$i]['childs']=false;\n }\n else\n {\n $returned[$i]['childs']=true;\n }\n $prevLevel=$returned[$i]['level'];\n }\n }\n\n return($returned);\n }", "function recharge_category() {\n\n\t\t$category = $this -> conn -> get_table_row_byidvalue('recharge_category', 'category_status', 1);\n\t\tforeach ($category as $key => $value) {\n\n\t\t\t$name = $value['category_name'];\n\t\t\t$category_id = $value['recharge_category_id'];\n\n\t\t\t$response[] = array('recharge_category_id' => $category_id, 'category_name' => $name);\n\t\t}\n\t\tif (!empty($response)) {\n\t\t\t$post = array(\"status\" => \"true\", \"message\" => $response);\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"No Record Found\");\n\t\t}\n\n\t\techo $this -> json($post);\n\t}", "function recharge_category() {\n\n\t\t$category = $this -> conn -> get_table_row_byidvalue('recharge_category', 'category_status', 1);\n\t\tforeach ($category as $key => $value) {\n\n\t\t\t$name = $value['category_name'];\n\t\t\t$category_id = $value['recharge_category_id'];\n\t\t\t\n\t\t\t$response[] = array('recharge_category_id' => $category_id, 'category_name' => $name);\n\t\t}\n\t\tif(!empty($response)){\n\t\t\t$post = array(\"status\" => \"true\",\"message\" => $response);\n\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"No Record Found\");\n\t\t}\n\t\t\n\t\techo $this -> json($post);\n\t}", "private function getCategory() {\n return '';\n }", "function getDocumentCategories()\n\t{\n\t\tif(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');\n\t\t$module_srl = Context::get('module_srl');\n\t\t$categories= $this->getCategoryList($module_srl);\n\t\t$lang = Context::get('lang');\n\t\t// No additional category\n\t\t$output = \"0,0,{$lang->none_category}\\n\";\n\t\tif($categories)\n\t\t{\n\t\t\tforeach($categories as $category_srl => $category)\n\t\t\t{\n\t\t\t\t$output .= sprintf(\"%d,%d,%s\\n\",$category_srl, $category->depth,$category->title);\n\t\t\t}\n\t\t}\n\t\t$this->add('categories', $output);\n\t}", "public function getCategory()\n {\n }", "public function categories() {\n\t\treturn $this->terms('category');\n\t}", "public function token_the_category() {\n\t\treturn implode( ', ', wp_list_pluck( (array)get_the_category(), 'name' ) );\n\t}", "public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }", "public function findCategories();", "public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "function getCategory_details($category_name)\n\t\t{\n\t\t\t$details = $this->manage_content->getValue_where('vertical_navbar','*','menu_name',$category_name);\n\t\t\techo '<div class=\"category_header\">'.$details[0]['menu_name'].'</div>\n <br /><br/>\n <div class=\"category_description\">'.$details[0]['description'].'</div>';\n\t\t}", "function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"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 $row_getQuery['cat_name'];\n\t}", "public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }", "public function getCategoriesList() {\n return $this->_get(16);\n }", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))->orderby(\"category_name\",\"ASC\")->get();\n\t\treturn $result;\n\t}", "public function getCategorys()\r\n {\r\n $groupData = $this->getGroupById();\r\n $html = null;\r\n if ($groupData) {\r\n foreach (explode(',', $groupData['categorys']) as $categoryId) {\r\n if ($categoryId) {\r\n $itemCategorys = $this->itemCollectionFactory->create()\r\n ->addFieldToFilter('category_id', array('eq' => $categoryId))\r\n ->addFieldToFilter('status', array('eq' => 1))\r\n ->addFieldToFilter('menu_type', array('eq' => 1));\r\n if ($itemCategorys->getData()) {\r\n foreach ($itemCategorys as $item) {\r\n $html .= $this->getMegamenuHtml($item);\r\n continue;\r\n }\r\n } else {\r\n $category = $this->getCategoryById($categoryId);\r\n if ($category) {\r\n $parentClass = ($this->hasSubcategory($category->getId())) ? 'parent' : null;\r\n $html .= '<li class=\"' . $this->checkCurrentCategory($category->getId()) . ' ui-menu-item level0 ' . $this->getMenuTypeGroup($groupData['menu_type']) . ' ' . $parentClass . ' \">';\r\n $html .= '<a href=\"' . $category->getUrl() . '\" class=\"level-top\"><span>' . $category->getName() . '</span></a>';\r\n if ($this->hasSubcategory($category->getId())) {\r\n $html .= '<div class=\"open-children-toggle\"></div>';\r\n }\r\n //get html of category\r\n $html .= $this->getHtmlCategory($category,\r\n $this->getMenuTypeGroup($groupData['menu_type']));\r\n $html .= '</li>';\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $html;\r\n }", "public function get_categories() {\n\t error_log(\"get_categories - category id: \" . $category_id,0);\n\n\t$query = \"SELECT * FROM category ORDER BY category_name ASC\";\n\n\t error_log(\"get_categories - query: \" . $query,0);\n\n \t $result = mysql_query($query);\n\n if ($result) {\n return $result;\n } else {\n\terror_log(\"did not get categories\",0);\n $error = mysql_errno();\n return -$error;\n }\n\n }", "function category_list() {\n $query = $this->db->get(\"categories\");\n return $query->result_array();\n }", "public function category() {\n\t\treturn $this->get_category();\n\t}", "function getDocumentCategoryTplInfo()\n\t{\n\t\t$oModuleModel = getModel('module');\n\t\t$oMemberModel = getModel('member');\n\t\t// Get information on the menu for the parameter settings\n\t\t$module_srl = Context::get('module_srl');\n\t\t$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);\n\t\t// Check permissions\n\t\t$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));\n\t\tif(!$grant->manager) return new Object(-1,'msg_not_permitted');\n\n\t\t$category_srl = Context::get('category_srl');\n\t\t$category_info = $this->getCategory($category_srl);\n\t\tif(!$category_info)\n\t\t{\n\t\t\treturn new Object(-1, 'msg_invalid_request');\n\t\t}\n\n\t\t$this->add('category_info', $category_info);\n\t}", "function wc_marketplace_category() {\n global $wmp;\n $wmp->output_report_category();\n }", "public function get_catR()\n {\n return $this->_catR;\n }", "public function catDisplay(){\n $query = \"SELECT * FROM shop_category\";\n $result = $this->db->select($query);\n\n return $result;\n }", "public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }", "public function GetCategoryOptions() {\n $return = \"\";\n $this->GetCategories();\n \n // Create the Options\n foreach ($this->rs as $row) {\n $return .= '<option value=\"' . $row->categoryID .'\">'. $row->categoryName .'</option>';\n }\n \n // Return the <options>\n return $return;\n }", "public function getCategory(): string;", "function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function afficherCategories2(){\n\t\t$sql=\"SElECT nom From categorie\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "function pico_get_requests4category($mydirname, $cat_id = null)\n{\n\t(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = &MyTextSanitizer::sGetInstance()) || $myts = &MyTextSanitizer::getInstance();\n\t$db = XoopsDatabaseFactory::getDatabaseConnection();\n\n\tinclude dirname(__DIR__) . '/include/configs_can_override.inc.php';\n\t$cat_options = [];\n\tforeach ($GLOBALS['xoopsModuleConfig'] as $key => $val) {\n\t\tif (empty($pico_configs_can_be_override[$key])) continue;\n\t\tforeach (explode(\"\\n\", @$_POST['cat_options']) as $line) {\n\t\t\tif (preg_match('/^' . $key . '\\:(.{1,100})$/', $line, $regs)) {\n\t\t\t\tswitch ($pico_configs_can_be_override[$key]) {\n\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t$cat_options[$key] = trim($regs[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'int':\n\t\t\t\t\t\t$cat_options[$key] = (int)$regs[1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bool':\n\t\t\t\t\t\t$cat_options[$key] = (int)$regs[1] > 0 ? 1 : 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (0 === $cat_id) {\n\t\t// top category\n\t\t$cat_vpath = null;\n\t\t$pid = 0xffff;\n\t} else {\n\t\t// normal category\n\t\t$cat_vpath = trim($myts->stripSlashesGPC(@$_POST['cat_vpath']));\n\t\t$pid = (int)@$_POST['pid'];\n\t\t// check $pid\n\t\tif ($pid) {\n\t\t\t$sql = 'SELECT * FROM ' . $db->prefix($mydirname . '_categories') . \" c WHERE c.cat_id=$pid\";\n\t\t\tif (!$crs = $db->query($sql)) die(_MD_PICO_ERR_SQL . __LINE__);\n\t\t\tif ($db->getRowsNum($crs) <= 0) die(_MD_PICO_ERR_READCATEGORY);\n\t\t}\n\t}\n\n\treturn [\n 'cat_title' => $myts->stripSlashesGPC(@$_POST['cat_title']),\n 'cat_desc' => $myts->stripSlashesGPC(@$_POST['cat_desc']),\n 'cat_weight' => (int)@$_POST['cat_weight'],\n 'cat_vpath' => $cat_vpath,\n 'pid' => $pid,\n 'cat_options' => pico_common_serialize($cat_options),\n ];\n}", "public function categories()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_category->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_category_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_category_vars($vars);\n\n // Load the file manager for the category image.\n ee()->publisher_helper_cp->load_file_manager();\n\n // Bail if there are no category groups defined.\n if (empty($vars['category_groups']))\n {\n show_error('No category groups found, please <a href=\"'. BASE.AMP .'D=cp&C=admin_content&M=edit_category_group\">create one</a>.');\n }\n\n return ee()->load->view('category/index', $vars, TRUE);\n }", "public function categories()\n {\n return $this->apiResponse(Items::$categories, 2678400);\n }", "function getCategory() {\n\t\treturn $this->node->firstChild->toString();\n\t}", "function getCategoriesCount(){\n return $this->query(\"SELECT GROUP_CONCAT(category) FROM docs WHERE visible=1\");\n }", "public function getRewardCategories()\r\n {\r\n return Controllers\\RewardCategories::getInstance();\r\n }", "public function getCategoryList() {\n $categories = $this->couponServices_model->fetchCategories();\n\n $category_options = array();\n $category_options[\"\"] = \"-- Select category --\";\n foreach ($categories as $item) {\n $category_options[$item['categoryId']] = $item['categoryName'];\n }\n return $category_options;\n }", "function percategory(SS_HTTPRequest $r){\r\n\t\t$catID = (int) $r->param('ID');\r\n\t\t$locale = $this->Locale;\r\n\t\t$percat = DataObject::get(\"SupportReview\",\"`Published` = true AND `Locale` ='\".$locale.\"' AND `SRCategoryID` = \". $catID, null, null, $this->getLimit());\r\n\t\treturn array(\r\n\t\t\t\"Reviews\" => $percat,\r\n\t\t\t\"Heading\" => DataObject::get_by_id(\"SRCategory\", $catID)->i18nTitle()\r\n\t\t);\r\n\t}", "function showCategory($catList) {\n $str =\"<ul id='menu-categories-menu'>\";\n foreach ($catList->getCategoriesActive()->getList() as $k => $v) {\n $str .=\"<li><a href='#'>\".$v->getCatname().\"</a></li>\";\n }\n $str .=\"</ul>\";\n return $str;\n}", "public function get_category_list()\n\t{\n\t\t$result = $this->db->from(\"category\")\n\t\t\t\t\t\t->where(array(\"category_status\" => 1,\"main_category_id\"=>0))\n\t\t\t\t\t\t->orderby(\"category_name\", \"ASC\")\n\t\t\t\t\t\t->get();\n\t\treturn $result;\n\t}", "function product_category_list(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\t$product_category_list = mysql_q(\"SELECT *\n\t\t\tFROM product_category\n\t\t\tORDER BY id\");\n\t\t$tpl->assign(\"product_category_list\", $product_category_list);\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_list.tpl\");\n\t\tdisplay($main);\n\t}", "public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}", "public function getCategoryList(){\n\t\t$recordLimit = Input::get('limit');\n\t\t$recordLimit = (!empty($recordLimit) && in_array($recordLimit, parent::$pagination_limits)) ? \n\t\t\t$recordLimit : parent::recordLimit;\n\t\t\t\n\t\t$colors = $this->shift->getCategoryColors();\n\t\t$categories = $this->shift->getCategories(null, $recordLimit == 'all' ? null : $recordLimit);\n\t\t\n\t\treturn View::make('admin.shifts.list_category')\n\t\t\t->withColors($colors)\n\t\t\t->withCategories($categories)\n\t\t\t//->withRecordlimit(parent::recordLimit);\n\t\t\t->withRecordlimit($recordLimit);\n\t}", "function displayCategoryLinks() {\n\n\t$catquery = \"select distinct ngroup from nassets where type like '0tdn%'\";\n\t$cresults = mysql_query($catquery);\n\t$has_null = false;\n\t$categories = array();\n\twhile ($acRow = mysql_fetch_array($cresults)) {\n\t\t$thisgroup = $acRow['ngroup'];\n\t\t$categories[] = $thisgroup;\n\t}\n\t\n\n\techo \"<ul>View by Category<br>\";\n\t$size = count($categories);\n \tforeach ($categories as $category) {\n \t\techo \"<li><a href=\\\"menu2.php?category=$category\\\" target=\\\"menu2\\\">$category</a><br/></li>\";\n \t}\n\n\techo \"</ul>\";\n}", "public function getCategory(){\n\t\t$stmt = $this->bdd->prepare('SELECT * FROM categorie');\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll();\n\t}", "public static function getCategoryDescription() {\n global $lC_Database, $lC_Language, $current_category_id;\n \n $Qcategory = $lC_Database->query('select categories_description from :table_categories_description where categories_id = :categories_id and language_id = :language_id');\n $Qcategory->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategory->bindInt(':categories_id', $current_category_id);\n $Qcategory->bindInt(':language_id', $lC_Language->getID());\n $Qcategory->execute();\n \n $output = '';\n if ($Qcategory->value('categories_description') != '') {\n $output .= $Qcategory->value('categories_description');\n }\n \n return $output;\n }", "function getCategory(){\n\t\t\t$data = array(); \n\t\t\t$query = \"select * from packages_category\";\n\t\t\t$result = mysql_query($query);\n\t\t \n\t\t\tif($result){\n\t\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t\tarray_push($data,$row);\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}else{\n\t\t\t\tdie(\"error in mysql query \" . mysql_error());\n\t\t\t}\n\t\t}", "function get_all_comic_categories_as_cat_string() {\n\tglobal $all_comic_categories_as_string, $category_tree;\n\tif (empty($all_comic_categories_as_string)) {\n\t\t$categories = array();\n\t\tforeach ($category_tree as $node) {\n\t\t\t$parts = explode(\"/\", $node);\n\t\t\t$categories[] = end($parts);\n\t\t}\n\t\t$all_comic_categories_as_string = implode(\",\", $categories);\n\t}\n\treturn $all_comic_categories_as_string;\n}", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function render(): array\n {\n return $this->categories;\n }", "public static function getCategoryListing() {\n global $lC_Database, $lC_Language, $lC_Products, $lC_CategoryTree, $lC_Vqmod, $cPath, $cPath_array, $current_category_id;\n \n include_once($lC_Vqmod->modCheck('includes/classes/products.php'));\n \n if (isset($cPath) && strpos($cPath, '_')) {\n // check to see if there are deeper categories within the current category\n $category_links = array_reverse($cPath_array);\n for($i=0, $n=sizeof($category_links); $i<$n; $i++) {\n $Qcategories = $lC_Database->query('select count(*) as total from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n\n if ($Qcategories->valueInt('total') < 1) {\n // do nothing, go through the loop\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $category_links[$i]);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n break; // we've found the deepest category the customer is in\n }\n }\n } else {\n $Qcategories = $lC_Database->query('select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.categories_mode, c.categories_link_target, c.categories_custom_url from :table_categories c, :table_categories_description cd where c.parent_id = :parent_id and c.categories_id = cd.categories_id and cd.language_id = :language_id and c.categories_status = 1 order by sort_order, cd.categories_name');\n $Qcategories->bindTable(':table_categories', TABLE_CATEGORIES);\n $Qcategories->bindTable(':table_categories_description', TABLE_CATEGORIES_DESCRIPTION);\n $Qcategories->bindInt(':parent_id', $current_category_id);\n $Qcategories->bindInt(':language_id', $lC_Language->getID());\n $Qcategories->execute();\n }\n $number_of_categories = $Qcategories->numberOfRows();\n $rows = 0;\n $output = '';\n while ($Qcategories->next()) {\n $rows++;\n $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%';\n $exists = ($Qcategories->value('categories_image') != null) ? true : false;\n $output .= ' <td style=\"text-align:center;\" class=\"categoryListing\" width=\"' . $width . '\" valign=\"top\">';\n if ($Qcategories->value('categories_custom_url') != '') {\n $output .= lc_link_object(lc_href_link($Qcategories->value('categories_custom_url'), ''), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no-image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n } else {\n $output .= lc_link_object(lc_href_link(FILENAME_DEFAULT, 'cPath=' . $lC_CategoryTree->buildBreadcrumb($Qcategories->valueInt('categories_id'))), ( ($exists === true) ? lc_image(DIR_WS_IMAGES . 'categories/' . $Qcategories->value('categories_image'), $Qcategories->value('categories_name')) : lc_image(DIR_WS_TEMPLATE_IMAGES . 'no_image.png', $lC_Language->get('image_not_found')) ) . '<br />' . $Qcategories->value('categories_name'), (($Qcategories->value('categories_link_target') == 1) ? 'target=\"_blank\"' : null));\n }\n $output .= '</td>' . \"\\n\";\n if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {\n $output .= ' </tr>' . \"\\n\";\n $output .= ' <tr>' . \"\\n\";\n } \n } \n \n return $output;\n }", "public function category()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->pro->prifix.$this->pro->category);\n\t\t$this->db->order_by($this->pro->category.'_id','desc');\n\t\t$this->db->where($this->pro->category.'_status','1');\n\t\t$this->db->where($this->pro->category.'_parent',0);\n\t\t$rs = $this->db->get();\n\t\t//echo $this->db->last_query();\n\t\treturn $rs->result_array();\n\t\t\n\t}", "public function getCategory() {\r\n return \\models\\Database::validateData($this->_category, 'string|specialchars|strip_tags');\r\n }", "public function get_category_permastruct()\n {\n }", "public function index()\n {\n return $this->apiResponse(ResultTypeController::Success, Category::all(),'Kategoriler', 200);\n }", "public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }", "public function get_category(){\n\t\treturn $this->category;\n\t}", "public function get_category() {\n $data['get_category'] = $this->Category_model->get_category();\n return $data['get_category'];\n }", "public function listattr_cat()\n {\n $this->db->where('descripcion_atributo', 'Catalogo');\n $resultados = $this->db->get('atributos_b');\n\n return $resultados->result();\n }", "public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}", "function afficherCategories()\n\t{\n\t\t$sql=\"SElECT * From categorie\";\n\t\t$db = config::getConnexion();\n\t\ttry\n\t\t{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e)\n {\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function tldCategoryList(){\n $expectedExceptions = array();\n $expectedExceptions[\"\\\\Kinikit\\\\MVC\\\\Exception\\\\RateLimitExceededException\"] = \"\\Netistrar\\ClientAPI\\Exception\\RateLimitExceededException\";\n return parent::callMethod(\"tldcategory\", \"GET\", array(),null,\"string[]\",$expectedExceptions);\n }", "public function tldCategoryList(){\n $expectedExceptions = array();\n $expectedExceptions[\"\\\\Kinikit\\\\MVC\\\\Exception\\\\RateLimitExceededException\"] = \"\\Netistrar\\ClientAPI\\Exception\\RateLimitExceededException\";\n return parent::callMethod(\"tldcategory\", \"GET\", array(),null,\"string[]\",$expectedExceptions);\n }", "public function getCategoryList()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t// sql\n\t\t\t$category = D('Category');\n\t\t\t$sql = \"SELECT * FROM lib_category;\";\n\t\t\t$return = $category->query($sql);\n\t\t\t$result = array();\n\t\t\tfor ($k = 0; $k < count($return); $k++) {\n\t\t\t\tarray_push($result, $return[$k]['category']);\n\t\t\t}\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return),\n\t\t\t\t\t'cat' => json_encode($result)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "public function getCategoryList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_category');\r\n\t\t$this->db->where(\"(category_parent_id = '' OR category_parent_id = '0')\");\r\n\t\t$this->db->where('category_status', '1');\r\n\t\t$this->db->where('category_type', 'Product');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}", "function tbc_completed_books_all()\n{\n $category_id = NULL;\n $output = \"\";\n $output = \"<h4>Category</h4>\";\n $output .= \"<hr style='background-color: #abb2b8;' /><div style='width:100%; float:left;'><h4>\";\n $output .= _textbook_companion_list_of_new_category($category_id);\n $output .= \"</h4></div>\";\n $result_count = db_query(\"SELECT pe.book FROM {textbook_companion_preference} pe LEFT JOIN textbook_companion_proposal po ON pe.proposal_id = po.id WHERE po.proposal_status =3 AND pe.approval_status =1\");\n $row_count = $result_count->rowCount();\n $output .= \"<p style='clear: both;'>Total number of completed books : &nbsp;\" . $row_count . \" </p><br><span style='color:red;'>The list below is not the books as named but only are the solved example for R</span>\";\n $output .= \"<hr style='background-color: #abb2b8;' />\";\n $result_category = db_query(\"SELECT * FROM {list_of_category} WHERE category_id !=0\");\n $row_category_count = $result_category->rowCount();\n $output .= \"<ol style='list-style-type: upper-roman;'><h4>\";\n for ($i = 1; $i <= $row_category_count; $i++)\n {\n $output .= \"<div id=$i>\" . _textbook_companion_list_of_new_category_display($i) . \"</div><br>\";\n } //$i = 1; $i <= $row_category_count; $i++\n $output .= \"</h4></ol>\";\n return $output;\n}", "public function categoryDetails() {\n\t\t$this->load->model(\"homeModel\");\n\t\t$response = array(\"error\" => FALSE);\n\n\t\t$output = array();\n\n\t\t$post = $this->input->raw_input_stream;\n\t\t$post = json_decode($post);\n\t\t$category = $post->category;\n\n\n\t\t$packages = $this->homeModel->getPackagesInCategory($category);\n\t\tif ($packages != null) {\n\t\t\tforeach ($packages as $key => $value) {\n\t\t\t\t$subPackages = $this->homeModel->getSubpackagesInCategory($value->id);\n\t\t\t\t$services = array();\n\n\t\t\t\tif ($subPackages != null) {\n\t\t\t\t\tforeach ($subPackages as $key => $sub) {\n\t\t\t\t\t\t$services = $this->homeModel->getServicesInSubpackage($sub->id);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$row['package'] = $value;\n\t\t\t\t$row['sub_packages'] = $subPackages;\n\t\t\t\t$row['services'] = $services;\n\n\t\t\t\t$output[] = $row;\n\t\t\t}\n\t\t}\n\n\t\t$response['packages'] = $packages;\n\t\t$response['data'] = $output;\n\t\techo json_encode($response);\n\t}", "function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }", "public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }", "public function get_all_academic_article_category()\n {\n echo $this->academic_article_model->get_all_academic_article_category();\n }", "public function category(){\n\t\t$query = $this->db->query(\"select * from `category` where status='enable'\");\n\t\treturn $query->result_array();\n\t}", "function get_all_courses_category_wise($category)\n {\n $this->db->select('cs.*,cat.name as category');\n $this->db->from('courses as cs');\n $this->db->join('courses_categories_gp as cc', 'cc.course_id=cs.id');\n $this->db->join('categories as cat', 'cat.id=cc.category_id');\n $this->db->where('cat.seo_url', $category);\n $this->db->where('cat.status', 1);\n $this->db->where('cs.status', 1);\n $this->db->order_by('cs.sort_order', 'asc');\n $query = $this->db->get();\n // return $this->db->last_query();\n if ($query->num_rows() > 0) {\n $courses = $query->result();\n return $courses;\n }\n return false;\n }", "function get_cat() {\r\n \r\n $query = $this->db->get('categories');\r\n return $query->result_array();\r\n }", "public function categoryList()\n {\n return view(\"Category::list\");\n }", "public static function getActiveCategories(){}", "function getcategorys_list(){\n \n global $wpdb;\n\n$post_per_page = (isset($_REQUEST['post_per_page'])) ? $_REQUEST['post_per_page'] : 1; \n\n$offset = $post_per_page * ($_REQUEST['page'] - 1);\n// Setup the arguments to pass in\n$args = array(\n'offset' => $offset,\n'number' => $post_per_page,\n'order' => 'DESC',\n'hide_empty'=>0\n);\n// Gather the series\n$mycategory = get_terms( 'products', $args );\n\n\n\n if(!empty($mycategory)){\n foreach($mycategory as $post)\n {\n\n \n $im = $post->taxonomy.'_'. $post->term_id; \n $collection_image = get_field('category_image',$im); \n\n $title = $collection_image['title'];\n $url = get_term_link($post);\n $medium= get_image_url($collection_image['id'],'medium');\n\n if(empty($medium)){\n $medium = (get_template_directory_uri().\"/images/no-image.png\"); \n }\n \n\n printf('<div class=\"col-lg-3 col-md-4 col-sm-4 col-xs-6\">\n <div class=\"product_info\"><a href=\"'.$url.'\" title=\"\" class=\"overly\"><span><img src=\"'.$medium.'\" alt=\"\" title=\"\"></span></a>\n <h4>'.$post->name.'</h4>\n <a href=\"'.$url.'\" title=\"View More\" class=\"link\">View More</a> </div>\n </div>');\n\n\n }\n }\n die();\n}", "function list_categories() {\n $project_parent_category = get_category_by_slug('project');\n $project_parent_category_id=$project_parent_category->term_id;\n $categories=get_the_category();\n $count = 0;\n foreach($categories as $category){\n if($category->category_parent==$project_parent_category_id){\n if ($count == 0) {\n echo '<div class=\"category-symbology\">';\n\n if(get_post_type(get_the_id()) == 'discussion') { echo '<i class=\"social-foundicon-chat\"> </i> '; }\n }\n echo \"<a class='one-category' href='/project/\". $category->slug . \"'>\" . $category->name . \"</a>\";\n if ($count == 0) {\n echo '</div>';\n } \n $count++;\n }\n }\n\n //emit a chat symbol for discussion\n if($count == 0 && get_post_type(get_the_id()) == 'discussion') {\n generate_discussion_w_no_category();\n }\n}", "public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }", "public function get_categories() {\n\t\treturn $this->terms('category');\n\t}" ]
[ "0.66375893", "0.6628101", "0.6549832", "0.6475605", "0.6454724", "0.6424433", "0.64082116", "0.6385193", "0.6338418", "0.6304909", "0.6304909", "0.62741977", "0.62741977", "0.6237723", "0.6224425", "0.62137187", "0.6212677", "0.6130184", "0.61257416", "0.6124295", "0.61215603", "0.6111906", "0.60967815", "0.6071749", "0.6064516", "0.60523796", "0.6051722", "0.6046533", "0.60459524", "0.6045142", "0.6043541", "0.6030394", "0.6025987", "0.6024929", "0.6019806", "0.6012623", "0.6007571", "0.6005854", "0.5999065", "0.5997885", "0.5997696", "0.59834635", "0.59675264", "0.5960574", "0.5959236", "0.59533376", "0.59471685", "0.5933207", "0.5929763", "0.5928963", "0.5914714", "0.59128153", "0.59085184", "0.5908298", "0.5907565", "0.5906947", "0.5895762", "0.58915985", "0.5891358", "0.5879455", "0.5875686", "0.5871091", "0.5865258", "0.5860838", "0.5852784", "0.5852784", "0.5852784", "0.58526796", "0.5845568", "0.5845089", "0.58380413", "0.5835762", "0.5833857", "0.583339", "0.58323026", "0.5830776", "0.58307105", "0.5825701", "0.5825482", "0.5822888", "0.58181566", "0.58181566", "0.58164626", "0.5814158", "0.5811127", "0.58098954", "0.5808916", "0.5808403", "0.58058494", "0.5803018", "0.5800077", "0.5794904", "0.57940906", "0.57928115", "0.5791781", "0.579072", "0.5790607", "0.57900935", "0.57859045", "0.5785392" ]
0.6635155
1
Get the form to manage recommandation categories
function recommandation_category_form($argument){ $id_categorie_preconisation = $argument['idElement']; $nom_categorie = $impressionRecommandation = $tailleimpressionRecommandation = $impressionRecommandationCategorie = $tailleimpressionRecommandationCategorie = ''; if(($id_categorie_preconisation != '') && ($id_categorie_preconisation > 0)){ $recommandationCategoryInfos = evaRecommandationCategory::getCategoryRecommandation($id_categorie_preconisation); $nom_categorie = html_entity_decode($recommandationCategoryInfos->nom, ENT_QUOTES, 'UTF-8'); $impressionRecommandation = html_entity_decode($recommandationCategoryInfos->impressionRecommandation, ENT_QUOTES, 'UTF-8'); $tailleimpressionRecommandation = html_entity_decode($recommandationCategoryInfos->tailleimpressionRecommandation, ENT_QUOTES, 'UTF-8'); $impressionRecommandationCategorie = html_entity_decode($recommandationCategoryInfos->impressionRecommandationCategorie, ENT_QUOTES, 'UTF-8'); $tailleimpressionRecommandationCategorie = html_entity_decode($recommandationCategoryInfos->tailleimpressionRecommandationCategorie, ENT_QUOTES, 'UTF-8'); } ?> <p class="recommandationCategoryFormErrorMessage digirisk_hide" >&nbsp;</p> <form action="<?php echo EVA_INC_PLUGIN_URL; ?>ajax.php" id="recommandation_category_form" method="post" > <input type="hidden" name="post" id="post" value="true" /> <input type="hidden" name="table" id="table" value="<?php _e(TABLE_CATEGORIE_PRECONISATION); ?>" /> <input type="hidden" name="act" id="act" value="saveRecommandationCategorie" /> <input type="hidden" name="id_categorie_preconisation" id="id_categorie_preconisation" value="<?php _e($id_categorie_preconisation); ?>" /> <input type="hidden" name="impressionRecommandationCategorieValue" id="impressionRecommandationCategorieValue" value="<?php _e($impressionRecommandationCategorie); ?>" /> <input type="hidden" name="impressionRecommandationValue" id="impressionRecommandationValue" value="<?php _e($impressionRecommandation); ?>" /> <!-- Recommandation category name --> <label for="nom_categorie" ><?php _e('Nom', 'evarisk'); ?></label> <input type="text" name="nom_categorie" id="nom_categorie" class="recommandationInput" value="<?php _e($nom_categorie); ?>" /> <!-- Option recommandation category picture in document --> <div class="recommandationCategoryOption" ><?php _e('Param&egrave;tres pour l\'impression de la famille de pr&eacute;conisations', 'evarisk'); ?></div> <div class="recommandationCategoryOptionChoice" ><input type="radio" class="impressionRecommandationCategorie" name="impressionRecommandationCategorie" id="impressionRecommandationCategorie_textandpicture" value="textandpicture" <?php (($impressionRecommandationCategorie == '') || ($impressionRecommandationCategorie == 'textandpicture')) ? _e('checked = "checked"') : ''; ?> /><label for="impressionRecommandationCategorie_textandpicture" class="recommandationCategoryOptionLabel" ><?php _e('Nom + image', 'evarisk'); ?></label></div> <div class="recommandationCategoryOptionChoice" ><input type="radio" class="impressionRecommandationCategorie" name="impressionRecommandationCategorie" id="impressionRecommandationCategorie_textonly" value="textonly" <?php (($impressionRecommandationCategorie != '') && ($impressionRecommandationCategorie == 'textonly')) ? _e('checked = "checked"') : ''; ?> /><label for="impressionRecommandationCategorie_textonly" class="recommandationCategoryOptionLabel" ><?php _e('Nom uniquement', 'evarisk'); ?></label></div> <div class="recommandationCategoryOptionChoice" ><input type="radio" class="impressionRecommandationCategorie" name="impressionRecommandationCategorie" id="impressionRecommandationCategorie_pictureonly" value="pictureonly" <?php (($impressionRecommandationCategorie != '') && ($impressionRecommandationCategorie == 'pictureonly')) ? _e('checked = "checked"') : ''; ?> /><label for="impressionRecommandationCategorie_pictureonly" class="recommandationCategoryOptionLabel" ><?php _e('Image uniquement', 'evarisk'); ?></label></div> <div class="recommandationCategoryOptionPicSizeContainer" id="pictureRecommandationCategoryContainer" ><label for="tailleimpressionRecommandationCategorie" class="recommandationCategoryOptionLabel" ><?php _e('Taille de l\'image (en cm)', 'evarisk'); ?></label><input type="text" name="tailleimpressionRecommandationCategorie" id="tailleimpressionRecommandationCategorie" value="<?php _e($tailleimpressionRecommandationCategorie); ?>" /></div> <div class="clear" >&nbsp;</div> <!-- Option recommandation picture in document --> <div class="recommandationCategoryOption" ><?php _e('Param&egrave;tres pour l\'impression des pr&eacute;conisations de cette famille', 'evarisk'); ?></div> <div class="recommandationCategoryOptionChoice" ><input type="radio" class="impressionRecommandation" name="impressionRecommandation" id="impressionRecommandation_textandpicture" value="textandpicture" <?php (($impressionRecommandation == '') || ($impressionRecommandation == 'textandpicture')) ? _e('checked = "checked"') : ''; ?> /><label for="impressionRecommandation_textandpicture" class="recommandationCategoryOptionLabel" ><?php _e('Nom + image', 'evarisk'); ?></label></div> <div class="recommandationCategoryOptionChoice" ><input type="radio" class="impressionRecommandation" name="impressionRecommandation" id="impressionRecommandation_textonly" value="textonly" <?php (($impressionRecommandation != '') && ($impressionRecommandation == 'textonly')) ? _e('checked = "checked"') : ''; ?> /><label for="impressionRecommandation_textonly" class="recommandationCategoryOptionLabel" ><?php _e('Nom uniquement', 'evarisk'); ?></label></div> <div class="recommandationCategoryOptionChoice" ><input type="radio" class="impressionRecommandation" name="impressionRecommandation" id="impressionRecommandation_pictureonly" value="pictureonly" <?php (($impressionRecommandation != '') && ($impressionRecommandation == 'pictureonly')) ? _e('checked = "checked"') : ''; ?> /><label for="impressionRecommandation_pictureonly" class="recommandationCategoryOptionLabel" ><?php _e('Image uniquement', 'evarisk'); ?></label></div> <div class="recommandationCategoryOptionPicSizeContainer" id="pictureRecommandationContainer" ><label for="tailleimpressionRecommandation" class="recommandationCategoryOptionLabel" ><?php _e('Taille de l\'image (en cm)', 'evarisk'); ?></label><input type="text" name="tailleimpressionRecommandation" id="tailleimpressionRecommandation" value="<?php _e($tailleimpressionRecommandation); ?>" /></div> <input type="submit" name="save_recommancation_category" id="save_recommancation_category" class="clear alignright button-primary" value="<?php _e('Enregistrer', 'evarisk'); ?>" /> </form> <script type="text/javascript" > digirisk(document).ready(function(){ jQuery(".impressionRecommandation").click(function(){ jQuery("#impressionRecommandationValue").val(jQuery(this).val()); if(jQuery(this).val() == 'textonly'){ jQuery("#pictureRecommandationContainer").hide(); } else{ jQuery("#pictureRecommandationContainer").show(); } }); jQuery(".impressionRecommandationCategorie").click(function(){ jQuery("#impressionRecommandationCategorieValue").val(jQuery(this).val()); if(jQuery(this).val() == 'textonly'){ jQuery("#pictureRecommandationCategoryContainer").hide(); } else{ jQuery("#pictureRecommandationCategoryContainer").show(); } }); jQuery("#recommandation_category_form").ajaxForm({ target: "#ajax-response", beforeSubmit: validate_recommandation_category_form }); }); function validate_recommandation_category_form(formData, jqForm, options){ evarisk("#nom_categorie").removeClass("ui-state-error"); for(var i=0; i < formData.length; i++){ if((formData[i].name == "nom_categorie") && !formData[i].value){ checkLength( evarisk("#nom_categorie"), "", 1, 128, "<?php _e('Le champs nom de la famille de pr&eacute;conisation doit contenir entre !#!minlength!#! et !#!maxlength!#! caract&egrave;res', 'evarisk'); ?>" , evarisk(".recommandationCategoryFormErrorMessage")) return false; } } return true; } </script> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "protected function form()\n {\n return Admin::form(ProductCategory::class, function (Form $form) {\n $channelNameArr=Admin::user()->channelNameArr();\n $categoryListArr=ProductCategory::query()->where('channel',array_keys($channelNameArr))->get(['id','name','parent_id'])->toArray();\n $categoryTreeArr=[];\n $a=formatTreeList($categoryListArr);\n foreach($a as $k=>$v){\n $categoryTreeArr[$v['id']]=$v['name'];\n }\n $categoryTreeArr=['0'=>'--作为一级分类--']+$categoryTreeArr;\n $form->display('id', 'ID');\n $form->select('channel','渠道')->options($channelNameArr);\n $form->select('parent_id','上级分类')->options($categoryTreeArr)->rules('required');\n $form->text('name','分类名称')->rules('required');\n $form->image('thumb','封面图')->move('upload/product')->removable();\n $form->display('created_at', '创建时间');\n $form->display('updated_at', '修改时间');\n });\n }", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function getName()\n {\n return 'category_form';\n }", "protected function form()\n {\n return Admin::form(ArticleCategory::class, function (Form $form) {\n\n $form->display('id', 'ID');\n // 添加text类型的input框\n $form->text('name', '分类名称')->rules('required');\n // 添加number类型的input框\n $form->number('sort', '排序');\n\n // 是否启用\n $form->switch('is_del', '启用?')->rules('required');\n //上传图片\n $form->image('icon','icon')->move('public/upload/image/')->rules('required');\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n });\n }", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "public function showCategoryForm() {\n $company_logo = $this->showLogoImage();\n $category_images = \\App\\CouponCategory::categoryList();\n $signup_category_images = \\App\\CouponCategory::categoryListWeb();\n $country_list = \\App\\Country::countryList();\n\n return view('frontend.signup.category')->with(['company_logo' => $company_logo,\n 'category_images' => $category_images, 'signup_category_images' => $signup_category_images,\n 'country_list' => $country_list]);\n }", "protected function form()\n {\n return Admin::form(Category::class, function (Form $form) {\n\n $form->display('catid', 'ID');\n $form->text('name','Category Name')->rules('required');\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n });\n }", "public function add_category() /// get routes of the form add cateogry\n {\n return view('admin.categories.add-category');\n }", "protected function form()\n {\n $form = new Form(new Category());\n \n $form->text('erp_id', __('ID(ERP用)'));\n $form->select('parent_id', __('中分類'))->options(\n\n Category::Mid()->pluck('name', 'id')\n\n )->required();\n \n $form->text('name', __('小分類名稱'));\n $form->hidden('type', __('Type'))->default(3);\n\n return $form;\n }", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function getPostForm(): CategorisedFormInterface;", "protected function form()\n {\n // 创建一个表单\n return Admin::form(ArticleCategory::class, function (Form $form) {\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->text('title', '文章分类名称')->rules('required');\n $form->text('sort', '排序(数字越小越靠前)')->default(0);\n $form->text('summary', '简介');\n });\n }", "public function create()\n {\n return view('admin.categories.form');\n }", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "protected function form()\n {\n $categoryModel = new ArticleCategory();\n $form = new Form(new ArticleCategory);\n\n $form->select('parent_id', '父级分类')->options($categoryModel::selectOptions())->default(1);\n $form->text('title', '标题')->required();\n $form->text('description', trans('description'));\n $form->image('avatar', trans('avatar'));\n $form->number('order', __('Order'))->default(1)->setDisplay(false);\n\n return $form;\n }", "protected function definition() {\n $mform = $this->_form;\n\n if (isset($this->_customdata['categoriesarray'])) {\n $this->set_categories_array($this->_customdata['categoriesarray']);\n } else {\n return;\n }\n\n if (isset($this->_customdata['defaultcategory'])) {\n $this->set_default_category($this->_customdata['defaultcategory']);\n } else {\n return;\n }\n\n $options = array(\n 'multiple' => false,\n );\n\n $categorieslistraw = $this->get_categories_array();\n\n $defaultcategory = $this->get_default_category();\n\n $categorieslistdefault = array_intersect_key($categorieslistraw, array_flip([$defaultcategory]));\n\n // Make sure that the default category was found, before unsetting it in the original array.\n if (isset($categorieslistdefault[$defaultcategory])) {\n unset($categorieslistraw[$defaultcategory]);\n }\n\n $categorieslist = $categorieslistdefault + $categorieslistraw;\n\n $mform->addElement(\n 'autocomplete',\n 'sel_cate',\n get_string('selectcategorybanner', 'local_course_templates'),\n $categorieslist,\n $options\n );\n\n $mform->addRule('sel_cate', get_string('requiredelement', 'form'), 'required', null, 'client');\n $mform->addRule('sel_cate', get_string('requiredelement', 'form'), 'required', null, 'server');\n\n // When there are two elements, we need a group.\n $buttonarray = array();\n $buttonarray[] = &$mform->createElement(\n 'button',\n 'back',\n get_string('back', 'local_course_templates'),\n array('onclick' => 'javascript :history.back(-1)')\n );\n $buttonarray[] = &$mform->createElement(\n 'submit',\n 'coursecategorieslistsubmit',\n get_string('continue', 'local_course_templates')\n );\n $mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);\n\n $mform->closeHeaderBefore('buttonar');\n }", "protected function form()\n {\n $form = new Form(new Category);\n\n// dump(Category::root(request()->segment(3)));\n\n $form->tab('Конструктор страницы', function($form){\n $form->sortable('source','Страница');\n $form->select('blocks','Добавить блок')->options(Block::where('static',0)->pluck('name','url'))->attribute(['rel' => 'blocks']);\n $form->select('static','Добавить статический блок')->options(Block::where('static',1)->pluck('name','url'))->attribute(['rel' => 'static']);\n });\n $form->tab('Настройки', function($form){\n $form->display('id');\n $form->alias('alias','Алиас');\n $form->text('link');\n $form->select('hook')->options(Resource::all()->pluck('name','id'));\n $form->text('name','Название');\n });\n $form->tab('SEO', function($form){\n $form->textarea('seo_title','seo title');\n $form->textarea('seo_desc','seo description');\n $form->textarea('seo_key','seo keywords');\n\n });\n\n return $form;\n }", "public function create() {\n return view('admin.category.category_create_form');\n }", "protected function form()\n {\n $form = new Form(new ArticleCategory);\n $form->text('name', '名称');\n return $form;\n }", "function getSetupForm($options = array()){\n $form = parent::getSetupForm($options);\n $form->setLegend('Category Options');\n \n $set = $form->createElement('select', 'set');\n $set->setLabel('Set: ');\n $set->setRequired('true');\n \n $service = new Content_Model_CategorySet_Service();\n $results = $service->getObjects();\n\n $options = array();\n foreach($results as $value){\n $options[$value->id] = $value->title;\n }\n\n //$template->addMultiOption('None','');\n $set->setMultiOptions($options);\n $form->addElement($set);\n \n return $form;\n }", "public function create()\n {\n return view('categoria.formcategoria');\n }", "protected function form()\n {\n $form = new Form(new Category);\n $module_model = new Module();\n\n $options = $this->category_model->getOptions();\n $form->select('parent_id', '父ID')->options($options);\n $form->select('module_id', '模块ID')->options($module_model->getOptions());\n $form->text('name', '名称');\n $form->number('order', '排序');\n $form->text('alias', '别名');\n $form->icon('icon', '图标');\n $form->image('image', '图片')->uniqueName();\n $form->url('link', '链接');\n $form->text('seo_title', 'Seo 标题');\n $form->text('seo_keywords', 'Seo 关键词');\n $form->textarea('seo_description', 'Seo 描述');\n $form->text('index_template', '首页模版');\n $form->text('detail_template', '详情模版');\n $form->switch('status', '状态')->default(1);\n\n $form->saving(function (Form $form) {\n\n if(!empty($form->model()->id)){\n if($form->model()->id == $form->parent_id){\n $error = new MessageBag([\n 'title' => '父ID值有误',\n 'message' => '父ID不允许为自身',\n ]);\n return back()->with(compact('error'));\n }\n }\n\n if(!empty($form->model()->id)){\n $categories = $this->category_model->all()->toArray();\n $ids = getSonIds($form->model()->id,$categories);\n if(in_array($form->parent_id,$ids)){\n $error = new MessageBag([\n 'title' => '父ID值有误',\n 'message' => '父ID不允许为自身的子集',\n ]);\n\n return back()->with(compact('error'));\n }\n }\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new TopicCategory);\n\n $form->text('name', '话题分类名称')->rules('required|string');\n $form->number('sort', '排序值')->default(9)->rules('required|integer|min:0')->help('默认倒序排列:数值越大越靠前');\n\n return $form;\n }", "public function create()\n {\n //Vista del formulario\n return view('pages.categoria.create');\n }", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "function question_category_form($course, $current, $recurse=1, $showhidden=false, $showquestiontext=false) {\n global $CFG;\n\n/// Make sure the default category exists for this course\n get_default_question_category($course->id);\n\n/// Get all the existing categories now\n $catmenu = question_category_options($course->id, true);\n\n $strcategory = get_string(\"category\", \"quiz\");\n $strshow = get_string(\"show\", \"quiz\");\n $streditcats = get_string(\"editcategories\", \"quiz\");\n\n echo \"<table><tr><td style=\\\"white-space:nowrap;\\\">\";\n echo \"<strong>$strcategory:</strong>&nbsp;\";\n echo \"</td><td>\";\n popup_form (\"edit.php?courseid=$course->id&amp;cat=\", $catmenu, \"catmenu\", $current, \"\", \"\", \"\", false, \"self\");\n echo \"</td><td align=\\\"right\\\">\";\n echo \"<form method=\\\"get\\\" action=\\\"$CFG->wwwroot/question/category.php\\\">\";\n echo \"<div>\";\n echo \"<input type=\\\"hidden\\\" name=\\\"id\\\" value=\\\"$course->id\\\" />\";\n echo \"<input type=\\\"submit\\\" value=\\\"$streditcats\\\" />\";\n echo '</div>';\n echo \"</form>\";\n echo '</td></tr></table>';\n\n echo '<form method=\"get\" action=\"edit.php\" id=\"displayoptions\">';\n echo \"<fieldset class='invisiblefieldset'>\";\n echo \"<input type=\\\"hidden\\\" name=\\\"courseid\\\" value=\\\"{$course->id}\\\" />\\n\";\n question_category_form_checkbox('recurse', $recurse);\n question_category_form_checkbox('showhidden', $showhidden);\n question_category_form_checkbox('showquestiontext', $showquestiontext);\n echo '<noscript><div class=\"centerpara\"><input type=\"submit\" value=\"'. get_string('go') .'\" />';\n echo '</div></noscript></fieldset></form>';\n}", "protected function form()\n {\n $form = new Form(new Category);\n\n $form->text('name', 'Имя');\n\n $form->textarea('text');\n\n $form->switch('status', 'Статус')->states([\n 'on' => ['value' => '1', 'text' => 'Публиковать', 'color' => 'success'],\n 'off' => ['value' => '0', 'text' => 'Не публиковать', 'color' => 'danger'],\n ]);\n\n\n return $form;\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function form()\n {\n $form = new Form(new PermissionCategory());\n $form->tab('Общее', function (Form $form) {\n $form->display('id', 'ID');\n\n $form->text('name', trans('admin.name'))->rules('required');\n });\n\n return $form;\n }", "public function render()\n {\n return view('components.category-form');\n }", "protected function form()\n {\n $form = new Form(new Cases);\n\n $form->select('cate_id', '分类')->options('/admin/api/getcasecate');\n $form->select('algw_id', '顾问')->options('/admin/api/getgw');\n $form->text('title', '标题');\n $form->text('keywords', 'SEO关键字');\n $form->text('description', 'SEO描述');\n $form->text('desc', '副标题');\n $form->text('author', '来源');\n $form->radio('is_tj', '推荐')->options([0=>'否',1=>'是']);\n $form->image('thumb', '缩略图')->uniqueName();\n $form->editor('data', '详情');\n\n\n return $form;\n }", "public function create()\n {\n $category = Categories::all();\n return view('panel.product-management.categories.form-create')->with(['category' => $category]);\n }", "public function create()\n { \n $form_type = 'Add';\n $images = [];\n $category = [];\n $questions = ['Case / Box','A Game','The Manual'];\n \n $categories = Categories::where('parent_id',0)->pluck('category_name','id')->prepend('Select League', ''); \n $regions = Regions::pluck('name','id')->prepend('Select Region', ''); \n \n return view('admin.subcategories.form', compact('form_type','categories','regions','images','category','questions')); \n }", "public function getSearchCategory(){\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n return $objectManager->get ( 'Apptha\\Airhotels\\Block\\Booking\\Form' );\n }", "public function definition() {\n\t\t\tglobal $CFG, $DB;\t\n\t\t\n\t\t$mform = $this->_form; // Don't forget the underscore!\n\t\n\t\t$result= $DB->get_records_sql(\"SELECT DISTINCT `intensidad` FROM `mdl_ejercicios`\");\n\t\t$result_tren= $DB->get_records_sql(\"SELECT DISTINCT `categoria` FROM `mdl_ejercicios`\");\n\t\t$options= array();\n\t\tforeach($result as $rs)\n\t\t\t\t$options[$rs->intensidad] = $rs->intensidad;\n\t\t\n\t\t$options_tren= array();\n\t\tforeach ($result_tren as $rst)\n\t\t\t$options_tren[$rst->categoria]= $rst->categoria;\n\t\t$mform->addElement('header', 'header', 'Para crear una rutina aleatoria');\n\t\t\n\t\t$mform->addElement('select', 'intensidad', '¿Qué intensidad quieres?:',$options);\n\n\t\t//$mform->addElement('select', 'categoria', '¿Qué tren de tu cuerpo quieres trabajar?:',$options_tren);\n\t\t\n\t\t\n\t\t$buttonarray=array();\n\t\t$buttonarray[] = &$mform->createElement('submit', 'submitbutton', 'Buscar rutina');\n\t\t$buttonarray[] = &$mform->createElement('reset', 'resetbutton', 'Resetear');\n\t\t$buttonarray[] = &$mform->createElement('cancel', 'cancel', 'Cancelar');\n\t\t$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);\n\t\t$mform->addElement('hidden', 'end');\n\t\t$mform->setType('end', PARAM_NOTAGS);\n\t\t$mform->closeHeaderBefore('end');\n\t}", "public function createProductForm()\n {\n $subCategory = Category::where('parent_id','<>',NULL)->get();\n return view('admin.createProductForm',['subCate' => $subCategory]);\n }", "protected function form()\n {\n $form = new Form(new Category());\n\n $parents = Category::where('parent_id', 0)->get()->toArray();\n $select_ = array_prepend($parents, ['id' => 0, 'name_cn' => '顶级']);\n $select_array = array_column($select_, 'name_cn', 'id');\n //创建select\n $form->select('parent_id', '上级')->options($select_array);\n\n $form->text('name_cn', __('Name cn'))->rules('required');\n $form->text('name_en', __('Name en'))->rules('required');\n $form->multipleImage('top_image', __('置顶图'))->sortable()->removable()->help('按数字大小正序长宽建议比列(178:174|177:87),请按照建议比例顺序上传图片');\n $form->image('image', __('Image'))->help('按数字大小正序长宽建议比列(710:295)');\n $form->text('description', __('Description'))->rules('required');\n $form->ueditor('content', __('Content'));\n $states = [\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n ];\n $form->switch('is_top', __('Is top'))->states($states)->default(0);\n $form->number('sort_order', __('Sort order'))->default(99);\n\n return $form;\n }", "public function init()\n {\n $this->addAttribs(array(\"class\" => \"form-horizontal\"))\n ->setDecorators(array(\n 'FormElements',\n 'Form'\n )); \n $this->addElement('hidden','idcategory'); \n \n $name = $this->createElement('text','name');\n $name->setLabel(\"Tên danh mục :\")\n ->setRequired()\n ->setAttrib(\"class\",\"large\")\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($name); \n \n $model = new Application_Model_DbTable_Categories();\n $result = $model->arrayChosen(); \n $groups_id = $this->createElement('select','parent_id');\n $groups_id->setLabel(\"Danh mục cha :\")\n ->setRequired()\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n ));\n $groups_id->addMultiOption(\"0\",\"None\"); \n foreach($result as $row){\n $groups_id->addMultiOption($row['key'],$row['value']);\n } \n $this->addElement($groups_id);\n \n $user_status = $this->createElement('Radio','status');\n $user_status->setLabel(\"Trạng thái :\")\n ->setMultiOptions(array(\"Khóa lại\",\"Hoạt động \"))\n ->setValue(1)\n ->addDecorators(array(\n array(\"Label\",array(\"tag\"=>\"div\",\"tagClass\"=>\"label-dt\")),\n array(\"HtmlTag\",array(\"tag\"=>\"div\", \"class\"=>\"input\" ))\n )); \n $this->addElement($user_status); \n \n $submit = $this->createElement(\"submit\",\"submit\");\n $submit->setLabel(\"Thêm\"); \n $this->addElement($submit); \n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function addNutrationCategory()\n {\n return view('admin.addnutratoncategory');\n }", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "protected function formShort()\n {\n $form = new Form(new Category);\n\n $form->tab('Настройки', function($form){\n $form->display('id');\n $form->alias('alias','Алиас');\n $form->text('name','Название');\n });\n $form->tab('SEO', function($form){\n $form->textarea('seo_title','seo title');\n $form->textarea('seo_desc','seo description');\n $form->textarea('seo_key','seo keywords');\n\n });\n return $form;\n }", "public function getFormCategory()\n\t{\n\t\treturn strtolower($this->_removeNonAlphaCharacters($this->category));\n\t}", "public function form()\n {\n \n return Admin::form(articleModel::class, function (Form $form) {\n $articlecats = articleCatModel::all()->toArray();\n $arr = array_pluck($articlecats, 'name', 'id');\n $form->select('cid','文章分类')->options($arr);\n $form->text('title','文章标题');\n// $form->textarea('content','文章内容');\n $form->editor('content','文章内容');\n $form->image('img','文章图片');\n $form->display('created_at', '创建时间');\n $form->display('updated_at', '更新时间');\n });\n }", "public function create()\n {\n return view('admin.categoria.create');\n }", "public function submitCrimeEntryForm(){\n $crimeCategories = db::table('crime_categories')->where('citizenView',\"Yes\")->get();\n return view('registeredCitizen.submitCrimeEntryForm',compact('crimeCategories'));\n }", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "public function create() \n\t{\n\t\n\t\t$this->data = (object) array();\n\t\t// Check for post data\n\t\t$this->form_validation->set_rules($this->_validation_rules);\n\t\t\n\t\t\n\t\t// if postback-validate\n\t\tif ($this->form_validation->run()) \n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$id = $this->categories_m->create($input);\n\t\t\t\n\t\t\tEvents::trigger('evt_category_created', $id );\n\t\t\t\n\t\t\t$this->session->set_flashdata('success', lang('success'));\n\t\t\tredirect('admin/shop/categories');\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tforeach ($this->_validation_rules as $key => $value) \n\t\t\t{\n\t\t\t\t$this->data->{$value['field']} = '';\n\t\t\t}\n\t\t}\n\n\t\t$this->data->parent_category_select \t= $this->categories_m->build_dropdown(array(\n\t\t\t'type'\t=> 'all'\n\t\t)); \n\n\n\t\t// prepare dropdown image folders\n\t\t$folders = $this->_prep_folders();\n\n\n\t\t// Build page\n\t\t$this->template\n\t\t\t->title($this->module_details['name'])\n\t\t\t->set('folders',$folders)\n\t\t\t->append_js('module::admin/categories.js')\t\n\t\t\t->append_js('module::admin/admin.js')\t\t\n\t\t\t->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n\t\t\t->build('admin/categories/form', $this->data);\n\t}", "public function build_forms()\n {\n // Get list of categories to populate the category selector\n $em = EntityManagerSingleton::getInstance();\n\n $category_options = [];\n $category_listings = $em->getRepository('Library\\Model\\Category\\Category')->findAllWithHierarchy();\n\n // Get list of categories that are theme categories so that they are are not included\n $criteria = new Criteria();\n $criteria->where($criteria->expr()->eq('id', Category::THEME_CATEGORY_ID))->orWhere($criteria->expr()->eq('parent_category', $em->getReference('Library\\Model\\Category\\Category', Category::THEME_CATEGORY_ID)));\n $theme_categories = $em->getRepository('Library\\Model\\Category\\Category')->matching($criteria);\n $all_theme_category_ids = [];\n if ($theme_categories->count() > 0)\n {\n /** @var Category $theme_category */\n foreach ($theme_categories as $theme_category)\n $all_theme_category_ids[] = $theme_category->getId();\n }\n\n if (!empty($category_listings))\n {\n foreach($category_listings as $listing)\n {\n // Don't include theme categories in the list\n if (in_array($listing['id'], $all_theme_category_ids))\n continue;\n\n // Construct listing name\n $listing_name = \"\";\n if (count($listing['ancestors']) > 0)\n {\n foreach ($listing['ancestors'] as $ancestor)\n {\n $listing_name .= $ancestor['name'] . \" >> \";\n }\n }\n\n $listing_name .= $listing['name'];\n $category_options[$listing['id']] = $listing_name;\n }\n }\n\n // Get list of statuses to list for products\n $this->status_options = [];\n $status_listings = $em->getRepository('Library\\Model\\Product\\Status')->findAll();\n $this->status_options[0] = \"None\";\n\n if (count($status_listings) > 0)\n {\n foreach ($status_listings as $staus_listing)\n {\n $this->status_options[$staus_listing->getId()] = $staus_listing->getName();\n }\n }\n\n // Get list of options for skus form\n $option_list = [];\n $options = $em->getRepository('Library\\Model\\Product\\Option')->findAll();\n if (!empty($options))\n {\n foreach ($options as $option)\n {\n $option_list[$option->getId()] = $option->getName();\n }\n }\n\n // Add content to forms\n $this->create_update_form->get('category')->setAttribute('options', $category_options);\n $this->create_update_form->get('status_override')->setAttribute('options', $this->status_options);\n $this->create_update_form->get('status')->setAttribute('options', $this->status_options);\n $this->add_skus_form->get('options')->setAttribute('options', $option_list);\n }", "public function create()\n {\n return view('admin.pages.category.add');\n }", "public function create()\n {\n return view('news.admin.categ.add');\n }", "protected function form()\n {\n $form = new Form(new GoodsModel);\n\n $form->select('cid', __('分类'))->options(CategoryModel::selectOptions());\n $form->text('goods_name', __('Goods name'));\n $form->image('goods_img', __('Goods img'));\n $form->textarea('content', __('Content'));\n $form->number('goods_pricing', __('Goods pricing'));\n $form->number('goods_price', __('Goods price'));\n\n return $form;\n }", "public function create()\n {\n return view('produit::pages.backoffice.categorie.create');\n }", "public function create()\n {\n //отвечает за открытие формы \"Создание категории\"\n return view('admin.categories.create', [\n 'category' => [],\n //колекция категорий (с вложенными)\n // with('children') - указывает метод в модели Категория\n // where - получаем только те категории, которые являются родителями\n 'categories' => Category::with('children')->where('parent_id', '0')->get(),\n // символ, обозначающий вложенность\n 'delimiter' => ''\n ]);\n\n }", "static public function ctrCrearCategoria(){\n\n\t\tif(isset($_POST[\"nuevaCategoria\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"nuevaCategoria\"])){\n\n\t\t\t\t$tabla=\"categorias\";\n\n\t\t\t\t$datos=$_POST[\"nuevaCategoria\"];\n\n\t\t\t\t$respuesta=ModelCategoria::mdlIngresarCategoria($tabla, $datos);\n\n\n\t\t\t\tif($respuesta==\"ok\"){\n\n\t\t\t\t\techo '<script> \n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t\t\ttitle:\"¡La categoria ha sido creada correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton:true,\n\t\t\t\t\t\t\tconfirmButtonText:\"cerrar\",\n\t\t\t\t\t\t\tclaseOnConfirm:false\n\t\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location=\"categorias\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t </script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\techo '<script> \n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\ttitle:\"¡La categoria no puede ir vacia o llevar caracteres especiales!\",\n\t\t\t\t\t\t\tshowConfirmButton:true,\n\t\t\t\t\t\t\tconfirmButtonText:\"cerrar\",\n\t\t\t\t\t\t\tclaseOnConfirm:false\n\t\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location=\"categorias\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t </script>';\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t}", "function getForumCategoryFormCfg() {\n return array(\n 'infoNotification' => __('NOTIFY_FORUM_IMAGE_SIZE'),\n 'items' => array(\n 'htmlForumCategoryImage' => '',\n 'nom' => array(\n 'label' => __('NAME'),\n 'type' => 'text',\n 'size' => 30,\n 'dataType' => 'text',\n 'required' => true\n ),\n 'image' => array(\n 'label' => __('IMAGE'),\n 'type' => 'text',\n 'size' => 42,\n 'uploadField' => 'uploadImage'\n ),\n 'uploadImage' => array(\n 'label' => __('UPLOAD_IMAGE'),\n 'type' => 'file',\n 'allowedExtension' => array('jpg', 'jpeg', 'png', 'gif'),\n 'uploadDir' => 'upload/Forum/cat'\n ),\n 'niveau' => array(\n 'label' => __('LEVEL'),\n 'type' => 'select',\n 'options' => array(\n 0 => 0,\n 1 => 1,\n 2 => 2,\n 3 => 3,\n 4 => 4,\n 5 => 5,\n 6 => 6,\n 7 => 7,\n 8 => 8,\n 9 => 9\n )\n ),\n 'ordre' => array(\n 'label' => __('ORDER'),\n 'type' => 'text',\n 'value' => '0',\n 'size' => 2,\n 'dataType' => 'integer',\n 'required' => true\n )\n ),\n 'itemsFooter' => array(\n 'submit' => array(\n 'type' => 'submit',\n 'value' => array('CREATE_CATEGORY', 'MODIFY_THIS_CATEGORY'),\n 'inputClass' => array('button')\n )\n )\n );\n}", "public function create()\n {\n return view(\"almacen.categoria.create\");\n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function create()\n {\n return view('pages.Admin.parametrizacao.categoria.create');\n }", "protected function form()\n {\n\n $form = new Form(new Goods);\n\n //分类树形\n $cateTree = getTree(Category::all()->where('is_show',1)->toArray());\n $cate_map = [];\n foreach ($cateTree as $key => $value) {\n $cate_map[$value['id']] = str_repeat('&#12288;&#12288;',$value['level']).$value['title'];\n }\n\n $form->display('id', 'ID');\n $form->select('cate_id', '分类')->rules('required')->options($cate_map);\n $form->text('name', '商品')->rules('required')->attribute(['autocomplete' => 'off']);\n $form->textarea('remark', '备注');\n $states = [\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n ];\n $form->switch('is_valid',trans('admin.is_show'))->states($states)->default(1);\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n $form->hidden('operated_admin_id')->value(Admin::user()->id);\n $form->hidden('hos_id')->value(session('hos_id'));\n\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n return $form;\n }", "protected function form($isEditing = false)\n {\n $form = new Form(new Category());\n\n $form->text('name', '分类名称')->rules('required');\n // 新增还是修改\n if ($isEditing) {\n $form->display('is_directory', '是否目录')->with(function ($val) {\n return $val ? '是' : '否';\n });\n $form->display('parent.name', '父目录');\n } else {\n $form->radio('is_directory', '是否目录')\n ->options(['1' => '是', '0' => '否'])\n ->default('0')->rules('required');\n $form->select('parent_id', '父目录')\n ->ajax('/admin/api/categories');\n }\n\n return $form;\n }", "public function create()\n {\n return view('admin.categoria.create');\n }", "protected function form()\n {\n $categories = Category::get()->pluck('name', 'id')->toArray();\n\n $form = new Form(new Plan);\n\n $form->select(Plan::CATEGORY_ID, 'Категория')\n ->options($categories)\n ->default(request()->input(Plan::CATEGORY_ID))\n ->required();\n\n $form->text(Plan::COUNT, __('Количество'))->required();\n $form->month('month', __('Месяц'))->default(now()->month)->required();\n $form->year('year', __('Год'))->default(now()->year)->required();\n\n $form->footer(function ($footer) {\n\n // disable `View` checkbox\n $footer->disableViewCheck();\n\n // disable `Continue editing` checkbox\n $footer->disableEditingCheck();\n\n // disable `Continue Creating` checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }", "public function create()\n {\n $form = \\FormBuilder::create( 'App\\Forms\\Admin\\CategoryForm', [ 'method' => 'POST', 'url' => route( 'admin.categories.store' ) ] );\n\n return view( 'admin.categories.create', compact( 'form' ) );\n }", "public function create()\n\t{\n\t\t//\n\t\t\n\t\treturn view('categoria.add-categoria');\n\n\t}", "public function create()\n {\n return view('admin.categories.create');\n }", "public function manageCategory()\n {\n $categories = Category::where('parent_category_id', '=', 0)->get();\n $allCategories = Category::pluck('name','id')->all();\n return view('category.add',compact('categories','allCategories'));\n }", "public function create()\n {\n return view(\"admin.contractor_categories.create\");\n }", "public function getAddEditForm($target = '/admin/Cart') {\n\t\t$form = new Form('CartCategory_addedit', 'post', $target);\n\t\t\n\t\t$form->setConstants( array ( 'section' => 'categories' ) );\n\t\t$form->addElement( 'hidden', 'section' );\n\t\t$form->setConstants( array ( 'action' => 'addedit' ) );\n\t\t$form->addElement( 'hidden', 'action' );\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$form->setConstants( array ( 'cartcategory_categories_id' => $this->getId() ) );\n\t\t\t$form->addElement( 'hidden', 'cartcategory_categories_id' );\n\t\t\t\n\t\t\t$defaultValues ['cartcategory_name'] = $this->getName();\n\t\t\t$defaultValues ['cartcategory_description'] = $this->getDescription();\n\t\t\t$defaultValues ['cartcategory_image'] = $this->getImage();\n\t\t\t$defaultValues ['cartcategory_parent_id'] = $this->getParent_id();\n\t\t\t$defaultValues ['cartcategory_date_added'] = $this->getDate_added();\n\t\t\t$defaultValues ['cartcategory_last_modified'] = $this->getLast_modified();\n\t\t\t$defaultValues ['cartcategory_status'] = $this->getStatus();\n\n\t\t\t$form->setDefaults( $defaultValues );\n\t\t}\n\t\t\n\t\t$form->addElement('text', 'cartcategory_name', 'Name');\n\t\t\n\t\t$description = $form->addElement('textarea', 'cartcategory_description', 'Description');\n\t\t$description->setCols(80);\n\t\t$description->setRows(10);\n\t\t\n\t\t$newImage = $form->addElement('file', 'cartcategory_image_upload', 'Category Image');\n\t\t$curImage = $form->addElement('dbimage', 'cartcategory_image', $this->getImage());\n\t\t\n\t\t$form->addElement('select', 'cartcategory_parent_id', 'Parent Category', self::toArray());\n\t\t\n\t\t$added = $form->addElement('text', 'cartcategory_date_added', 'Date Added');\n\t\t$added->freeze();\n\t\t\n\t\t$modified = $form->addElement('text', 'cartcategory_last_modified', 'Date Last Modified');\n\t\t$modified->freeze();\n\t\t\n\t\t$form->addElement('select', 'cartcategory_status', 'Status', Form::statusArray());\n\t\t$form->addElement('submit', 'cartcategory_submit', 'Submit');\n\n\t\tif (isset($_REQUEST['cartcategory_submit']) && $form->validate() && $form->isSubmitted()) {\n\t\t\t$this->setName($form->exportValue('cartcategory_name'));\n\t\t\t$this->setDescription($form->exportValue('cartcategory_description'));\n\t\t\t$this->setImage($form->exportValue('cartcategory_image'));\n\t\t\t$this->setParent_id($form->exportValue('cartcategory_parent_id'));\n\t\t\t$this->setDate_added($form->exportValue('cartcategory_date_added'));\n\t\t\t$this->setLast_modified($form->exportValue('cartcategory_last_modified'));\n\t\t\t$this->setStatus($form->exportValue('cartcategory_status'));\n\t\t\t\n\t\t\tif ($newImage->isUploadedFile()) {\n\t\t\t\t$im = new Image();\n\t\t\t\t$id = $im->insert($newImage->getValue());\n\t\t\t\t$this->setImage($im);\n\t\t\t\t\n\t\t\t\t$curImage->setSource($this->getImage()->getId());\n\t\t\t}\n\t\t\t\n\t\t\t$this->save();\n\t\t}\n\n\t\treturn $form;\n\t\t\n\t}", "public function create() {\n return view('admin.categorias.create');\n }", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "public function create()\n {\n //si da problemas puedes intentar cambiar las comillas simples por dobles\n return view('almacen.categoria.create');\n }", "public function create()\n {\n $this->data['method'] = method_field('POST');\n $this->data['mst_ad_categories'] = MstAdCategories_m::get();\n $this->data['mst_ads'] = MstAds_m::whereIn('mst_ad_slug', ['iklan-umum', 'iklan-khusus'])->get();\n if(isset($_GET['code']))\n {\n $this->data['rlt_ad_category'] = $this->rlt_ads_categories_m::where(RltAdsCategories_m::getPrimaryKey(), decrypt($_GET['code']))->first();\n $this->data['method'] = method_field('PUT');\n $this->authorize('update-master-ads', $this->data['rlt_ad_category']);\n }\n\n return view('ads::admin.'.$this->data['theme_cms']->value.'.content.RltAdsCategories.form', $this->data);\n }", "public function create()\n {\n return view(config('app.theme').'.admin.category.create');\n }", "public function create()\n\t{\n return View::make('admin.categories.create');\n\t}", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "public function create()\n {\n return view('admin/add_category');\n }", "public function create()\n {\n return view(\"dashboard.pages.supervisor.category.add\");\n \n }", "public function getCategoryFormElements($category) {\n //TYPE\n //DEFAULT ELEMENTS\n //Category ELEMENTS\n \n }", "public function create()\n {\n return \\view(\"pages.admin.category.create\");\n }", "public function prepareForm()\n {\n $categories = DB::select('SELECT * FROM category');\n $hkDistricts = DB::select('SELECT * FROM district WHERE region = \"HK\"');\n $knDistricts = DB::select('SELECT * FROM district WHERE region = \"KN\"');\n $ntDistricts = DB::select('SELECT * FROM district WHERE region = \"NT\"');\n\n return view('coachApply' ,\n [\n 'categories' => $categories,\n 'hkDistricts' => $hkDistricts,\n 'knDistricts' => $knDistricts,\n 'ntDistricts' => $ntDistricts\n ]);\n }", "public function create()\n {\n return view('tienda.admin.categorias.create');\n\n }", "public function get_category_form_by_ajax() {\n $category_count = $_POST['id'];\n $data['category_id'] = $category_count;\n $data['category_branch_location'] = $this->get_branch_location();\n $data['get_printer'] = $this->get_printer();\n $this->load->view('restaurant/category/insert_category_form', $data);\n }", "protected function _prepareForm()\r\n {\r\n \t/* @var $model Lanot_EasyBanner_Model_Category */\r\n $model = $this->_getHelper()->getCategoryItemInstance();\r\n\r\n /**\r\n * Checking if user have permissions to save information\r\n */\r\n if (Mage::helper('lanot_easybanner/admin')->isActionAllowed('manage_category/save')) {\r\n $isElementDisabled = false;\r\n } else {\r\n $isElementDisabled = true;\r\n }\r\n\r\n $form = new Varien_Data_Form();\r\n\r\n $form->setHtmlIdPrefix('category_main_');\r\n\r\n $fieldset = $form->addFieldset('base_fieldset', array(\r\n 'legend' => $this->_getHelper()->__('Category Item Info')\r\n ));\r\n\r\n if ($model->getId()) {\r\n $fieldset->addField('category_id', 'hidden', array(\r\n 'name' => 'id',\r\n ));\r\n }\r\n\r\n //Add main elements to the category\r\n $fieldset->addField('title', 'text', array(\r\n 'name' => 'title',\r\n 'label' => $this->_getHelper()->__('Title'),\r\n 'title' => $this->_getHelper()->__('Title'),\r\n 'required' => true,\r\n 'disabled' => $isElementDisabled\r\n ));\r\n\r\n $fieldset->addField('description', 'textarea', array(\r\n \t'name' => 'description',\r\n \t'label' => $this->_getHelper()->__('Description'),\r\n \t'title' => $this->_getHelper()->__('Description'),\r\n \t'required' => false,\r\n \t'disabled' => $isElementDisabled,\r\n \t'style' => 'height: 100px',\t\r\n ));\r\n \r\n $fieldset->addField('is_active', 'select', array(\r\n \t'name' => 'is_active',\r\n \t'label' => $this->_getHelper()->__('Is Active'),\r\n \t'title' => $this->_getHelper()->__('Is Active'),\r\n \t'required' => true,\r\n \t'disabled' => $isElementDisabled,\r\n \t'options' => $model->getAvailableStatuses(),\r\n ));\r\n\r\n /*\r\n //Add layout updates elements to the category\r\n $lBlock = $this->getLayout()->createBlock('lanot_easybanner/adminhtml_widget_instance_edit_tab_main_layout');\r\n $fieldset = $form->addFieldset('layout_updates_fieldset', array(\r\n 'legend' => $this->_getHelper()->__('Layout Updates')\r\n ));\r\n\r\n $fieldset->addField('layout_updates', 'note', array());\r\n $form->getElement('layout_updates_fieldset')->setRenderer($lBlock);\r\n */\r\n\r\n $form->setValues($model->getData());\r\n \r\n Mage::dispatchEvent('adminhtml_easybanner_category_edit_tab_main_prepare_form', array('form' => $form));\r\n\r\n $this->setForm($form);\r\n\r\n return parent::_prepareForm();\r\n }", "public function renderManageCategories()\n\t{\n\t\t// Check access\n\t\tif (! $this->user->isInRole('admin'))\n\t\t{\n\t\t\tthrow new ForbiddenRequestException('Nemáte oprávnění');\n\t\t}\n\t\t$database = $this->context->database;\n\t\t$this->template->categories = $database->table(\"WritingCategories\");\n\t}", "public function executeNew(sfWebRequest $request)\n {\n $this->form = new ForumCategoriesForm();\n }", "public function create() {\n return view( 'admin.create', [ 'class' => 'category' ] );\n }", "function lib4ridora_citation_subtype_form_options() {\n module_load_include('inc', 'xml_form_builder', 'includes/associations');\n $forms = array();\n foreach (xml_form_builder_get_associations(array(), array(), array('MODS')) as $id => $association) {\n $forms[$association['form_name']] = $association['form_name'];\n }\n return $forms;\n}", "public function create()\n {\n return view('category.add_edit');\n }", "public function create()\n {\n return view(\"categorie.create\");\n }", "function form($instance)\n {\n $instance = wp_parse_args((array)$instance, $defaults); ?>\n <!-- Category -->\n <p>\n <label for=\"<?php echo $this->get_field_id('categories'); ?>\">Select Category:</label>\n <select id=\"<?php echo $this->get_field_id('categories'); ?>\"\n name=\"<?php echo $this->get_field_name('categories'); ?>\" style=\"width:100%;\">\n <?php $categories = get_categories('hide_empty=0&depth=1&type=post'); ?>\n <?php foreach ($categories as $category) { ?>\n <option value='<?php echo $category->term_id; ?>' <?php if ($category->term_id == $instance['categories']) echo 'selected=\"selected\"'; ?>><?php echo $category->cat_name; ?></option>\n <?php } ?>\n </select>\n </p>\n <?php\n }", "protected function form()\n {\n return Admin::form(ExpertRecom::class, function (Form $form) {\n\n $form->display('expid', '讲师ID');\n $form->display('expert.real_name', '讲师名');\n $form->display('expert.wx_img_url','头像')->with(function ($url) {\n return $url ? \"<img width='80px' src='$url' />\" : '';\n });\n $form->display('expert.price_ask', '提问金额');\n $form->textarea('desc', '简介')->rows(5)->rules('required');\n $form->text('weight', '排序权值')->rules('required|numeric');\n\n });\n }", "public function create(){\n return view('admin.categories.create');\n }", "public function create() {\n\t\treturn view('categoria.create');\n\t}", "public function create()\n { \n return view('admin.category.create');\n }", "public function create()\r\n {\r\n $categories=$this->permission_repository->getTreeData();\r\n return view('admin.role.form',compact('categories'));\r\n }", "public function create()\n {\n return view (\"admin.category.create\");\n }", "public function create()\n {\n return view('adminlte::categories.create');\n }", "public function newcategory() {\n\n if (ckeckAddmin()) {\n $this->load->view('admin/header/header');\n $this->load->view('admin/css/css');\n $this->load->view('admin/topnav/topnav');\n $this->load->view('admin/sidenav/sidenav');\n $this->load->view('admin/content/addcatogry');\n $this->load->view('admin/footer/footer');\n # $this->load->view('admin/js/extra');\n $this->load->view('admin/js/js');\n } else {\n CustomFlash('Admin/login', 'alert-danger', 'plz First Login');\n }\n }" ]
[ "0.7271398", "0.69954646", "0.69121104", "0.6819063", "0.6757278", "0.6731332", "0.67038345", "0.66973805", "0.66855335", "0.66353893", "0.65785646", "0.65640277", "0.6458903", "0.6446483", "0.64325154", "0.6408677", "0.6406369", "0.6388703", "0.63806856", "0.63789576", "0.6249687", "0.6249669", "0.6249358", "0.6223017", "0.61969465", "0.61855555", "0.6182378", "0.6173408", "0.6164558", "0.61562276", "0.6133868", "0.6128521", "0.6109228", "0.6106825", "0.6096609", "0.60838324", "0.60719085", "0.60472494", "0.6036649", "0.6035371", "0.601586", "0.600169", "0.59984076", "0.5982621", "0.59710675", "0.59600806", "0.5951131", "0.5948186", "0.5947516", "0.5941922", "0.5927663", "0.5925036", "0.5917569", "0.5916818", "0.5910821", "0.5908451", "0.5903077", "0.5886789", "0.5886232", "0.5882774", "0.58756304", "0.5869686", "0.58649075", "0.5864822", "0.5857163", "0.5854879", "0.58520365", "0.58483505", "0.5843359", "0.584251", "0.5839022", "0.58349377", "0.58313", "0.58292156", "0.58283234", "0.58242476", "0.58167547", "0.58160084", "0.58155197", "0.581218", "0.5811296", "0.581034", "0.5807088", "0.5804925", "0.5795454", "0.579508", "0.579424", "0.57941914", "0.57920843", "0.5790013", "0.57899195", "0.57884914", "0.5786006", "0.5784826", "0.57816046", "0.5780138", "0.5780086", "0.57771164", "0.57761353", "0.5776" ]
0.63338053
20
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n $this->booklist();\n }", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236", "0.68033123", "0.6797587", "0.6795274", "0.67868614", "0.67610204", "0.67426085", "0.67303514", "0.6727031", "0.67257243", "0.67257243", "0.67257243", "0.67195046", "0.67067856", "0.67063624", "0.67045796", "0.66655326", "0.666383", "0.66611767", "0.66604036", "0.66582054", "0.6654805", "0.6649084", "0.6620993", "0.66197145", "0.6616024", "0.66077465", "0.6602853", "0.6601494", "0.6593894", "0.65878326", "0.6586189", "0.6584675", "0.65813804", "0.65766823", "0.65754175", "0.657203", "0.657202", "0.65713936", "0.65642136", "0.6563951", "0.6553249", "0.6552584", "0.6546312", "0.6536654", "0.6534106", "0.6532539", "0.6527516", "0.6526785", "0.6526042", "0.65191233", "0.6518727", "0.6517732", "0.6517689", "0.65155584", "0.6507816", "0.65048593", "0.6503226", "0.6495243", "0.6492096", "0.6486592", "0.64862204", "0.6485348", "0.6483991", "0.64789015", "0.6478804", "0.64708763", "0.6470304", "0.64699143", "0.6467142", "0.646402", "0.6463102", "0.6460929", "0.6458856", "0.6454334", "0.6453653", "0.645357", "0.6450551", "0.64498454", "0.64480853", "0.64453584" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $request->validate([ 'comment'=>'required', ]); $eventStarter = EventStarter::find($request->event_starter_id); //dd($request->user_id); $comment = new Comment([ 'user_id' => $request->user_id, 'event_starter_id'=> $eventStarter->id, 'parent_id'=> $request->parent_id, 'comment'=> $request->comment, ]); $comment->save(); if(Auth::guest()){ return Redirect::guest("login")->withSuccess('You have to login first'); } return back(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.7285922", "0.714503", "0.71324795", "0.6639801", "0.6620405", "0.6568167", "0.65257645", "0.650948", "0.64484984", "0.6375281", "0.6373189", "0.63650924", "0.63650924", "0.63650924", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731", "0.6341731" ]
0.0
-1
Display the specified resource.
public function show(Comment $comment) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Comment $comment) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", "0.68129057", "0.68083996", "0.68082106", "0.6803853", "0.67966306", "0.6794222", "0.6794222", "0.6789979", "0.67861426", "0.678112", "0.677748", "0.67702436", "0.67625374", "0.6748088", "0.67475355", "0.67475355", "0.67446774", "0.6742005", "0.67374676", "0.6727497", "0.6714345", "0.6696231", "0.6693851", "0.6689907", "0.6689746", "0.6687102", "0.66870165", "0.6684574", "0.6670877", "0.66705006", "0.6667089", "0.6667089", "0.6663205", "0.66626745", "0.66603845", "0.66593564", "0.66560745", "0.66545844", "0.66447026", "0.6633528", "0.66319114", "0.66298395", "0.66298395", "0.6622365", "0.6621021", "0.66170275", "0.661664", "0.6612467", "0.66107714", "0.6608453", "0.65979743", "0.659645", "0.6596389", "0.6592672", "0.6591205", "0.6588125", "0.6582166", "0.6581656", "0.65811247", "0.65785724", "0.65782833", "0.6576397", "0.6570971", "0.6569483", "0.6568432", "0.656811", "0.6563493", "0.6563493", "0.65622604", "0.65602434", "0.65585065", "0.6557997", "0.65574414", "0.6556701", "0.65565753", "0.6556226", "0.6556107", "0.6549118", "0.65485924", "0.65463555" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Comment $comment) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Comment $comment) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
This only exists for backwardscompatibiliy with DBAL 2.4
protected function throwInvalidArgumentException($message) { if (class_exists('Doctrine\DBAL\Exception\InvalidArgumentException')) { throw new InvalidArgumentException($message); } else { throw new DBALException($message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function nativeDbType(array $type);", "protected function isDbalEnabled() {}", "protected function isDbalEnabled() {}", "protected function isDbalEnabled() {}", "protected function isDbalEnabled() {}", "abstract protected function _getSQL(): String;", "public function ormObject();", "function augmentDatabase() {\r\n\t}", "private function setUpAndReturnDatabaseStub() {}", "abstract protected function fetchRowAssocDb();", "function oci_fetch_object($statement)\n{\n}", "public function getDbalConnection();", "protected function getSupportedDbalDrivers() {}", "function so_sql()\n\t{\n\t\tthrow new egw_exception_assertion_failed('use __construct()!');\n\t}", "abstract function getSQL();", "public function getFromDB() {}", "public abstract function getDbTable();", "public static function primaryKey()\n {\n\n\n\n throw new NotSupportedException(__METHOD__ . ' you need to override this method');\n }", "function yy_r142(){ $this->_retvalue = 'primaryKey'; }", "function __construct()\n\t{\n\t\t$this->connection = Application::getDatabaseConnection();\n\t\t$this->connection->SetFetchMode(2);\n\t}", "protected function initDatabaseRecord() {}", "public function getDbAdapter();", "protected function getIncompatibleSqlModes() {}", "protected function _setupDatabaseAdapter()\n {\n $zl = Zend_Registry::get('Zend_Locale');\n $this->_db = Zend_Registry::get('db4');\n\n parent::_setupDatabaseAdapter();\n }", "abstract protected function getDatabaseConnectionParameters();", "protected abstract function getSelectStatement();", "protected abstract function getSelectStatement();", "function testDBSelectCorrect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select variable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}", "protected function getSelectedDbalDriver() {}", "function db_driver_error()\n{\n global $_db;\n\n return pg_result_error($_db['resource'][$_db['target']]['dbh']);\n}", "function oci_fetch_assoc($statement)\n{\n}", "function yy_r30(){ $this->_retvalue = new SQL\\AlterTable\\DropPrimaryKey; }", "public function testPdoStatementClass() {\n if (PHP_VERSION_ID >= 80000) {\n $this->markTestSkipped('Drupal\\Core\\Database\\Statement is incompatible with PHP 8.0. Remove in https://www.drupal.org/node/3177490');\n }\n $this->expectDeprecation('\\Drupal\\Core\\Database\\Connection::$statementClass is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should use or extend StatementWrapper instead, and encapsulate client-level statement objects. See https://www.drupal.org/node/3177488');\n $mock_pdo = $this->createMock(StubPDO::class);\n new StubConnection($mock_pdo, ['namespace' => 'Drupal\\\\Tests\\\\Core\\\\Database\\\\Stub\\\\Driver'], ['\"', '\"'], Statement::class);\n }", "abstract public function primaryKey(): string;", "public function key()\n {\n throw new PDOException('key() method is not implemented for Oci8PDO_Statement');\n }", "function db_driver_result($resource)\n{\n global $_db;\n\n $results = array();\n while ($data = pg_fetch_array($resource, null, PGSQL_ASSOC)) {\n $results[] = $data;\n }\n\n return $results;\n}", "function pg_select($connection, string $table_name, array $assoc_array, int $options = PGSQL_DML_EXEC, int $result_type = PGSQL_ASSOC)\n{\n error_clear_last();\n $result = \\pg_select($connection, $table_name, $assoc_array, $options, $result_type);\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n return $result;\n}", "function db_driver_query($query)\n{\n global $_db;\n\n return pg_query($_db['resource'][$_db['target']]['dbh'], $query);\n}", "public function dbInstance();", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected abstract function getSqlStatement();", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "protected function getDatabaseConnection() {}", "function yy_r17(){ $this->_retvalue = new SQL\\BeginTransaction; }", "protected function prepareSelectStatement() {}", "public function initialize()\n {\n // Intentionally blank as this will be overloaded by DBAL\n }", "function yy_r18(){ $this->_retvalue = new SQL\\BeginTransaction($this->yystack[$this->yyidx + 0]->minor); }", "public function testStatementDeprecation() {\n if (PHP_VERSION_ID >= 80000) {\n $this->markTestSkipped('Drupal\\Core\\Database\\Statement is incompatible with PHP 8.0. Remove in https://www.drupal.org/node/3177490');\n }\n $this->expectDeprecation('\\Drupal\\Core\\Database\\Statement is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Database drivers should use or extend StatementWrapper instead, and encapsulate client-level statement objects. See https://www.drupal.org/node/3177488');\n $mock_statement = $this->getMockBuilder(Statement::class)\n ->disableOriginalConstructor()\n ->getMock();\n }", "public function dynamoDbType(): string\n {\n return 'S';\n }", "function yy_r19(){ $this->_retvalue = new SQL\\CommitTransaction; }", "public function delegateTransactionalDdlSupport(array &$connection_options = []);", "protected abstract function getErrornousPersistenceAdapter();", "protected function getDatabase() {}", "public static function hrTagCorrectlyTransformedOnWayToDataBaseDataProvider() {}", "function testDBSelect() {\r\n\t$db = MetadataDB::getInstance();\r\n\t// error in sql...\r\n\t$sql = 'select varable from metadata';\r\n\t$result = $db->select($sql);\r\n\tif (!$result) {\r\n\t} else {\r\n\t\t//print 'All OK!';\r\n\t}\r\n}", "abstract public function prepareSelect();", "function maxdb_fetch_object($result)\n{\n}", "abstract protected function getSql($builder);", "protected static function afterGetFromDB(&$row){}", "function setupDb(&$mdb2)\n{\n // loading the Manager module\n $mdb2->loadModule('Manager');\n $tableDefinition = array (\n 'id' => array (\n 'type' => 'integer',\n 'unsigned' => 1,\n 'notnull' => 1,\n 'default' => 0,\n ),\n 'name' => array (\n 'type' => 'text',\n 'length' => 300,\n 'notnull' => 1\n ),\n 'type' => array (\n 'type' => 'text',\n 'length' => 300,\n 'notnull' => 1\n ),\n 'lifespan' => array (\n 'type' => 'integer',\n 'unsigned' => 1,\n 'notnull' => 1,\n 'default' => 0,\n ),\n );\n \n $tableConstraints = array (\n 'primary' => true,\n 'fields' => array (\n 'id' => array()\n )\n );\n $mdb2->dropTable('tbl_animals');\n $mdb2->createTable('tbl_animals', $tableDefinition);\n $mdb2->createConstraint('tbl_animals', 'primary_key', $tableConstraints);\n $mdb2->createSequence('primary_key');\n \n}", "public function fetchSqlString();", "abstract public function getStatement(array $row): Transaction;", "abstract protected function fetchTableDefDb(string $table);", "function yy_r21(){ $this->_retvalue = new SQL\\RollbackTransaction; }", "abstract protected function fetchTableNamesDb();", "protected function _createColumnQuery()\n\t{\n\t\n\t}", "abstract protected function buildSQL(): string;", "function yy_r20(){ $this->_retvalue = new SQL\\CommitTransaction($this->yystack[$this->yyidx + 0]->minor); }" ]
[ "0.5989523", "0.59084326", "0.59073323", "0.59073323", "0.59073323", "0.56714606", "0.5535435", "0.5420769", "0.53785443", "0.53582126", "0.53561544", "0.53288215", "0.5324187", "0.5309221", "0.53019524", "0.527904", "0.52708215", "0.5226666", "0.5219393", "0.52001756", "0.5171113", "0.5163379", "0.51347554", "0.5130888", "0.511877", "0.51042366", "0.51042366", "0.509932", "0.50864285", "0.50848913", "0.50808305", "0.50805837", "0.5074546", "0.50664204", "0.5065925", "0.5035306", "0.5034124", "0.50171036", "0.5013205", "0.5012837", "0.5012837", "0.5012837", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50124925", "0.50121725", "0.5010431", "0.5010431", "0.5010431", "0.5010431", "0.5010431", "0.5010431", "0.5010431", "0.5010431", "0.5010431", "0.5010431", "0.5010431", "0.5010431", "0.5010196", "0.5010196", "0.50080854", "0.4993048", "0.49851817", "0.4977273", "0.49759364", "0.49700543", "0.4966625", "0.49660435", "0.4955555", "0.49533203", "0.49455905", "0.49424276", "0.4941064", "0.4933731", "0.49241674", "0.49211812", "0.49210134", "0.49191418", "0.49142247", "0.49049294", "0.4901956", "0.4893496", "0.4887658", "0.48828956", "0.48496556" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function controller(array $params): void\n {\n if (!isset($params['name'])) {\n Console::fatal('Missing name parameter.');\n }\n\n $entityName = studly_case($params['name']);\n $options = [\n 'entityName' => $entityName,\n 'className' => 'App\\\\Controller\\\\' . str_plural($entityName) . 'Controller',\n 'fileKind' => 'controller',\n 'replace' => [\n 'tags' => ['{entityName}', '{controllerName}'],\n 'values' => [$entityName, str_plural($entityName)],\n ],\n 'filePath' => 'Controller/' . str_plural($entityName) . 'Controller.php',\n ];\n\n $this->createFile($options);\n }" ]
[ "0.82679385", "0.81739837", "0.7811711", "0.7706132", "0.76824135", "0.76599807", "0.7486886", "0.7407581", "0.72973657", "0.72537446", "0.71976084", "0.7175448", "0.70148426", "0.6989921", "0.698332", "0.69719964", "0.6963479", "0.69347966", "0.6898294", "0.68923163", "0.68766165", "0.6870487", "0.6863028", "0.6839216", "0.6780402", "0.6704657", "0.6670529", "0.6662537", "0.6652341", "0.6645224", "0.6616762", "0.6615776", "0.6587971", "0.64491856", "0.64456904", "0.64298046", "0.6427206", "0.6303513", "0.62986237", "0.6293529", "0.62816995", "0.626091", "0.62548393", "0.6170004", "0.61632925", "0.61594075", "0.6142092", "0.6137889", "0.6134217", "0.61322975", "0.61300254", "0.61109394", "0.6095679", "0.6089122", "0.60764354", "0.6065879", "0.6060519", "0.60574526", "0.60453564", "0.6030476", "0.6024937", "0.60245734", "0.601992", "0.6013322", "0.60132945", "0.6011444", "0.6010348", "0.6003902", "0.59994984", "0.5998256", "0.5995091", "0.59874576", "0.59874576", "0.59874576", "0.5969236", "0.5952697", "0.59487635", "0.59418136", "0.592625", "0.59155315", "0.5914119", "0.5913534", "0.59123963", "0.5910155", "0.5904157", "0.59010935", "0.5899018", "0.5896666", "0.58957773", "0.5893092", "0.58897334", "0.5877193", "0.5870557", "0.5865181", "0.58613557", "0.5851115", "0.5839423", "0.5834002", "0.58249503", "0.5816664", "0.5812349" ]
0.0
-1
Delete the given page.
public function __invoke(Page $page): void { $this->authorize('delete', $page); $page->delete(); abort(Response::HTTP_NO_CONTENT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destroy(Page $page)\n {\n $page->delete();\n\n }", "public function deletePage() {\n\t\t\n\t\t$output = array();\n\t\t$url = Request::post('url');\n\t\t$title = Request::post('title');\n\n\t\t// Validate $_POST.\n\t\tif ($url && ($Page = $this->Automad->getPage($url)) && $url != '/' && $title) {\n\n\t\t\t// Check if the page's directory and parent directory are wirtable.\n\t\t\tif (is_writable(dirname($this->getPageFilePath($Page))) && is_writable(dirname(dirname($this->getPageFilePath($Page))))) {\n\n\t\t\t\tFileSystem::movePageDir($Page->path, '..' . AM_DIR_TRASH . dirname($Page->path), $this->extractPrefixFromPath($Page->path), $title);\n\t\t\t\t$output['redirect'] = '?context=edit_page&url=' . urlencode($Page->parentUrl);\n\t\t\t\tCore\\Debug::log($Page->url, 'deleted');\n\n\t\t\t\t$this->clearCache();\n\n\t\t\t} else {\n\t\t\n\t\t\t\t$output['error'] = Text::get('error_permission') . '<p>' . dirname(dirname($this->getPageFilePath($Page))) . '</p>';\n\t\t\n\t\t\t}\n\t\n\t\t} else {\n\t\t\t\n\t\t\t$output['error'] = Text::get('error_page_not_found');\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "public function destroy(Page $page)\n {\n $page->delete();\n return redirect()->route('admin.pages.index');\n }", "public function pageDelete($page_id) {\n\t\t// Build the MindTouch API URL to delete the page.\n\t\t$url = $this->pageUrl($page_id);\n\n\t\t// Get output from API.\n\t\t$output = $this->delete($url);\n\n\t\t// Parse the output.\n\t\t$output = $this->parseOutput($output);\n\n\t\treturn $output;\n\t}", "public function sitePageDeleteAction ()\n {\n\t\t$Page = Tg_Site::getInstance ()->getPageById($this->_getParam ('id'));\n\t\tif (!$Page)\n\t\t\tthrow new Exception (\"Page not found\");\n\t\t\t\n\t\tif ($Page->locked)\n\t\t\tthrow new Exception (\"Page is locked\");\n\t\t\n \t$Page->delete();\n \t\n\t\techo '{\"success\":true,\"msg\":\"Delete successful\"}';\n\t\tdie;\n }", "public function destroy(Page $page)\n {\n //\n }", "public function destroy(Page $page)\n {\n //\n }", "public function destroy(Page $page)\n {\n $page->delete();\n return redirect()->route('pages.index')->withSuccess('Страница удалена');\n }", "public function destroy(Page $page)\n {\n //\n // $this->authorize('delete', Page::class);\n // $page->delete();\n // return redirect('/page');\n return response(['message'=>'Deleted']);\n // \n }", "public function deleteAction(Request $request, Page $page)\n {\n $form = $this->createDeleteForm($page);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->remove($page);\n $em->flush();\n }\n\n return $this->redirectToRoute('page_index');\n }", "public function destroy(Page $page)\n {\n if ($page->image != 'default.png') {\n delete_image('page_images',$page->image);\n } \n\n $page->delete();\n\n session()->flash('success', __('site.deleted_successfully'));\n\n return redirect()->route('dashboard.pages.index');\n }", "public function destroy(Page $page)\n\t{\n\t\t$delete = $page->delete();\n\t\tif (!$delete) {\n\t\t\treturn back()->with('error', 'Your page can not delete from your system right now. Plz try again later.');\n\t\t}\n\t\treturn redirect()->route($this->route . 'index')->with('success', 'Page deleted successfully');\n\t}", "public function destroy(Page $page)\n {\n checkreturn($page->delete(),\"删除\");\n\n if($page->type==2){\n return redirect(route('admin.page.index'));\n }else{\n return redirect(route('admin.page.licheng'));\n }\n }", "public function deletePage(page $page) {\r\n\tforeach ($this->pages as $idPage => $thepage) {\r\n\t if ($idPage == $page->getId()) {\r\n\t\tunset($this->pages[$idPage]);\r\n\t\treturn unlink(PROFILE_PATH . $this->name . '/pages/' . $page->getId() . '.' . \\app::$config['dev']['serialization']);\r\n\t }\r\n\t}\r\n\treturn FALSE;\r\n }", "function delete($page_id)\n\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$this->db->where( 'pageid', $page_id);\n\t\n\t\t\t\t\t$this->db->delete('oxm_pagedetails');\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t }", "public function destroy(Page $page)\n {\n $page->delete();\n return LanguageService::getTranslate(\"PageDeletedSuccessfully\");\n }", "public function destroy(Page $page)\n {\n \n $page->delete();\n //--- Redirect Section \n alert()->success('Contents Deleted successfully.', 'Deleted');\n return redirect()->route('admin.pages.index'); \n //--- Redirect Section Ends \n }", "public function destroy(Page $page)\n {\n if($page->page_image == 'noimage.png')\n {\n $page->delete();\n return redirect('/pages')->withPage($page)->with('success', 'Page deleted!');\n }\n else{\n Storage::delete('http://ads-site.epizy.com/ads-site/storage/app/public/page_images/'.$page->page_image);\n $page->delete();\n return redirect('/pages')->with('success', 'Page deleted!');\n }\n }", "public function delete() { // Page::destroy($this->pages()->select('id')->get());\n $this->pages()->detach();\n parent::delete();\n }", "public function destroy(Page $page)\n {\n $page->delete();\n session()->flash('success', 'Post Trashed Successfully!');\n return redirect(route('admin-pages'));\n }", "function customcert_delete_page($pageid) {\n global $DB;\n\n // Get the page.\n $page = $DB->get_record('customcert_pages', array('id' => $pageid), '*', MUST_EXIST);\n\n // Delete this page.\n $DB->delete_records('customcert_pages', array('id' => $page->id));\n\n // The element may have some extra tasks it needs to complete to completely delete itself.\n if ($elements = $DB->get_records('customcert_elements', array('pageid' => $page->id))) {\n foreach ($elements as $element) {\n // Get an instance of the element class.\n if ($e = customcert_get_element_instance($element)) {\n $e->delete_element();\n }\n }\n }\n\n // Now we want to decrease the page number values of\n // the pages that are greater than the page we deleted.\n $sql = \"UPDATE {customcert_pages}\n SET pagenumber = pagenumber - 1\n WHERE customcertid = :customcertid\n AND pagenumber > :pagenumber\";\n $DB->execute($sql, array('customcertid' => $page->customcertid,\n 'pagenumber' => $page->pagenumber));\n}", "public function testPageDelete()\n {\n $faker = Faker::create();\n $page = Page::inRandomOrder()->first();\n $response = $this\n ->actingAs(User::where(\"admin\", true)->whereNotNull(\"verified\")->inRandomOrder()->first(), 'api')\n ->withHeaders([\n \"User-Agent\" => $faker->userAgent(),\n ])\n ->json('DELETE', \"/api/pages/\" . $page->slug);\n $response\n ->assertStatus(200);\n }", "public function delete() {\r\n $page = $this->api->getParam('page', '1');\r\n $this->model->id = $_REQUEST['id'];\r\n $this->checkOwner();\r\n $message = 'Cannot Be Deleted';\r\n if ($this->model->delete()) {\r\n $message = 'Deleted Successfully';\r\n }\r\n $this->api->redirect('contact/home?message=' . $message . '&page=' . $page);\r\n }", "function supprimer_page($page)\n{\n global $config_wri,$pdo;\n $page=$pdo->quote($page);\n $query=\"delete from pages_wiki where nom_page=$page\";\n $res=$pdo->query($query);\n if (!$res)\n return erreur(\"Requête SQL impossible à executer\",$query);\n\n return ok(\"Page supprimée et tout ses anciennes versions\");\n}", "public function delete()\n {\n\n\n $myDataAccess = aDataAccess::getInstance();\n $myDataAccess->connectToDB();\n // I just made it cascade null when deleted ;)\n\n\n \t$recordsAffected = $myDataAccess->deletePage($this->m_Pageid);\n\n \treturn \"$recordsAffected row(s) affected!\";\n }", "public function destroy($id)\n {\n $page = page::find($id);\n // $action = 'deleted page';\n // $data = $page->title;\n \n $page->delete();\n // $activity = activityController::postUser($action,$data);\n return redirect()->back();\n }", "public function destroy(Page $page)\n {\n $page->delete();\n\n return response()->json(['message' => 'success']);\n }", "public function destroy(Page $page)\n {\n// return $page;\n Page::where('id', $page->id)->update(['status'=> 2]);\n return redirect('admin/page');\n }", "public function destroy(Page $page)\n {\n if($page->banner != ''){\n $banner = $this->load_image('pagebanner/'.$page->banner);\n if($banner){\n $banner->remove_image();\n }\n }\n $page->delete();\n return response()->json([\n 'status' => 'success',\n 'message' => 'Page successfully deleted.',\n ]);\n }", "public function delete($id)\n {\n $page = $this->pageRepo->getId($id);\n \n $this->recordExists($page);\n \n $result = Page::destroy($id);\n \n if ($result) {\n $this->setFeed('Удалил страницу &laquo;'. trim($page->title, '&raquo; &laquo;') .'&raquo;');\n }\n return $this->redirectResponse($result, ['success' => 'Запись удалена', 'error' => 'Ошибка удаления']);\n }", "public function delete($id)\n {\n Page::find($id)->delete();\n session()->flash('message', 'Page Deleted Successfully.');\n }", "public function delete($id)\n\t{\n\n\t\t$page = $this->pagesDb->find($id);\n\n\t\tif (empty($page)) {\n\t\t\t$this->showNotFound();\n\t\t}\n\n\t\t// Soumission formulaire\n\t\tif (!empty($_POST)) {\n\n\t\t\t$post = array_map('trim', array_map('strip_tags', $_POST));\n\n\t\t\tif (isset($post['delete']) && $post['delete'] == 'yes') {\n\t\t\t\t$this->pagesDb->delete($id);\n\n\t\t\t\t$this->flash('La page a été supprimée avec succès', 'success');\n\t\t\t\t$this->redirectToRoute('back_pages_list');\n\t\t\t}\n\t\t}\n\n\n\t\t$this->render(self::PATH_VIEWS . '/delete', [\n\t\t\t'page' => $page,\n\t\t]);\n\t}", "public function actionDelete(){\n\t\t$form = $_POST;\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('DELETE FROM core_pages WHERE id = ?', $form['id']);\n\t\t$this->redirect('pages:');\n\t}", "public static function onPageDelete($event)\n {\n $instance = $event->sender;\n if(!($instance instanceof Page))\n return;\n\n $entry = MailingListEntry::find()->where([\n 'page_id' => $instance->id,\n ])->one();\n if($entry)\n $entry->delete();\n }", "public function delete_page($page_id) {\n if(is_numeric($page_id)) {\n $deleted = $this->db_wrapper->delete($this->table_name, 'page_id = ' . $page_id);\n \n if($deleted) {\n //TODO: add try catch clause here\n $this->remove_page_module_relationship_by_page($page_id);\n return true;\n }\n else throw new ArtMySQLException('Could not delete from table ' . $this->table_name, ArtException::MYSQL);\n } else {\n throw new ArtInvalidIdException('Invalid id passes to delete_page method of Page class.', ArtException::INVALID_ID);\n }\n }", "public function destroy(ehPage $page)\n {\n\n\n // TODO: are there any other conditions that must be met (or checked) before we delete a page entry?\n\n // Deletion rules:\n // 1. You can't delete any item that has children (which should only be modules or submenus).\n if (ehMenus::getMyChildren($page->id)->count()) {\n throw ValidationException::withMessages(['type' =>\n \"You can't delete a page that has <strong>child entries</strong>.\n You must <strong>reassign</strong> or <strong>delete</strong> those pages first.\n \"]);\n }\n\n\n\n\n ///////////////////////////////////////////////////////////////////////////////////////////\n // Then go ahead and delete this Page entry.\n dd('Got to the delete statement.');\n// $result = $page->delete();\n\n\n ///////////////////////////////////////////////////////////////////////////////////////////\n // If all went okay then say so to the flash message.\n if ($result) {\n session()->flash('message','Page item <strong>'.$page->id.'-'.$page->name.'</strong> has been deleted.');\n } else {\n session()->flash('message','Something went wrong.');\n }\n\n return redirect('/pages');\n }", "public function testRemovePageWhenDeleted()\n {\n\n // Add a public page.\n $page = $this->_simplePage(true);\n\n // Delete.\n $page->delete();\n\n // Should remove Solr document.\n $this->_assertNotRecordInSolr($page);\n\n }", "public function destroy($id)\n {\n $page = Page::findOrFail($id); \n $page->delete();\n return redirect()->route('admin.pages');\n }", "function delete_hello_world() {\n $post = get_page_by_path('hello-world',OBJECT,'post');\n if ($post){\n wp_delete_post($post->ID,true);\n }\n }", "public function destroy(Page $page)\n {\n try {\n $page->delete();\n } catch (Exception $ex) {\n return response()->json(['error' => $ex->getMessage()], 403);\n }\n\n return response()->json(null, 204);\n }", "public function delete_page($id)\n {\n $record = LanguagePage::where('id', $id)->get()->first();\n if(!env('DEMO_MODE')) {\n $record->delete();\n }\n $response['status'] = 1;\n $response['message'] = LanguageHelper::getPhrase('record_deleted_successfully');\n return json_encode($response);\n }", "public function delete()\n {\n $ids = Request::get(\"id\");\n\n $ids = is_array($ids) ? $ids : [$ids];\n\n foreach ($ids as $ID) {\n\n $page = Page::findOrFail($ID);\n\n // Fire deleting action\n\n Action::fire(\"page.deleting\", $page);\n\n $page->tags()->detach();\n $page->delete();\n\n // Fire deleted action\n\n Action::fire(\"page.deleted\", $page);\n }\n\n return Redirect::back()->with(\"message\", trans(\"pages::pages.events.deleted\"));\n }", "function delete_sample_page() {\n $default_page = get_page_by_title( 'Sample Page' );\n if ($default_page) {\n wp_delete_post( $default_page->ID );\n }\n }", "function deletePage( &$outPage )\n {\n #echo \"eZNewsFlowerArticleViewer::deletePage( \\$outPage = $outPage )<br />\\n\";\n global $form_delete;\n \n $this->IniObject->readAdminTemplate( \"eznewsflower/article\", \"view.php\" );\n\n global $Story;\n global $Price;\n global $Name;\n global $ImageID;\n global $ParentID;\n\n $this->Item = new eZNewsArticle( $this->Item->id() );\n\n\n $this->IniObject->set_file( array( \"article\" => \"delete.tpl\" ) );\n $this->IniObject->set_block( \"article\", \"go_to_parent_template\", \"go_to_parent\" );\n $this->IniObject->set_block( \"article\", \"go_to_self_template\", \"go_to_self\" );\n $this->IniObject->set_block( \"article\", \"upload_picture_template\", \"upload_picture\" );\n $this->IniObject->set_block( \"article\", \"picture_uploaded_template\", \"picture_uploaded\" );\n $this->IniObject->set_block( \"article\", \"picture_template\", \"picture\" );\n $this->IniObject->set_block( \"article\", \"article_image_template\", \"article_image\" );\n\n $this->doThis();\n \n\n $this->IniObject->setAllStrings();\n $outPage = $this->IniObject->parse( \"output\", \"article\" );\n\n $value = true;\n \n return $value;\n }", "public function page_delete()\n {\n if (isset($_POST['site_id']) && $_POST['page_name'] != '') {\n if ($this->sitemodel->delete_pages($_POST['site_id'], $_POST['page_name'])) {\n return TRUE;\n } else {\n return FALSE;\n }\n }\n }", "public function destroy(Pages $page)\n {\n try {\n $page->delete();\n } catch (\\Throwable $th) {\n // throw $th;\n return redirect()->back()->with('error','Erro ao excluir página!');\n }\n\n return redirect()->back()->with('success','Página apagado com sucesso!');\n }", "public function destroy($id)\n {\n $page = DB::table(\"page_service\")->where('id', $id)->first();\n DB::table(\"page_service\")->where('id', $id)->delete();\n return redirect('page/'. $page->page_id.'/edit');\n }", "public function destroy($id)\n {\n try {\n\n $modelObj = $this->page->find($id);\n if($modelObj)\n {\n $dataObj = $modelObj;\n $destroyed = $modelObj->delete();\n if($destroyed)\n return $this->cmsResponse( sprintf('Successfully deleted page (%s).',$dataObj->title));\n }\n return $this->cmsResponse('Failed to delete page.',400);\n\n } catch (SystemError $e) {\n return $this->cmsResponse($e->getMessage(),400);\n } catch (\\Exception $e) {\n return $this->cmsResponse($e->getMessage(),400);\n }\n }", "public function delete($enterpriseId, $pageId, $clusterId, $optParams = [])\n {\n $params = ['enterpriseId' => $enterpriseId, 'pageId' => $pageId, 'clusterId' => $clusterId];\n $params = array_merge($params, $optParams);\n return $this->call('delete', [$params]);\n }", "public function destroy(Request $request,$page, $id)\n {\n $post = Post::find($id);\n $post->delete();\n return response()->json(['ret' => 0]);\n }", "public function delete(Request $request)\n {\n $id = $request->id;\n $deletePage = Page::deletePage($id);\n return redirect('/admin/pages/list')->with('successMessage', 'Page deleted successfully');\n }", "public function deletePage($intPageID)\n\t{\n\t\t\n\t\t$intDeleteID = $this->delete(\"page_id = $intPageID\");\n\t\treturn $intDeleteID;\n\t}", "public function destroy($id)\n {\n $page = Page::find($id);\n $page -> delete();\n \n return redirect('admin/page')->with('success','Data has been deleted successfully');\n }", "public function supprimerPage(){\n $idpage = $this->input->post('idpage');\n $this->db->delete('pages', array('idPage' => $idpage));\n echo $idpage;\n }", "public function processDelete()\n {\n $pageId = Tools::getValue('id_page');\n\n Db::getInstance()->delete($this->module->table_name, 'id_page='.$pageId);\n Db::getInstance()->delete($this->module->table_lang, 'id_page='.$pageId);\n Db::getInstance()->delete($this->module->table_related, 'id_parent='.$pageId.' OR id_related='.$pageId);\n\n $this->redirect_after = static::$currentIndex.'&conf=1&token='.$this->token;\n }", "public function deletePage(string $identifier) {\n $page = Pages::page($identifier);\n\n if ($page->status === 'DELETED') {\n return response('', 405);\n }\n\n if (isset($page)) {\n $this->changePageStatus($identifier, $page->id, 'DELETED');\n\n return response('', 204);\n } else {\n return response('', 404);\n }\n }", "public function destroy(Page $page, PageContent $section)\n {\n // delete page_content\n $this->deleteEntry($section, request());\n\n log_activity('Page Component Deleted', 'A Page Content was successfully removed from the Page', $section);\n\n return redirect_to_resource();\n }", "public function destroy($id) {\n $this->page->delete($id);\n return redirect()->route('pages.index');\n }", "public function delete($id = false){\n if($id){\n Posts::where('type', '=', 'page')\n ->where('id', '=', $id)\n ->delete();\n }\n return \\Redirect::nccms('page');\n }", "public function destroy($id)\n {\n $delete = page::findOrFail($id);\n $delete->delete();\n return response(['status' => true ,'text' => 'has deleted'], 200);\n }", "public function delete(User $user, Page $page): Response\n {\n return $this->update($user, $page);\n }", "public function destroy(Page $page)\n {\n $page->delete();\n \n $page->media()->delete($page->id);\n\n if ($page) {\n $data = [\n 'status' => '1',\n 'msg' => 'success'\n ];\n toastr()->success('اطلاعات شما حذف شد');\n } else {\n $data = [\n 'status' => '0',\n 'msg' => 'fail'\n ];\n toastr()->warning('اطلاعات شما حذف نشد');\n\n\n\n }\n return response()->json($data);\n }", "public function destroy($id)\n {\n $page = Page::find($id);\n\t\t$page->delete();\n\t\treturn back()->with('message', \"Страница \".$page->title.\" удалена\");\n }", "public function destroy(Destroy $request, Page $page)\r\n {\r\n if ($page->delete()) {\r\n session()->flash(config('seo.flash_message'), 'Page successfully deleted');\r\n } else {\r\n session()->flash(config('seo.flash_error'), 'Error occurred while deleting Page');\r\n }\r\n\r\n return redirect()->back();\r\n }", "public function destroy($id)\n {\n $page = $this->page->findOrFail($id);\n return $page->delete();\n }", "public function DeletePage($pid){\n\t\t\t\n\t\t\tif(empty($pid)){\n\t\t\t\t$this->session->set_flashdata('verify_msg','<div class=\"alert alert-danger text-center\"><strong>Error!</strong> Invalid Request! </div>');\n\t\t\t\t\n\t\t\t\tredirect('admin/pages');\n\t\t\t}\n\t\t\t\n\t\t\t$pageHeader = \tarray( 'pagetitle' => 'Page Delete Request',\n\t\t\t'slug'=>'pages',\n\t\t\t'font_icon'=>'book',\n\t\t\t);\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$returnReq\t=\t$this->AdminPageModel->DeletePage($pid);\n\t\t\t\n\t\t\tif($returnReq == true){\n\t\t\t\t\n\t\t\t\t$this->session->set_flashdata('verify_msg','<div class=\"alert alert-success text-center\"><strong>Success </strong> Page Successfully Deleted </div>');\n\t\t\t\t}else{\n\t\t\t\t$this->session->set_flashdata('verify_msg','<div class=\"alert alert-danger text-center\"><strong>Error ! </strong> Not able to delete Page!</div>');\n\t\t\t}\n\t\t\t\n\t\t\tredirect('admin/pages');\n\t\t\t\n\t\t}", "public function delete($pid){\n\t\ttry {\n\t\t\t$sql = \"DELETE FROM page WHERE id= :id\";\n\t\t\t$stmt = $this->_db->prepare($sql);\n\t\t\t$stmt->execute(array( 'id' => $pid));\n\t\t\tif($stmt->errorCode() != 0){\n\t\t\t\t$error = $stmt->errorInfo();\n\t\t\t\tthrow new SQLException($error[2], $error[0], $sql, \"Impossible de supprimer une page\");\n\t\t\t}\n\t\t\treturn true;\n\t\t}catch(PDOException $e){\n\t\t\tthrow new DatabaseException($e->getCode(), $e->getMessage(), \"Impossible de supprimer une page\");\n\t\t}\n\t}", "public function deletePage($id) {\n $this->query(\"DELETE FROM Pages WHERE id=$id\");\n return ($this->connection->affected_rows > 0);\n }", "function testPageDeleteById()\n {\n $page = $this->_pageTable->createRow($this->_data);\n $page->save();\n\n $pageId = $page->id;\n\n $this->assertNotNull($pageId);\n\n // Delete Record in DB\n $res = $this->_pageTable->deleteById($pageId);\n $this->assertEquals(1, $res);\n\n // Get Record from DB\n //$page = $this->_pageTable->find($pageId);\n //$this->assertNull($page->id);\n }", "public function destroy($id)\n {\n $page = Page::findOrFail($id);\n $page->delete();\n\n return redirect()\n ->route('admin.page.index')\n ->withSuccess('Page deleted.');\n }", "public function destroy(Request $request)\n {\n $id = $request->id;\n $nhamay = Page::find($id);\n $nhamay->delete();\n\n return redirect()->route('backend.page.index');\n }", "public function get_delete($id = null)\n\t{\n\t\t$msg = Messages::make();\n\t\t$page = Page::find($id);\n\n\t\tif (is_null($page))\n\t\t{\n\t\t\t$msg->add('error', __('orchestra::response.db-404'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\n\t\t\t\tDB::transaction(function () use ($page)\n\t\t\t\t{\n\t\t\t\t\t$page->status = Page::STATUS_DELETED;\n\t\t\t\t\t$page->save();\n\t\t\t\t});\n\n\t\t\t\t$msg->add('success', __('cello::response.pages.delete', array(\n\t\t\t\t\t'name' => $page->title,\n\t\t\t\t)));\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\n\t\treturn Redirect::to(handles('orchestra::resources/cello.pages'))\n\t\t\t\t->with('message', $msg->serialize());\n\t}", "public function destroy($id)\n {\n Page::find($id)->delete();\n return redirect()->route('pages.index')->with('success', 'The page is successfully removed.');\n }", "public function destroy($id)\n {\n Page::findOrFail($id)->delete();\n session()->flash('message', 'Page Deleted with ID of : ' . $id);\n return redirect()->route('page_list');\n }", "public function deleteAction() : object\n {\n $page = $this->di->get(\"page\");\n $form = new DeleteForm($this->di);\n $form->check();\n\n $page->add(\"questions/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $page->render([\n \"title\" => \"Delete an item\",\n ]);\n }", "public function delete() {\n // we expect a url of form ?controller=posts&action=delete&id=x\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id']))\n return call('pages', 'error');\n\n // we use the given id to get the right post and delete from the database\n $post = Post::delete($_GET['id']);\n require_once('view/posts/delete.php');\n }", "public function deleteContentAndCopyDraftPage() {}", "public function delete($id)\n {\n $pages = PageContents::where('id',$id)->first();\n if (isset($pages->id)) {\n $returnHTML = Theme::view('default::core.pages_contents.opr.delete', [\n 'page' => $pages,\n ])->render();\n\n return response()->json([\n 'success' => true,\n 'msg' => $pages,\n 'html' => $returnHTML,\n ]);\n } else {\n return response()->json([\n 'success' => false,\n 'msg' => 'Single Data',\n 'html' => '',\n ]);\n }\n }", "public function deletePage($m_Pageid)\n {\n $sqlStatement=\"Delete FROM Pages WHERE PageId='$m_Pageid' \";\n\n $this->result = @$this->dbConnection->query($sqlStatement);\n if(!$this->result)\n {\n die('Could not retrieve records from the CMS Database: ' .\n $this->dbConnection->error);\n }\n\n return $this->dbConnection->affected_rows;\n }", "static function beforePageDelete($a_page)\n\t{\n\t\tinclude_once(\"./Services/MediaObjects/classes/class.ilObjMediaObject.php\");\n\t\t$mob_ids = ilObjMediaObject::_getMobsOfObject(\n\t\t\t$a_page->getParentType().\":pg\", $a_page->getId(), 0, $a_page->getLanguage());\n\n\t\tilObjMediaObject::_deleteAllUsages($a_page->getParentType().\":pg\", $a_page->getId(), false,\n\t\t\t$a_page->getLanguage());\n\n\t\tforeach($mob_ids as $mob)\t// check, whether media object can be deleted\n\t\t{\n\t\t\tif (ilObject::_exists($mob) && ilObject::_lookupType($mob) == \"mob\")\n\t\t\t{\n\t\t\t\t$mob_obj = new ilObjMediaObject($mob);\n\t\t\t\t$usages = $mob_obj->getUsages(false);\n\t\t\t\tif (count($usages) == 0)\t// delete, if no usage exists\n\t\t\t\t{\n\t\t\t\t\t$mob_obj->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function wiki_delete_page($page_id)\n{\n if (php_function_allowed('set_time_limit')) {\n @set_time_limit(0);\n }\n\n // Get page details\n $pages = $GLOBALS['SITE_DB']->query_select('wiki_pages', array('*'), array('id' => $page_id), '', 1);\n if (!array_key_exists(0, $pages)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE', 'wiki_page'));\n }\n $page = $pages[0];\n $_description = $page['description'];\n $_title = $page['title'];\n\n // Delete posts\n $start = 0;\n do {\n $posts = $GLOBALS['SITE_DB']->query_select('wiki_posts', array('id'), array('page_id' => $page_id), '', 500, $start);\n foreach ($posts as $post) {\n wiki_delete_post($post['id']);\n }\n //$start += 500; No, we just deleted, so offsets would have changed\n } while (array_key_exists(0, $posts));\n\n // Log revision\n $log_id = log_it('WIKI_DELETE_PAGE', strval($page_id), $_title);\n if (addon_installed('actionlog')) {\n require_code('revisions_engine_database');\n $revision_engine = new RevisionEngineDatabase();\n $revision_engine->add_revision(\n 'wiki_page',\n strval($page_id),\n strval($page_id),\n get_translated_text($_title),\n get_translated_text($_description),\n $page['submitter'],\n $page['add_date'],\n $log_id\n );\n }\n\n // Delete and update caching...\n\n delete_lang($_description);\n delete_lang($_title);\n $GLOBALS['SITE_DB']->query_delete('wiki_pages', array('id' => $page_id), '', 1);\n $GLOBALS['SITE_DB']->query_delete('wiki_children', array('parent_id' => $page_id));\n $GLOBALS['SITE_DB']->query_delete('wiki_children', array('child_id' => $page_id));\n\n if (addon_installed('catalogues')) {\n update_catalogue_content_ref('wiki_page', strval($page_id), '');\n }\n\n if ((addon_installed('commandr')) && (!running_script('install')) && (!get_mass_import_mode())) {\n require_code('resource_fs');\n expunge_resource_fs_moniker('wiki_page', strval($page_id));\n }\n\n require_code('sitemap_xml');\n notify_sitemap_node_delete('_SEARCH:wiki:browse:' . strval($page_id));\n}", "public function deleteById($id)\n {\n return $this->wallpaperMapper->deletePage($id);\n }", "public function destroy(PageHeader $pageHeader)\n {\n $destroy = $pageHeader;\n $destroy->delete();\n return redirect('/pageHeaders');\n }", "public function delete_page(string $area, string $uri)\n{\n\n // Delete from database\n db::query(\"DELETE FROM cms_layouts WHERE area = %s AND filename = %s\", $area, $uri);\n\n // Delete from redis\n $key = $area . '/' . $uri;\n redis::hdel('cms:titles', $key);\n redis::hdel('cms:layouts', $key);\n\n}", "public function destroy()\n {\n\n $id = Input::get('id');\n\n if ( ! empty( $this->photoGallery->getDataById($id)->cover_pic )) {\n $cover_pic = $this->photoGallery->getDataById($id)->cover_pic;\n\n $coverpicDirectory = base_path() . '/uploads/gallery';\n\n File::delete($coverpicDirectory . '/' . $cover_pic);\n\n }\n\n $success = \"Successfully deleted Page\";\n $error = \"Error! Adding Page\";\n\n if ($this->photoGallery->deleteData($id)) {\n return redirect(PREFIX.'/multicms/pages/gallery')->withErrors($success);\n } else {\n return redirect(PREFIX.'/multicms/pages/gallery')->withErrors($error);\n }\n\n\n }", "public function destroy($id)\n {\n $data = FixedPage::findOrFail($id);\n $data->delete();\n\n return redirect(route('page.index'))->with('success','تم الحذف بنجاح');\n }", "public function actionDelete($id)\n {\n $this->adminOnly();\n\n $page = $this->findPageById($id);\n\n if ($page !== null) {\n $page->delete();\n }\n\n return $this->redirect($this->contentContainer->createUrl('list'));\n }", "public function removePage($pageId)\n {\n # DELETE /accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}/pages/{pageId}\n }", "public function delete()\n {\n $post['id'] = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $this->post->deletePost($post['id']);\n $this->redirect(\"admin\", \"chapters\"); // une fois le post supprimé, je redirige vers la vue chapters\n }", "function delete()\n {\n $nim = $this->uri->segment(3);\n $this->siswa_model->delete($nim);\n redirect('siswa/page');\n }", "protected function _delete()\n {\n $pages = $this->getTable('ExhibitPage')->findBy(array('exhibit'=>$this->id));\n foreach($pages as $page) {\n $page->delete();\n }\n $this->deleteTaggings();\n }", "public function destroy($id)\n {\n $page = Page::find($id);\n\n $page->delete();\n\n return redirect()->back();\n }", "public function destroy($id)\n {\n $page = Page::findOrFail($id);\n\n $page->delete();\n\n Session::flash('message', 'Page deleted!');\n Session::flash('status', 'success');\n\n return redirect('pages');\n }", "public function deleteContentAndCopyLivePage() {}", "public function destroy($id)\n {\n $page = Page::findOrFail($id);\n $page->delete();\n\n flash()->success('Page successfully deleted.');\n\n return redirect()->route('admin.pages.index');\n }", "public function destroy($id)\n {\n $this->page->where('parent_id', '=', $id)->delete();\n $this->page->find($id)->delete();\n\n return Redirect::route('pages.index')\n ->with('message', trans('validation.success'));\n }", "public function destroy($id)\n {\n if ( ! $this->repository->delete($id)) {\n return abort(500, \"Failed to delete wiki page #{$id}\");\n }\n\n cms_flash(\n cms_trans(\n 'wiki.flash.success-page-delete',\n [ 'record' => $id ]\n ),\n FlashLevel::SUCCESS\n );\n\n return redirect()->to(cms_route('wiki.home'));\n }", "public function destroy(Page $page, PageSection $section)\n {\n $deleted = $this->repository->delete($section);\n\n return response()->json([\n 'error' => !$deleted,\n ]);\n }", "public function actionDelete($id)\n {\n $page = $this->findById($id);\n\n $page->delete();\n\n return $this->redirect(Url::previous('actions-redirect'));\n }", "public function massDeleteAction()\n {\n $pageIds = $this->getRequest()->getParam('page_id');\n if(!is_array($pageIds)) {\n $this->_getSession()->addError($this->__('Please select page(s).'));\n } else {\n try {\n /** @var Training_Cms_Model_Eav_Page $pages */\n $pages = Mage::getModel('training_cms/eav_page');\n foreach ($pageIds as $pageId) {\n $pages->load($pageId);\n $pages->delete();\n }\n $this->_getSession()->addSuccess($this->__('Total of %d record(s) were deleted.', count($pageIds)));\n } catch (Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n }\n }\n $this->_redirect('*/*/list');\n }" ]
[ "0.772782", "0.77253294", "0.76866454", "0.76588756", "0.7657103", "0.7644251", "0.7644251", "0.76235956", "0.75868237", "0.7536604", "0.7522216", "0.75117576", "0.7419789", "0.7414787", "0.7388147", "0.7360826", "0.73555714", "0.72706264", "0.7270079", "0.7256255", "0.7240069", "0.7219923", "0.72063655", "0.7179627", "0.7178896", "0.7146229", "0.7137949", "0.7134736", "0.71204764", "0.7113654", "0.7107972", "0.7078691", "0.707701", "0.7070762", "0.70606387", "0.70582", "0.69921744", "0.69697654", "0.6957724", "0.69354624", "0.6895099", "0.688047", "0.68579566", "0.6818939", "0.6798779", "0.6795537", "0.6773117", "0.6762909", "0.6759974", "0.6734795", "0.67142427", "0.6714054", "0.67002434", "0.6690072", "0.6679458", "0.6673079", "0.6646194", "0.66430837", "0.6636403", "0.66347015", "0.66236275", "0.6621086", "0.661779", "0.6616901", "0.6598218", "0.6587865", "0.6571119", "0.65673804", "0.65666336", "0.65495765", "0.653158", "0.6527299", "0.6526165", "0.6521967", "0.6520289", "0.6490886", "0.64824134", "0.6475417", "0.64617825", "0.6454397", "0.645142", "0.6446585", "0.64382493", "0.6420789", "0.6416163", "0.6406795", "0.6375413", "0.6368767", "0.6359566", "0.6354963", "0.63493997", "0.6348722", "0.633206", "0.63314015", "0.6330362", "0.63273495", "0.62980837", "0.62969905", "0.6289928", "0.6265209" ]
0.76671845
3
Create a new job instance.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }", "abstract public function makeJob();", "abstract public function makeJob();", "private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }", "public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }", "public function createJobExecution(JobInstance $job)\n {\n return new JobExecution();\n }", "public function setJobName(string $jobName): JobInstanceInterface;", "public function __construct(Job $job)\n {\n $this->job = $job;\n }", "public static function createJob($project, $jobOptions, $parentJob = null) {\n\n // Check if the job must be CC\n $isCC = ($jobOptions->getProjectJobFileType() && $jobOptions->getProjectJobFileType() == ProjectJobFile::TYPE_CC);\n\n if ($jobOptions->getJobType())\n Subtitle::defineSubtitleExtension($jobOptions->getJobType());\n\n // Get job type service id\n $jobOptionsTypeService = JobTypeService::model()->byJobTypeAndService(\n $jobOptions->getJobType(),\n $jobOptions->getService()\n )->find();\n\n // Set attributes\n $projectJob = new PRMProjectJob();\n $projectJob->source_lang_id = $jobOptions->getSourceLanguage();\n $projectJob->target_lang_id = $jobOptions->getTargetLanguage();\n $projectJob->project_id = $project->id;\n $projectJob->job_type_id = $jobOptions->getJobType();\n $projectJob->job_type_service_id = $jobOptionsTypeService->id;\n $projectJob->subtitle_provided = $jobOptions->isSubtitleProvided() ? 1 : 0;\n $projectJob->status = parent::STATUS_NEW;\n $projectJob->due_date = $jobOptions->getDueDate();\n $projectJob->is_billable = ($jobOptions->getJobType() != JobType::TYPE_ACCEPTANCE) ? 1 : 0;\n $projectJob->is_cc = (int) $isCC;\n $projectJob->forced_subtitle = $jobOptions->getIsForced() ? 1 : 0;\n $projectJob->job_meta_type_id = $jobOptions->getMetaType();\n\n if($projectJob->save(false)) {\n\n $deliverySpecComponent = new DeliverySpecComponent();\n $projectJobPreference = $deliverySpecComponent->copyTerritoriesToJobPreferences($projectJob, $project->delivery_spec_id);\n // Set max_box_lines = 3 for CC jobs\n if($projectJobPreference instanceof ProjectJobPreference && $isCC) {\n $projectJobPreference->max_box_lines = 3;\n $projectJobPreference->save(false);\n }\n\n ProjectBreakdownReport::create(ProjectBreakdownReportActions::TASK_ADDED)\n ->forProjectJob($projectJob)\n ->save();\n\n if ($project->user_id){\n PUserJob::model()->assignJob($project->user_id, $projectJob->id);\n }\n\n ProjectJobParent::link($parentJob ? $parentJob->id : 0, $projectJob->id);\n\n if ($jobOptions->getOutputSupportedFile() instanceof ProjectSupportedFile) {\n $deliverableFile = new ProjectJobDeliverableFiles();\n $deliverableFile->project_job_id = $projectJob->id;\n $deliverableFile->project_supported_file_id = $jobOptions->getOutputSupportedFile()->id;\n $deliverableFile->file_name = $jobOptions->getOutputFileName();\n\n if ($jobOptions->getOutputPositioningType()){\n $deliverableFile->positioning_profile = \"0;{$jobOptions->getOutputPositioningType()};{$jobOptions->getOutputAspect()};{$jobOptions->getOutputAspectRatio()}\";\n }\n\n $deliverableFile->save(false);\n }\n\n // Return job\n return $projectJob;\n }\n\n return false;\n }", "public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }", "public function create(JobRequest $jobRequest)\n {\n $job = new Job();\n\n $job->business_person = $jobRequest->business_person;\n $job->principal_phone = $jobRequest->principal_phone;\n $job->optional_phone = $jobRequest->optional_phone;\n $job->init_date = $jobRequest->init_date;\n $job->finish_date = $jobRequest->finish_date;\n $job->city = $jobRequest->city;\n\n $job->save();\n\n return compact('job');\n }", "public function createNewJob($jobBody, $queue)\n {\n $job = new Job($jobBody, $queue);\n\n if ($this->jobHasBeenAddedFromOutside($job)) {\n $this->addMissingJobTimeData($job);\n }\n\n return $job;\n }", "protected function createJobFromPayload($payload = [])\n {\n return new Job([\n 'title' => $payload['jobTitle'],\n 'name' => $payload['jobTitle'],\n 'description' => $payload['descriptionFragment'],\n 'url' => $payload['jobViewUrl'],\n 'sourceId' => $payload['jobListingId'],\n 'location' => $payload['location'],\n 'industry' => $payload['jobCategory']\n ]);\n }", "public function created(Job $job)\n {\n //\n }", "protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "static public function factory($job, $conn, $handle, $initParams=array())\n {\n if (empty($initParams['path'])) {\n $paths = explode(',', NET_GEARMAN_JOB_PATH);\n $file = null;\n\n foreach ($paths as $path) {\n $tmpFile = $path . '/' . $job . '.php';\n\n if (file_exists(realpath($tmpFile))) {\n $file = $tmpFile;\n break;\n }\n }\n }\n else {\n $file = $initParams['path'];\n }\n\n if ( ! file_exists($file) ) {\n throw new Net_Gearman_Job_Exception('Invalid Job class file: ' . (empty($file) ? '<empty>' : $file));\n }\n\n include_once $file;\n\n if (empty($initParams['class_name'])) {\n $class = NET_GEARMAN_JOB_CLASS_PREFIX . $job;\n }\n else {\n $class = $initParams['class_name'];\n }\n\n if (!class_exists($class)) {\n throw new Net_Gearman_Job_Exception('Invalid Job class: ' . (empty($class) ? '<empty>' : $class) . ' in ' . (empty($file) ? '<empty>' : $file) );\n }\n\n $instance = new $class($conn, $handle, $initParams);\n if (!$instance instanceof Net_Gearman_Job_Common) {\n throw new Net_Gearman_Job_Exception('Job is of invalid type: ' . get_class($instance));\n }\n\n return $instance;\n }", "public function creating(Job $job)\n {\n $job->setTokenValue();\n $job->setExpiresAtValue();\n $job->is_activated = 1;\n }", "private function createJob (string $cronTab) : CronJobInterface\n {\n return new class ($cronTab) implements CronJobInterface\n {\n /** @var string */\n private $cronTab;\n\n\n /**\n */\n public function __construct (string $cronTab)\n {\n $this->cronTab = $cronTab;\n }\n\n\n /**\n */\n public function getCronTab () : string\n {\n return $this->cronTab;\n }\n\n\n /**\n */\n public function getName () : string\n {\n return \"My Job\";\n }\n\n\n /**\n */\n public function execute (BufferedSymfonyStyle $io) : CronStatus\n {\n return new CronStatus(true);\n }\n };\n }", "private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }", "public function getNewJob() {\n # we can grab a locked job if we own the lock\n $rs = $this->runQuery(\"\n SELECT id\n FROM \" . self::$jobsTable . \"\n WHERE queue = ?\n AND (run_at IS NULL OR NOW() >= run_at)\n AND (locked_at IS NULL OR locked_by = ?)\n AND failed_at IS NULL\n AND attempts < ?\n ORDER BY created_at DESC\n LIMIT 10\n \", array($this->queue, $this->name, $this->max_attempts));\n\n // randomly order the 10 to prevent lock contention among workers\n shuffle($rs);\n\n foreach ($rs as $r) {\n $job = new DJJob($this->name, $r[\"id\"], array(\n \"max_attempts\" => $this->max_attempts,\n \"fail_on_output\" => $this->fail_on_output\n ));\n if ($job->acquireLock()) return $job;\n }\n\n return false;\n }", "public function store(Request $request): JobResource\n {\n $jobTypes = Factory::listTypes();\n $validValues = $this->validate(\n $request,\n [\n 'sample_code' => ['filled', 'string', 'alpha_dash'],\n 'name' => ['required', 'string'],\n 'type' => ['required', 'string', Rule::in($jobTypes->pluck('id'))],\n 'parameters' => ['filled', 'array'],\n ]\n );\n $parametersValidation = $this->_prepareNestedValidation(\n Factory::validationSpec($validValues['type'], $request)\n );\n $validParameters = $this->validate($request, $parametersValidation);\n $type = $validValues['type'];\n $validParameters = $validParameters['parameters'] ?? [];\n $job = Job::create(\n [\n 'sample_code' => $validValues['sample_code'] ?? null,\n 'name' => $validValues['name'],\n 'job_type' => $type,\n 'status' => Job::READY,\n 'job_parameters' => [],\n 'job_output' => [],\n 'log' => '',\n 'user_id' => \\Auth::guard('api')->id(),\n ]\n );\n $job->setParameters(Arr::dot($validParameters));\n $job->save();\n $job->getJobDirectory();\n\n return new JobResource($job);\n }", "public function __construct(JobPoster $job)\n {\n $this->job = $job;\n }", "public function create()\n {\n // Display form to create a new job\n return view('jobs.create');\n }", "public function __construct(Job $job)\n {\n parent::__construct();\n\n $this->job = $job;\n }", "protected function getJobInstance(): JobInstance\n {\n if (!isset($this->jobInstance)) {\n $id = $this->argument('instanceId');\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n $this->jobInstance = JobInstance::findOrFail(intval($id));\n }\n\n return $this->jobInstance;\n }", "public function getInstance()\n {\n if (!is_null($this->instance)) {\n return $this->instance;\n }\n\n if (!class_exists($this->class)) {\n throw new \\RuntimeException('Could not find job class \"'.$this->class.'\"');\n }\n\n if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" does not contain a public \"'.$this->method.'\" method');\n }\n\n $class = new \\ReflectionClass($this->class);\n\n if ($class->isAbstract()) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" cannot be an abstract class');\n }\n\n $instance = $class->newInstance();\n\n return $this->instance = $instance;\n }", "static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }", "public function create() {}", "public function __construct()\n {\n $this->jobService = new JobService();\n }", "public function create()\n {\n $job=new Job;\n return view('jobs.create',[\n 'job'=>$job,]);\n //\n }", "public function store(CreateJobFormRequest $request)\n {\n $job = Job::create($request->input());\n\n return response()->json($job, 201);\n\n }", "public function create()\n {\n return view('admin.job.create');\n }", "public function createAction(Request $request)\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function create(){}", "public function create(Request $request) {\n $jobPost = new Job();\n $jobPost->user_id = Auth::user()->id;\n\n // Substract one credit from user's subscription\n $userPlans = Auth::user()->plans;\n\n foreach ($userPlans as $plan) {\n if ($plan->credits > 0) {\n $plan->credits = $plan->credits - 1;\n $plan->save();\n }\n }\n\n $jobPostData = $request::input('jobPost');\n foreach ($jobPostData as $key => $value) {\n $jobPost[$key] = $value;\n }\n\n $jobPost->save();\n\n return $jobPost;\n }", "public function __construct($job)\n {\n $payload = [];\n $this->job = $job;\n $payload['data'] = json_encode($this->job);\n\n $payload['classname'] = $this->job->getNameOfClass();\n $this->payload = $payload;\n\n }", "public function create()\n {\n return view('profile.job.create');\n }", "public function create()\n {\n return view('job.add_job');\n }", "public function store(CreateRequest $request, Job $job)\n {\n $newTask = $request->validated();\n $newTask['job_id'] = $job->id;\n $task = Task::create($newTask);\n\n flash(__('task.created'), 'success');\n\n return redirect()->route('jobs.show', $job);\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public function create()\n {}", "public function createTask()\n {\n return factory($this->model)->create();\n }", "public function newAction()\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function createJob(array $settings, $metaData = [], $priority = 0)\n {\n return $this->client->createJob([\n 'Role' => config('media-converter.iam_arn'),\n 'Settings' => $settings,\n 'Queue' => config('media-converter.queue_arn'),\n 'UserMetadata' => $metaData,\n 'StatusUpdateInterval' => $this->getStatusUpdateInterval(),\n 'Priority' => $priority,\n ]);\n }", "public function addNewJobOpo()\n {\n }", "public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }", "public function run()\n {\n Job::create([\n \"name\" => \"Wirausaha\"\n ]);\n\n Job::create([\n \"name\" => \"Wiraswasta\"\n ]);\n\n Job::create([\n \"name\" => \"Freelance\"\n ]);\n\n Job::create([\n \"name\" => \"Pelajar\"\n ]);\n }", "public function create() {\n \n }", "public function create() {\n \n }", "public static function createJob($mysqli,$name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate){\n $insert = \"INSERT INTO job (job_name,job_desc,cust_email,trade_name,area,preferred_cost,date_needed,offer_end_date) VALUES (?,?,?,?,?,?,?,?)\";\n $stmt = $mysqli->prepare($insert);\n $stmt->bind_param('sssssiss', $name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate); \n $stmt->execute();\n $stmt->close();\n $job = new Job(['JobName'],['JobDesc'],['Email'],['Trade'],['Area'],['JobCost'],['JobDate'],['EstDate']);\n return $job;\n }", "public function store(Request $request)\n {\n $job = new Job();\n $job->title = $request->title;\n $job->description = $request->description;\n $job->company_name = $request->company_name;\n $this->repo->save($job);\n return new JobsResources($job);\n }", "public function create()\n {\n $fields = Field::all();\n $jobTypes = config('user.job_type');\n\n return view('job.create', [\n 'fields' => $fields,\n 'jobTypes' => $jobTypes,\n ]);\n }", "public static function create($queue, $class, array $data = null, $run_at = 0)\n {\n $id = static::createId($queue, $class, $data, $run_at);\n\n $job = new static($queue, $id, $class, $data);\n\n if ($run_at > 0) {\n if (!$job->delay($run_at)) {\n return false;\n }\n } elseif (!$job->queue()) {\n return false;\n }\n\n Stats::incr('total', 1);\n Stats::incr('total', 1, Queue::redisKey($queue, 'stats'));\n\n return $job;\n }", "public function create()\n {\n return $this->objectManager->create($this->className);\n }", "public function create() {\r\n }", "public function create()\n {\n //TODO\n }", "public function submit(Job $job): JobResource\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to submit a job that is already submitted.');\n }\n $job->setStatus(Job::QUEUED);\n JobRequest::dispatch($job);\n\n return new JobResource($job);\n }", "public function __construct(int $status, Job $job)\n {\n $this->status = $status;\n $this->job = $job;\n\n $this->updateTask($this->status, $this->job);\n }", "public function create()\n {\n return new $this->class;\n }", "public function create() {\n }", "public function create() {\n }", "public function create() {\n\t \n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create()\n {\n return view('admin.jobs.create');\n }", "public function fake(Generator &$faker): Job\n {\n return new Job([\n 'name' => $faker->catchPhrase,\n 'summary' => $faker->sentence,\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'stage_id' => random_int(1, Fabricator::getCount('stages') ?: 99),\n ]);\n }", "public function run()\n {\n Job::factory()->count(100)->create();\n \n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n {\n return view('admin.jobs.create');\n\n }", "public function create() {\n\n\t\t\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "protected function _createJob($type, $job)\n\t{\n\t\treturn strtoupper($type) . ' ' . json_encode($job);\n\t}", "public function createJobWithSalesPrices(array $inputData): Job;", "public function create(Job $job)\n {\n $states = $job->prepareStates();\n $countries = $job->prepareCountries();\n $hours = $job->prepareHours();\n $minutes = $job->prepareMinutes();\n $ampm = $job->prepareAmpm();\n $open = $job->prepareOpen();\n return view('companies.create', compact(['states','countries','hours','minutes','ampm','open']));\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }", "public function create()\n {\n return view('jobs.create');\n }" ]
[ "0.6920272", "0.6905722", "0.6905722", "0.6869542", "0.6808916", "0.65271425", "0.65184414", "0.64918077", "0.6489135", "0.6468623", "0.6425879", "0.64058304", "0.63938236", "0.63899404", "0.63753885", "0.6304669", "0.6256802", "0.6241474", "0.620155", "0.61789167", "0.60741454", "0.60695714", "0.6047274", "0.60462874", "0.6028435", "0.6027225", "0.6021894", "0.60214204", "0.59231514", "0.58802027", "0.5874528", "0.58576655", "0.58098435", "0.5805053", "0.58005697", "0.5789109", "0.57851434", "0.57767034", "0.5775661", "0.5755982", "0.5702295", "0.5683395", "0.5683395", "0.5683395", "0.5683376", "0.5679739", "0.5678496", "0.5659406", "0.56529284", "0.56470996", "0.5634536", "0.5632702", "0.5632702", "0.5628215", "0.5625956", "0.5621957", "0.56141514", "0.56048644", "0.5604791", "0.5601149", "0.5601067", "0.5599652", "0.5595376", "0.55932534", "0.55932534", "0.55932015", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55778396", "0.55362236", "0.5534658", "0.5531583", "0.55224913", "0.5522197", "0.5517534", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.55171794", "0.5514842", "0.549955", "0.5497938", "0.54876786", "0.54876786", "0.54876786" ]
0.0
-1
Add nonce for security and authentication.
function fill_metabox( $post ) { wp_nonce_field( 'autore_id_nonce_action', 'autore_id_nonce' ); // Retrieve an existing value from the database. $autore_id = get_post_meta( $post->ID, 'autore_id', true ); //print_r($autore_id); global $post; // required $args=array( 'post_type'=>'hotel', 'post_per_page'=>-1, 'orderby'=> ID, 'order' => ASC ); $custom_posts = get_posts($args); foreach($custom_posts as $p) : $checked = ""; if(is_array( $autore_id )){ if( in_array( $p->ID, $autore_id ) ) $checked = 'checked="checked"'; } echo '<p><label><input type="checkbox" name="autore_id[]" class="check_autori_field" value="' . $p->ID . '" ' . $checked . '> ' . $p->post_title . '</label><p>'; endforeach; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setNonce($nonce) {}", "public function setNonce($nonce);", "public function generate_nonce() {\n\t\tWP_CLI::line( AMP_Validation_Manager::get_amp_validate_nonce() );\n\t}", "public function getNonce();", "public static function generateNonce()\n {\n self::$scriptNonce = hash('sha256',\n \\Zend_Crypt_Math::randBytes(512)\n );\n }", "public static function nonce()\n {\n // Using microtime() instead of time() because of the\n // need to chain successive API calls that would fail\n // due to nonce duplication.\n\n return (int) 10000 * microtime(true);\n }", "abstract public function nonce_check();", "function getNonce() {\n\t\t\t$time = ceil(time() / $this->nonceLife) * $this->nonceLife;\n\t\t\treturn md5(date('Y-m-d H:i', $time).':'.$_SERVER['REMOTE_ADDR'].':'.$this->privateKey);\n\t\t}", "private function _generateNonce()\n {\n return md5(uniqid(microtime()));\n }", "public function getNonce(): int;", "public function set_nonce() {\n\t\tif ( empty( $this->nonce ) ) {\n\t\t\t$this->nonce = wp_create_nonce( 'fffcf_submission_' . $this->id );\n\t\t}\n\t}", "function nonce_generate() {\n\t$_SESSION['nonce'] = md5(uniqid(mt_rand(), true) + NONCE_KEY);\n}", "protected function getNonce()\n\t{\n\t\treturn self::NONCE;\n\t}", "private static function generate_nonce() {\n $mt = microtime();\n $rand = mt_rand();\n\n return md5($mt . $rand); // md5s look nicer than numbers\n }", "private static function generate_nonce()\n {\n $mt = microtime();\n $rand = mt_rand();\n\n return md5($mt . $rand); // md5s look nicer than numbers\n }", "private function generate_nonce () {\n $c = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f' ];\n $count = count($c);\n $nonce = '';\n for ($i = 0; $i < 32; $i++) {\n $nonce .= $c[rand(0, $count)];\n }\n // save nonce as domain cookie\n // expires with current browser session\n setcookie('sso_nonce', $nonce, 0, '/');\n return $nonce;\n }", "function nonce_input() {\n\techo '<input type=\"hidden\" name=\"nonce\" id=\"form_key\" value=\"' . $_SESSION['nonce'] . '\">';\n}", "public function getClientNonce(): string;", "private function get_nonce() {\r\n\t\t$i = ceil( time() / 600);\r\n\t\treturn $this->hash($i, 'nonce');\r\n\t}", "public function getNonce(): int\n {\n $time = explode(' ', microtime());\n\n return $time[1] . substr($time[0], 2, 6);\n }", "function wp_create_nonce($action = -1)\n {\n }", "private function get_nonce () {\n return @$_COOKIE['sso_nonce'];\n }", "protected function getNonce() {\n global $pagenow;\n if ($pagenow == 'tools.php' && isset($_GET['page']) && $_GET['page'] == __CLASS__ . '_opt_menu') {\n if (isset($_GET[__CLASS__ . '_nonce'])) {\n $nonce = $_GET[__CLASS__ . '_nonce'];\n\n if (wp_verify_nonce($nonce, __CLASS__)) {\n return $nonce;\n }\n }\n }\n }", "public function create_nonce() {\n\n\t\t$action = $this->nonce_action;\n\t\t$i = wp_nonce_tick();\n\n\t\treturn substr( wp_hash( $i . $action, 'nonce' ), - 12, 10 );\n\n\t}", "function get_nonce() {\n if (!empty($this->nonce)) {\n $nonce = $this->nonce;\n unset($this->nonce);\n return $nonce;\n }\n $mt = microtime();\n $rand = mt_rand();\n\n return md5($mt . $rand);\n }", "protected function generate_nonce()\n\t{\n\t\treturn md5(uniqid(rand(), true));\n\t}", "public function getNonce()\n {\n return $this->nonce;\n }", "public static function generateNonce()\n {\n $nonce = random_bytes(SODIUM_CRYPTO_BOX_NONCEBYTES);\n\n return \\sodium_bin2hex($nonce);\n }", "public function nonceAp() { return $this->_m_nonceAp; }", "function xgb_request_nonce_error() { ?>\n\t\t<div class=\"notice notice-error\">\n\t\t\t<p><?php _e( 'That request did not pass the necessary security checks. <br>Hint: Log out and login and try again or if this persists, <a class=\"dottedunderline\" href=\"http://www.millionclues.net/support/\">contact support</a>.', 'xgb' ); ?></p>\n\t\t</div> <?php\n}", "public function get_nonce() {\n return wp_nonce_field( 'yith_wcbk_google_calendar_form', 'yith_wcbk_gcal_nonce', false, false );\n }", "protected function _generateNonce() {\n\t\t// For example, a general cryptographic component\n\t\t$_nonce = base64_encode(openssl_random_pseudo_bytes(32));\n\t\t$nonce = preg_replace('/[^A-Za-z0-9]/', '', $_nonce);\n\t\treturn $nonce;\n\t}", "public static function generate_nonce(){\n SUPER_Common::setClientData( array( 'name'=> 'sf_nonce', 'value'=>false ) );\n $sf_nonce = md5(uniqid(mt_rand(), true)) . md5(uniqid(mt_rand(), true)) . md5(uniqid(mt_rand(), true));\n SUPER_Common::setClientData( \n array( \n 'name' => 'sf_nonce', \n 'value' => $sf_nonce,\n 'expires' => 5*60, // nonce will expire after 30 sec. by default\n 'exp_var' => 60*60 // there is no need to refresh a nonce, so we set it's expire variant to a higher value\n )\n );\n return $sf_nonce;\n }", "public function setNonce($nonce)\n {\n $this->nonce = $nonce;\n return $this;\n }", "function wp_ajax_rest_nonce()\n {\n }", "public static function makeNonce() {\r\n\t\treturn bin2hex(openssl_random_pseudo_bytes(16));\r\n\t}", "static function generate_nonce($counter) {\n\t\treturn self::hash($counter);\n\t}", "public function get_nonce() {\n\t\treturn $this->mt_nonce;\n\t}", "function get_nonce(): ?string\n{\n return is_request() ? input_request('nonce') : input_get('nonce');\n}", "final public function randomNonce() {\n\t\treturn Salt::randombytes(Salt::box_NONCE);\n\t}", "private static function makeNonce():string {\r\n try {\r\n $randBytes = random_bytes(32);\r\n $b64random = base64_encode($randBytes);\r\n $nonce = preg_replace(\"/[^A-Za-z0-9 ]/\", '', $b64random); //strip out non-alphanumeric\r\n } catch (\\Exception $e) {\r\n $nonce = null;\r\n }\r\n\r\n return $nonce;\r\n }", "public function registerForm(){\n $this->nonce=Nonce::getNonce();\n }", "private function cspGenerateNonce()\n {\n $nonce = base64_encode(\n openssl_random_pseudo_bytes(30, $isCryptoStrong)\n );\n\n if ( ! $isCryptoStrong)\n {\n $this->addError(\n 'OpenSSL (openssl_random_pseudo_bytes) reported that it did\n <strong>not</strong> use a cryptographically strong algorithm\n to generate the nonce for CSP.',\n\n E_USER_WARNING\n );\n }\n\n return $nonce;\n }", "public function generateNonce(): string\n {\n $nonce = $this->randomService->hex(32);\n\n return $nonce;\n }", "public static function nonce($length=12){\n $characters = array_merge(range(0,9), range('A','Z'), range('a','z'));\n $length = $length > count($characters) ? count($characters) : $length;\n shuffle($characters);\n $prefix = microtime();\n $nonce = md5(substr($prefix . implode('', $characters), 0, $length));\n return $nonce;\n }", "public function getScriptNonce() {\n if (empty($this->nonce)) {\n $this->nonce = hash('sha256', SALT . rand(0, time()));\n }\n\n return $this->nonce;\n }", "function wp_comment_form_unfiltered_html_nonce()\n {\n }", "public function testNonceCreation() {\n\t\t$signer = new Auth_OAuth_Signer();\n\n\t\t$params = array('file'=>'vacation.jpg', 'size'=>'original', 'oauth_version'=>'1.0',\n\t\t\t\t\t'oauth_consumer_key'=>'dpf43f3p2l4k3l03', 'oauth_token'=>'nnch734d00sl2jdk');\n\t\tself::build_request('GET', 'http://photos.example.net/photos', $params);\n\t\t$request = Auth_OAuth_RequestImpl::fromRequest();\n\t\t$server = new Auth_OAuth_Store_ServerImpl('key', 'kd94hf93k423kf44');\n\t\t$server->setSignatureMethods( array('PLAINTEXT', 'HMAC-SHA1') );\n\t\t$token = new Auth_OAuth_TokenImpl('token', 'pfkkdhi9sl3r4s00', 'key', 'access');\n\n\t\t$current_time = time();\n\n\t\t$signer->sign($request, $server, $token);\n\t\t$this->assertNotNull($request->getTimestamp());\n\t\t$this->assertTrue($request->getTimestamp() > ($current_time - 100));\n\t\t$this->assertTrue($request->getTimestamp() < ($current_time + 100));\n\t\t$this->assertNotNull($request->getNonce());\n\t}", "public function setCardNonce(?string $cardNonce): void\n {\n $this->cardNonce['value'] = $cardNonce;\n }", "public function unsetCardNonce(): void\n {\n $this->cardNonce = [];\n }", "public static function nonce($bits=256,$method='sha512') {\n \n $bytes = ceil($bits / 8);\n $text = '';\n \n for ($i = 0; $i < $bytes; $i++) {\n $text .= chr(mt_rand(0, 255));\n }\n \n $text = hash($method, $text);\n \n /* pass it back */\n \n return $text;\n }", "public function getClientNoncePad(): string;", "function nonce_validate($method = 'get') {\n\tswitch($method) {\n\t\tcase 'post':\n\t\t\t$nonce = (!empty($_POST['nonce'])) ? $_POST['nonce'] : '';\n\t\tbreak;\n\n\t\tdefault:\n\t\t\t$nonce = (!empty($_GET['nonce'])) ? $_GET['nonce'] : '';\n\t\tbreak;\n\t}\n\treturn $_SESSION['nonce'] == $nonce && $_SESSION['nonce'];\n}", "public function getNonce()\n {\n return $this->event[\"link\"][\"nonce\"];\n }", "public function checkServerNonce ( $consumer_key, $token, $timestamp, $nonce ) { }", "function wp_nonce_field($action = -1, $name = '_wpnonce', $referer = \\true, $display = \\true)\n {\n }", "private function generateNonce()\n {\n $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n $string = '';\n $max = mb_strlen( $characters, '8bit' ) - 1;\n\n for ( $i = 0; $i < 32; ++$i )\n {\n $string .= $characters[random_int( 0, $max )];\n }\n\n return $string;\n }", "private function getNonce()\n {\n $ch = $this->createCurlConnection('/auth/nonce');\n\n $body = curl_exec($ch);\n $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n $result = null;\n\n if ($code == 200) {\n $result = json_decode($body, true);\n $result = $result['authNonce'];\n } elseif ($code == 403) {\n $result = 'ERROR403';\n }\n curl_close($ch);\n //fclose($fp);\n\n return $result;\n }", "function signup_nonce_fields()\n {\n }", "private function manageNonceFile(string $nonce)\n {\n $timestamp = date('U');\n $file = $this->config->hawk->get('nonce_dir', '/tmp') . '/' .\n $this->nonceFile;\n if (file_exists($file)) {\n /**\n * Manage recorded nonces\n */\n $lines = file($file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n $handle = fopen($file, 'w');\n foreach ($lines as $line) {\n $parts = explode(',', $line);\n if (sizeof($parts) === 2) {\n if ($parts[1] + $this->config->hawk->get('expire', 60)\n < $timestamp) {\n /**\n * Forget expired nonces\n */\n continue;\n }\n fwrite($handle, $line . \"\\n\");\n } else {\n throw new Exception(\"Malformed row in $file: $line\");\n }\n }\n } else {\n $handle = fopen($file, 'w');\n }\n // Record new nonce\n fwrite($handle, \"$nonce,$timestamp\\n\");\n fclose($handle);\n chmod($file, 0755);\n }", "private static function not_a_nonce( $uid, $tid ){\n\t\t$salt = self::mjj_get_salt();\n\t\t//because why not add a little string to it\n\t\t$string = $uid . $tid . \"user and topic ids\";\n\t\t$encrypted = hash_hmac( 'md5', $string, $salt );\n\t\treturn $encrypted;\n\n\t}", "private function manageNonces(string $nonce)\n {\n switch ($this->backend) {\n case 'file':\n $this->manageNonceFile($nonce);\n break;\n case 'database':\n case 'db':\n $this->manageNonceDatabase($nonce);\n break;\n case 'cache':\n $this->manageNonceCache($nonce);\n break;\n default:\n throw new Exception(\"Unknown Hawk backend: {$this->backend}\");\n }\n }", "function acf_verify_nonce($value)\n{\n}", "function wp_nonce_tick($action = -1)\n {\n }", "public function nonceStation() { return $this->_m_nonceStation; }", "public function testDefaultWPNonceFieldOOP() {\n $nonceField = $this->nonceInstance->wp_nonce_field();\n $this->assertEquals('<input type=\"hidden\" id=\"_wpnonce\" name=\"_wpnonce\" value=\"b192fc4204\" /><input type=\"hidden\" name=\"_wp_http_referer\" value=\"/index.php\" />', $nonceField);\n }", "private function manageNonceCache()\n {\n if (!$this->di->has('cache')) {\n throw new Exception(\n \"Nonce backend 'cache' requires cache service to be configured.\"\n );\n }\n $this->cache->save($this->nonceCacheKey, true);\n }", "function lookup_nonce($consumer, $token, $nonce, $timestamp) {\n // Should add some clever logic to keep nonces from\n // being reused - for no we are really trusting\n // that the timestamp will save us\n return NULL;\n }", "public function get_nonce_action();", "function wp_nonce_ays($action)\n {\n }", "public function add_security_nonce( $action ) {\r\n\t\tif ( ! is_array( $this->security_nonces ) ) {\r\n\t\t\t$this->security_nonces = array();\r\n\t\t}\r\n\t\tif ( ! function_exists( 'wp_create_nonce' ) ) {\r\n\t\t\tinclude_once ABSPATH . WPINC . '/pluggable.php';\r\n\t\t}\r\n\t\t$this->security_nonces[ $action ] = wp_create_nonce( $action );\r\n\t}", "protected function generateNonceTag($salt)\n {\n return wp_nonce_field($salt, \"authenticity_token\", true, false);\n }", "function lookup_nonce($consumer, $token, $nonce, $timestamp) {\n // Should add some clever logic to keep nonces from\n // being reused - for no we are really trusting\n // that the timestamp will save us\n return NULL;\n }", "function wp_block_theme_activate_nonce()\n {\n }", "protected function getNonceSalt()\n {\n // Allow users to set their own nonce\n if (!is_null($this->getConfig('nonce'))) {\n return $this->request->generateNonceKey($this->getConfig('nonce'));\n // Use the entity if it is present\n } elseif (!is_null($this->associatedEntity)) {\n return $this->request->generateNonceKey($this->associatedEntity);\n }\n\n // Fallback to something custom for the Helper\n return $this->request->generateNonceKey();\n }", "function acf_nonce_input($nonce = '')\n{\n}", "function wp_verify_nonce($nonce, $action = -1)\n {\n }", "public function get_nonce_field(): string {\n\t\treturn $this->nonce_field;\n\t}", "public function getCardNonce(): ?string\n {\n if (count($this->cardNonce) == 0) {\n return null;\n }\n return $this->cardNonce['value'];\n }", "public function setDebugNonce($nonce)\n {\n $this->debugNonce = $nonce;\n }", "public function useJsNonce($nonce) {\n\t\t$this->useJsNonce = $nonce;\n\t\treturn $this;\n\t}", "private function check_nonce($consumer, $token, $nonce, $timestamp) {\n if( ! $nonce )\n throw new OAuthException(\n 'Missing nonce parameter. The parameter is required'\n );\n\n // verify that the nonce is uniqueish\n $found = $this->data_store->lookup_nonce(\n $consumer,\n $token,\n $nonce,\n $timestamp\n );\n if ($found) {\n throw new OAuthException(\"Nonce already used: $nonce\");\n }\n }", "function mknonce($len = 64)\n{\n\t$SNChars = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM';\n\t$SNCCount = strlen($SNChars);\n\t$s = '';\n\twhile (strlen($s) < $len)\n\t{\n\t\t$s .= $SNChars[random_int(0, $SNCCount-1)];\n\t}\n\treturn $s;\n}", "public function signupNonceFields() {\n if (function_exists(self::SIGNUP_NONCE_FIELDS) === FALSE) {\n return FALSE;\n } else {\n call_user_func(self::SIGNUP_NONCE_FIELDS);\n }\n }", "protected function getNonceLength()\n {\n switch ($this->cipher) {\n case static::CIPHER_AES_256:\n return SODIUM_CRYPTO_AEAD_AES256GCM_NPUBBYTES;\n\n case static::CIPHER_CHACHA:\n return SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES;\n\n case static::CIPHER_CHACHA_IETF:\n return SODIUM_CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES;\n\n // documented here:\n // https://libsodium.gitbook.io/doc/secret-key_cryptography/aead/chacha20-poly1305/xchacha20-poly1305_construction\n case static::CIPHER_X_CHACHA_IETF:\n return 24;\n\n default:\n return 0;\n }\n }", "function wp_explain_nonce($action)\n {\n }", "public function get_cart_nonce() {\n\n\t\treturn WC()->session->get( 'wc_braintree_paypal_cart_nonce', '' );\n\t}", "public function insert($nonce, $ip) {\n $this->deleteIP($ip);\n return $this->_mysqli->query(sprintf(\"INSERT INTO tbl_nonces (`s_ip`, `dt_datetime`, `s_nonce`) VALUES ('%s', '%s', '%s')\", $this->_mysqli->real_escape_string($ip), date('Y-m-d H:i:s'), $this->_mysqli->real_escape_string($nonce)));\n }", "protected function getWpNonceFieldFunction()\n {\n return new TwigFunction('wp_nonce_field', 'wp_nonce_field', [\n 'is_safe' => ['html'],\n ]);\n }", "function signup_nonce_check($result)\n {\n }", "function wp_nonce_url($actionurl, $action = -1, $name = '_wpnonce')\n {\n }", "public function setNonce($nonce, $opURL)\n {\n $sql = \"INSERT INTO {$this->tableNames['nonce']}\n (uri, nonce, created)\n VALUES (?, ?, ?)\";\n $this->prepareExecute($sql, array($opURL, $nonce, time()));\n\n return $this;\n }", "private function checkNonce(Client $client, Token $token, $nonce, $timestamp)\n {\n if (!$nonce) {\n throw new OAuthException('Missing nonce parameter. The parameter is required');\n }\n\n // verify that the nonce is uniqueish\n $found = $this->data_store->lookupNonce($client, $token, $nonce, $timestamp);\n if ($found) {\n throw new OAuthException('Nonce already used: ' . $nonce);\n }\n }", "public function lookup_nonce($consumer, $token, $nonce, $timestamp)\n {\n // Should add some clever logic to keep nonces from\n // being reused - for no we are really trusting\n // that the timestamp will save us\n return !apc_add($consumer . $timestamp , $nonce,1800);\n }", "public function testWPNonceUrlOOP1() {\n $nonceUrl = $this->nonceInstance->wp_nonce_url('http://www.hmil.ph/index.php?');\n $this->assertEquals('http://www.hmil.ph/index.php?_wpnonce=b192fc4204', $nonceUrl);\n }", "public function testWPCreateNonceOOP() {\n $nonceCreate = $this->nonceInstance->wp_create_nonce('log-out');\n $this->assertEquals('b192fc4204', $nonceCreate);\n }", "public function testWPNonceUrlOOP2() {\n $nonceUrl = $this->nonceInstance->wp_nonce_url('http://www.hmil.ph/index.php?', 'log-out', 'my-nonce');\n $this->assertEquals('http://www.hmil.ph/index.php?my-nonce=b192fc4204', $nonceUrl);\n }", "public function getPaymentMethodNonce()\n {\n return $this->getInfoInstance()->getAdditionalInformation('payment_method_nonce');\n }", "private function get_nonce( $post ) {\n\t\t$nonce = array(\n\t\t\twp_nonce_field( 'formation_frontend_submission', 'formation_nonce', true, false ),\n\t\t);\n\n\t\t$reference_args = array(\n\t\t\t'value' => $post->ID,\n\t\t\t'slug' => self::FORM_ID_KEY,\n\t\t);\n\t\t$reference = new Field\\Hidden( $reference_args, $this->plugin, null );\n\t\t$nonce[] = $reference->render( $reference_args );\n\n\t\treturn $nonce;\n\t}", "public function wp_comment_form_unfiltered_html_nonce() {\n\t\t$post = get_post();\n\t\t$post_id = $post ? $post->ID : 0;\n\n\t\tif ( current_user_can( 'unfiltered_html' ) \n\t\t\t\t&& 'dwqa-answer' != get_post_type( $post_id ) ) {\n\t\t\twp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_disabled', false );\n\t\t\techo \"<script>( function() {if ( window===window.parent ) {document.getElementById( '_wp_unfiltered_html_comment_disabled' ).name='_wp_unfiltered_html_comment';}} )();</script>\\n\";\n\t\t} elseif ( current_user_can( 'unfiltered_html' ) \n\t\t\t\t\t\t&& 'dwqa-answer' == get_post_type( $post_id ) ) {\n\t\t\t\t\t\t\t\n\t\t\twp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_answer_disabled', false );\n\t\t\techo \"<script>( function() {if ( window===window.parent ) {document.getElementById( '_wp_unfiltered_html_comment_answer_disabled' ).name='_wp_unfiltered_html_comment';}} )();</script>\\n\";\n\t\t}\n\t}", "public function is_valid_nonce( $nonce = 'mpp_ajax_nonce' ){\n if( ! isset( $_POST['ajax_nonce'] ) || ! wp_verify_nonce( $_POST['ajax_nonce'], $nonce ) ){\n return false;\n }\n return true;\n }" ]
[ "0.7351805", "0.72904134", "0.70569694", "0.68044084", "0.67492175", "0.66496146", "0.65936077", "0.65637004", "0.6545681", "0.6545059", "0.6541406", "0.64330024", "0.6392068", "0.62986654", "0.6278513", "0.62599474", "0.6245064", "0.6223602", "0.6203271", "0.61891425", "0.6124586", "0.6113116", "0.61049724", "0.60927004", "0.6050775", "0.60405624", "0.6030123", "0.60263014", "0.6022986", "0.60116327", "0.59973013", "0.5987839", "0.59485334", "0.58989984", "0.5884954", "0.58674306", "0.58316416", "0.57643783", "0.5759413", "0.5738045", "0.5726455", "0.5713539", "0.5713383", "0.57121533", "0.57118475", "0.57099736", "0.5699083", "0.56822217", "0.56539625", "0.5621257", "0.5608091", "0.5605586", "0.55689186", "0.55598575", "0.55542326", "0.55421776", "0.5537505", "0.5507936", "0.5497959", "0.537791", "0.53606683", "0.53428644", "0.53208315", "0.530363", "0.5299545", "0.5290396", "0.5279046", "0.5267353", "0.52611053", "0.52461714", "0.5228708", "0.5214032", "0.5181895", "0.5180202", "0.51732016", "0.517284", "0.514426", "0.51280284", "0.51152", "0.5098048", "0.5074543", "0.5063257", "0.5040966", "0.50387806", "0.50311065", "0.5017803", "0.49787793", "0.49649987", "0.49443007", "0.4936072", "0.49273375", "0.49071452", "0.48924914", "0.48851806", "0.48801875", "0.48783773", "0.48769498", "0.48692566", "0.48642787", "0.48615295", "0.48350123" ]
0.0
-1
Utility function saves game stat
function gameStatUtil(){ $db = new DBIO(); if($_SERVER["REQUEST_METHOD"] == 'POST'){ if(isset($_POST["saveGame"])){ $db->setScore($this->title, $_SESSION['user'], $_POST["cookieScore"],$_POST["RPSWin"],$_POST["RPSLoss"]); } header("Location:" . $_SERVER["PHP_SELF"]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function saveStats()\r\n {\r\n }", "private function save() {\n $this->state->get()['score'] += $this->dice->sum();\n $this->state->get()['round'] += 1;\n\n if ($this->state->get()['score'] >= 100) {\n $this->message = \"Grattis! Du vann!\";\n $this->cleardice = TRUE;\n $this->cleargame = TRUE;\n }\n\n $this->dice->clear();\n }", "function writeGamestate($newdata) {\n\t//file_put_contents(\"data/gamestate.json\", json_encode($newdata));\n\tif (isset($_SESSION['gameid'])) {\n\t\t$id = $_SESSION['gameid'];\n\n\t\tfile_put_contents(\"data/games/$id.json\", json_encode($newdata));\n\n\t\treturn $newdata;\n\t} else {\n\t\treturn []; // error('please register first');\n\t}\n\n}", "private function storeGame()\n {\n $_SESSION['game'] = array(\n 'remaining_ships' => $this->remainingShips,\n 'player_turns' => $this->playerTurns,\n 'ships' => $this->ships,\n 'board' => $this->board\n );\n }", "function getSave($savegame) {\n // Magic number at beginning of file: 'Devi'.\n $ret['magic'] = substr($savegame, 0x0, 0x4);\n\n // 2-byte checksum, in little-endian format.\n $ret['checksum'] = substr($savegame, 0x4, 0x2);\n\n // This segment of data is unknown.\n $ret['unknown1'] = substr($savegame, 0x6, 0x3A);\n\n // Leader for team 1.\n $ret['l0'] = substr($savegame, 0x40 + (0 * 0x1C), 0x1C);\n\n // Leader for team 2.\n $ret['l1'] = substr($savegame, 0x40 + (1 * 0x1C), 0x1C);\n\n // Leader for team 3.\n $ret['l2'] = substr($savegame, 0x40 + (2 * 0x1C), 0x1C);\n\n // Leader for team 4.\n $ret['l3'] = substr($savegame, 0x40 + (3 * 0x1C), 0x1C);\n\n // More leaders/demons, that are not currently on a team. These will be available for editing at a later time.\n $ret['unknown2'] = substr($savegame, 0xB0, 0xE0);\n\n // Demon 1 for team 1.\n $ret['d0'] = substr($savegame, 0x190 + (0 * 0x1A), 0x1A);\n\n // Demon 2 for team 1.\n $ret['d1'] = substr($savegame, 0x190 + (1 * 0x1A), 0x1A);\n\n // Demon 1 for team 2.\n $ret['d2'] = substr($savegame, 0x190 + (2 * 0x1A), 0x1A);\n\n // Demon 2 for team 2.\n $ret['d3'] = substr($savegame, 0x190 + (3 * 0x1A), 0x1A);\n\n // Demon 1 for team 3.\n $ret['d4'] = substr($savegame, 0x190 + (4 * 0x1A), 0x1A);\n\n // Demon 2 for team 3.\n $ret['d5'] = substr($savegame, 0x190 + (5 * 0x1A), 0x1A);\n\n // Demon 1 for team 4.\n $ret['d6'] = substr($savegame, 0x190 + (6 * 0x1A), 0x1A);\n\n // Demon 2 for team 4.\n $ret['d7'] = substr($savegame, 0x190 + (7 * 0x1A), 0x1A);\n\n // More demon data. Not sure where it is used in-game.\n $ret['unknown3'] = substr($savegame, 0x260, 0x1A0);\n\n // Unknown data. Assumed to contain info for leader names.\n $ret['unknown4'] = substr($savegame, 0x400, 0x84);\n\n // Macca (money).\n $ret['macca'] = substr($savegame, 0x484, 0x4);\n\n // Shop rating.\n $ret['shopRating'] = substr($savegame, 0x488, 0x4);\n\n // This segment of data is unknown.\n $ret['unknown5'] = substr($savegame, 0x48C, 0x4A0);\n\n // Timestamp of some sort. Appears to be in little endian format, and follows a structure similar to epoch timestamps.\n $ret['timestamp'] = substr($savegame, 0x92C, 0x4);\n\n // This segment of data is unknown.\n $ret['unknown6'] = substr($savegame, 0x930, 0x98);\n\n // Quick save data. Assumed to contain a similar structure to main save data.\n $ret['quickSave'] = substr($savegame, 0x9C8, 0x1628);\n\n // Footer at end of file: 'DEVILSURVIVOR_US'.\n $ret['footer'] = substr($savegame, 0x1FF0, 0x10);\n\n return $ret;\n}", "public function save_game(){\n\n\t\t$query = \"UPDATE `games`\n\t \tSET `title` = '$this->title', `user_count` = '$this->user_count', `api` = '$this->api',\n\t \t`info` = '$this->info', `bgimage` = '$this->bgimage', `banner` = '$this->banner', `level` = '$this->level'\n\t \tWHERE `id` = '$this->id'\";\n\n\t\tif(DB::sql($query)){\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function saveGame()\n\t{\n\t\t$db = new PegDB();\n\t\t\n\t\treturn $db->saveGame($this->moves);\n\t}", "function writeGame($id, $data) {\n\tif (!file_exists('data/games')) {\n\t\tmkdir('data/games', 0744);\n\t}\n\tfile_put_contents(\"data/games/$id.json\", json_encode($data));\n}", "function writeGames($new) {\n\tfile_put_contents(\"data/games.json\", json_encode($new));\n\n\treturn $new;\n}", "function writePlayerData($player, $data) {\n\t$old_data = getGamestate();\n\t$old_data[$player] = $data;\n\twriteGamestate($old_data);\n}", "function game_store($key, $value) {\n\t$file = get_game_storage($key);\n\t$dir = dirname($file);\n\tif(!is_dir($dir)) {\n\t\t`mkdir -p $dir`;\n\t}\n\tfile_put_contents($file, serialize($value));\n}", "function gaUnit_save($appGlobals) {\n $atGameId = $this->game_atGameId; // will be zero for new game\n $modWhen = rc_getNow();\n $row = array();\n if ($this->game_gameId>=1) {\n $row['gpGa:GameId'] = $this->game_gameId; //can be zero if new record\n }\n $row['gpGa:@GameId'] = $this->game_atGameId; //will be zero for first player of new game\n $row['gpGa:@ProgramId'] = $this->game_AtProgramId;\n $row['gpGa:@PeriodId'] = $this->game_atPeriodId;\n $row['gpGa:WhenCreated'] = $this->game_whenCreated;\n $row['gpGa:GameTypeIndex'] = $this->game_gameType;\n $row['gpGa:@KidPeriodId'] = $this->game_opponents_kidPeriodId[$i];\n $row['gpGa:GamesWon'] = $this->game_opponents_wins[$i];\n $row['gpGa:GamesLost'] = $this->game_opponents_losts[$i];\n $row['gpGa:GamesDraw'] =$this->game_opponents_draws[$i];\n $row['gpGa:Opponents'] = is_array(game_opponents_kidPeriodId) ? implode(',',$this->game_opponents_kidPeriodId) : $this->game_opponents_kidPeriodId;\n $row['gpGa:OriginCode'] = GAME_ORIGIN_CLASS;\n $row['gpGa:ClassDate'] = $this->game_classDate;\n $row['gpGa:ModBy@StaffId'] = rc_getStaffId(); //????? make safe\n $row['gpGa:ModWhen'] = $modWhen;\n $gameId = $this->game_opponents_gameId[$i];\n if ($gameId==0) {\n $query = kcmRosterLib_db_insert($appGlobals->gb_db,'gp:games',$row);\n $result = $appGlobals->gb_db->rc_query( $query );\n if ($result === FALSE) {\n $appGlobals->gb_sql->sql_fatalError( __FILE__,__LINE__, $query);\n }\n if ($atGameId==0) {\n $atGameId = $appGlobals->gb_db->insert_id;\n $row = array();\n $row['gpGa:@GameId'] = $atGameId;\n $query = kcmRosterLib_db_update($appGlobals->gb_db,'gp:games',$row,\"WHERE `gpGa:GameId` = '{$atGameId}'\");\n $result = $appGlobals->gb_db->rc_query( $query );\n if ($result === FALSE) {\n $appGlobals->gb_sql->sql_fatalError( __FILE__,__LINE__, $query);\n }\n }\n }\n else {\n $query = kcmRosterLib_db_update($appGlobals->gb_db,'gp:games',$row,\"WHERE `gpGa:GameId` = '{$gameId}'\");\n $result = $appGlobals->gb_db->rc_query( $query );\n if ($result === FALSE) {\n $appGlobals->gb_sql->sql_fatalError( __FILE__,__LINE__, $query);\n }\n }\n $this->game_atGameId = $atGameId;\n return $atGameId;\n}", "function doSavePlayerGame() {\n\t\tif(!LibTools::isAdmin()) {\n\t\t\treturn;\n\t\t}\n\t\t$gamePlayed = $_POST['gamePlayed'];\n\t\tif(!isset($gamePlayed)) {\n\t\t\treturn;\n\t\t}\n\t\tforeach($gamePlayed as $id_game => $id_char) {\n\t\t\tSs::get()->dao->playerGameDao->save($this->id, $id_game, $id_char);\n\t\t}\n\t\t\n\t}", "function Save()\n\t{\n\t\t$Database = new DatabaseConnection();\n\t\t$this->pog_query = \"select `statsid` from `stats` where `statsid`='\".$this->statsId.\"' LIMIT 1\";\n\t\t$Database->Query($this->pog_query);\n\t\tif ($Database->Rows() > 0)\n\t\t{\n\t\t\t$this->pog_query = \"update `stats` set \n\t\t\t`objectname`='\".$Database->Escape($this->objectname).\"', \n\t\t\t`objectid`='\".$Database->Escape($this->objectid).\"', \n\t\t\t`impressions`='\".$Database->Escape($this->impressions).\"', \n\t\t\t`clicks`='\".$Database->Escape($this->clicks).\"' where `statsid`='\".$this->statsId.\"'\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->pog_query = \"insert into `stats` (`objectname`, `objectid`, `impressions`, `clicks`) values (\n\t\t\t'\".$Database->Escape($this->objectname).\"', \n\t\t\t'\".$Database->Escape($this->objectid).\"', \n\t\t\t'\".$Database->Escape($this->impressions).\"', \n\t\t\t'\".$Database->Escape($this->clicks).\"' )\";\n\t\t}\n\t\t$Database->InsertOrUpdate($this->pog_query);\n\t\tif ($this->statsId == \"\")\n\t\t{\n\t\t\t$this->statsId = $Database->GetCurrentId();\n\t\t}\n\t\treturn $this->statsId;\n\t}", "function SaveInfo()\r\n\t{\r\n\t\t//Access is not stored in files, just directories.\r\n\t\tif (is_file($this->path)) unset($this->info['access']);\r\n\t\t$info = $this->dir.'/.'.$this->filename;\r\n\t\t$fp = fopen($info, 'w+');\r\n\t\tfwrite($fp, serialize($this->info));\r\n\t\tfclose($fp);\r\n\t}", "protected function saveState() {\n $filename = $this->tempPath() . self::STATEFILE_STUB;\n return file_put_contents($filename, serialize($this->state));\n }", "public function saveScore()\n {\n $this->savedScore += $this->score;\n $this->score = 0;\n $this->points -= 5;\n }", "public function saveGame($name, $data, $imageData) {\n $savedGames = fopen(\"../../../ressources/savedGames/\".$name.\".json\", \"wb\");\n $savedGamesImg = fopen(\"../../../ressources/savedGames/\".$name.\".txt\", \"wb\");\n\tfwrite($savedGames, $data);\n\tfwrite($savedGamesImg, $imageData);\n\tfclose($savedGames);\n\tfclose($savedGamesImg);\n }", "function saveVister()\n {\n \n }", "private function save() \n {\n $content = \"<?php\\n\\nreturn\\n[\\n\";\n\n foreach ($this->arrayLang as $this->key => $this->value) \n {\n $content .= \"\\t'\".$this->key.\"' => '\".$this->value.\"',\\n\";\n }\n\n $content .= \"];\";\n\n file_put_contents($this->path, $content);\n\n }", "function save_score($player) {\n if ($player->score >= 0 && $player->level != '1-1') {\n $result = mysql_query(\"select * from spelunky_scores \" .\n \" where scores_players_id = \" . $player->steamid . \n \" and scores_date = date('\" . date('Y-m-d') . \"')\");\n\n if (! ($row = mysql_fetch_array($result))) {\n $insert = \"insert into spelunky_scores (\" . \n \"scores_id, \" . \n \"scores_players_id, \" .\n \"scores_date, \" . \n \"scores_score, \" . \n \"scores_level, \" .\n \"scores_character, \" .\n \"scores_twitch) values (\" . \n \"null, \" .\n $player->steamid . \", \" .\n \"date('\" . date('Y-m-d') . \"'), \" . \n $player->score . \", \" .\n \"'\" . $player->level . \"', \" .\n $player->character . \", \" . \n \"'\" . trim($player->twitch) . \"')\";\n\n mysql_query($insert);\n }\n }\n }", "public static function update(Game $game)\n {\n $stats = self::get();\n if (isset($stats[$game->getState()->getId()])) {\n $stats[$game->getState()->getId()]++;\n } else {\n $stats[$game->getState()->getId()] = 1;\n }\n\n if (isset($stats[self::STATISTIC_COMPUTER_DRAW_PREFIX][$game->getComputerDecision()->getId()])) {\n $stats[self::STATISTIC_COMPUTER_DRAW_PREFIX][$game->getComputerDecision()->getId()]++;\n } else {\n $stats[self::STATISTIC_COMPUTER_DRAW_PREFIX][$game->getComputerDecision()->getId()] = 1;\n }\n\n if (isset($stats[self::STATISTIC_OPPONENT_DRAW_PREFIX][$game->getOpponentDecision()->getId()])) {\n $stats[self::STATISTIC_OPPONENT_DRAW_PREFIX][$game->getOpponentDecision()->getId()]++;\n } else {\n $stats[self::STATISTIC_OPPONENT_DRAW_PREFIX][$game->getOpponentDecision()->getId()] = 1;\n }\n $cache = new FilesystemCache();\n $cache->set(self::STATISTIC_PREFIX, $stats);\n }", "function updateStatus() {\n global $status, $spambotDataLoc;\n return file_put_contents( $spambotDataLoc.'sbstatus', serialize($status) ); \n}", "public function write_new_game(){\n\n\t\t$query = \"INSERT INTO `games`\n\t\t( `title`, `user_count`, `info`, `bgimage`, `banner`, `level`, `api`)\n\t\tVALUES\n\t\t('$this->title', '$this->user_count', '$this->info', '$this->bgimage', '$this->banner', '$this->level', '$this->api')\";\n\n\t\tif(DB::sql($query)){\n\t\t\t$this->id = DB::last_id();\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\n\t}", "public function savePosition() {}", "function game_save_best_score($game) {\n global $DB, $USER;\n\n // Get all the attempts made by the user\n if (!$attempts = game_get_user_attempts( $game->id, $USER->id)) {\n print_error( 'Could not find any user attempts');\n }\n\n // Calculate the best grade\n $bestscore = game_calculate_best_score( $game, $attempts);\n\n // Save the best grade in the database\n if ($grade = $DB->get_record('game_grades', array( 'gameid' => $game->id, 'userid' => $USER->id))) {\n $grade->score = $bestscore;\n $grade->timemodified = time();\n if (!$DB->update_record('game_grades', $grade)) {\n print_error('Could not update best grade');\n }\n } else {\n $grade->gameid = $game->id;\n $grade->userid = $USER->id;\n $grade->score = $bestscore;\n $grade->timemodified = time();\n if (!$DB->insert_record( 'game_grades', $grade)) {\n print_error( 'Could not insert new best grade');\n }\n }\n\n return true;\n}", "function saveSettings() {\n\tglobal $settings;\n\n\tfile_put_contents(\"settings.json\",json_encode($settings));\n}", "public function saveScore()\n {\n $this->savedScore += $this->score;\n $this->score = 0;\n }", "function config_save($cfg) {\n\t\t$h = fopen(CONFIG_PATH,\"w+\");\n\t\tforeach ($cfg as $cam) {\n\t\t\t$cam_info = $cam[\"name\"].\" : \".$cam[\"hw\"].\"\\t\".$cam[\"width\"].\"x\".$cam[\"height\"].\"\\n\";\n\t\t\tfwrite($h, $cam_info);\n\t\t\tforeach ($cam[\"gates\"] as $gate) {\n\t\t\t\t$gate_info = \"\\t\".$gate[\"name\"].\"\\t(\".$gate[\"x1\"].\",\".$gate[\"y1\"].\")\\t(\".$gate[\"x2\"].\",\".$gate[\"y2\"].\")\\n\";\n\t\t\t\tfwrite($h, $gate_info);\n\t\t\t}\n\t\t}\n\t\tfclose($h);\n\t}", "public function setupGameFiles($game)\r\n {\r\n $this->gamefile = '.' . $game . '-' . $this->command->chat_id;\r\n $this->answerfile = $this->gamefile . '-answer';\r\n\r\n $this->scorefile = $this->gamefile . '-score';\r\n $this->monthlyscorefile = $this->gamefile . '-score-' . date('Ym');\r\n $this->globalscorefile = $this->gamefile . '-score-all';\r\n }", "public function PrintStats(){\n\n ##Check for bad jumps\n for($i = 0; $i < count($this->jumps); $i++){\n if(!in_array( $this->jumps[$i], $this->labels)){\n $this->COUNTERS[BADJUMPS] += 1;\n $this->COUNTERS[FWJUMPS] -= 1;\n }\n }\n\n for($i = 0; $i < count($this->statfiles); $i++){\n\n $filename = $this->statfiles[$i];\n $filehandler = fopen($filename, \"w\");\n if(false){\n $this->Error(ERROR_OUTPUT_FILES, \"Unable to open file {$filename}\");\n }\n \n $statFlag = $this->statFlags[$i];\n\n for($j = 0; $j < count($statFlag); $j++){\n fwrite($filehandler,$this->COUNTERS[$this->FLAGS[$statFlag[$j]]].\"\\n\");\n #fwrite($filehandler,\"\\n\"); \n }\n fclose($filehandler);\n }\n }", "private function createSavegame()\n {\n if (isset($this->savegame)) {\n posix_kill($this->savegame, SIGKILL);\n }\n\n $pid = pcntl_fork();\n\n if ($pid) {\n // Save the savegame PID for later\n $this->savegame = $pid;\n file_put_contents($this->savegameFile, $this->savegame);\n } else {\n // Stop and wait until savegame is needed.\n posix_kill(posix_getpid(), SIGSTOP);\n\n // Savegame has been resumed\n // We'll need a new monitor and savegame\n $this->createMonitor();\n $this->createSavegame();\n }\n }", "function save();", "function save();", "public function save(game $game) \n {\n\n $logo = $game->getLogo();\n $bg = $game->getBackground();\n\n $this->imageDAO->save($logo);\n $this->imageDAO->save($bg);\n\n $gameData = array(\n 'game_title' => $game->getTitle(),\n 'game_logo_id' => $logo->getId(),\n 'game_bg_id' => $bg->getId()\n );\n\n if ($game->getId()) {\n // The game has already been saved : update it\n $this->getDb()->update('game', $gameData, array('game_id' => $game->getId()));\n } else {\n // The game has never been saved : insert it\n $this->getDb()->insert('game', $gameData);\n // Get the id of the newly created game and set it on the entity.\n $id = $this->getDb()->lastInsertId();\n $game->setId($id);\n }\n }", "function gaMatch_getSavedString($appGlobals) {\n $s = '';\n $sSep = '';\n for ($i=0; $i < $this->game_opponents_count; ++$i) {\n //$kidPeriod = $appGlobals->rst_cur_period->perd_getKidPeriodObject($this->game_opponents_kidPeriodId[$i]);\n //$kidName = $kidPeriod->kidPer_kidObject->rstKid_uniqueName;\n $kidName = $appGlobals->rst_cur_period->perd_getKidUniqueName($this->game_opponents_kidPeriodId[$i]);\n $sep = '';\n $s1 = '';\n $tot = $this->game_opponents_wins[$i] + $this->game_opponents_losts[$i] + $this->game_opponents_draws[$i];\n if ($this->game_opponents_wins[$i] > 0) {\n $s1 = ($this->game_opponents_wins[$i] + $tot == 2)? 'Won' : ' Won ' . $this->game_opponents_wins[$i] ;\n $sep = ', ';\n }\n if ($this->game_opponents_losts[$i] > 0) {\n $lost = ($this->game_opponents_losts[$i] + $tot == 2)? 'Lost' : ' Lost ' . $this->game_opponents_losts[$i] ;\n $s1 .= $sep . $lost;\n $sep = ', ';\n }\n if ($this->game_opponents_draws[$i] > 0) {\n $draw = ($this->game_opponents_draws[$i] + $tot == 2)? 'Draw' : ' Draw ' . $this->game_opponents_draws[$i];\n $s1 .= $sep . $draw; ;\n $sep = ', ';\n }\n $s .= $sSep . $kidName . ' (' . $s1 . ')';\n $sSep = ', ';\n }\n return kcmRosterLib_getDesc_gameType($this->game_gameType) . ' Game Saved: ' . $s;\n}", "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}", "public function save()\n\t{\n\t\t// -> means the file was never loaded because no setting was changed\n\t\t// -> means no need to save\n\t\tif ($this->settings === null) return;\n\t\t\n\t\t$yaml = Spyc::YAMLDump($this->settings);\n\t}", "public function salvaStatoInsiemeTags()\n\t\t{\n\t\t\tif( $fp = fopen(\"tags.stat\", \"w\") )\n\t\t\t\tfwrite($fp, serialize(InsiemeTags::$istanza));\n\t\t\t\t\n\t\t\tfclose($fp);\n\t\t}", "function save()\n {\n }", "function save()\n {\n }", "function makeStatus() {\n\t\t$ap = $this->me->get(\"ap\");\n\t\t$dollar = $this->me->get(\"dollar\");\n\t\t$name = $this->me->get(\"name\");\n\t\t$userName = $this->sysObj->userLogin;\n\t\t$myCityId = $this->me->get(\"city\");\n\t\t$myCityName = getOneThing(\"name\", \"mapdata_cities\", \"id=\".$myCityId);\n\t\t$round = getOneThing(\"current_round\", \"gamestate\", \"gameid=$this->gameId\");\n\t\tif ($this->IAmPlaying) {\n\t\t\t$curCharName = $name;\n\t\t\t$curPlayerName = $userName;\n\t\t} else {\n\t\t\t$curCharName = $this->curChar->get(\"name\");\n\t\t\t$curPlayerName = getOneThing(\"login\", \"user\", \"id=\".getOneThing(\"playedby\", \"gamestate_characters\", \"id=\".$this->curCharId));\n\t\t}\n\t\t$rv = \"\n\t\tgamestate.ap = \".$ap.\";\\n\n\t\tgamestate.dollar = \".$dollar.\";\\n\n\t\tgamestate.charname = '\".$name.\"';\\n\n\t\tgamestate.username = '\".$userName.\"';\\n\n\t\tgamestate.curcityname = '\".$myCityName.\"';\\n\n\t\tgamestate.round = \".$round.\";\\n\n\t\tgamestate.curcharname = '\".$curCharName.\"';\\n\n\t\tgamestate.curplayername = '\".$curPlayerName.\"';\\n\n\t\tgamestate.me = \".$this->myId.\";\\n\";\n\t\treturn $rv;\t\n\t}", "public function save() {\r\n /** probably we should add a timestamp, Item ID and stuff */\r\n $stored_data = json_encode(array($this->name, $this->status), JSON_UNESCAPED_UNICODE);\r\n $this->db_write(\"objects\", \"Item_s11n\", $stored_data);\r\n print ($stored_data);\r\n }", "private static function save() {\n\t\tif(self::$data===null) throw new Excepton('Save before load!');\n\t\t$fp=fopen(self::$datafile,'w');\n\t\tif(!$fp) throw new Exception('Could not write data file!');\n\t\tforeach (self::$data as $item) {\n\t\t\tfwrite($fp,$item); // we use the __toString() here\n\t\t}\n\t\tfclose($fp);\n\t}", "public function WriteFiles()\n {\n $popdata = \"\\$pop = \" . var_export($this->population, true) . \";\\n\";\n $popdata .= \"\\$names = \" . var_export($this->names, true) . \";\\n\";\n file_put_contents(\"population.txt\", $popdata);\n \n file_put_contents(\"fitness.txt\", \"\\$fitness = \" . var_export($this->fitness, true) . \";\");\n \n $state_data = \"\\$generation = \" . var_export($this->generation, true) . \";\\n\";\n $state_data .= \"\\$memory = \" . var_export($this->memory, true) . \";\\n\";\n $state_data .= \"\\$strains = \" . var_export($this->strains, true) . \";\\n\";\n $state_data .= \"\\$lastname = \" . var_export($this->lastname, true) . \";\\n\";\n file_put_contents(\"ga_state.txt\", $state_data);\n }", "function count_access($base_path, $name) {\r\n $filename = $base_path . DIRECTORY_SEPARATOR . \"stats.json\";\r\n $stats = json_decode(file_get_contents($filename), true);\r\n $stats[$name][mktime(0, 0, 0)] += 1;\r\n file_put_contents($filename, json_encode($stats, JSON_PRETTY_PRINT));\r\n}", "public function saveGraphicState() {}", "public function saveGraphicState() {}", "public static function save()\n\t{\n\t\tConfigManager::save('discord', self::load(), 'config');\n\t}", "function updateSession() {\n\tglobal $game;\n\t$_SESSION['board'] = $game[\"board\"];\n\t$_SESSION['player'] = $game[\"player\"];\n\t$_SESSION['winningCombo'] = $game[\"winningCombo\"];\n\t$_SESSION['playToken'] = $game[\"playToken\"];\n\t$_SESSION['gameOver'] = $game[\"gameOver\"];\n}", "public function saveDataToFile()\n {\n\n }", "public function save()\n {\n App::cliLog(\"Saving to $this->format file\", false);\n\n try {\n call_user_func([$this, 'export' . ucfirst($this->format)]);\n } catch (Exception $e) {\n App::cliLog($e->getMessage());\n }\n }", "function save() {\r\n\t\t$this->log .= \"save() called<br />\";\r\n\t\tif (count($this->data) < 1) {\r\n\t\t\t$this->log .= \"Nothing to save.<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//create file pointer\r\n\t\tif (!$fp=@fopen($this->filename,\"w\")) {\r\n\t\t\t$this->log .= \"Could not create or open \".$this->filename.\"<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//write to file\r\n\t\tif (!@fwrite($fp,serialize($this->data))) {\r\n\t\t\t$this->log .= \"Could not write to \".$this->filename.\"<br />\";\r\n\t\t\tfclose($fp);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//close file pointer\r\n\t\tfclose($fp);\r\n\t\treturn true;\r\n\t}", "function getGamestate() {\n\t//\treturn json_decode(file_get_contents(\"data/gamestate.json\"), true);\n\n\tif (isset($_SESSION['gameid'])) {\n\t\t$id = $_SESSION['gameid'];\n\n\t\treturn json_decode(file_get_contents(\"data/games/$id.json\"), true);\n\t} else {\n\t\treturn []; // error('please register first');\n\t}\n\n}", "function save($filePath);", "function Save();", "private function logAnswer() {\n\t\t$fileName = $this::filesPath . $this->lesson->getLessonFileName () . $this::statisticsExtension;\n\t\t// lese Statistik ein\n\t\t$stats = $this->getStatsFromFile ( $fileName );\n\t\t// aktualisiere Statistik\n\t\t$stats [1] ++;\n\t\tif ($this->lesson->isCorrectAnswer ())\n\t\t\t$stats [0] ++;\n\t\t// versuche Statistik in Datei zu schreiben\n\t\ttry {\n\t\t\tif (file_exists ( $fileName ) && ! is_writable ( $fileName ) || ! is_writable ( $this::filesPath ))\n\t\t\t\tthrow new RuntimeException ( 'Statistik konnte nicht gespeichert werden. Stelle sicher, dass entsprechende Dateien und Ordner auf dem Webserver mit den nötigen Schreibrechten eingerichtet sind.' );\n\t\t\tfile_put_contents ( $fileName, $stats [0] . \"\\t\" . $stats [1] );\n\t\t} catch ( RuntimeException $e ) {\n\t\t\t$this->errorMessage = $e->getMessage ();\n\t\t}\n\t}", "public function Save()\n {\n $content = \"\";\n foreach ($this->vars as $key => $elem) {\n $content .= \"[\".$key.\"]\\n\";\n foreach ($elem as $key2 => $elem2) {\n $content .= $key2.\" = \\\"\".$elem2.\"\\\"\\n\";\n }\n $content .= \"\\n\";\n }\n if (!$handle = @fopen($this->fileName, 'w')) {\n error_log(\"Config::Save() - Could not open file('\".$this->fileName.\"') for writing, error.\");\n }\n if (!fwrite($handle, $content)) {\n error_log(\"Config::Save() - Could not write to open file('\" . $this->fileName .\"'), error.\");\n }\n fclose($handle);\n }", "private function gameStatus($game){\n\t\t$count = array_diff($game['words'],$game['words_found']);\n\t\tif(count($count)==0){\n\t\t\t$game['status'] = 'completed';\n\t\t}\n\t\treturn $game;\n\t}", "public function save(array $player) {\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 storeStoredStats($path, array $storedStats);", "function save() {\n $this->log .= \"save() called<br />\";\n if (count($this->data) < 1) {\n $this->log .= \"Nothing to save.<br />\";\n return false;\n }\n //create file pointer\n $this->log .= \"Save file name: \".$this->filename.\"<br />\";\n if (!$fp=@fopen($this->filename,\"w\")) {\n $this->log .= \"Could not create or open \".$this->filename.\"<br />\";\n return false;\n }\n //write to file\n if (!@fwrite($fp,serialize($this->data))) {\n $this->log .= \"Could not write to \".$this->filename.\"<br />\";\n fclose($fp);\n return false;\n }\n //close file pointer\n fclose($fp);\n return true;\n }", "private function saveHighscores() {\n\t\t\t$file = fopen('scores.csv', 'w');\n\t\t\tfputcsv($file, $this->highscores);\n\t\t\tfclose($file);\n\t\t}", "public final function save() {\n }", "private function updateGameSession()\n {\n $this->getSession()->set('gameData', $this->getGame()->getGameData());\n }", "protected function _storeProfile()\n {\n $projectProfileFile = $this->_loadedProfile->search('ProjectProfileFile');\n\n $name = $projectProfileFile->getContext()->getPath();\n\n $this->_registry->getResponse()->appendContent('Updating project profile \\'' . $name . '\\'');\n\n $projectProfileFile->getContext()->save();\n }", "public function getSavedScore()\n {\n return $this->savedScore;\n }", "public function getSavedScore()\n {\n return $this->savedScore;\n }", "private function saveData() {\n // Create a new object with relevant information\n $data = new stdClass();\n $data->accessToken = $this->accessToken;\n $data->expirationDate = $this->expirationDate;\n $data->refreshToken = $this->refreshToken;\n\n // And save it to disk (will automatically create the file for us)\n file_put_contents(DATA_FILE, json_encode($data));\n }", "function doSavePlayer() {\n\t\tif(!LibTools::isAdmin()) {\n\t\t\treturn;\n\t\t}\n\t\t$savePlayer = $_POST['savePlayer'];\n\t\t$pseudo = $savePlayer[\"pseudo\"];\n\t\t$prenom = $savePlayer[\"prenom\"];\n\t\t$nom \t= $savePlayer[\"nom\"];\n\t\t$mail\t= $savePlayer[\"mail\"];\n\t\t$tel\t= $savePlayer[\"tel\"];\n\t\t\n\t\tSs::get()->dao->playerDao->save($this->id, $pseudo, $prenom, $nom, $mail, $tel);\n\t}", "public function save(array $player) {\n\n }", "public function save(array $player) {\n\n }", "function saveValue($datafile, $group,$i,$sendStage,$value,$time){\n\tglobal $status, $playerIndexArray, $valueInDatabase, $timeOutLog;\n\t\n\t// Check if record is still empty & player status is not 'completed'\n\tif ($group[$i+1+$sendStage] == \"[.....]\" and $group[$i+1] != \"completed\") {\n\t\t// If value does not exist and group is not completed, add new value and timestamp to datafile...\n\t\t$group[$i+1+$sendStage] = $value;\n\t\t$valueInDatabase = $value;\n\t\t$group[$i+1] = $time; \n\t\t$status = \"ok\";\n\t\taddData($complete, $group, $datafile);\n\t}\n\telse {\n\t\t// ... otherwise, retrieve the targe value from datafile\n\t\t$valueInDatabase = $group[$i+1+$sendStage];\n\t\t\n\t\t// Check if retrieved value is a default response. If not, it is a duplicate response (no action)\n\t\tif (strpos($valueInDatabase, \"[DefaultResponse]\") === false) {$status = \"duplicate\";}\n\t\telse { // Otherwise, it is a default response: add warning to timeout log\n\t\t\t$valueInDatabase = substr($valueInDatabase,17);\n\t\t\t$status = \"timed out\";\n\t\t\tif ($valueInDatabase == \"terminated\"){\n\t\t\t\t$timeOutLog = $timeOutLog . \" *** Warning: This player has timed out in stage \" . $sendStage . \". Survey terminated.\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$timeOutLog = $timeOutLog . \" *** Warning: This player has timed out in stage \" . $sendStage . \". Default response: \" . $valueInDatabase . \".\";\n\t\t\t}\n\t\t}\n\t}\n}", "function savetwit ($username) \n{\n\t$local_file = './cache/'.$username.'.rss';\n\n\tif (is_file($local_file))\n\t\t{\n\t\t\t//Find out how many seconds it has been since the file was last updated - in seconds\n\t\t\t$time_lapse = (strtotime(\"now\") - filemtime($local_file));\n\t\t\t\t//if it has been more than 10 minutes, update the local feed\n\t\t\t\tif ($time_lapse > 600) \n\t\t\t\t\t{\n\t\t\t\t\t\t//grab the feed from twitter\n\t\t\t\t\t\t$feed_grab = file_get_contents('http://twitter.com/statuses/user_timeline/'.$username.'.rss');\n\t\t\t\t\t\t\t//check to make sure the feed has content and isn't just some error message\n\t\t\t\t\t\t\tif (strlen($feed_grab) > 100)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//if all looks good, update the local feed\n\t\t\t\t\t\t\t\t\tfile_put_contents($local_file, $feed_grab);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\n\t\t\n\t\t\n\t\t} \n\t\t\n\telse \n\t\t{\n\t\t\t//grab the feed from twitter\n\t\t\t$feed_grab = file_get_contents('http://twitter.com/statuses/user_timeline/'.$username.'.rss');\n\t\t\t//check to make sure the feed has content and isn't just some error message\n\t\t\t\tif (strlen($feed_grab) > 100)\n\t\t\t\t\t{\n\t\t\t\t\t\t//if all looks good, update the local feed\n\t\t\t\t\t\tfile_put_contents($local_file, $feed_grab);\n\t\t\t\t\t}\n\t\t\n\t\t}\n\n}", "function SaveGame($idPlayer, $IndividualScore)\n{\n $dbh = ConnectDB();\n $req = $dbh->query(\"INSERT INTO fishermenland.history (ScoreHistory, fkPlayerHistory) VALUES ('$IndividualScore','$idPlayer')\");\n}", "public function saveAllPlayers(): void;", "function mysteam_status(&$steam)\n{\n\tglobal $lang, $mybb, $templates, $post, $steam_status;\n\t\n\t// Determine user's current status and appropriate visual style.\n\tif ($steam['steamstatus'] == '0')\n\t{\n\t\t$steam_state = $lang->mysteam_offline;\n\t\t$avatar_class = 'steam_avatar_offline';\n\t\t$color_class = 'steam_offline';\n\t}\n\telseif (!empty($steam['steamgame']))\n\t{\n\t\t$steam_state = $steam['steamgame'];\n\t\t$avatar_class = 'steam_avatar_in-game';\n\t\t$color_class = 'steam_in-game';\n\t}\n\telseif ($steam['steamstatus'] == '1')\n\t{\n\t\t$steam_state = $lang->mysteam_online;\n\t\t$avatar_class = 'steam_avatar_online';\n\t\t$color_class = 'steam_online';\n\t}\n\telseif ($steam['steamstatus'] == '3')\n\t{\n\t\t$steam_state = $lang->mysteam_away;\n\t\t$avatar_class = 'steam_avatar_online';\n\t\t$color_class = 'steam_online';\n\t}\n\telseif ($steam['steamstatus'] == '4')\n\t{\n\t\t$steam_state = $lang->mysteam_snooze;\n\t\t$avatar_class = 'steam_avatar_online';\n\t\t$color_class = 'steam_online';\n\t}\n\telseif ($steam['steamstatus'] == '2')\n\t{\n\t\t$steam_state = $lang->mysteam_busy;\n\t\t$avatar_class = 'steam_avatar_online';\n\t\t$color_class = 'steam_online';\n\t}\n\telseif ($steam['steamstatus'] == '5')\n\t{\n\t\t$steam_state = $lang->mysteam_looking_to_trade;\n\t\t$avatar_class = 'steam_avatar_online';\n\t\t$color_class = 'steam_online';\n\t}\n\telseif ($steam['steamstatus'] == '6')\n\t{\n\t\t$steam_state = $lang->mysteam_looking_to_play;\n\t\t$avatar_class = 'steam_avatar_online';\n\t\t$color_class = 'steam_online';\n\t}\n\t\n\t// Some things to check if running this on postbit.\n\tif ($post)\n\t{\n\t\t// If set to display status as an image.\n\t\tif ($mybb->settings['mysteam_postbit'] == 'img')\n\t\t{\n\t\t\t// Special display style for classic post bit.\n\t\t\tif ($mybb->user['classicpostbit'])\n\t\t\t{\n\t\t\t\tif ($mybb->settings['mysteam_hover'])\n\t\t\t\t{\n\t\t\t\t\t$steam_icon_status = 'steam_icon_status_classic';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$steam_icon_status = 'steam_icon_status_classic_nohover';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($mybb->settings['mysteam_hover'])\n\t\t\t\t{\n\t\t\t\t\t$steam_icon_status = 'steam_icon_status';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$steam_icon_status = 'steam_icon_status_nohover';\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\teval(\"\\$steam['steam_status_img'] = \\\"\".$templates->get(\"mysteam_postbit\").\"\\\";\");\n\t\t}\n\t\t// If set to display status as text\n\t\telseif ($mybb->settings['mysteam_postbit'] == 'text')\n\t\t{\n\t\t\teval(\"\\$steam['steam_status'] = \\\"\".$templates->get(\"mysteam_profile\").\"\\\";\");\n\t\t}\n\t\t// If set not to display\n\t\telse\n\t\t{\n\t\t\t// Display nothing.\n\t\t}\n\t}\n\telse\n\t{\n\t\teval(\"\\$steam_status = \\\"\".$templates->get(\"mysteam_profile\").\"\\\";\");\n\t}\n}", "function newGame() {\n\t$newid = uniqid();\n\t$newgame = [\n\t\t'open' => $newid,\n\t\t$newid => ['state' => 'open', 'players' => []],\n\t];\n\tupdateGames($newgame);\n\twriteGame($newid, ['round' => 0]);\n\n\treturn $newid;\n}", "public function conversion_savings_stats() {\r\n\t\t$core = WP_Smush::get_instance()->core();\r\n\r\n\t\tif ( WP_Smush::is_pro() && ! empty( $core->stats['conversion_savings'] ) && $core->stats['conversion_savings'] > 0 ) {\r\n\t\t\t?>\r\n\t\t\t<li class=\"smush-conversion-savings\">\r\n\t\t\t\t<span class=\"sui-list-label\">\r\n\t\t\t\t\t<?php esc_html_e( 'PNG to JPEG savings', 'wp-smushit' ); ?>\r\n\t\t\t\t</span>\r\n\t\t\t\t<span class=\"sui-list-detail wp-smush-stats\">\r\n\t\t\t\t\t<?php echo $core->stats['conversion_savings'] > 0 ? esc_html( size_format( $core->stats['conversion_savings'], 1 ) ) : '0 MB'; ?>\r\n\t\t\t\t</span>\r\n\t\t\t</li>\r\n\t\t\t<?php\r\n\t\t}\r\n\t}", "public final function save()\n {\n }", "public function getSavePath(): string;", "function save_screen_option( $status, $option, $value ) {\n\t\treturn $value;\n\t}", "function gaMatch_save($appGlobals){\n // $appGlobals->gb_sql->sql_transaction_start ($appGlobals); //?????????????????????\n $exists = ( ! empty($this->game_atGameId) );\n // need to update opponent array\n if ( $exists ) {\n $orgRec = new stdData_gameMatch_group;\n $orgRec->gaMatch_read($appGlobals,$this->game_atGameId, $this->game_opponents_gameId[0]);\n $orgRec->gag_updateGameTotals($appGlobals,-1);\n $orgRec->gag_updateKidPeriodTotals($appGlobals,-1);\n }\n $atGameId = $this->gaUnit_save($appGlobals);\n $this->gag_updateGameTotals($appGlobals,1);\n $this->gag_updateKidPeriodTotals($appGlobals,1);\n // $appGlobals->gb_sql->sql_transaction_end ($appGlobals);\n return $atGameId;\n // end transaction processing\n}", "public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\tfclose($h);\n\t}", "function saveRepo($name) {\n\tglobal $repos, $counter;\n\t$counter++;\n\tif(!array_key_exists($name, $repos)) {\n\t\t$repos[$name] = $name;\n\t\tfile_put_contents('repos.txt', implode(\"\\r\\n\",$repos));\n\t\t//echo sizeof($repos).\"/$counter\\n\";\n\t}\n}", "public function save($state)\n\t{\n\t\tIOHelper::writeToFile($this->stateFile, serialize($state));\n\t}", "function save($b){\r\n\techo \"<b>SOMETHING WENT WRONG.</b> Saving to _junk.txt<P>\";\t\r\n\t$fp = fopen(\"_junk.txt\", \"w\");\r\n\tfwrite($fp, $b); \r\n\tfclose($fp);\t\r\n}", "public function save( $filename )\n {\n \n }", "function zg_ai_save_data($bot, array $data) {\n return zg_ai_data_type($data);\n}", "protected function save( $file_name, $data ) {\n\n\t\tif ( ! dir( 'commands' ) ) {\n\t\t\tdie( 'Please create the directory commands' );\n\t\t} else {\n\t\t\t// We need to add directory creation.\n\t\t\tif ( ! empty( $this->_namespace ) ) {\n\t\t\t\t$this->_status = file_put_contents( \"commands/{$file_name}.php\", $data );\n\t\t\t} else {\n\t\t\t\t$this->_status = file_put_contents( \"commands/{$file_name}.php\", $data );\n\t\t\t}\n\n\t\t}\n\n\t\treturn $this->_status;\n\t}", "public function save()\n\t{\n\t\t// No operation. This is a CLI session, we save nothing.\n\t}", "function JSonWritePOINT($obj){\n $point = (int)$obj;\n $file = file_get_contents('lvl.json');\n $fDecode = json_decode($file,true);\n $fDecode['PO'] = $point;\n $json = json_encode($fDecode);\n file_put_contents('lvl.json',$json);\n}", "function save_debug($txt,$file) {\n\n// ECRITURE FICHIER\n\t// ENREGISTREMENT LOG\n\tif ($fp=fopen($file, \"a\")) {\n\t\tfwrite($fp, \"\\n---------------------------------------------------------\\n\");\n\t\tfwrite($fp, $txt);\n\t\tfwrite($fp, \"\\n---------------------------------------------------------\\n\\n\");\n\t\tfclose($fp);\n\t} else {\n\t\techo \"Erreur d'ouverture de \".$file;\n\t}\n}", "public function save()\n\t{\n\t\t$updatedProfile = Yii::$app->user->identity->profile;\n\t\t\n\t\t$updatedProfile = Yii::$app->user->identity->profile;\n\t\t\n\t\t$updatedProfile->{Yii::$app->request->post()['flag']} = Yii::$app->request->post()['val'];\n\n\t\t$updatedProfile->save();\n\t}", "function AgregaRevisame()\n {\n\t try{\n\t $nombre_archivo = 'Revisame/25.mbg'; \n \t $contenido=\"0\";\n \t fopen($nombre_archivo, 'a+'); \n\t \t //Asegurarse primero de que el archivo existe y puede escribirse sobre el. \n\t\t if (is_writable(\"Revisame/25.mbg\")) { \n\t\t if (!$gestor = fopen($nombre_archivo, 'a')) { \n\t\t\t echo \"No se puede abrir el archivo ($nombre_archivo)\"; \n\t\t\t exit; \n\t\t } \n\t\t if (fwrite($gestor, $contenido.\"\\n\") === FALSE) { \n\t\t echo \"No se puede escribir al archivo ($nombre_archivo)\"; \n\t\t exit; \n\t\t } \n\t\t fclose($gestor); \n\t\t } else { \n\t\t\t echo \"No se puede escribir sobre el archivo $nombre_archivo\"; \n\t\t\t } \n\t\t} catch(Exception $e){\n echo \"Error :\" & $e;\n }\t\n}", "function fiftyone_degrees_set_bandwidth_stats($stats) {\n if (isset($_SESSION)) {\n $_SESSION['51D_stats'] = $stats;\n }\n}", "public function saveToDB()\r\n\t{\r\n\t\t$date = new DateTime();\r\n\t\t$this->timestamp = date('Y-m-d H:i:s',$date->getTimestamp());\r\n\t\t$con = db_connect();\r\n\t\t\r\n\t\t//user, game, timestamp, text, building, card, location, icon\r\n\t\t$this->user!=null ? $userid=$this->user->getUserID() : $userid=null;\r\n\t\t$this->game!=null ? $gameID=$this->game->getGameID() : $gameID=null;\r\n\t\t$this->building!=null ? $buildingID=$this->building->getBuildingID() : $buildingID=null;\r\n\t\t$this->card!=null ? $cardID=$this->card->getCardID() : $cardID=null;\r\n\t\t\r\n\t\t$statement = $con->prepare('Insert into logger (user, game, timestamp, text, building, card, location, icon) values (?,?,?,?,?,?,?,?)');\r\n\t\t$statement->execute(array($userid,$gameID,$this->timestamp,$this->Text,$buildingID,$cardID,$this->location->locationID, $this->icon));\r\n\t\t\r\n\t\t$id = $con->lastInsertId();\r\n\t\t$con = null;\r\n\t\treturn $id;\r\n\t}", "protected function write()\n {\n if (!is_dir($this->path)) {\n mkdir($this->path);\n }\n\n file_put_contents($this->file, json_encode([\n 'network' => $this->network,\n 'epoch' => static::$epoch,\n 'iteration' => static::$iteration,\n 'a' => $this->a,\n 'e' => $this->e\n ]));\n }", "function write_debug () {\n /*\necho $this->log_debug;\n\n $fp = fopen (\"backup/debug/battle\".$this->user['battle'].\".txt\",\"a\"); //открытие\n flock ($fp,LOCK_EX); //БЛОКИРОВКА ФАЙЛА\n fputs($fp , $this->log_debug) ; //работа с файлом\n fflush ($fp); //ОЧИЩЕНИЕ ФАЙЛОВОГО БУФЕРА И ЗАПИСЬ В ФАЙЛ\n flock ($fp,LOCK_UN); //СНЯТИЕ БЛОКИРОВКИ\n fclose ($fp); //закрытие\n $this->log_debug = '';\n */\n\n//die();\n }" ]
[ "0.7586503", "0.6469614", "0.6434765", "0.63647336", "0.6363002", "0.6297978", "0.6279136", "0.6117659", "0.60549855", "0.6043253", "0.6042876", "0.59474075", "0.5902", "0.5888748", "0.5848548", "0.5847063", "0.5835252", "0.583419", "0.5731178", "0.57301545", "0.563913", "0.5612874", "0.56018114", "0.5590975", "0.5552014", "0.5538218", "0.5528184", "0.54903764", "0.5457868", "0.5443713", "0.5437551", "0.5413014", "0.53905535", "0.53905535", "0.539015", "0.5372944", "0.5336083", "0.53334117", "0.5327881", "0.53261614", "0.53261614", "0.5325084", "0.5319831", "0.5304915", "0.5303007", "0.52554804", "0.5241196", "0.5239641", "0.5235979", "0.52300054", "0.5227369", "0.52258587", "0.52193683", "0.52189577", "0.52182865", "0.5176628", "0.5141654", "0.51295865", "0.5127373", "0.51270556", "0.51185626", "0.51072913", "0.50972897", "0.5086703", "0.50850797", "0.50835216", "0.50791323", "0.50767636", "0.50767636", "0.5076155", "0.50683963", "0.5067557", "0.5067557", "0.5061152", "0.5060794", "0.50603867", "0.5056069", "0.5053652", "0.50530314", "0.50457424", "0.504382", "0.504251", "0.5041786", "0.50404507", "0.5021224", "0.5013185", "0.5011444", "0.50101674", "0.500914", "0.5003916", "0.5002684", "0.49997136", "0.49996528", "0.49981463", "0.49943823", "0.4994245", "0.49874145", "0.49844337", "0.49834794", "0.4979697" ]
0.63113064
5
Run the database seeds.
public function run() { $this->truncateTables([ 'facturas', 'clientes', 'especialidades', 'users', ]); $this->call(UsuariosTableSeeder::class); //$this->call(IngredienteSeeder::class); $this->call(EspecialidadesSeeder::class); $this->call(ClienteSeeder::class); $this->call(FacturasSeeder::class); $this->call(OrdenesSeeder::class); $this->call(ProductoSeeder::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { if ($request->ajax()) { $offset = ($request->page - 1) * $request->limit; $journeys = MeetingJourney::where([])->orderBy($request->get('field', 'id'), $request->get('order', 'desc')) ->with('meeting') ->offset($offset) ->limit($request->limit) ->get(); $count = MeetingJourney::where([])->count(); return ['code' => 0, 'data' => $journeys, 'msg' => '', 'count' => $count]; } return view('meeting_journeys.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $meetings = Meeting::where([])->get(); return view('meeting_journeys.create', compact('meetings')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.7594873", "0.7594873", "0.75862724", "0.7577369", "0.75727355", "0.7500874", "0.74348205", "0.74339336", "0.7389178", "0.73531044", "0.73364365", "0.73124814", "0.7296061", "0.72818893", "0.7274119", "0.72423935", "0.72292763", "0.72266877", "0.7187332", "0.717915", "0.7174258", "0.7150343", "0.7144378", "0.7144238", "0.7134942", "0.7128289", "0.71236694", "0.7115823", "0.7115823", "0.7115823", "0.7112145", "0.70943975", "0.70857024", "0.70802104", "0.70800203", "0.7057187", "0.7057187", "0.7055648", "0.7039616", "0.7039533", "0.7036246", "0.70346695", "0.70305556", "0.7027626", "0.7026509", "0.70199776", "0.7017972", "0.70049554", "0.7003876", "0.7000925", "0.69973546", "0.6994639", "0.69937307", "0.69898754", "0.6986977", "0.69664884", "0.6965616", "0.69563985", "0.6951776", "0.69510984", "0.69472855", "0.69444585", "0.6942343", "0.69411284", "0.69378203", "0.69378203", "0.6936664", "0.69344825", "0.69317704", "0.69282645", "0.69263744", "0.6924216", "0.6918314", "0.6915855", "0.69128567", "0.6911424", "0.6910289", "0.69085616", "0.6903973", "0.6901382", "0.6901172", "0.6900354", "0.6895054", "0.6893486", "0.6893189", "0.68918854", "0.6891604", "0.6891604", "0.6889186", "0.6888053", "0.6887076", "0.6884677", "0.68822217", "0.6880916", "0.6875967", "0.68739045", "0.6873874", "0.6870332", "0.6869766", "0.68696475", "0.6868746" ]
0.0
-1
Store a newly created resource in storage.
public function store(MeetingJourneyRequest $request) { if (!Meeting::where(['id' => $request->meeting_id])->count()) { return redirect()->back()->withInput()->withErrors('请选择行程所属的会议!'); } MeetingJourney::create($request->all()); return redirect()->route('meeting_journeys.index')->with('success', '会议行程添加成功!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.7286258", "0.71454436", "0.7132821", "0.6640289", "0.6621105", "0.6566493", "0.65255576", "0.65087926", "0.6448317", "0.63752604", "0.63736314", "0.6365631", "0.6365631", "0.6365631", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(MeetingJourney $journey) { return view('meeting_journeys.edit', compact('journey')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }" ]
[ "0.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6834711", "0.6810601", "0.680613", "0.6804975", "0.68015367", "0.6795471", "0.6791821", "0.6791821", "0.6787303", "0.6783644", "0.67790574", "0.67766285", "0.6767741", "0.67610145", "0.67455536", "0.67455536", "0.6744367", "0.6743159", "0.6739656", "0.67351145", "0.67246765", "0.67128825", "0.6692859", "0.66916454", "0.6687554", "0.66875297", "0.6687494", "0.6684443", "0.668203", "0.66689324", "0.66680384", "0.6664605", "0.6664605", "0.66621166", "0.66604865", "0.66589504", "0.6655767", "0.66542184", "0.665213", "0.66422516", "0.6631665", "0.663077", "0.6627607", "0.6627607", "0.66193914", "0.6618503", "0.66160196", "0.66146857", "0.6609641", "0.6608315", "0.6605284", "0.6595882", "0.65947276", "0.6594626", "0.65895563", "0.6589339", "0.6587281", "0.65805006", "0.6579201", "0.6579166", "0.657641", "0.6576111", "0.65740323", "0.65692765", "0.6568046", "0.6567221", "0.6565346", "0.6560687", "0.6560687", "0.6560384", "0.65577257", "0.65569293", "0.65558636", "0.6555392", "0.65553015", "0.65542984", "0.655418", "0.6554106", "0.6547678", "0.65473104", "0.6543329" ]
0.0
-1
Update the specified resource in storage.
public function update(MeetingJourneyRequest $request, MeetingJourney $journey) { if (!Meeting::where(['meeting_id' => $request->meeting_id])->count()) { return redirect()->back()->withInput()->withErrors('请选择行程所属的会议!'); } MeetingJourney::update($request->all()); return redirect()->route('meeting_journeys.index')->with('success', '会议行程修改成功!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7424884", "0.7062319", "0.70572054", "0.6897199", "0.658233", "0.6450576", "0.6347209", "0.6211253", "0.6146092", "0.6121878", "0.6114851", "0.61005586", "0.608833", "0.60537165", "0.60196865", "0.60068345", "0.5972924", "0.594671", "0.5940615", "0.5938648", "0.58927333", "0.58618903", "0.5855116", "0.5855116", "0.58517504", "0.5816175", "0.5807103", "0.5753658", "0.5753658", "0.57354003", "0.5724066", "0.5714874", "0.56957984", "0.5692136", "0.5688278", "0.5670771", "0.5656715", "0.5651525", "0.5647887", "0.563695", "0.5635239", "0.5633743", "0.5633203", "0.56296664", "0.5622203", "0.56089646", "0.5602395", "0.55937296", "0.55837464", "0.5582684", "0.55814886", "0.5575469", "0.5572433", "0.55668694", "0.556366", "0.5562336", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.5560869", "0.55574787", "0.55562645", "0.5554329", "0.5553793", "0.5553788", "0.55448633", "0.55448294", "0.5541889", "0.55402213", "0.5537772", "0.55359083", "0.55358595", "0.55248064", "0.5520229", "0.5517453", "0.5513332", "0.5511126", "0.55085385", "0.5508433", "0.5503835", "0.5502763", "0.5501662", "0.5500294", "0.5498694", "0.5496697", "0.5496697", "0.5495247", "0.5494445", "0.5494331", "0.549349", "0.5492967", "0.5484066", "0.5480196", "0.5479421", "0.54788667", "0.546669", "0.5464114", "0.54621613", "0.5458347" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(MeetingJourney $journey) { $journey->delete(); return ['code' => 0, 'msg' => '删除成功!']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Create a new AuthController instance.
public function __construct() { //$this->middleware('auth:api', ['except' => ['login','register','recovery']]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function factory($config = array())\n\t{\n\t\treturn new Auth($config);\n\t}", "public function newInstance()\n {\n return new Auth($this->segment);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "public static function factory($config = array())\n\t{\n\t\treturn new Simple_Auth($config);\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "protected function createController()\n {\n $this->createClass('controller');\n }", "public function indexController()\n\t{\n\t\t$auth = new Authentification();\n\t}", "public static function instance($config = array())\n\t{\n\t\tstatic $instance;\n\n\t\t// Load the Auth instance\n\t\tempty($instance) and $instance = new Auth($config);\n\n\t\treturn $instance;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "public function __construct()\n {\n // Setting the auth middleware for this controller\n $this->middleware('auth');\n }", "function auth(): Auth\n{\n return (new Auth);\n}", "public static function Auth()\n\t{\n\t\treturn self::$auth = new Auth();\n\t}", "public static function make()\n\t{\n\t\treturn IoC::container()->resolve('laravel.auth');\n\t}", "public static function instance($config = array())\n\t{\n\t\tstatic $instance;\n\n\t\t// Load the Auth instance\n\t\tempty($instance) and $instance = new Simple_Auth($config);\n\n\t\treturn $instance;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "public function createController( ezcMvcRequest $request );", "public function __construct()\n\t{\n\t\treturn $this->middleware('auth');\n\t}", "public function __contruct()\n {\n $this->middleware('auth');\n }", "public function getAuthentication()\n {\n return Controllers\\AuthenticationController::getInstance();\n }", "public function __construct()\n {\n // $this->middleware('auth');\n\n //if trying to access this controller without being authenticated, it will ask him for authentication\n // $this->middleware ('auth');\n }", "public function __construct()\n {\n $this->middleware('auth');\n\n $this->CalendarController = new CalendarController();\n\n }", "public function getAuthorization()\n {\n return Controllers\\AuthorizationController::getInstance();\n }", "public function __construct(){\n\t\t$this->middleware('auth', ['only'=>['create']])\n\t}", "public function getAuthenticationV1()\n {\n return Controllers\\AuthenticationV1Controller::getInstance();\n }", "public function __construct()\n {\n\n Log::info('Auth controller constructed executed: ');\n Log::info('Auth controller executed');\n $this->middleware('guest',['only'=>['getLogin','getRegister']]);\n $this->middleware('auth',['only'=>['create','notification']]);\n}", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public function __construct()\n {\n $this->middleware('auth');\n //$this->middleware('auth', ['only' => 'create']);\n }", "public function __construct()\n {\n // We could add middleware specific for this controller like so:\n // $this->middleware('auth');\n }", "public\n\n\tfunction __construct() {\n\t\t$this->middleware( 'auth' );\n\t}", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function __construct()\n\t{\n //attach auth middleware to ensure login before accessing this controller\n\t\t$this->middleware('auth');\n\t}", "public function getAccessController() {\n\t\tif (!$this->accessController) {\n\t\t\tlist($vendor, $extension,) = Utility::getClassNamePartsForPath($this->dispatcher->getPath());\n\n\t\t\t// Check if an extension provides a Authentication Provider\n\t\t\t$accessControllerClass = 'Tx_' . $extension . '_Rest_AccessController';\n\t\t\tif (!class_exists($accessControllerClass)) {\n\t\t\t\t$accessControllerClass = ($vendor ? $vendor . '\\\\' : '') . $extension . '\\\\Rest\\\\AccessController';\n\t\t\t}\n\n\t\t\t// Use the configuration based Authentication Provider\n\t\t\tif (!class_exists($accessControllerClass)) {\n\t\t\t\t$accessControllerClass = 'Cundd\\\\Rest\\\\Access\\\\ConfigurationBasedAccessController';\n\t\t\t}\n\t\t\t$this->accessController = $this->get($accessControllerClass);\n\t\t\t$this->accessController->setRequest($this->dispatcher->getRequest());\n\t\t}\n\t\treturn $this->accessController;\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "private static function create(): Authentication\n {\n // Get the request to check the authorization token.\n $request = Request::createFromGlobals();\n\n // Default value if no token was sent.\n $accessToken = null;\n\n if ($request->headers->has('Authorization')) {\n $bearerToken = $request->headers->get('Authorization');\n\n // Search if the token is a Bearer.\n if (\\strpos($bearerToken, 'Bearer ') !== 0) {\n throw new \\UnexpectedValueException('The authorization is not a Bearer token.');\n }\n\n // Remove the Bearer from the token.\n $jwt = \\substr($bearerToken, 7);\n\n // Get the AccessToken.\n $accessToken = AccessTokenServiceFactory::get()->getAccessToken($jwt);\n\n // Throw exception if the token is revoked.\n if ($accessToken->revoked()) {\n throw new TokenRevokedException();\n }\n }\n\n return new AuthManager($accessToken);\n }", "public function getAuthorizationV1()\n {\n return Controllers\\AuthorizationV1Controller::getInstance();\n }", "public function __construct() {\n\t\t$this->middleware ( 'auth' );\n\t}", "public static function getInstance()\n {\n if (null === self::$auth) self::$auth = new self();\n return self::$auth;\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "public function __construct()\r\n\t{\r\n\t\t$this->middleware('auth');\r\n\t}", "public function __construct()\r\n\t{\r\n\t\t$this->middleware('auth');\r\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function __construct()\n {\n $this->repository = app(AuthRepository::class);\n }", "public function __construct() {\n\t\t$this->middleware('auth');\n\t}", "public function __construct() {\n\n\t\t$this->middleware( 'auth' );\n\n\t}", "public function __construct()\n {\n // auth here\n }", "public function _construct()\n {\n $this->middleware('auth');\n }", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}", "public function __construct()\n\t{\n\t\t$this->middleware('auth');\n\t}" ]
[ "0.7055059", "0.6948648", "0.66441727", "0.6499543", "0.6262191", "0.62306565", "0.617785", "0.61735874", "0.6060623", "0.6017453", "0.60044205", "0.59742635", "0.596828", "0.588856", "0.58031136", "0.58029795", "0.5798353", "0.57597774", "0.5751612", "0.57512736", "0.5744536", "0.573976", "0.5739119", "0.5735472", "0.57180583", "0.5716281", "0.5709616", "0.56963325", "0.5691423", "0.56715345", "0.56627834", "0.56407", "0.5628729", "0.56230986", "0.56209785", "0.56163865", "0.56070447", "0.5596288", "0.55940926", "0.5579399", "0.5579399", "0.5577299", "0.55734193", "0.5573293", "0.55597574", "0.5544037", "0.55411965", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303", "0.5538303" ]
0.0
-1
Get a JWT via given credentials.
public function login(UserLoginRequest $request) { if (! $token = auth()->attempt( $request->validated() )){ return response()->json(['error' => 'Unauthorized'], 401); } return $this->respondWithToken($token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getJWT();", "public function getJWT()\n {\n // Collect all the data\n $secret = static::getSecretKey();\n $currentTime = time();\n $expire = $currentTime + 86400; // 1 day\n $request = Yii::$app->request;\n $hostInfo = '';\n // There is also a \\yii\\console\\Request that doesn't have this property\n if ($request instanceof WebRequest) {\n $hostInfo = $request->hostInfo;\n }\n // Merge token with presets not to miss any params in custom\n // configuration\n $token = array_merge([\n 'iat' => $currentTime,\n // Issued at: timestamp of token issuing.\n 'iss' => $hostInfo,\n // Issuer: A string containing the name or identifier of the issuer application. Can be a domain name and can be used to discard tokens from other applications.\n 'aud' => $hostInfo,\n 'nbf' => $currentTime,\n // Not Before: Timestamp of when the token should start being considered valid. Should be equal to or greater than iat. In this case, the token will begin to be valid 10 seconds\n 'exp' => $expire,\n // Expire: Timestamp of when the token should cease to be valid. Should be greater than iat and nbf. In this case, the token will expire 60 seconds after being issued.\n 'data' => [\n 'username' => $this->username,\n 'roleLabel' => $this->getRoleLabel(),\n 'lastLoginAt' => $this->last_login_at,\n ]\n ], static::getHeaderToken());\n // Set up id\n $token['jti'] = $this->getJTI(); // JSON Token ID: A unique string, could be used to validate a token, but goes against not having a centralized issuer authority.\n return [JWT::encode($token, $secret, static::getAlgo()), $token];\n }", "public function __invoke()\n {\n return new JwtAuthentication([\n 'secret' => getenv('JWT_SECRET_KEY'),\n 'attribute' => 'JWT',\n \"error\" => function ($response, $arguments) {\n \n return $response->withJson(['message' => \"Invalid token! ({$arguments['message']})\"], 401);\n\n }\n ]); \n }", "public function retrieveByCredentials(array $credentials)\n {\n if (isset($credentials['user_code'])) {\n return User::where(['user_code' => $credentials['user_code']])->first();\n }\n\n if (isset($credentials['email'])) {\n $externalUser = ExternalUser::where(['email' => $credentials['email']])->first();\n if ($externalUser !== null) {\n return $externalUser->user;\n }\n }\n\n if (isset($credentials['jwt_token'])) {\n try {\n $decoded = JWT::decode($credentials['jwt_token'], $this->websiteToken, ['HS256']);\n $user = User::where(['user_code' => $decoded->lidnr])->first();\n if ($user === null) {\n // First login for user, create one\n $user = User::create([\n 'user_code' => $decoded->lidnr,\n 'type' => User::TYPE_GEWIS,\n ]);\n }\n return $user;\n } catch (\\UnexpectedValueException $e) {\n return null;\n }\n }\n\n return null;\n }", "public function retrieveByCredentials(array $credentials);", "public function retrieveByCredentials(array $credentials);", "public function retrieveByCredentials(array $credentials);", "public static function fromJWTMiddleware($username, $password) {\n $authStrategy = new JsonAuthStrategy(\n [\n 'username' => $username,\n 'password' => $password,\n 'json_fields' => ['username', 'password'],\n ]\n );\n\n // Create authClient\n $authClient = new ApiClient(['base_uri' => self::$env['base_uri']]);\n\n //Create the JwtManager\n $jwtManager = new JwtManager(\n $authClient,\n $authStrategy,\n [\n 'token_url' => '/v1/token',\n 'token_key' => 'token',\n 'expire_key' => 'expires_in', # de\n ]\n );\n\n // Create a HandlerStack\n $stack = HandlerStack::create();\n\n // Add middleware\n $stack->push(new JwtMiddleware($jwtManager));\n\n self::setClient(new ApiClient([\n // Base URI is used with relative requests\n 'base_uri' => self::$env['base_uri'],\n // You can set any number of default request options.\n 'timeout' => 2.0,\n // Handlers\n 'handler' => $stack,\n ]));\n\n return self::getClient();\n }", "public function getJWT()\n\t{\n\t\t$secret = static::getSecretKey();\n\t\t$currentTime = time();\n\t\t$expire = $currentTime + 28800; //28800 8 ชม //1 day 86400\n\t\t$request = Yii::$app->request;\n\t\t$hostInfo = '';\n\t\t// There is also a \\yii\\console\\Request that doesn't have this property\n\t\tif ($request instanceof WebRequest) {\n\t\t\t$hostInfo = $request->hostInfo;\n\t\t}\n\n\t\t// Merge token with presets not to miss any params in custom\n\t\t// configuration\n\t\t$token = array_merge([\n\t\t\t'iat' => $currentTime, // Issued at: timestamp of token issuing.\n\t\t\t'iss' => $hostInfo, // Issuer: A string containing the name or identifier of the issuer application. Can be a domain name and can be used to discard tokens from other applications.\n\t\t\t'aud' => $hostInfo,\n\t\t\t'nbf' => $currentTime, // Not Before: Timestamp of when the token should start being considered valid. Should be equal to or greater than iat. In this case, the token will begin to be valid 10 seconds\n\t\t\t'exp' => $expire, // Expire: Timestamp of when the token should cease to be valid. Should be greater than iat and nbf. In this case, the token will expire 60 seconds after being issued.\n\t\t\t'data' => [\n 'name' => $this->profile->name,\n\t\t\t\t'email' => $this->email,\n\t\t\t\t'username' => $this->username\n\t\t\t]\n\t\t], static::getHeaderToken());\n\t\t// Set up id\n\t\t$token['jti'] = $this->getJTI(); // JSON Token ID: A unique string, could be used to validate a token, but goes against not having a centralized issuer authority.\n\t\treturn [JWT::encode($token, $secret, static::getAlgo()), $token];\n }", "public function load(string $token): JWT;", "public function buildAuthenticatedByJwtToken($jwtToken)\n {\n $authentication = Authentication::fromJwtToken($jwtToken);\n\n return $this->buildAuthenticatedClient($authentication);\n }", "public function retrieveByCredentials(array $credentials)\n\t{\n\t\t// first thing we check is that we have a valid token,\n\t\t// and if not return ASAP and without lookups\n\t\tif (empty($credentials[static::CREDENTIAL_KEY])) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$token = $credentials[static::CREDENTIAL_KEY];\n\t\tif (strlen($token) !== ApiToken::TOKEN_LENGTH) {\n\t\t\treturn null;\n\t\t}\n\n\t\tLog::debug('Validating access token');\n\t\t$st = microtime(true);\n\n\t\t$s = app()->ApiTokenService;\n\t\t$token = hash('sha256', $token);\n\n\t\t$at = $s->getByToken($token);\n\n\t\tif (empty($at)) {\n\t\t\treturn $this->rejectToken($st, 'not found', $token);\n\t\t}\n\n\t\tif ($at->revoked) {\n\t\t\treturn $this->rejectToken($st, 'revoked', $token, $at->id);\n\t\t}\n\n\t\tif ($at->expires_at && $at->expires_at->isBefore(now())) {\n\t\t\treturn $this->rejectToken($st, 'expired', $token, $at->id);\n\t\t}\n\n\t\tLog::info('Accepted access token', [\n\t\t\t'atId' => $at->id,\n\t\t\t'duration' => round(microtime(true) - $st, 3),\n\t\t]);\n\n\t\treturn $at->user;\n\t}", "public function getJwt(): Jwt\n {\n return $this->jwt;\n }", "public function getIdentity(Credentials $credentials);", "public function getJWT()\n {\n // Collect all the data\n $secret = static::getSecretKey();\n $currentTime = time();\n// $expire = $currentTime + 24 * 60 * 60; // 微信端不过期\n $request = Yii::$app->request;\n $hostInfo = '';\n // There is also a \\yii\\console\\Request that doesn't have this property\n if ($request instanceof WebRequest) {\n $hostInfo = $request->hostInfo;\n }\n\n // Merge token with presets not to miss any params in custom\n // configuration\n $token = array_merge([\n 'iat' => $currentTime, // Issued at: timestamp of token issuing.\n 'iss' => $hostInfo, // Issuer: A string containing the name or identifier of the issuer application. Can be a domain name and can be used to discard tokens from other applications.\n 'aud' => $hostInfo,\n 'nbf' => $currentTime, // Not Before: Timestamp of when the token should start being considered valid. Should be equal to or greater than iat. In this case, the token will begin to be valid 10 seconds\n// 'exp' => $expire, // 微信端不过期 Expire: Timestamp of when the token should cease to be valid. Should be greater than iat and nbf. In this case, the token will expire 60 seconds after being issued.\n 'data' => [\n 'username' => $this->username,\n 'lastLoginAt' => $this->last_login_at,\n ]\n ], static::getHeaderToken());\n // Set up id\n $token['jti'] = $this->getJTI(); // JSON Token ID: A unique string, could be used to validate a token, but goes against not having a centralized issuer authority.\n return [JWT::encode($token, $secret, static::getAlgo()), $token];\n }", "public function generate_jwt_token($request) {\n \t$jwt = new Jwt_Auth_Public( 'jwt-auth', '1.1.0' );\n \treturn $jwt->generate_token($request);\n }", "protected static function getJWTFromAuthHeader()\n {\n if ('testing' === env('APP_ENV')) {\n //getallheaders method is not available in unit test mode.\n return [];\n }\n\n if (!function_exists('getallheaders')) {\n function getallheaders()\n {\n if (!is_array($_SERVER)) {\n return [];\n }\n\n $headers = [];\n foreach ($_SERVER as $name => $value) {\n if (substr($name, 0, 5) == 'HTTP_') {\n $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] =\n $value;\n }\n }\n\n return $headers;\n }\n }\n\n $token = null;\n $headers = getallheaders();\n $authHeader = ArrayUtils::get($headers, 'Authorization');\n if (strpos($authHeader, 'Bearer') !== false) {\n $token = substr($authHeader, 7);\n }\n\n return $token;\n }", "public function generateJwt()\n {\n\n \t$now = time();\n \t$user = User::find(Auth::user()->id);\n\n \t$token = array(\n \"jti\" => bcrypt($now . rand()),\n \"iat\" => $now,\n \"name\" => $user->name,\n \"email\" => $user->email\n );\n\n \treturn JWT::encode($token, $this->key);\n }", "public function getJwtIdentifier(): string;", "public function getToken() {\n\t\treturn $this->jwt;\n\t}", "public function login()\n {\n $credentials = request()->only(['email', 'password']);\n\n try {\n if (!$token = JWTAuth::attempt($credentials)) {\n return response()->json(['error' => 'invalid_credentials'], 401);\n }\n } catch (JWTException $e) {\n return response()->json(['error' => 'could_not_create_token'], 500);\n }\n\n return $this->respondWithToken($token);\n }", "public function login($credentials)\n\t{\n\t\t$user = new MyErdikoUser();\n\t\tswitch ($credentials['username']) {\n\t\t\tcase \"[email protected]\":\n\t\t\t\t$user->setUsername('foo');\n\t\t\t\t$user->setDisplayName('Foo');\n\t\t\t\t$user->setUserId(1);\n\t\t\t\t$user->setRoles(array(\"client\"));\n\t\t\t\tbreak;\n\t\t\tcase \"[email protected]\":\n\t\t\t\t$user->setUsername('bar');\n\t\t\t\t$user->setDisplayName('Bar');\n\t\t\t\t$user->setUserId(2);\n\t\t\t\t$user->setRoles(array(\"admin\"));\n break;\n\t\t\tcase \"[email protected]\":\n\t\t\t\t$user->setUsername('jwt');\n\t\t\t\t$user->setDisplayName('JWT');\n\t\t\t\t$user->setUserId(2);\n\t\t\t\t$user->setRoles(array(\"client\"));\n\n $result = (object)array(\n \"user\" => $user,\n \"token\" => \"abc1234\"\n );\n\n return $result;\n\n\t\t\t\tbreak;\n\t\t}\n\t\treturn $user;\n }", "public function retrieveByCredentials(array $credentials){\n\n }", "public function retrieveByCredentials(array $credentials)\n {\n return $this->retrieveByUsername($credentials);\n }", "public function retrieveByCredentials(array $credentials)\n {\n if (empty($credentials)) {\n return;\n }\n\n // First we will add each credential element to the query as a orWhere clause\n // and removes any passed scopes. Then we can execute the query and, if we found\n // a user, return it in a Eloquent User \"model\" that will be utilized by the Guard\n // instances.\n $query = $this->createModel()->newQuery()->withoutGlobalScopes($this->scopesToRemove);\n\n $query->where(function ($query) use ($credentials) {\n foreach ($credentials as $key => $value) {\n if (! Str::contains($key, 'password')) {\n $query->orWhere($key, $value);\n }\n }\n });\n\n return $query->first();\n }", "public function authenticate(Request $request)\n {\n $credentials = json_decode(request()->getContent(), true);\n\n\n try {\n if (! $token = JWTAuth::attempt($credentials)) {\n return response()->json(['result' => 100, 'error' => 'invalid_credentials'], 400);\n }\n } catch (JWTException $e) {\n return response()->json(['result' => 101, 'error' => 'could_not_create_token'], 500);\n }\n\n $user = JWTAuth::user();\n return response()->json(compact('user','token'));\n }", "public function getToken()\n {\n // base64:KEY\n // so i need to get the key and base64 decode it\n $key = base64_decode(explode(':', config('app.key'))[1]);\n\n return JWT::encode($this, $key);\n }", "function generateJWT($host,$user_id,$login) {\n $now = new DateTime();\n $future = new DateTime(\"now +12 hours\");\n $jti = Base62::encode(random_bytes(16));\n\n $payload = [\n \"iat\" => $now->getTimeStamp(),\n \"exp\" => $future->getTimeStamp(),\n \"jti\" => $jti,\n \"iss\" => $host,\n // \"sub\" => $server[\"PHP_AUTH_USER\"],\n // \"scope\" => $scopes\n \"data\" => [\n \"userId\" => $user_id,\n \"userLogin\" => $login,\n ]\n ];\n $secret = getenv(\"JWT_SECRET\");\n return JWT::encode($payload, $secret, \"HS256\");\n}", "public function retrieveByCredentials(array $credentials)\n {\n // First we will add each credential element to the query as a where clause.\n // Then we can execute the query and, if we found a user, return it in a\n // generic \"user\" object that will be utilized by the Guard instances.\n $query = $this->model;\n foreach ($credentials as $key => $value) {\n if (!Str::contains($key, 'password')) {\n $query->where($key, $value);\n }\n }\n // Now we are ready to execute the query to see if we have an user matching\n // the given credentials. If not, we will just return nulls and indicate\n // that there are no matching users for these given credential arrays.\n $user = $query->first();\n return $this->getGenericUser($user);\n }", "public function retrieveByCredentials(array $credentials)\n {\n $key = \"{$this->prefix()}:\".\\implode(':', Arr::except($credentials, 'password'));\n\n return $this->cache->remember(\n $key,\n now()->addMinutes(1),\n function () use ($credentials) {\n return $this->getProvider()->retrieveByCredentials($credentials);\n }\n );\n }", "public function jwtToken($arr = array()){\n $payload = [\n 'iss' => Hash::make(env('APP_NAME')),\n 'sub' => $this->authUser->id,\n 'iat' => time(),\n 'exp' => time() + env('JWT_EXPIRY', 10)*60\n ];\n\n if(count($arr) > 0) $payload = array_merge($arr, $payload);\n\n return JWT::encode($payload, env('JWT_SECRET'));\n }", "public function createToken()\n\t{\n\t\t$domain = $this->config->get('app.domain');\n\n\t\t$data = [\n\t\t\t'iss' => $domain,\n\t\t\t'aud' => $domain,\n\t\t\t'iat' => time(),\n\t\t\t'exp' => time () + $this->expiration,\n\t\t];\n\n\t\t$token = JWT::encode($data, $this->config->get('app.app_key'));\n\n\t\t$this->createAuth([\n\t\t\t'token' => $token,\n\t\t\t'expires_at' => date('Y-m-d h:i:s', $data['exp'])\n\t\t]);\n\n\t\treturn $token;\n\t}", "public function retrieveByCredentials(array $credentials) {\n $query = $this->model->newQuery();\n \n foreach ( Arr::except($credentials, 'password') as $key => $value ) {\n $query->where($key, $value);\n }\n \n return $query->first();\n }", "public function retrieveByCredentials(array $credentials)\n {\n if (empty($credentials)) {\n return;\n }\n\n // First we will add each credential element to the query as a where clause.\n // Then we can execute the query and, if we found a user, return it in a\n // Eloquent Employee \"model\" that will be utilized by the Guard instances.\n $query = $this->createModel()->newQuery()->{$this->scope}();\n\n foreach ($credentials as $key => $value) {\n if (! Str::contains($key, 'password')) {\n $query->where($key, $value);\n }\n }\n\n return $query->first();\n }", "public function authenticate(Request $request){\n \n //validation\n $this->validateRequest($request);\n \n $credentials = $request->only('email','password');\n \n try{\n //If authentication fails\n if(!$token = JWTAuth::attempt($credentials)){\n return $this->response('Invalid Credentials',400);\n }\n }catch(JWTException $e){\n return $this->response('Could not create token!',500);\n }\n //authenticated\n return response()->json($token,200);\n }", "function auth (){\n //$app = \\Slim\\Slim::getInstance();\n //$headers = $app->request()->headers();\n //$token = JWT::decode($headers['X-Auth-Token'], 'secret_server_key');\n //print_r($token);\n //echo $headers['X-Auth-Token'];\n}", "public function retrieveByCredentials(array $credentials)\n {\n }", "public function retrieveByCredentials(array $credentials) {\n $query = $this->createModel()->newQuery();\n return $query->first();\n }", "public static function createFromToken($token) {\n $jwt = new JWTManager();\n $stdClass = $jwt->decode($token, self::$secret);\n $jwt->setAll(get_object_vars($stdClass));\n return $jwt;\n }", "private function oauthlogin($credentials){\n try {\n $curl = curl_init();\n // Set some options - we are passing in a useragent too here\n curl_setopt_array($curl, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $this->getParameter('zfzmyrjlmj_api_host') . \"/oauth/v2/token?grant_type=password&client_id=\" . $this->getParameter('oauth_client_id') . \"&client_secret=\" . $this->getParameter('oauth_secret') . \"&username=\" . $credentials['username'] . \"&password=\" . $credentials['password'],\n CURLOPT_USERAGENT => 'Get an Access Token for Yara clinica User'\n ));\n // Send the request & save response to $resp\n $resp = curl_exec($curl);\n // Close request to clear up some resources\n curl_close($curl);\n $oauthResponse = json_decode($resp, true);\n if(isset($oauthResponse['access_token'])){//Make sure access_token is retrieved\n return $oauthResponse;\n }\n return null;\n }catch (\\Exception $e){\n return array(\"error\" => $e->getMessage());\n }\n }", "public function retrieveUserUsingJWT($encodedJWT)\n {\n return $this->startAnonymous()->uri(\"/api/user\")\n ->authorization(\"Bearer \" . $encodedJWT)\n ->get()\n ->go();\n }", "public function retrieveByCredentials(array $credentials)\n\t{\n\t\tif (! $user = $credentials[$this->getUsernameField()]) {\n\t\t\tthrow new \\InvalidArgumentException('\"'.$this->getUsernameField().'\" field is missing');\n\t\t}\n\n\t\t$query = $this->createModel()->newQuery();\n\n\t\tforeach ($credentials as $key => $value)\n\t\t{\n\t\t\tif ( ! str_contains($key, 'password')) $query->where($key, $value);\n\t\t}\n\n\t\t$model = $query->first();\n\t\tif($model) {\n\t\t\treturn $this->getUserFromLDAP($model);\n\t\t}\n\n\t\treturn null;\n\t}", "public function retrieveByCredentials(array $credentials)\n\t{\n\t}", "public function authenticate(Request $request)\n {\n $credentials = $request->only('email', 'password');\n\n try {\n // attempt to verify the credentials and create a token for the user\n if (! $token = JWTAuth::attempt($credentials)) {\n return response()->json(['error' => 'invalid_credentials'], 401);\n }\n } catch (JWTException $e) {\n // something went wrong whilst attempting to encode the token\n return response()->json(['error' => 'could_not_create_token'], 500);\n }\n\n // all good so return the token\n return response()->json(compact('token'));\n }", "function decode_get() {\n $token = $this->head('Token');\n $auth = $this->head('Auth');\n $resp = array();\n\n if ($token) {\n $tokendt = JWT::decode($token, $this->config->item('jwt_key'));\n $resp['token'] = $tokendt;\n }\n\n if ($auth) {\n $authdt = JWT::decode($auth, $this->config->item('jwt_key'));\n $resp['auth'] = $authdt;\n }\n\n $this->response($resp, 200); \n }", "public function loginUser($credentials)\n {\n if (!$token = auth('api')->attempt($credentials)) {\n abort(404, 'Incorrect email/password');\n }\n\n return ['token' => $token];\n }", "public function generateToken()\n {\n $token = array(\n \"iss\" => $this->id,\n \"aud\" => $this->name,\n \"iat\" => $this->email,\n \"nbf\" => $this->phone\n );\n\n return JWT::encode($token, self::JWT_KEY);\n }", "public function getList()\n {\n $config = $this->getServiceLocator()->get('Config');\n $jwt_public_key_path = $config['jwt_config']['public_key_path'];\n $authFailed = false;\n\n $auth = $this->getRequest()->getHeaders('Authorization');\n\n if ($auth) {\n $authFailed = false;\n $token = str_replace('Bearer ', '', $auth->getFieldValue());\n\n if ($this->_checkTokenFormat($token)) {\n $jws = SimpleJWS::load($token);\n\n\n $public_key = openssl_pkey_get_public($jwt_public_key_path);\n\n if ($jws->isValid($public_key, 'RS256')) {\n $payload = $jws->getPayload();\n $userId = (int)$payload['sub'];\n\n $jws = new SimpleJWS(array(\n 'typ' => 'JWT',\n 'alg' => 'RS256'\n ));\n\n $jws->setPayload(array(\n 'iss' => 'Buddha Jones',\n 'iat' => time(),\n 'exp' => time() + 2400, //86400,\n 'sub' => $userId\n ));\n\n $private_key = openssl_pkey_get_private($this->_config['jwt_config']['private_key_path'], $this->_config['jwt_config']['password']);\n $jws->sign($private_key);\n\n $response = array(\n 'status' => 1,\n 'message' => \"User login time extended\",\n 'data' => array(\n 'token' => $jws->getTokenString()\n )\n );\n } else {\n $authFailed = true;\n }\n } else {\n $authFailed = true;\n }\n\n }\n\n if (!$auth || $authFailed) {\n $response = array(\n 'status' => 0,\n 'message' => \"User authentication failed\",\n 'auth_error' => 1\n );\n\n $this->getResponse()->setStatusCode(401);\n }\n\n return new JsonModel($response);\n }", "public function createPasswordCredentialsToken()\n {\n\n $authorization_token = base64_encode($this->getUsername() . ':' . $this->getPassword());\n\n $params = [\n 'headers' => [ 'Authorization' => 'Basic '. $authorization_token],\n 'form_params' => ['grant_type' => env('DW_GRANT_TYPE', 'client_credentials')]\n ];\n\n // Make the Request and process the response\n $response = $this->guzzle->request('POST', $this->getAuthUrl(), $params);\n $result = json_decode((string) $response->getBody());\n\n $this->setToken($result->access_token)\n ->setTokenExpiry(\n Carbon::now()\n ->addSeconds($result->expires_in)\n );\n\n return $this->token;\n }", "public function getCredentials()\n { return $this->get('credentials'); }", "protected function getToken($username, $password)\n {\n $this->client->request('POST', self::AUTHENTICATION, [\n '_username' => $username,\n '_password' => $password\n ]);\n\n $result = (array)json_decode($this->client->getResponse()->getContent(), true);\n\n return $result['token'];\n }", "public function loadUserByJWT($jwt): UserInterface;", "public function getAuthenticatedUser()\n {\n try {\n\n if (! $user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n }\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n\n return response()->json(['token_expired'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n\n return response()->json(['token_invalid'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n\n return response()->json(['token_absent'], $e->getStatusCode());\n\n }\n\n // the token is valid and we have found the user via the sub claim\n return response()->json(compact('user'));\n }", "public function login(Request $request)\n {\n $credentials = $request->only('email', 'password');\n\n try {\n // attempt to verify the credentials and create a token for the user\n if (! $token = JWTAuth::attempt($credentials)) {\n return response()->json(['error' => 'Invalid credentials'], 401);\n }\n } catch (JWTException $e) {\n // something went wrong whilst attempting to encode the token\n return response()->json(['error' => 'Could not create token'], 500);\n }\n\n // all good so return the token\n return response()->json(compact('token'));\n }", "public function login(Request $request) {\n $credentials = $request->only('email', 'password');\n\n // set the identifier for wp_users\n JWTAuth::setIdentifier('id');\n\n try {\n // attempt authorization\n if (! $token = JWTAuth::attempt($credentials, [ 'aud' => 'access' ])) {\n // authorization failed\n return $this->json(['message' => 'invalid credentials'], 400);\n }\n return $this->json(compact('token'));\n }\n catch (\\Exception $ex) {\n // authorization error\n return $this->error('could not create token', $ex);\n }\n }", "public function LoginToken_get()\n {\n $tokenData['user_id'] = '1';\n $tokenData['role'] = 'admin';\n $tokenData['first_name'] = 'Al';\n $tokenData['last_name'] = 'Mobin';\n $tokenData['phone'] = '+8801921040960';\n $jwtToken = $this->tokenHandler->GenerateToken($tokenData);\n $token = $jwtToken;\n echo json_encode(array('Token'=>$jwtToken));\n }", "public function getToken($username, $password)\n {\n if (true === $this->cache->contains($username)) {\n $this->logger->addInfo(\\sprintf('using cache for %s', $username));\n\n return $this->cache->fetch($username);\n }\n\n $token = $this->getTokenFromProvider($username, $password);\n\n // read cacheDurationFallback from token\n $now = new \\DateTime('now', new \\DateTimeZone('UTC'));\n $nowTimestamp = $now->getTimestamp();\n $expipreTimestamp = $this->getExpireTimestamp($token);\n\n $cacheDuration = $expipreTimestamp - $nowTimestamp;\n\n if (0 >= $cacheDuration) {\n $cacheDuration = $this->cacheDurationFallback;\n }\n\n $this->cache->save($username, $token, $cacheDuration);\n\n return $token;\n }", "protected static function getFacadeAccessor() { return 'jwt.auth'; }", "private function jwt($user) {\n $payload = [\n 'iss' => env('JWT_SECRET'), // Issuer of the token\n 'sub' => $user['id'], // Subject of the token\n 'iat' => time(), // Time when JWT was issued.\n 'exp' => time() + env('JWT_EXPIRATION_TIME') // Expiration time\n ];\n\n return JWT::encode($payload, env('JWT_SECRET'));\n }", "public function retrieveByCredentials(array $credentials): AuthUserServiceContract\n {\n $criteria = collect([]);\n\n foreach ($credentials as $key => $value) {\n if (!Str::contains((string)$key, 'password')) {\n $criteria->put($key, $value);\n }\n }\n\n return $this->authUserService__()->workWithByFilters($criteria);\n }", "protected function getToken()\n {\n // We have a stateless app without sessions, so we use the cache to\n // retrieve the temp credentials for man in the middle attack\n // protection\n $key = 'oauth_temp_'.$this->request->input('oauth_token');\n $temp = $this->cache->get($key, '');\n\n return $this->server->getTokenCredentials(\n $temp,\n $this->request->input('oauth_token'),\n $this->request->input('oauth_verifier')\n );\n }", "public function authenticate(Request $request)\n {\n // grab credentials from the request\n $credentials = $request->only('email', 'password');\n try {\n // attempt to verify the credentials and create a token for the user\n if (!$token = JWTAuth::attempt($credentials)) {\n return response()->json(['error' => 'invalid_credentials'], 401);\n }\n } catch (JWTException $e) {\n // something went wrong whilst attempting to encode the token\n return response()->json(['error' => 'could_not_create_token'], 500);\n }\n // all good so return the token\n return response()->json(compact('token'));\n }", "public function getToken(array $credential = [])\n {\n if (!isset($credential['client_email'], $credential['private_key'])) {\n\n throw new WDTException('Client email & private key are not set.');\n }\n\n $payload = array(\n \"iss\" => $credential['client_email'],\n \"scope\" => 'https://www.googleapis.com/auth/drive',\n \"aud\" => 'https://oauth2.googleapis.com/token',\n \"exp\" => time() + 3600,\n \"iat\" => time(),\n );\n\n $jwt = JWT::encode($payload, $credential['private_key'], 'RS256');\n\n $args = array(\n 'headers' => array(),\n 'body' => array(\n 'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer',\n 'assertion' => $jwt,\n )\n );\n\n $googleResponse = wp_remote_post('https://oauth2.googleapis.com/token', $args);\n\n if (!is_wp_error($googleResponse) && isset($googleResponse['response']['code']) && $googleResponse['response']['code'] == 200) {\n return array(TRUE, json_decode($googleResponse['body'], TRUE));\n } else {\n $errorMsg = isset($googleResponse['response']['message']) ? json_encode($googleResponse['response']['message']) : \"Google Response for token authorization have failed\";\n throw new WDTException($errorMsg);\n }\n }", "public function getAuthUser(Request $request){\n $user = JWTAuth::toUser($request->token);\n return response()->json(['result' => $user]);\n }", "public function getAuthUser()\n {\n $user = JWTAuth::authenticate(JWTAuth::getToken());\n\n return response()->json(['user' => $user]);\n }", "public function login()\n {\n $credentials = request(['email', 'password']);\n\n// if (!$token = auth('api')->attempt($credentials)) {\n if (!$token = JWTAuth::attempt($credentials)) {\n return response()->json(['error' => 'Unauthorized'], 401);\n }\n\n return $this->respondWithToken($token);\n }", "private function convertToJWT(): Token\n {\n $this->initJwtConfiguration();\n\n if (null === $this->jwtConfiguration) {\n throw new \\RuntimeException('Unable to convert to JWT without config');\n }\n\n return $this->jwtConfiguration->builder()\n ->permittedFor($this->getClient()->getIdentifier())\n ->identifiedBy($this->getIdentifier())\n ->issuedAt(new \\DateTimeImmutable())\n ->canOnlyBeUsedAfter(new \\DateTimeImmutable())\n ->expiresAt($this->getExpiryDateTime())\n ->relatedTo((string) $this->getUserIdentifier())\n ->withClaim('scopes', $this->getScopes())\n ->getToken($this->jwtConfiguration->signer(), $this->jwtConfiguration->signingKey());\n }", "public function getAuthenticatedUser()\n {\n try {\n\n if (! $user = JWTAuth::parseToken()->authenticate()) {\n return response()->json(['user_not_found'], 404);\n }\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n\n return response()->json(['token_expired'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n\n return response()->json(['token_invalid'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n\n return response()->json(['token_absent'], $e->getStatusCode());\n\n }\n\n // El token es correcto y devuelve los datos del usuario\n return $user['original'];\n }", "public function authenticate(Request $request)\n {\n $credentials = $request->only('email', 'password');\n try {\n // attempt to verify the credentials and create a token for the user\n if (!$token = JWTAuth::attempt($credentials)) {\n return response()->errorUnauthorized();\n }\n } catch (JWTException $e) {\n // something went wrong whilst attempting to encode the token\n return response()->errorInternal();\n }\n\n // all good so return the token\n return response()->json([\"token\"=> $token, \"user\" => $credentials])->setStatusCode(200);\n\n }", "public function retrieveByCredentials(array $credentials)\n {\n if (isset($credentials['email'])) {\n $credentials['email_hash'] = hash_hmac('sha512', $credentials['email'], config('app.key'));\n unset($credentials['email']);\n }\n\n return parent::retrieveByCredentials($credentials);\n }", "public function authenticate(Request $request) {\n $credentials = $request->only('email', 'password');\n\n try {\n if(!$token = JWTAuth::attempt($credentials)) {\n return response()->json(['error' => 'User credentials are not correct!']);\n }\n } catch(JWTException $e) {\n return response()->json(['error' => 'Something went wrong!']);\n }\n\n return response()->json(['token' => $token, 'id' => User::where('email', $request->email)->first()->id]);\n }", "public function getByCredentials(string $email, string $password): User;", "public function authenticateByCredentials(string $identifier, string $secret): AuthenticableInterface;", "public function getAuthenticatedUser()\n {\n try {\n if ( !$user = JWTAuth::parseToken()->authenticate() ) {\n return response()->json(['user_not_found'], 404);\n }\n } catch ( TokenExpiredException $e ) {\n return response()->json(['token_expired'], $e->getStatusCode());\n } catch ( TokenInvalidException $e ) {\n return response()->json(['token_invalid'], $e->getStatusCode());\n } catch ( JWTException $e ) {\n return response()->json(['token_absent'], $e->getStatusCode());\n }\n\n // The token is valid and we have found the user via the sub claim\n return $user;\n }", "public function getAuthenticatedUser()\n {\n $token = JWTAuth::getToken();\n if (!$token)\n return false;\n\n try {\n $user = JWTAuth::parseToken()->authenticate();\n if (!$user) {\n return response()->json(['user_not_found'], 404);\n }\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n\n return response()->json(['token_expired'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n\n return response()->json(['token_invalid'], $e->getStatusCode());\n\n } catch (Tymon\\JWTAuth\\Exceptions\\JWTException $e) {\n\n return response()->json(['token_absent'], $e->getStatusCode());\n\n }\n\n // the token is valid and we have found the user via the sub claim\n return $user;\n }", "public function signin(Request $request)\n {\n $this->validate($request, [\n 'email' => 'required|email',\n 'password' => 'required',\n ]);\n $credentials = $request->only('email', 'password');\n\n //how to get authenticated user\n if(! $user = JWTAuth::parseToken()->authenticate()){\n return response()->json(['msg'=>'User not found'],404);\n }\n\n\n try {\n if (!$token = $this->jwt->attempt($credentials)) {\n return response()->json(['msg' => 'Invalid credential'], 401);\n }\n } catch (\\Tymon\\JWTAuth\\Exceptions\\TokenExpiredException $e) {\n\n return response()->json(['token_expired'], 500);\n\n } catch (\\Tymon\\JWTAuth\\Exceptions\\TokenInvalidException $e) {\n\n return response()->json(['token_invalid'], 500);\n\n } catch (JWTException $e) {\n return response()->json(['token_absent' => $e->getMessage()], 500);\n }\n\n return response()->json(['token' => $token], 200);\n }", "protected function authenticate(){\n $user = User::create([\n 'name' => 'test',\n 'email' => '[email protected]',\n 'password' => Hash::make('secret1234'),\n ]);\n $this->user = $user;\n $token = JWTAuth::fromUser($user);\n return $token;\n }", "public function authenticate(Request $request)\n {\n $credentials = $request->only('email', 'password');\n\n try {\n // attempt to verify the credentials and create a token for the user\n if (! $token = JWTAuth::attempt($credentials)) {\n return response()->json(['error' => 'invalid_credentials'], 401);\n }\n } catch (JWTException $e) {\n // something went wrong whilst attempting to encode the token\n return response()->json(['error' => 'could_not_create_token'], 500);\n }\n\n // all good so return the token\n return response()->json([\n 'success' => true,\n 'message' => \"Successful\",\n 'token' => $token\n ]);\n }", "public function login() {\n if(!$this->validate()) {\n return false;\n }\n $statement = $this->conn->prepare(\"SELECT id, username, password_hash FROM {$this->table} where username = :username\");\n $statement->execute(['username' => $this->username]);\n $row = $statement->fetch();\n \n # If user is verified, return JWT\n if(password_verify($this->password, $row['password_hash'])) {\n return $this->generateToken();\n } \n \n $this->errors = 'Invalid login credentials';\n return false;\n }", "public function login(Request $request){\n $credentials = $request->only('email', 'password');\n $token = null;\n try {\n if (!$token = JWTAuth::attempt($credentials)) {\n return response()->json(['invalid_email_or_password'], 422);\n }\n } catch (JWTAuthException $e) {\n return response()->json(['failed_to_create_token'], 500);\n }\n return response()->json(compact('token'));\n }", "private function getJsonWenToken()\n {\n $respContent = $this->post(\n \"auth\",\n ['public_key' => $this->publicKey]\n );\n\n return json_decode($respContent)->content;\n }", "public function getAuthUser(Request $request) {\n $user = JWTAuth::toUser($request->token);\n return response()->json(['result' => $user]);\n }", "public function retrieveByCredentials(array $credentials) {\n $userData = $this->getUserDataByEmail($credentials['email']);\n if ($userData != null && $userData[1] == $credentials['password']) {\n return \\User::fromCSV($userData);\n }\n return null;\n }", "public function createToken()\n {\n $key = base64_encode(getenv('JWT_SECRET'));\n $payload = array(\n \"jti\" => base64_encode(random_bytes(32)),\n \"iat\" => time(),\n \"iss\" => getenv('BASE_URL'),\n \"nbf\" => time() + 10,\n \"exp\" => time() + (3600 * 24 * 15),\n \"data\" => [\n \"user\" => [\n \"username\" => $this->username,\n \"uuid\" => $this->uuid\n ]\n ]\n );\n try {\n return $this->container->jwt::encode($payload, $key, 'HS256');\n } catch (Exception $e) {\n return false;\n }\n }", "public function token() {\n try {\n $payload = JWTUtils::inst()->byBasicAuth($this->request);\n\n return $this->returnArray($payload);\n } catch (JWTUtilsException $e) {\n return $this->httpError(403, $e->getMessage());\n }\n }", "public function getCredentials(Request $request)\n {\n $code = $request->query->get('code');\n\n $application = $this->commonGroundService->cleanUrl(['component'=>'wrc', 'type'=>'applications', 'id'=>$this->params->get('app_id')]);\n $providers = $this->commonGroundService->getResourceList(['component' => 'uc', 'type' => 'providers'], ['type' => 'id-vault', 'application' => $this->params->get('app_id')])['hydra:member'];\n $provider = $providers[0];\n\n $backUrl = $request->query->get('backUrl', false);\n if ($backUrl) {\n $this->session->set('backUrl', $backUrl);\n }\n\n $accessToken = $this->idVaultService->authenticateUser($code, $provider['configuration']['app_id'], $provider['configuration']['secret']);\n\n $json = base64_decode(explode('.', $accessToken['id_token'])[1]);\n $json = json_decode($json, true);\n\n $credentials = [\n 'username' => $json['email'],\n 'email' => $json['email'],\n 'givenName' => $json['given_name'],\n 'familyName' => $json['family_name'],\n 'id' => $json['jti'],\n 'authorization' => $accessToken['access_token'],\n 'newUser' => $accessToken['newUser'],\n 'groups' => $json['groups'],\n 'organizations' => $json['organizations']\n ];\n\n $request->getSession()->set(\n Security::LAST_USERNAME,\n $credentials['username']\n );\n\n return $credentials;\n }", "public function getToken() : string {\n if (($this->token === null) || ($this->token->isExpired())) {\n $jwtBuilder = new Builder();\n $jwtBuilder->set('iss', $this->handlerPublicKey);\n $jwtBuilder->set('sub', $this->credentialPublicKey);\n\n $this->token = $jwtBuilder\n ->sign(new Sha256(), $this->handlerPrivateKey)\n ->getToken();\n }\n\n return (string) $this->token;\n }", "public static function getJWTFromHeader() {\n $httpHeaders = getallheaders();\n if (isset($httpHeaders['Authorization']) &&strpos($httpHeaders['Authorization'], 'Bearer ') === 0) {\n return substr($httpHeaders['Authorization'], strlen('Bearer '));\n }\n return NULL;\n }", "public function get_user_by_credentials($credentials) {\n $stmt = $this->pdo->prepare('SELECT id, user_name, email_address, password, remember_me_until \n FROM users WHERE user_name = :user_name OR email_address = :email_address;');\n $stmt->execute([\n 'user_name' => $credentials,\n 'email_address' => $credentials\n ]);\n $user = $stmt->fetch();\n return $user;\n }", "public function hawkAuthGet($path, HawkCredentialInterface $credentials, array $options = []) {\n $header = isset($options['header']) && $options['header'] instanceof Header ? $options['header']\n : $this->getHawkAuthHeader($path, $credentials);\n return $this->drupalGet($path, $options, [$header->fieldName() . ': ' . $header->fieldValue()]);\n }", "private function getJsonWebToken($username): void\n {\n $credentials = [\n 'username' => $username,\n 'password' => UserFixtures::PASSWORD\n ];\n $this->client = $this->createClient();\n $this->client->request('POST', '/authentication_token', [], [], [\n 'CONTENT_TYPE' => 'application/json'\n ], json_encode($credentials));\n\n $data = json_decode($this->client->getResponse()->getContent(), true);\n\n $this->client->setServerParameter('HTTP_Authorization', sprintf('Bearer %s', $data['token']));\n }", "function verify_token () {\n $request = new Request();\n\n // Retrieve the user's JWT\n $jwt = get_token();\n\n if ($jwt) {\n try {\n /*\n * decode the jwt using the key from config\n */\n $config = Factory::fromFile('config/config.php', true);\n $secretKey = base64_decode($config->get('jwt')->get('key'));\n $token = JWT::decode($jwt, $secretKey, [$config->get('jwt')->get('algorithm')]);\n\n return $token;\n\n } catch (Exception $e) {\n /*\n * the token was not able to be decoded.\n * this is likely because the signature was not able to be verified (tampered token)\n */\n return new Response(array(\n 'body' => 'Invalid JWT token',\n 'header' => 401\n ));\n }\n } else {\n /*\n * No token was able to be extracted from the authorization header\n */\n return new Response(array(\n 'body' => 'JWT missing within authorisation header',\n 'header' => 400\n ));\n }\n\n // if ($request->isGet()) {\n // $authHeader = $request->getHeader('authorization');\n //\n // /*\n // * Look for the 'authorization' header\n // */\n // if ($authHeader) {\n // /*\n // * Extract the jwt from the Bearer\n // */\n // list($jwt) = sscanf( $authHeader->toString(), 'Authorization: Bearer %s');\n //\n // if ($jwt) {\n // try {\n // $config = Factory::fromFile('config/config.php', true);\n //\n // /*\n // * decode the jwt using the key from config\n // */\n // $secretKey = base64_decode($config->get('jwt')->get('key'));\n //\n // $token = JWT::decode($jwt, $secretKey, [$config->get('jwt')->get('algorithm')]);\n //\n // $asset = base64_encode(file_get_contents('http://lorempixel.com/200/300/cats/'));\n //\n // /**\n // * Valid request\n // */\n // return json_encode(array(\n // 'status' => true,\n // 'jwt' => token($token->data->userId, $token->data->userName)\n // ));\n //\n // } catch (Exception $e) {\n // /*\n // * the token was not able to be decoded.\n // * this is likely because the signature was not able to be verified (tampered token)\n // */\n // return array(\n // 'status' => false,\n // 'error' => 'HTTP/1.0 401 Unauthorized'\n // );\n // }\n // } else {\n // /*\n // * No token was able to be extracted from the authorization header\n // */\n // return array(\n // 'status' => false,\n // 'error' => 'HTTP/1.0 400 Bad Request'\n // );\n // }\n // } else {\n // /*\n // * The request lacks the authorization token\n // */\n // return array(\n // 'status' => false,\n // 'error' => 'HTTP/1.0 400 Bad Request'\n // );\n // }\n // } else {\n // return array(\n // 'status' => false,\n // 'error' => 'HTTP/1.0 405 Method Not Allowed'\n // );\n // }\n}", "private function checkToken()\n {\n\t\ttry {\n\t\t\t$user = JWTAuth::GetJWTUser();\n\t\t\t$this->token = JWTAuth::CheckJWTToken($user->id);\n return $user;\n } catch (\\UnexpectedValueException $e) {\n return $this->sendResponse($e->getMessage());\n }\n }", "public function retrieveByCredentials(array $credentials)\n {\n return new User($credentials);\n }", "public function authenticate(Request $request)\n {\n $credentials = $request->only('email', 'password');\n\n try {\n // attempt to verify the credentials and create a token for the user\n if ( ! $token = JWTAuth::attempt($credentials)) {\n return $this->respondUnauthorized('Invalid credentials');\n }\n } catch (JWTException $e) {\n // something went wrong whilst attempting to encode the token\n return $this->respondInternalError('Could not create token');\n }\n\n return $this->respond(['token' => $token]);\n }", "public function login(Request $request)\n {\n $rules = [\n 'teamid' => 'required',\n 'password' => 'required',\n ];\n $input = $request->only('teamid', 'password');\n $this->validate($request, $rules);\n /* $validator = Validator::make($input, $rules);\n if($validator->fails()) {\n $error = $validator->messages()->toJson();\n return response()->json(['success'=> false, 'error'=> $error]);\n }*/\n $credentials = [\n 'teamid' => $request->teamid,\n 'password' => $request->password,\n \n ];\n try {\n // attempt to verify the credentials and create a token for the user\n if (! $token = JWTAuth::attempt($credentials)) {\n return response()->json(['success' => false, 'error' => 'Invalid Credentials. Please enter correct team id and password.'], 401);\n }\n } catch (JWTException $e) {\n // something went wrong whilst attempting to encode the token\n return response()->json(['success' => false, 'error' => 'could_not_create_token'], 500);\n }\n // all good so return the token\n return response()->json(['success' => true, 'data'=> [ 'token' => $token ]]);\n }", "public function getCredentials(Request $request)\n {\n $extractor = new AuthorizationHeaderTokenExtractor(\n 'Bearer',\n 'Authorization'\n );\n\n $token = $extractor->extract($request);\n\n if (!$token) {\n return;\n }\n\n return $token;\n }", "public function authenticate(Request $request)\n {\n $credentials = $request->only('email', 'password');\n\n try {\n // attempt to verify the credentials and create a token for the user\n if (! $token = $this->jwtauth->attempt($credentials)) {\n \n return response(array(\n \t\t\t'Message' => 'Invalid Email or password',\n \t\t\t'code' => 401,\n \t\t\t'status' => 'fail',\n \t\t\t));\n\n }\n } catch (JWTException $e) {\n // something went wrong whilst attempting to encode the token\n return response(array(\n \t\t\t'Message' => 'Could not create token',\n \t\t\t'code' => 500,\n \t\t\t'status' => 'fail',\n \t\t\t));\n }\n\n // all good so return the token\n return response()->json(compact('token'));\n \n }", "public function byCredentials(array $credentials)\n {\n return $this->auth->once($credentials);\n }", "public function getCredentials(Request $request)\n {\n }", "public function actingAsUser($credentials)\n {\n if (!$token = JWTAuth::attempt($credentials)) {\n return $this;\n }\n\n $user = ($apiKey = Arr::get($credentials, 'api_key'))\n ? User::whereApiKey($apiKey)->firstOrFail()\n : User::whereEmail(Arr::get($credentials, 'email'))->firstOrFail()\n ;\n\n return $this->actingAs($user);\n }" ]
[ "0.68546844", "0.619579", "0.6153601", "0.6050922", "0.6005828", "0.6005828", "0.6005828", "0.5997815", "0.59959185", "0.59626955", "0.5942627", "0.5922473", "0.5909551", "0.5879693", "0.58108866", "0.5775995", "0.5770352", "0.5757317", "0.5690253", "0.56530917", "0.56380564", "0.561093", "0.5598549", "0.5549299", "0.55222857", "0.55144536", "0.550848", "0.5492527", "0.547105", "0.5459857", "0.5457614", "0.5445924", "0.5434345", "0.5411581", "0.54017484", "0.54003364", "0.5394792", "0.5392654", "0.5389389", "0.5387113", "0.53579175", "0.53559387", "0.5349194", "0.53383714", "0.53319275", "0.5326183", "0.53131336", "0.52805525", "0.5278131", "0.52736497", "0.52734566", "0.5251273", "0.5244268", "0.5243092", "0.52424276", "0.5240453", "0.5226904", "0.5223961", "0.52221555", "0.52193683", "0.5212437", "0.5210999", "0.51894706", "0.5180912", "0.51789653", "0.51751184", "0.517182", "0.5170278", "0.51690626", "0.51485944", "0.51465803", "0.5129084", "0.51243395", "0.5120174", "0.51181144", "0.5114993", "0.51119", "0.51099926", "0.5106676", "0.51040405", "0.5097726", "0.50950754", "0.5077249", "0.50756717", "0.5065152", "0.50619394", "0.5052867", "0.5051079", "0.5049689", "0.5048159", "0.5047097", "0.5045141", "0.5039773", "0.5032411", "0.5031994", "0.50297004", "0.50284857", "0.50278133", "0.5026622", "0.5023338", "0.5021004" ]
0.0
-1
Get the authenticated User.
public function me() { return response()->json(auth()->user()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getAuthenticatedUser()\n {\n return auth()->user();\n }", "public function getAuthenticatedUser()\n {\n // get the web-user\n $user = Auth::guard()->user();\n\n // get the api-user\n if(!isset($user) && $user == null) {\n $user = Auth::guard('api')->user();\n }\n return $user;\n }", "private function getAuthenticatedUser()\r\n {\r\n $tokenStorage = $this->container->get('security.token_storage');\r\n return $tokenStorage->getToken()->getUser();\r\n }", "private function getAuthenticatedUser()\r\n {\r\n $tokenStorage = $this->container->get('security.token_storage');\r\n return $tokenStorage->getToken()->getUser();\r\n }", "protected function getAuthUser () {\n return Auth::user();\n }", "public static function getAuthenticatedUser ()\n\t{\n\t\t$inst = self::getInstance();\n\t\t\n\t\tif ($inst->_authenticatedUser == null) \n\t\t{\n\t\t\t$user = $inst->_auth->getIdentity();\n\t\t\tif ($user)\n\t\t\t\t$inst->_authenticatedUser = Tg_User::getUserById($user['id']);\n\t\t\telse\n\t\t\t\t$inst->_authenticatedUser = false;\n\t\t}\n\t\t\t\n\t\treturn $inst->_authenticatedUser;\n\t}", "public function getAuthenticatedUser()\n\t{\n\t\t$user = Auth::user();\n\t\t$user->merchant;\n\n\t\treturn $user;\n\t}", "public function user()\n {\n\n //Check if the user exists\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n //Retrieve token from request and authenticate\n return $this->getTokenForRequest();\n }", "public function getAuthenticatedUser()\n {\n return $this->getUnsplashClient()->sendRequest('GET', 'me');\n }", "public function user() {\n\t\tif (!Auth::check()) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn Auth::getUser();\n\t}", "public function user()\n {\n return $this->auth->user();\n }", "public function getLoggedInUser() {\n return $this->_user->getLoggedInUser();\n }", "public function user()\n {\n return $this->app->auth->user();\n }", "public function user()\n {\n return $this->app->auth->user();\n }", "public function getAuthenticatedUser()\n {\n return JWTAuth::parseToken()->authenticate();\n }", "public function GetCurrentUser()\n {\n return $this->userManager->getCurrent();\n }", "public function user()\n {\n if ( ! Auth::check()) {\n return null;\n }\n\n return Auth::getUser();\n }", "public function user()\n {\n if (!Auth::check()) {\n return null;\n }\n\n return Auth::getUser();\n }", "public function getAuthorizedUser()\n {\n if (empty($this->currentUser)) {\n $this->authorize();\n }\n return $this->currentUser;\n }", "function getLoggedInUser()\n{\n\tif(isLoggedIn()) {\n\t\treturn auth()->user();\n\t}\n\treturn null;\n}", "protected function getUser()\n {\n return $this->container->get('security.context')->getToken()->getUser();\n }", "public function user()\n {\n if ($this->loggedOut) {\n return;\n }\n\n // If we've already retrieved the user for the current request we can just\n // return it back immediately. We do not want to fetch the user data on\n // every call to this method because that would be tremendously slow.\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n if (\\session()->has($this->user_provider->getAuthIdentifierName()))\n {\n $user = \\session()->get($this->user_provider->getAuthIdentifierName());\n return $user;\n }\n\n $authenticated_user = $this->user_provider->retrieveById($this->user_provider->getAuthIdentifier());\n if (!isset($authenticated_user))\n {\n return;\n }\n $this->user_provider->setUserAttribute($authenticated_user);\n $this->setUser($this->user_provider);\n\n return $this->user;\n }", "public function getUser() {\n $user = $this->getSessionUser();\n\n return $user;\n }", "function getAuthenticatedUser()\n {\n if (isset($_SESSION['MFW_authenticated_user'])) {\n return $_SESSION['MFW_authenticated_user'];\n }\n\n return null;\n }", "public function get_user() {\n\t\treturn $this->user;\n\t}", "public function user()\n {\n return $this->authUserService__();\n }", "public static function getCurrentUser()\n {\n /**\n * @var \\ZCMS\\Core\\ZSession $session\n */\n $session = Di::getDefault()->get('session');\n return $session->get('auth');\n }", "protected function getUser()\n {\n if ($this->_user === null) {\n $this->_user = User::findIdentity(Yii::$app->user->id);\n }\n\n return $this->_user;\n }", "public static function getUser() {\n return session(\"auth_user\", null);\n }", "public function get_user() {\n\t\treturn ($this->logged_in()) ? $this->session->get($this->config['session_key'], null) : null;\n\t}", "public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}", "public function getUser()\n {\n return $this->getAuth()->getIdentity();\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n return $this->get(self::_USER);\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = User::findByUsername($this->email);\n }\n return $this->_user;\n }", "function authUser()\n {\n return auth()->user();\n }", "public function getUser() {\n\t\treturn $this->api->getUserById($this->getUserId());\n\t}", "static public function GetUser() {\n if (self::GetImpersonatedUser()) {\n return self::GetImpersonatedUser();\n }\n return self::GetAuthUser();\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = User::findByLogin($this->login);\n }\n\n return $this->_user;\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = User::findByLogin($this->login);\n }\n\n return $this->_user;\n }", "public function getUser()\n {\n return Session::get(self::USER);\n }", "public function user()\n {\n if (!$this->user) {\n $identifier = $this->getToken();\n $this->user = $this->provider->retrieveByToken($identifier, '');\n }\n return $this->user;\n }", "public function getUser() {\r\n\r\n if (self::$user === null)\r\n $this->refreshIdentity();\r\n\r\n return self::$user;\r\n }", "public function getCurrentUser()\n {\n $this->validateUser();\n\n if ($this->session->has(\"user\")) {\n return $this->session->get(\"user\");\n }\n }", "public static function user()\n {\n if (!isset(static::$user)) {\n $uid = static::getCurrentUserId();\n if ($uid) static::$user = static::fetchUserById($uid);\n }\n \n return static::$user;\n }", "public function getCurrentUser()\n {\n $accessToken = $this->getFOSOauthServer()->verifyAccessToken(\n $this->getAccessTokenString(),\n 'user'\n );\n\n return $accessToken->getUser();\n }", "protected function getUser()\n {\n if ($this->_user === null) {\n $this->_user = Users::findByUsername($this->login);\n }\n\n return $this->_user;\n }", "public function getUser()\n {\n $attributes = $this->getUserAttributes();\n\n // Try to load user by ldap id attribute\n if ($this->idAttribute !== null && isset($attributes['authclient_id'])) {\n $user = User::findOne(['authclient_id' => $attributes['authclient_id'], 'auth_mode' => $this->getId()]);\n if ($user !== null) {\n return $user;\n }\n }\n\n return $this->getUserAuto();\n }", "protected function getUser()\n {\n return $this->user;\n }", "public function user()\n {\n return $this->app->auth->guard('admin')->user();\n }", "private function getLoggedInUser()\n {\n if (null !== $token = $this->securityContext->getToken()) {\n return $token->getUser();\n }\n\n return null;\n }", "public static function getUser()\n {\n return self::getInstance()->_getUser();\n }", "public function user()\n {\n if ($this->loggedOut) {\n return;\n }\n\n // If we've already retrieved the user for the current request we can just\n // return it back immediately. We do not want to fetch the user data on\n // every call to this method because that would be tremendously slow.\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n $id = $this->session->get($this->getName());\n\n // First we will try to load the user using the identifier in the session if\n // one exists. Otherwise we will check for a \"remember me\" cookie in this\n // request, and if one exists, attempt to retrieve the user using that.\n if (! is_null($id)) {\n if ($this->user = $this->provider->retrieveById($id)) {\n $this->fireAuthenticatedEvent($this->user);\n }\n }\n\n // If the user is null, but we decrypt a \"recaller\" cookie we can attempt to\n // pull the user data on that cookie which serves as a remember cookie on\n // the application. Once we have a user we can return it to the caller.\n $recaller = $this->recaller();\n\n if (is_null($this->user) && ! is_null($recaller)) {\n $this->user = $this->userFromRecaller($recaller);\n\n if ($this->user) {\n $this->replaceRememberToken($this->user, $recaller->token());\n\n $this->updateSession($this->user->getAuthIdentifier());\n\n $this->fireLoginEvent($this->user, true);\n }\n }\n\n return $this->user;\n }", "public function getUser()\n {\n if(!$this->user)\n $this->user = User::getActive();\n\n return $this->user;\n }", "public function getUser()\n {\n if (! $this->user) {\n $this->exchange();\n }\n\n return $this->user;\n }", "public function getAuthenticatedUser()\n {\n return response()->json($this->guard('api')->user());\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = User::findByUsername($this->username);\n }\n\n return $this->_user;\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = User::findByUsername($this->username);\n }\n\n return $this->_user;\n }", "protected function getUser()\n {\n if ($this->_user === null) {\n $this->_user = User::findByUsername($this->username);\n }\n\n return $this->_user;\n }", "public function getUser()\n {\n return $this->container->get('user')->getUser();\n }", "public function GetUser()\n\t\t{\n\t\t\treturn $this->User;\n\t\t}", "public function getUser()\n {\n if ($this->_user === null) {\n $this->_user = Admin::findByUsernameOrEmail($this->username);\n }\n\n return $this->_user;\n }", "protected function getUser()\n {\n return $this->user_provider->getHydratedUser();\n }", "public static function user() {\n return Auth::currentUser();\n }", "public function getUser() {\n\t\treturn $this->Session->read('UserAuth');\n\t}", "public static function getCurrentUser()\n {\n if (isset($_SESSION['user'])) {\n return $_SESSION['user'];\n } else {\n return new User();\n }\n }", "private function getUser()\n {\n return $this->user->getUser();\n }", "protected function getUser()\n {\n if ($this->_user === null) {\n $this->_user = User::findByUsername($this->username);\n }\n return $this->_user;\n }", "public function getLoggedInUser() {\n\t\treturn elgg_get_logged_in_user_entity();\n\t}", "public function getUser()\n {\n if (null === $token = $this->securityContext->getToken()) {\n return;\n }\n\n if (!is_object($user = $token->getUser())) {\n return;\n }\n\n return $user;\n }", "public function getUser()\n {\n if ($this->user === null) {\n $this->user = Yii::$app->user->getIdentity();\n }\n\n return $this->user;\n }", "public function getUser() {\n if ($this->_user === false) {\n $this->_user = User::findByUsername($this->username);\n }\n\n return $this->_user;\n }", "public function getUser()\n {\n if (!isset($_SESSION['user']['id'])) {\n return;\n }\n\n return new \\User($_SESSION['user']['id']);\n }", "public function getCurrentUser()\n\t{\n\t\treturn $this->users->getCurrentUser();\n\t}", "public final function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = mgcms\\db\\User::find()->andWhere(['or', ['username' => $this->username], ['email' => $this->username]])->one();\n }\n\n return $this->_user;\n }", "public static function getCurrentUser()\n {\n $auth = Zend_Auth::getInstance();\n $_data = $auth->getIdentity();\n return new User($_data);\n }", "public function user()\n\t{\n\t\tif (is_null($this->user) and $this->session->has(static::$key))\n\t\t{\n\t\t\t$this->user = call_user_func(Config::get('auth.by_id'), $this->session->get(static::$key));\n\t\t}\n\n\t\treturn $this->user;\n\t}", "public function getAuthUserDetail()\n {\n return $this->user;\n }", "public function getUser()\n {\n if ($this->_user === false) {\n $this->_user = \\app\\models\\User::findByUsername($this->username);\n }\n return $this->_user;\n }", "public function getLoggedInUser()\n {\n $securityContext = $this->container->get('security.context');\n $consultant = $securityContext->getToken()->getUser();\n return $consultant;\n }", "public static function getLoggedInUser() {\n if (self::$loggedInUser == false) {\n //We need the Db class to escape the username, just in case.\n $db = Db::getInstance();\n\n // The email is used as the username to log into the service.\n $login = $db->escapeString($_SERVER['PHP_AUTH_USER']);\n $password = $db->escapeString($_SERVER['PHP_AUTH_PW']);\n \n $query = \"SELECT \".Config::AUTH_FIELD_UID.\", \".Config::AUTH_FIELD_LOGIN.\" \"\n .\"FROM \".Config::DB_DB.\".\".Config::AUTH_TABLE.\" WHERE \"\n .Config::AUTH_FIELD_LOGIN.\" = '$login' \"\n .\"AND `\".Config::AUTH_FIELD_PASSWORD.\"` = SHA1('$password')\";\n\n self::$loggedInUser = self::loadBySql($query);\n }\n\n return self::$loggedInUser;\n }", "public static function getUser()\n\t{\n\t\tif(isset($_SESSION['user_id'])){\n\t\t\t\n\t\t\treturn User::findByID($_SESSION['user_id']);\n\t\t\t\n\t\t}else{\n\t\t\n\t\t\treturn static::loginFromRememberCookie();\n\t\t\n\t\t}\n\t}", "public function getUser() {\n\t\treturn User::newFromName( $this->params['user'], false );\n\t}", "public function getUser()\n {\n if ($this->user === null) {\n // if we have not already determined this and cached the result.\n $this->user = $this->getUserFromAvailableData();\n }\n\n return $this->user;\n }", "public function getUser() {\n\t\treturn User::find($this->user_id);\n\t}", "public function getCurrentUser()\n {\n if ($this->_currentUser == null) {\n\n if ($this->_oauthToken == null) {\n $this->_setOauthToken();\n }\n $this->_currentUser = json_decode($this->_oauthToken)->user;\n }\n\n return $this->_currentUser;\n }", "public function getUser() {\n\t\treturn $this->user;\n\t}", "public function getUser() {\n\t\treturn $this->user;\n\t}", "public static function getUser() {\n\t\t\tif(isset($_SESSION['user']))\n\t\t\t\t$user = $_SESSION['user'];\n\t\t\telse\n\t\t\t\t$user = new User();\n\t\t\treturn $user;\n\t\t}", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }", "public function getUser()\n {\n return $this->user;\n }" ]
[ "0.8572953", "0.8565583", "0.84420604", "0.84420604", "0.8354281", "0.8297551", "0.81614834", "0.8072469", "0.8036144", "0.800262", "0.7990153", "0.7954066", "0.7948575", "0.7948575", "0.7921939", "0.7915742", "0.7897955", "0.78873825", "0.7861962", "0.78340834", "0.78295624", "0.7812409", "0.78069687", "0.77428293", "0.77316284", "0.77286947", "0.77275664", "0.77168417", "0.7698261", "0.767817", "0.7660705", "0.7652842", "0.76407874", "0.76407874", "0.76407874", "0.76407874", "0.76381004", "0.763541", "0.7627028", "0.7626564", "0.7624593", "0.7624593", "0.7618222", "0.76173204", "0.7610115", "0.7605702", "0.7602781", "0.7593715", "0.75877756", "0.7586586", "0.7582371", "0.75785375", "0.7577236", "0.7576169", "0.7575078", "0.75743747", "0.757332", "0.75670797", "0.7550634", "0.7550634", "0.75387436", "0.75379616", "0.7537579", "0.7532513", "0.7529427", "0.75281334", "0.7524402", "0.75241745", "0.751987", "0.75193524", "0.7514986", "0.75134534", "0.7508038", "0.750726", "0.7505705", "0.74851906", "0.7472776", "0.7469548", "0.74667877", "0.74648136", "0.7464477", "0.74598706", "0.7457264", "0.7452836", "0.74507624", "0.74424624", "0.7442169", "0.74326885", "0.74306613", "0.7429435", "0.7429435", "0.74182355", "0.7403708", "0.7403708", "0.7403708", "0.7403708", "0.7403708", "0.7403708", "0.7403708", "0.7403708", "0.7403708" ]
0.0
-1
Log the user out (Invalidate the token).
public function logout() { auth()->logout(); return response()->json(['message' => 'Successfully logged out']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function logout() {\n\t$new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\t\n\t# Create the data array we'll use with the update method\n\t# In this case, we're only updating one field, so our array only has one entry\n\t$data = Array(\"token\" => $new_token);\n\t\n\t# Do the update\n\tDB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\t\n\t# Delete their token cookie - effectively logging them out\n\tsetcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\t\n\tRouter::redirect(\"/users/login\");\n }", "public function logout() {\n\t\t# Generate and save a new token for next login\n\t\t$new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string() );\n\n\t\t# Create the data array we'll use with the update method\n\t\t# In this case, we're only updating one field, so our array only has one entry\n\t\t$data = Array(\"token\" => $new_token);\n\n\t\t# Do the update\n\t\tDB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\n\t\t# Delete their token cookie by setting it to a date in the past - effectively logging them out\n\t\tsetcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n\t\t# Send them back to the main index.\n\t\tRouter::redirect(\"/\");\n\t}", "public function log_out() {\n $this->store_token(null);\n }", "public function logout(){\n\t\t$new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\t\t\n\t\t# Create the data array we'll use with the update method\n\t\t$data = Array(\"token\" => $new_token);\n\n\t\t# Do the update\n\t\tDB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\t\t\n\t\t# Delete their token cookie by setting it to a date in the past - effectively logging them out\n\t\tsetcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n\t\t#send back to main index\n\t\tRouter::redirect(\"/\");\n\t}", "public function logout() {\n # Generate and save a new token for next login\n $new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\n # Create the data array we'll use with the update method\n # In this case, we're only updating one field, so our array only has one entry\n $data = Array(\"token\" => $new_token);\n\n # Do the update\n DB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\n # Delete their token cookie by setting it to a date in the past, logging them out\n setcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n # Send them back to the main index.\n Router::redirect(\"/\");\n }", "public function logout(){\n $new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\n # Create the data array we'll use with the update method\n # In this case, we're only updating one field, so our array only has one entry\n $data = Array(\"token\" => $new_token);\n\n # Do the update\n DB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\n # Delete their token cookie by setting it to a date in the past - effectively logging them out\n setcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n # Send them back to the main index.\n Router::redirect(\"/\");\n }", "public function logout() {\n $new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\n # Create the data array we'll use with the update method\n # In this case, we're only updating one field, so our array only has one entry\n $data = Array(\"token\" => $new_token);\n\n # Do the update\n DB::instance(DB_NAME)->update(\"users\", $data, \"WHERE token = '\".$this->user->token.\"'\");\n\n # Delete their token cookie by setting it to a date in the past - effectively logging them out\n setcookie(\"token\", \"\", strtotime('-1 year'), '/');\n\n # Send them back to the main index.\n Router::redirect(\"/\");\n\n }", "public function logOut()\n {\n $auth = new AuthenticationService();\n\n if ($auth->hasIdentity()) {\n Session::getDefaultManager()->forgetMe();\n $auth->clearIdentity();\n }\n }", "public function logout()\n {\n $this->user_provider->destroyAuthIdentifierSession();\n\n \\session()->flush();\n \n $this->user = null;\n\n $this->loggedOut = true;\n }", "public function logout() {\n\t\t$this->removeAccessToken();\n\t}", "public function logout()\n\t{\n\t\t$this->client->revokeToken();\n\t \t$this->destroy();\n\t}", "public function logOut(){\n $this->authToken=\"\";\n $this->loggedUser=\"\";\n $this->clearAuthCookie();\n }", "public static function logOut()\r\n {\r\n (new Session())->remove(static::$userIdField);\r\n }", "public function logout()\n {\n $this->app['security']->setToken(null);\n }", "public function logout(){\n $user = Auth::user();\n $user->tokens()->delete();\n\n }", "public function logout(){\n $this->_user->logout();\n }", "public function logout() {\n\t\t//Log this connection into the users_activity table\n\t\t\\DB::table('users_activity')->insert(array(\n\t\t\t'user_id'=>$this->user->attributes[\"id\"],\n\t\t\t'type_id'=>15,\n\t\t\t'data'=>'Log out',\n\t\t\t'created_at'=>date(\"Y-m-d H:i:s\")\n\t\t));\n\t\t$this->user = null;\n\t\t$this->cookie($this->recaller(), null, -2000);\n\t\tSession::forget($this->token());\n\t\t$this->token = null;\n\t}", "public function logout()\n {\n $this->session->remove('user');\n }", "public function logOut () : void {\n $this->destroySession();\n }", "public function LogOut() {\n\t\t$this->session->UnsetAuthenticatedUser();\n\t\t$this->session->AddMessage('success', \"You have been successfully logged out.\");\n\t}", "public function logoutUser() {\r\n\t\t$this->coreAuthenticationFactory->logoutUser ();\r\n\t}", "public function logout(): void\n\t{\n\t\t$this->session->regenerateId();\n\n\t\t$this->session->regenerateToken();\n\n\t\t$this->session->remove($this->options['auth_key']);\n\n\t\t$this->response->getCookies()->delete($this->options['auth_key'], $this->options['cookie_options']);\n\n\t\t$this->user = null;\n\n\t\t$this->hasLoggedOut = true;\n\t}", "function logout()\n {\n $user = $this->getAuthenticatedUser();\n if (!$user) return;\n\n unset($_SESSION['MFW_authenticated_user']);\n }", "public static function doLogout() {\n session()->forget('auth_token');\n session()->flush();\n }", "public function logOut() {\n\t$this->isauthenticated = false;\n\tunset($_SESSION['clpauthid'], $_SESSION['clpareaname'], $_SESSION['clpauthcontainer']);\n\tsession_regenerate_id();\n}", "public function logout()\n\t{\n\t\t$this->user = null;\n\n\t\t$this->session->forget(static::$key);\n\t}", "public function logout()\n {\n if (!is_null($this->token)) {\n $this->token->delete();\n }\n if (isset($_SESSION['uuid'])) {\n unset($_SESSION['uuid']);\n session_destroy();\n setcookie('token', '', time() - 3600, '/', getenv('DOMAIN'));\n }\n }", "function LogOut() {\n\t\tunset($user);\n\t\t$loggedIn=false;\n\t}", "public static function logout() {\n Session::forget('user');\n redirect('/login');\n }", "public function logoutUser()\n {\n // Unset session-key user\n $this->di->get(\"session\")->delete(\"my_user_id\");\n $this->di->get(\"session\")->delete(\"my_user_name\");\n //$this->di->get(\"session\")->delete(\"my_user_password\");\n $this->di->get(\"session\")->delete(\"my_user_email\");\n //$this->di->get(\"session\")->delete(\"my_user_created\");\n //$this->di->get(\"session\")->delete(\"my_user_updated\");\n //$this->di->get(\"session\")->delete(\"my_user_deleted\");\n //$this->di->get(\"session\")->delete(\"my_user_active\");\n $this->di->get(\"session\")->delete(\"my_user_admin\");\n }", "public function logout()\n {\n $this->_delAuthId();\n }", "public function Logout() {\n\n $cookie = json_decode(\\FluitoPHP\\Request\\Request::GetInstance()->\n Cookie($this->\n config['id']), true);\n\n if (isset($cookie['salt_id'])) {\n\n $this->\n database->\n Conn($this->\n GetConn())->\n Helper()->\n Delete($this->\n GetPrefix() . 'usersalt', array(\n array(\n 'column' => 'salt_id',\n 'operator' => '=',\n 'rightvalue' => $cookie['salt_id']\n )\n ))->\n Query();\n\n \\FluitoPHP\\Response\\Response::GetInstance()->\n SetCookie($this->\n config['id'], '', 0, '', '', false, true);\n }\n\n $this->\n currentUser = null;\n }", "static function logout() {\n self::forget(self::currentUser());\n unset($_SESSION['userId']);\n session_destroy();\n }", "public function signOut();", "public function logout()\n {\n if ( !$this->isAuthenticated() )\n {\n return;\n }\n\n $event = new OW_Event(OW_EventManager::ON_USER_LOGOUT, array('userId' => $this->getUserId()));\n OW::getEventManager()->trigger($event);\n\n $this->authenticator->logout();\n }", "public function Logout() {\n $this->session->UnsetAuthenticatedUser();\n $this->profile = array();\n $this->AddMessage('success', \"You have logged out.\");\n }", "public function logOutUser() {\r\n\t\tif (isset($_SESSION)) {\r\n\t\t\tunset($_SESSION);\r\n\t\t\tsession_unset();\r\n\t\t\tsession_destroy();\r\n\t\t}\r\n\t\theader('Location: /');\r\n\t}", "public function logout(){\n\t\tglobal $con;\n\t\t\n\t\t// If the session was persisted through cookies,\n\t\t// get rid of that first.\n\t\tif(isset($_COOKIE['id'])){\n\t\t\t$prep = $con->prepare(\"\n\t\t\t\tDELETE FROM `tokens` \n\t\t\t\tWHERE token_user = $this->user_id\n\t\t\t\t\tAND token_val = ?\n\t\t\t\");\n\t\t\t\n\t\t\t$prep->bind_param(\"s\", $_COOKIE['id']);\n\t\t\t$prep->execute();\n\t\t\t// and clear the cookies...\n\t\t\tunset($_COOKIE['id']);\n\t\t\t/*bool setcookie ( string $name [, string $value [, \n\t\t\t\tint $expire = 0 [, string $path [, string $domain [, \n\t\t\t\tbool $secure = false [, bool $httponly = false ]]]]]] )*/\n\t\t\tsetcookie('id', '', time() - 3600);\n\t\t}\n\t\t\n\t\t// and now destroy the session variables...\n\t\tsession_unset();\n\t\tsession_destroy();\n\t\n\t\t\n\t}", "public function logOut(){\n\t\t\tsetcookie(\"usertoken\", $_SESSION['usertoken'], 1, \" \", '', false, false);\t\n\t\t \tsetcookie(\"sesstoken\", $_SESSION['sesstoken'], 1, \" \", '', false, false); \n\t\t \t\n\t\t \tsession_destroy();\n\t\t \theader(\"Refresh:0; url=index.php\"); \n\n\t }", "public function logoutUser() {\n $this->session->unsetSession(self::$storedUserId);\n $this->session->setFlashMessage(2);\n self::$isLoggedIn = false;\n }", "public function logout()\n {\n $this->webUser = false;\n $this->refresh();\n \\Bdr\\Vendor\\Database::logout();\n }", "public function logout() {\n\t\tAuth::clear('userLogin');\n\t\t$this->redirect(array('action'=>'login'));\n\t}", "public function logUserOut()\n\t{\n\t\t# destroy the session\n\t\tSession::flush();\n\n\t\t# generate a new session ID\n\t\tSession::regenerate();\n\n\t\t# ... and show the homepage\n\t\treturn Redirect::home();\n\t}", "public function logout()\n {\n $this->user = null;\n $this->synchronize();\n unset($_SESSION);\n }", "public function logout()\n {\n $this->userId = 0;\n $this->createSession();\n $this->logger->loginOutEntry(2);\n }", "function logout() {\n if ($this->getRequestMethod() != 'POST') {\n $this->response('', 406);\n }\n\t \t\n\t $userId = $_POST['user_id']; \n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($userId, $auth)) {\n\t\terror_log(\"logout: token expired\"); \n\t\t$this->response('',204);\n }\n $query = \"delete from tokens where user_id = $userId\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $success = array('status' => \"Success\", \"msg\" => \"Successfully logged out.\");\n $this->response(json_encode($success), 200);\n }", "public function logoutUser() {\n $this->debugPrint(\"Logging out user...\");\n\n if ($this->auth_http_method == 'DIGEST')\n $data = $this->parseDigest($_SERVER['PHP_AUTH_DIGEST']);\n\n if ($this->session_check_method == 'BOTH' || $this->session_check_method == 'NONCE' && !empty($data))\n $this->{$this->nonce_expire_function}($data['nonce']);\n if ($this->session_check_method == 'BOTH' || $this->session_check_method == 'COOKIE') {\n session_start();\n $_SESSION['lastseen'] = time() - ($this->cookie_expire + 3600 );\n }\n if ($this->redirect_on_logout) {\n echo <<<EOF\n <html>\n <meta http-equiv=\"refresh\" content=\"0; url={$this->redirect_on_logout_url}?error=2\" />\n <body><h2>{$this->logout_text}</h2></body>\n </html>\nEOF;\n } else {\n echo \"<html><body><h2>{$this->logout_text}</h2></body></html>\";\n }\n exit();\n }", "public function logout()\n {\n\t\t$user = JWTAuth::GetJWTUser();\n\t\t$this->expireToken($user);\n\t\treturn $this->sendResponse('You are now logged out');\n\t}", "public function logout(): void\n\t{\n\t\t/** @var \\App\\Models\\User $user */\n\t\t$user = Auth::user();\n\t\tLog::channel('login')->info(__METHOD__ . ':' . __LINE__ . ' -- User (' . $user->username . ') has logged out.');\n\t\tAuth::logout();\n\t\tSession::flush();\n\t}", "public function logout()\n {\n DbModel::logUserActivity('logged out of the system');\n\n //set property $user of this class to null\n $this->user = null;\n\n //we call a method remove inside session that unsets the user key inside $_SESSION\n $this->session->remove('user');\n\n //we then redirect the user back to home page using the redirect method inside Response class\n $this->response->redirect('/');\n\n\n }", "public function logout_user() {\n\t\tif(isset($_SESSION['eeck'])) {\n\t\t\tunset($_SESSION['eeck']);\n\t\t}\n\t}", "public function logout(){\r\n unset($_SESSION['user_id']);\r\n unset($this->user_id);\r\n $this->signed_in = false;\r\n }", "public function logout()\n {\n $this->removeRememberMeCookie();\n }", "public function logout(){\n session_unset($_SESSION[\"user\"]);\n }", "public function logOut(){\r\n\t\t// Starting sessions\r\n\t\tsession_start();\r\n\t\t\r\n\t\t// Emptying sessions\r\n\t\t$_SESSION['userID'] = '';\r\n\t\t$_SESSION['logged_in'] = false;\r\n\t\t\r\n\t\t// Destroying sessions\r\n\t\tsession_destroy();\r\n\t\theader(\"Location: ?controller=home\");\r\n\t\texit();\r\n\t}", "public function logout() {\n\t\t$this->facebook->destroy_session();\n\t\t// Remove user data from session\n\t\t$this->session->sess_destroy();\n\t\t// Redirect to login page\n redirect('/user_authentication');\n }", "function logout() {\r\n $this->auth->logout();\r\n }", "private function logout() {\n }", "public function logoff(){\n\t ServiceSession::destroy();\n\t Redirect::to(\"/login\")->do();\n\t }", "public function logout() {\t\n\t\t$this->Session->destroy();\n\t\t$this->delete_cookie('KEYADMUSER');\n\t\t$this->disable_cache();\t\t\n\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert\">&times;</button>You have successfully signed off', 'default', array('class' => 'alert alert-success'));\n\t\t$this->redirect('/admin/login/');\n\n\t}", "public function signOut() {\n\n $this->getAttributeHolder()->removeNamespace('sfGuardSecurityUser');\n $this->user = null;\n $this->clearCredentials();\n $this->setAuthenticated(false);\n $expiration_age = sfConfig::get('app_sf_guard_plugin_remember_key_expiration_age', 15 * 24 * 3600);\n $remember_cookie = sfConfig::get('app_sf_guard_plugin_remember_cookie_name', 'sfRemember');\n sfContext::getInstance()->getUser()->setAttribute('view', '');\n sfContext::getInstance()->getResponse()->setCookie($remember_cookie, '', time() - $expiration_age);\n }", "public function logout() {\n $db = Db::getInstance();\n $user = new User($db);\n $user->logout();\n }", "public static function logoutUser( ) {\r\n self::$database->update(\"UPDATE users set sid=? where sid=?\", \r\n \"\", session_id());\r\n session_destroy();\r\n }", "public function logout()\n {\n $this->Session->delete('User');\n\n $this->redirect($this->Auth->logout());\n }", "public function logout()\n {\n $this->getAuth()->clearIdentity();\n }", "public function logout()\n {\n $this->Auth->logout();\n $this->login();\n }", "public function logout()\r\n\t{\r\n\t\tif(!$this->loggedIn()) return;\r\n\t\t$query = 'UPDATE users SET fingerprint=NULL WHERE id=' . $this->user->id . ' LIMIT 1';\r\n\t\tmysql_query($query);\r\n\t\tsetcookie('qw_login', '', time()-60*60*24, '/');\r\n\t\tsetcookie('tree_grid_cookie', '', time()-60*60*24, '/');\r\n\t\t$this->user = false;\r\n\t}", "public function Logout()\n\t{\n\t\t$this->user->Logout();\n\t\t$this->RedirectToController();\n\t}", "Public Function Logout()\n\t{\n\t\tunset($_SESSION['User']);\n\t}", "public function userLogout() {\n // Starting a session to unset and destroy it\n session_start();\n session_unset();\n session_destroy();\n\n // Sending the user back to the login page\n header(\"Location: login\");\n }", "public function logout()\n\t{\n\t\t$this->session->unset_userdata(array(\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_LOGGED_IN',\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_ID',\n\t\t\t\t\t\t\t\t\t\t\t'VB_FULL_NAME',\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_EMAIL',\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_MOBILE',\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_CURRENT_PATH',\n\t\t\t\t\t\t\t\t\t\t\t'VB_USER_LAST_LOGIN'));\n\t\t\t\t\t\t\n\t\tredirect(base_url());\n\t}", "public function logoff() {}", "public function logoff() {}", "public function logoff() {}", "public function logout()\n {\n $user = $this->user();\n\n // If we have an event dispatcher instance, we can fire off the logout event\n // so any further processing can be done. This allows the developer to be\n // listening for anytime a user signs out of this application manually.\n $this->clearUserDataFromStorage();\n\n if (isset($this->events)) {\n $this->events->dispatch(new LogoutEvent($this->name, $user));\n }\n\n // Once we have fired the logout event we will clear the users out of memory\n // so they are no longer available as the user is no longer considered as\n // being signed into this application and should not be available here.\n $this->user = null;\n\n $this->loggedOut = true;\n }", "public function logout() {\n\t\t$user = $this->Auth->user();\n\t\t$this->Session->destroy();\n\t\t$this->Cookie->destroy();\n\t\t$this->Session->setFlash(sprintf(__('%s you have successfully logged out'), $user[$this->{$this->modelClass}->displayField]));\n\t\t$this->redirect($this->Auth->logout());\n\t}", "public function signOut()\r\n {\r\n $this->getAttributeHolder()->removeNamespace('sfGuardSecurityUser');\r\n $this->user = null;\r\n $this->clearCredentials();\r\n $this->setAuthenticated(false);\r\n $expiration_age = sfConfig::get('app_sf_guard_plugin_remember_key_expiration_age', 15 * 24 * 3600);\r\n $remember_cookie = sfConfig::get('app_sf_guard_plugin_remember_cookie_name', 'sfRemember');\r\n sfContext::getInstance()->getResponse()->setCookie($remember_cookie, '', time() - $expiration_age);\r\n }", "public static function logout(){\n \n //Tornando se sessão User nulla\n $_SESSION[User::SESSION] = null;\n \n }", "public function logout()\n {\n $user = Auth::user();\n $check = $user->token()->revoke();\n\n if ($check) {\n return response()->json([\n 'response' => true,\n 'message' => 'Sucess logout'\n ], 200);\n }\n }", "public function user_logout()\n {\n $this->session->sess_destroy();\n redirect('userController/login_view', 'refresh');\n }", "public function logout(){\n unset($_SESSION['user_id']);\n \n session_destroy();\n redirect('users/login');\n }", "function logout()\n\t{\n\n\t\t// log the user out\n\t\t$this->session->sess_destroy();\n\n\t\t// redirect them to the login page\n\t\tredirect('auth', 'refresh');\n\t}", "public function Logoff();", "public function logout() {\n\t\t$this->setLoginStatus(0);\n\t}", "public function logoff()\n\t{\n\t\t$this->session->sess_destroy();\n\t\tredirect(base_url());\n\t}", "public function logout()\r\n {\r\n if($this->twitter->check_login() != False)\r\n {\r\n // Revoke the session - this means logging out\r\n // Note that it also removes the Oauth access keys from Twitter NOT jsut removing the cookie\r\n $this->twitter->revokeSession(True);\r\n \r\n }\r\n //url::redirect('ktwitter/demo');\r\n url::redirect($this->docroot.'users');\r\n }", "public function logout() {\r\n \r\n // signal any observers that the user has logged out\r\n $this->setState(\"logout\");\r\n }", "public function logout()\n { \n $accessToken = Auth::user()->token();\n \n \\DB::table('oauth_access_tokens')\n ->where('user_id', $accessToken->user_id)\n ->update([\n 'revoked' => true\n ]);\n $accessToken->revoke();\n return response()->json(['data' => 'Usuario ha cerrado sesión en todos los dispositivos'], 200); \n }", "function log_out() {\n\t// session_destroy ();\n\t\n\tupdate_option('access_token', '');\n\tupdate_option('insta_username', '');\n\tupdate_option('insta_user_id', '');\n\tupdate_option('insta_profile_picture', '');\n\n}", "public function logout() {\n\t\t\tunset( $_SESSION['user_id'] );\n\t\t\tunset( $this->user_id );\n\t\t\t$this->logged_in = false;\n\t\t}", "public static function logout(): void\n {\n // Remove from the session (user object)\n unset($_SESSION['user']);\n }", "public function logoff();", "public function logout() {\n $this->_disconnect_user();\n redirect(base_admin_url('identification'), 'refresh');\n }", "private function logout() {\n $_SESSION['user'] = null;\n $_SESSION['valid'] = false;\n }", "public function logout()\n {\n $this->deleteAllPersistentData();\n $this->accessToken = null;\n $this->user = null;\n $this->idToken = null;\n $this->refreshToken = null;\n }", "public function logout() {\n\t\t$this->facebook->destroy_session();\n\t\t// Remove user data from session\n\t\t$this->session->unset_userdata('userData');\n\t\t$this->session->unset_userdata('username');\n\t\t$this->session->unset_userdata('password');\n\t\t// Redirect to login page\n redirect(base_url());\n }", "public function logout() {\n\t\t$this->session->unset_userdata('uid');\n\t\tredirect('/', 'refresh');\n\t}", "public function logout() {\n unset($_SESSION['user_id']);\n unset($_SESSION['user_email']);\n unset($_SESSION['user_name']);\n session_destroy();\n redirect('');\n }", "function user_logging_out($user_id) {\n \n }", "public function userLogout() {\n session_destroy();\n header('Location: index.php');\n }", "public function logout() {\n $auth_cookie = Cookie::get(\"auth_cookie\");\n if ($auth_cookie != '') {\n $this->deleteCookie($auth_cookie);\n }\n }" ]
[ "0.8452815", "0.8450766", "0.8448169", "0.8411725", "0.83866173", "0.83664024", "0.8346802", "0.82519895", "0.81790286", "0.8113731", "0.8050321", "0.7976354", "0.7968111", "0.79555553", "0.7938776", "0.79256284", "0.7922902", "0.78912675", "0.7861488", "0.7798542", "0.77923733", "0.7770137", "0.7765641", "0.77608955", "0.7744858", "0.7743986", "0.77434325", "0.7742391", "0.7706348", "0.7698541", "0.7678968", "0.7665257", "0.7660283", "0.76565975", "0.7648951", "0.7636103", "0.763594", "0.7630934", "0.7629578", "0.762862", "0.76172924", "0.76161104", "0.7610168", "0.760231", "0.75957793", "0.7593365", "0.7588008", "0.7584349", "0.75825137", "0.75712615", "0.75631756", "0.7555991", "0.7552974", "0.75444937", "0.75435936", "0.7543191", "0.75431174", "0.75212854", "0.75179255", "0.7511618", "0.7508362", "0.7506849", "0.75052404", "0.7505095", "0.7500601", "0.7494695", "0.7490775", "0.7490152", "0.74817085", "0.74746484", "0.7458476", "0.74561256", "0.745567", "0.74555045", "0.7447851", "0.7444881", "0.74354655", "0.7433699", "0.7428916", "0.74273217", "0.74228054", "0.74193865", "0.74157536", "0.7414618", "0.74144393", "0.74087447", "0.73975706", "0.7392684", "0.7392557", "0.73896784", "0.7382779", "0.73814213", "0.73810494", "0.73788965", "0.73719263", "0.73678166", "0.7367778", "0.7361559", "0.7359639", "0.73506033", "0.73469704" ]
0.0
-1
Get the token array structure.
protected function respondWithToken($token) { return response()->json([ 'access_token' => $token, 'token_type' => 'bearer', 'expires_in' => auth()->factory()->getTTL() * 60 ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getToken()\n {\n return array($this->_token, $this->_token_secret);\n }", "public function getTokens(): array\n {\n return $this->tokens;\n }", "function &get_xoops_token()\n{\n\tif ( class_exists('XoopsMultiTokenHandler') )\n\t{\n\t\t$token =& XoopsMultiTokenHandler::quickCreate( $this->_TOKEN_NAME );\n\t\t$name = $token->getTokenName();\n\t\t$value = $token->getTokenValue();\n\t}\n\telse\n\t{\n\t\t$name = 'token';\n\t\t$value = 0;\n\t}\n\t$arr = array($name, $value);\n\treturn $arr;\n}", "private function get_token() \n {\n if ($this->last_token === 'TK_TAG_SCRIPT' || $this->last_token === 'TK_TAG_STYLE') { //check if we need to format javascript\n $type = substr($this->last_token, 7);\n $token = $this->get_contents_to($type);\n if (!is_string($token)) {\n return $token;\n }\n return array($token, 'TK_' . $type);\n }\n if ($this->current_mode === 'CONTENT') {\n $token = $this->get_content();\n \n if (!is_string($token)) {\n return $token;\n } else {\n return array($token, 'TK_CONTENT');\n }\n }\n\n if ($this->current_mode === 'TAG') {\n $token = $this->get_tag();\n\n if (!is_string($token)) {\n return $token;\n } else {\n $tag_name_type = 'TK_TAG_' . $this->tag_type;\n return array($token, $tag_name_type);\n }\n }\n }", "public function getTokens();", "public function getToken(): object\n {\n $token = (object) [];\n\n if ($this->accessToken && $this->refreshToken && $this->instanceUrl) {\n $token = (object) [\n 'accessToken' => $this->accessToken,\n 'refreshToken' => $this->refreshToken,\n 'instanceUrl' => $this->instanceUrl,\n 'tokenExpiry' => $this->tokenExpiry\n ];\n }\n\n return $token;\n }", "public function get_tokens()\n\t{\n\t\treturn $this->tokens;\n\t}", "public function getTokens()\n {\n return $this->tokens;\n }", "public function getTokens() {\n\t\treturn array_keys($this->tokens);\n\t}", "private function RequestTokens() {\n return (array)$this->oauth->getRequestToken();\n }", "public static function realTokenToArray($token)\n {\n $class = get_class($token);\n\n $tokenArray = array(\n 'class' => $class,\n\n // 'extraParams' => $token->getExtraParams(),\n );\n\n switch($class)\n {\n case 'League\\OAuth1\\Client\\Credentials\\TokenCredentials':\n $tokenArray['identifier'] = $token->getIdentifier();\n $tokenArray['secret'] = $token->getSecret();\n break;\n\n case 'League\\OAuth2\\Client\\Token\\AccessToken':\n $tokenArray['accessToken'] = $token->getToken();\n $tokenArray['refreshToken'] = $token->getRefreshToken();\n $tokenArray['endOfLife'] = $token->getExpires();\n break;\n }\n\n return $tokenArray;\n }", "public function getToken()\n {\n return current($this->tokens);\n }", "public function token() {\n try {\n $payload = JWTUtils::inst()->byBasicAuth($this->request);\n\n return $this->returnArray($payload);\n } catch (JWTUtilsException $e) {\n return $this->httpError(403, $e->getMessage());\n }\n }", "public function toTokenArray() {\n\t\t$ret = [];\n\n\t\t$ret[] = new Token(\n\t\t\tToken::T_FUNCTION,\n\t\t\t[ 'value' => $this->name, 'position' => [ $this->line, $this->pos ] ]\n\t\t);\n\t\t// Manually looping and appending turns out to be noticably faster than array_merge.\n\t\tforeach ( $this->value->toTokenArray() as $v ) {\n\t\t\t$ret[] = $v;\n\t\t}\n\t\t$ret[] = new Token( Token::T_RIGHT_PAREN );\n\n\t\treturn $ret;\n\t}", "public function getTokens()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('tokens');\n }", "public function getUserTokens();", "public function token()\n {\n return $this->token['token'] ?? null;\n }", "public function token()\n {\n return $this->metadata();\n }", "public function arrayStructure()\n\t{\n\t\treturn array();\n\t}", "public function getTokenObject() {\n\n\t\treturn $this->TokenObject;\n\t}", "protected static function getHeaderToken()\n {\n return [];\n }", "protected static function getHeaderToken()\n {\n return [];\n }", "public function tokensDataProvider(): array\n {\n return [\n 'PHP 7' => [\n [\n 0 => [T_WHITESPACE, ' '],\n 1 => [T_NS_SEPARATOR, '\\\\'],\n 2 => [T_STRING, 'Object'],\n 3 => [T_PAAMAYIM_NEKUDOTAYIM, '::'],\n ]\n ],\n 'PHP 8' => [\n [\n 0 => [T_WHITESPACE, ' '],\n 1 => [T_NAME_FULLY_QUALIFIED, '\\\\Object'],\n 2 => [T_PAAMAYIM_NEKUDOTAYIM, '::'],\n ]\n ]\n ];\n }", "public function providerDeviceToken()\n {\n return array(\n array('foo_bar', true),\n array(str_repeat('aq', 32), true),\n array(str_repeat('af', 32), false),\n array(str_repeat('AF', 32), false)\n );\n }", "function &get_token_pair()\n{\n\treturn $this->get_token();\n}", "public function getTokenInfo() {\n\t\t\t$error = [\"error\" => \"invalid_token\"];\n\t\t\tif( !isset($_GET[\"access_token\"]) ) return $error;\n\t\t\t$token = $this->getAccessToken($_GET[\"access_token\"]);\n\t\t\tif( $token === NULL ) return $error;\n\t\t\t$client = $this->getClient($token[\"client_id\"]);\n\t\t\tif( $client === FALSE ) return $error;\n\t\t\treturn [\n\t\t\t\t\"audience\"\t=> $client[\"client_id\"],\n\t\t\t\t\"userid\"\t=> $client[\"user_id\"],\n\t\t\t\t\"scope\"\t\t=> $token[\"scope\"],\n\t\t\t\t\"expires\"\t=> $token[\"expires\"] - time()\n\t\t\t\t\n\t\t\t];\n\t\t}", "public static function getToken()\n {\n return isset(self::$_data[self::KEY_TOKEN]) ? self::$_data[self::KEY_TOKEN] : NULL;\n }", "public function decode(string $token): array;", "function get_token(){\n global $token;\n global $identifier;\n global $array_stream;\n global $key_val;\n global $keywords;\n\n global $c_commentary;\n\n $token_end = True;\n $token_type = tokenType::start;\n init_token();\n\n while($token_end){\n /**\n * @warning end of Array works only for PHP7.3!!!!\n */\n if($key_val === array_key_last($array_stream)){\n $token->last = False;\n if($token->data !== PHP_EOL){\n $token->type = tokenType::EOL;\n $token_end = False;\n }\n }\n /* State automaton for lexical analysis combined with usage of regular expressions */\n switch ($token_type) {\n case tokenType::start:\n {\n if($array_stream[$key_val] === \".\"){ //header dection\n $token_type = tokenType::header;\n break;\n }\n elseif($array_stream[$key_val] === \"@\"){ //at mark detected\n $token->data = $array_stream[$key_val];\n $token->type = tokenType::marker;\n identify_operand();\n preset_label();\n $key_val++;\n $token_end = False;\n break;\n }\n elseif($array_stream[$key_val] === \"#\"){ //start of commentary\n $token_type = tokenType::commentary;\n break;\n }\n elseif($array_stream[$key_val] === PHP_EOL){ //EOL detected\n $token_type = tokenType::EOL;\n break;\n }\n elseif($array_stream[$key_val] === \"\\t\" || $array_stream[$key_val] === \" \"){ //white spaces before instruction/commentary\n $key_val++;\n preset_identifier();\n }\n elseif(ctype_alpha($array_stream[$key_val]) || ctype_digit($array_stream[$key_val]) || preg_match(\"/^_|\\-|\\$|&|%|\\*|!|\\?$/\", $array_stream[$key_val])){ //var/string/int catch\n $token_type = tokenType::charStream;\n break;\n }\n else {\n fwrite(STDERR, \"ERROR : Input doesn't start with .IPPcode19 header\\n\");\n exit(21);#appropriate exit code\n }\n break;\n }\n case tokenType::header:\n {\n /* Load header in loop, until new line space or commentary right after header */\n while(1){\n if($array_stream[$key_val] === PHP_EOL || preg_match(\"/^[ \\t#]$/\",$array_stream[$key_val]) || $key_val === array_key_last($array_stream)){\n if(preg_match(\"/^.ippcode19$/\", strtolower($token->data))){\n $token->type = tokenType::header;\n $token_end = False;\n break;\n }\n else {\n fwrite(STDERR,\"ERROR : Innapropriate header detected\\n\");\n exit(21);//no ippcode header;\n }\n }\n $token->data .= $array_stream[$key_val];\n $key_val++;\n }\n break;\n }\n /* Creates EOL token */\n case tokenType::EOL:\n {\n $token->data = $array_stream[$key_val];\n $token->type = tokenType::EOL;\n $key_val++;\n preset_identifier();\n preset_label();\n $token_end = False;\n break;\n }\n /* Catches commentary, all character are trimmed until EOL*/\n case tokenType::commentary:\n {\n while($array_stream[$key_val] !== PHP_EOL)\n {\n if($key_val === array_key_last($array_stream)) break;\n $key_val++;\n }\n $c_commentary++;\n $token_type = tokenType::EOL;\n break;\n }\n /* string/int or var stream stored into token */\n case tokenType::charStream:\n {\n while(1){\n if(preg_match(\"/^[ \\t@]$/\",$array_stream[$key_val])){\n $token_type = tokenType::identifyStream;\n break;\n }\n elseif($array_stream[$key_val] === PHP_EOL || $array_stream[$key_val] === \"#\"){ //read until newline or commentary start\n $token_type = tokenType::identifyStream;\n break;\n }\n elseif($key_val === array_key_last($array_stream)){ //read until EOF and add last character to token\n $token->data .= $array_stream[$key_val];\n $token_type = tokenType::identifyStream;\n break;\n }\n $token->data .= $array_stream[$key_val];\n $key_val++;\n }\n break;\n }\n case tokenType::identifyStream:\n {\n if(preg_match(\"/^[a-zA-Z_\\-\\$&%\\*!?][a-zA-Z_\\-\\$&%\\*!?0-9]*$/\", $token->data)){ //matching the identifier\n $token->type = tokenType::identifier;\n foreach ($keywords as $key => $value) { //searching for keyword\n $match_pattern = \"/\\b\" . \"$value\" . \"\\b/i\";\n if(preg_match($match_pattern, strtolower($token->data))){\n $token->type = $key + 110;\n if(preg_match(\"/^(bool)|(int)|(string)|(nil)|(gf)|(lf)|(tf)$/\", $token->data)){\n identify_operand();\n }\n break;\n }\n }\n isset_identif();\n $token_end = False;\n break;\n }\n if(preg_match(\"/^[+|-]?[0-9]*$/\", $token->data)){ //matching numbers //^[+|-]?[1-9][0-9]*|[+|-][0]|[0]$\n $token->type = tokenType::number;\n $token_end = False;\n break;\n }\n /* Match for string literal - all unicode numbers and escape sequences */\n elseif(preg_match(\"/^([\\x{0024}-\\x{005B}]|[\\x{0021}\\x{0022}]|[\\x{005D}-\\x{FFFF}]|[ěščřžýáíéóúůďťňĎŇŤŠČŘŽÝÁÍÉÚŮa-zA-Z0-9]|([\\\\\\\\][0-9]{3})?)*$/\", $token->data)){ //^([ěščřžýáíéóúůďťňĎŇŤŠČŘŽÝÁÍÉÚŮa-zA-Z0-9]|([\\\\\\\\][0-9]{3})?)*$\n $token->type = tokenType::stringStream;\n $token_end = False;\n }\n else {\n fwrite(STDERR,\"ERROR : LEX : detected lexical error in: $token->data\\n\");\n exit(23);\n }\n break;\n }\n\n default:\n break;\n }\n }\n }", "public function data()\n {\n return [\n 'token' => $this->token\n ];\n }", "public function getToken() {\n\t\treturn $this->_token;\n\t}", "public static function getTokenData() {\n\n\t\t$tokenData = [];\n\n\t\t$tokenData[SSOData::CLAIM_AUDIENCE] = 'testPlugin';\n\t\t$tokenData[SSOData::CLAIM_EXPIRE_AT] = strtotime('10 minutes');\n\t\t$tokenData[SSOData::CLAIM_NOT_BEFORE] = strtotime('-1 minute');\n\t\t$tokenData[SSOData::CLAIM_ISSUED_AT] = time();\n\t\t$tokenData[SSOData::CLAIM_ISSUER] = 'api.staffbase.com';\n\t\t$tokenData[SSOData::CLAIM_INSTANCE_ID] = '55c79b6ee4b06c6fb19bd1e2';\n\t\t$tokenData[SSOData::CLAIM_INSTANCE_NAME] = 'Our locations';\n\t\t$tokenData[SSOData::CLAIM_USER_ID] = '541954c3e4b08bbdce1a340a';\n\t\t$tokenData[SSOData::CLAIM_USER_EXTERNAL_ID] = 'jdoe';\n\t\t$tokenData[SSOData::CLAIM_USER_FULL_NAME] = 'John Doe';\n\t\t$tokenData[SSOData::CLAIM_USER_FIRST_NAME] = 'John';\n\t\t$tokenData[SSOData::CLAIM_USER_LAST_NAME] = 'Doe';\n\t\t$tokenData[SSOData::CLAIM_USER_ROLE] = 'editor';\n\t\t$tokenData[SSOData::CLAIM_ENTITY_TYPE] = 'user';\n\t\t$tokenData[SSOData::CLAIM_THEME_TEXT_COLOR] = '#00ABAB';\n\t\t$tokenData[SSOData::CLAIM_THEME_BACKGROUND_COLOR] = '#FFAABB';\n\t\t$tokenData[SSOData::CLAIM_USER_LOCALE] = 'en_US';\n\t\t$tokenData[SSOData::CLAIM_USER_TAGS] = ['profile:field1:val', 'profile:field2:val'];\n\n\t\treturn $tokenData;\n\t}", "protected function getContextAsTokenData() {\n $data = array();\n foreach ($this->getContexts() as $context) {\n // @todo Simplify this when token and typed data types are unified in\n // https://drupal.org/node/2163027.\n if (strpos($context->getContextDefinition()->getDataType(), 'entity:') === 0) {\n $token_type = substr($context->getContextDefinition()->getDataType(), 7);\n if ($token_type == 'taxonomy_term') {\n $token_type = 'term';\n }\n $data[$token_type] = $context->getContextValue();\n }\n }\n return $data;\n }", "public function getTokenParsers()\n {\n return array();\n }", "public function getTokenParsers()\n {\n return array();\n }", "public function getToken()\r\n {\r\n return $this->token;\r\n }", "public function getToken()\r\n {\r\n return $this->token;\r\n }", "public function get_token() {\n\t\treturn $this->token;\n\t}", "public function GetArray(): array\n {\n return array('mac' => $this->GetMac(), 'name' => $this->GetName());\n }", "public function getToken() {\n\t\treturn $this->token;\n\t}", "public function getArray() : array {\n\t\treturn $this->input;\n\t}", "public function getToken()\n\t{\n\t\treturn $this->token;\n\t}", "public function getToken ()\n {\n return $this->token;\n }", "public function getToken() {\n\n\t\treturn $this->Token;\n\t}", "public function readToken() {}", "public function getToken() {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken() {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function createTokens()\n {\n\n }", "public function getArray(): array\n {\n return $this->array;\n }", "public function getArray(): array\n {\n return $this->array;\n }", "function exportTokens() {\n\t\treturn $this->tokens;\n\t}", "public function getTokenInfoArray($token)\n {\n // Break the token up at the '_'s\n $tokenParts = explode('_', $token);\n // Pop the ApiConsumer ID off the end of the array\n $id = array_pop($tokenParts);\n // Instantiate the empty starter token string\n $starterToken = '';\n // Put the token back together again without the ApiConsumer ID\n foreach ($tokenParts as $tokenPart) {\n $starterToken .= $tokenPart . '_';\n }\n\n // Return the ApiConsumer ID and the Starter Token in an array\n return ['id' => $id, 'starter_token' => rtrim($starterToken, '_')];\n }", "public function getAuthInfoArray() {}", "public function tokenPayload(string $token)\n {\n return (array) JWT::decode($token, $this->JWTSecret, ['HS256']);\n }", "public function getJwtPayload(): array;", "public function getArray()\n {\n return $this->array;\n }", "public function getAsArray();", "protected function fetchNewToken(): array\n {\n $guzzle = new Client;\n $config = $this->config;\n\n $response = $guzzle->post($config['host'] . '/oauth/token', [\n 'form_params' => [\n 'grant_type' => 'client_credentials',\n 'client_id' => $config['client_id'],\n 'client_secret' => $config['client_secret']\n ]\n ]);\n\n return \\json_decode((string)$response->getBody(), true);\n }", "public function getToken() {\n return \\Firebase\\JWT\\JWT::encode($this->elements, self::$secret);\n }", "public static function get_tokens()\n\t{\n\t\treturn static::$client->get_tokens();\n\t}", "function __invoke()\n {\n $token = new AccessToken($this->tokenSettings);\n return ['token' => $token];\n }", "public function get_access_tokens() {\n\t\t$tokens = get_user_meta($this->user->ID, self::META_TYK_ACCESS_TOKENS_KEY, true);\n\t\tif (!is_array($tokens)) {\n\t\t\treturn array();\n\t\t}\n\n\t\t// lambda to add an 'is_valid' attribute to each token\n\t\t$map_is_valid = function ($token) {\n\t\t\treturn array_merge($token, array(\n\t\t\t\t'is_valid' => $this->has_token($token['hash']),\n\t\t\t\t));\n\t\t};\n\n\t\treturn array_map($map_is_valid, $tokens);\n\t}", "public function getToken()\n {\n return self::TOKEN;\n }", "public function getArray()\n {\n return $this->get(self::_ARRAY);\n }", "protected function getStructure(): array\n {\n if (isset($this->structure)) {\n return $this->structure;\n }\n\n return [\n 'foo' => 'foo',\n 'money' => 'money substr:1|float:2',\n 'key' => 'nested.key int',\n 'new_key' => 'no_key default:bar',\n 'package.name' => 'name initials',\n 'baz' => 'Illuminate\\Support\\Str::after:hello',\n 'QUX' => 'qux Illuminate\\Support\\Str::upper',\n 'mid_char' => 'chars sampleCustom',\n ];\n }", "public function getTokenizer() {}", "public function getTokenizer() {}", "public function gameTokens();", "public function data()\n {\n return (empty(\\Session::flash())) ? array('token' => \\Token::getToken()) : array_merge(\\Session::flash(), array('token' => \\Token::getToken()));\n }", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "function to_array() \n {\n $d = array();\n $d[\"vocab\"] = $this->vocab;\n $d[\"meta_name\"] = $this->meta_name;\n $d[\"text\"] = $this->text;\n $d[\"lang\"] = $this->lang;\n foreach($this->attrs as $key => $value) {\n $d[$key] = $value;\n }\n return $d;\n }", "public function getToken()\n {\n $accessToken = null;\n if (file_exists($_SERVER['DOCUMENT_ROOT'].$this->tokenFile)) {\n $accessToken = unserialize(file_get_contents($_SERVER['DOCUMENT_ROOT'].$this->tokenFile));\n }\n\n return json_decode($accessToken);\n }", "public function getToken()\n {\n return $this->controller->getToken();\n }", "private function parse($input) {\n $tokens= [];\n foreach (new Tokens(new StringTokenizer($input)) as $type => $value) {\n $tokens[]= [$type, $value];\n }\n return $tokens;\n }", "function getTokenFull() {\n\t\t\treturn $this->tokenFull;\n\t\t}", "function getArray(){\n\t\t\t\t\t$fieldArray = array('username'=> $this->_username, 'password'=>$this->_password);\n\t\t\t\t\treturn $fieldArray;\n\t\t\t\t}", "public function token($type , $value, $line)\n {\n return array($type , $value, $line);\n }", "public function getComponentToken()\n {\n $url = $this->weconnectDomain . '/sa/componentToken';\n $resultJson = Yii::$app->curl->get($url);\n LogUtil::info(['url' => $url, 'response' => $resultJson], 'channel');\n $result = json_decode($resultJson, true);\n\n if ($result && isset($result['code']) && 200 == $result['code'] && isset($result['data']) && $result['data']['componentToken']['expireDateTime'] > time()) {\n return [\n 'componentAppId' => $result['data']['componentAppId'],\n 'componentToken' => $result['data']['componentToken']['token']\n ];\n } else {\n throw new ApiDataException('GET ' . $url, $resultJson);\n }\n }", "public function getArray() {\n \treturn array(\n \t\t\t'id' => $this->id,\n \t\t\t'name' => $this->name,\n \t\t\t'path' => $this->path,\n \t\t\t'description' => $this->description,\n \t\t\t'version' => $this->version,\n \t\t\t'groups' => $this->groups,\n \t\t\t'enabled' => $this->enabled\n \t);\n }", "public function asArray()\n\t{\n\t\t$fields = [\n\t\t\t'@type' => $this->type(),\n\t\t\t'@key' => $this->key()\n\t\t];\n\n\t\tforeach ($this->fields as $name => $field)\n\t\t{\n\t\t\t$fields[$name] = $field->value;\n\t\t}\n\n\t\treturn $fields;\n\t}", "function getAllTokens($sql){\n $txt = \"\";\n $rez = vrati_podatke($sql);\n $tokens=array();\n if ($rez->num_rows > 0) {\n while ($row = $rez->fetch_assoc()) {\n array_push($tokens, $row[\"token\"]);\n }\n } \n return $tokens;\n}", "public function to_array() /*array*/\n {\n return $_SESSION[self::KEY];\n }" ]
[ "0.71393645", "0.71245617", "0.71064186", "0.7023479", "0.69822", "0.65953726", "0.6563174", "0.654563", "0.64619535", "0.64316744", "0.63753426", "0.6335638", "0.6307287", "0.6257231", "0.6188339", "0.6175191", "0.6066591", "0.60613745", "0.604052", "0.6028691", "0.60033476", "0.60033476", "0.59666926", "0.5965913", "0.5940376", "0.59267956", "0.59142405", "0.590957", "0.5906342", "0.588581", "0.5868592", "0.58580196", "0.58567274", "0.5851598", "0.5851598", "0.5837172", "0.5837172", "0.58211714", "0.5815675", "0.581526", "0.58111364", "0.58030295", "0.57976973", "0.5797022", "0.5792387", "0.5790338", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.57892853", "0.5782915", "0.576918", "0.57677084", "0.5755441", "0.5755441", "0.5752143", "0.57451475", "0.5741118", "0.572673", "0.5687677", "0.56840765", "0.56836027", "0.5676895", "0.56653225", "0.56571347", "0.564951", "0.56457055", "0.5645524", "0.5645052", "0.5634442", "0.56255674", "0.56255674", "0.5613941", "0.55919665", "0.55886644", "0.55886644", "0.55886644", "0.55886644", "0.5586096", "0.5584874", "0.55840135", "0.55835223", "0.55659753", "0.55620223", "0.55535984", "0.55469567", "0.5508913", "0.55023634", "0.54994607", "0.54665536" ]
0.0
-1
This command fetches the new versions of the packages.json from the known repositories This command fetches the new versions of the packages.json from the known repositories
public function updateCommand() { $this->browser->setRequestEngine($this->browserRequestEngine); $flowPackages = array(); foreach ($this->repositories as $baseUrl => $repository) { $domain = parse_url($repository, PHP_URL_HOST); #$baseUrl = dirname($repository) . '/'; $basePath = FLOW_PATH_DATA . 'Packages/' . $domain; if (!is_dir(FLOW_PATH_DATA . 'Packages/')) { mkdir(FLOW_PATH_DATA . 'Packages/'); } if (!is_dir(FLOW_PATH_DATA . 'Packages/' . $domain)) { mkdir(FLOW_PATH_DATA . 'Packages/' . $domain); } $response = $this->browser->request($repository); $packagesFile = $basePath . '/packages.json'; file_put_contents($packagesFile, $response->getContent()); $packageList = json_decode($response->getContent()); if (isset($packageList->includes)) { $includes = get_object_vars($packageList->includes); if (!empty($includes)) { foreach ($includes as $file => $meta) { $packagesFile = $basePath . '/' . $file; if (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) { continue; } if (!is_dir(dirname(($packagesFile)))) { \TYPO3\Flow\Utility\Files::createDirectoryRecursively(dirname($packagesFile)); } try { $response = $this->browser->request($baseUrl . $file); file_put_contents($packagesFile, $response->getContent()); } catch(\Exception $e) { } } } } if (isset($packageList->providers)) { $providers = get_object_vars($packageList->providers); if (!empty($providers)) { foreach ($providers as $file => $meta) { $packagesFile = $basePath . '/' . $file; if (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) { continue; } if (!is_dir(dirname(($packagesFile)))) { \TYPO3\Flow\Utility\Files::createDirectoryRecursively(dirname($packagesFile)); } try { $response = $this->browser->request($baseUrl . $file); file_put_contents($packagesFile, $response->getContent()); } catch(\Exception $e) { } } } } $files = \TYPO3\Flow\Utility\Files::readDirectoryRecursively($basePath, '.json'); foreach ($files as $file) { $packagesObject = json_decode(file_get_contents($file)); $flowPackages = array_merge($flowPackages, $this->filterFlowPackages($packagesObject->packages)); } } $flowPackagesFile = FLOW_PATH_DATA . 'Packages/packages-typo3-flow.json'; file_put_contents($flowPackagesFile, json_encode($flowPackages)); $this->checkForNewPackages($flowPackages); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find_updatable_packages() {\n\tif ($this->updatable === null) {\n\t\t/**\n\t\t * @todo don't call installed_packages here\n\t\t * instead, make calls to installed_version find out if there are installed\n\t\t * and let them cache the composer.lock themselves\n\t\t */\n\t\t$installed_packages = $this->find_installed_packages();\n\t\t$required_packages = $this->find_required_packages();\n\t\t\n\t\tif (debby\\VERBOSE) {\n\t\t\tdebby\\debby::log('Checking '.$this->get_name().' for updatable packages');\n\t\t}\n\t\t\n\t\tif (debby\\VERBOSE) {\n\t\t\t$debug_index = 0;\n\t\t\t$debug_count = count($required_packages);\n\t\t\t$debug_padding = strlen($debug_count);\n\t\t}\n\t\t\n\t\t$this->updatable = [];\n\t\tforeach ($required_packages as $package) {\n\t\t\tif (debby\\VERBOSE) {\n\t\t\t\t$debug_index++;\n\t\t\t\t$debug_prefix = \"\\t\".str_pad($debug_index, $debug_padding, $string=' ', $type=STR_PAD_LEFT).'/'.$debug_count.': ';\n\t\t\t\tdebby\\debby::log($debug_prefix.$package->get_name());\n\t\t\t}\n\t\t\t\n\t\t\t$version_regex = '/versions\\s*:.+v?([0-9]+\\.[0-9]+(\\.[0-9]+)?)(,|$)/U';\n\t\t\tif ($package->is_installed_by_reference()) {\n\t\t\t\t$version_regex = '/source\\s*:.+ ([a-f0-9]{40})$/m';\n\t\t\t}\n\t\t\t\n\t\t\t// find out the latest release\n\t\t\t$package_info = shell_exec('cd '.$this->path.' && '.$this->executable.' show -a '.escapeshellarg($package->get_name()));\n\t\t\tpreg_match($version_regex, $package_info, $latest_version);\n\t\t\tif (empty($latest_version)) {\n\t\t\t\t$e = new exception('can not find out latest release for '.$package->get_name());\n\t\t\t\t$e->stop();\n\t\t\t}\n\t\t\t\n\t\t\tif ($package->is_later_version($latest_version[1])) {\n\t\t\t\t$package->mark_updatable($latest_version[1]);\n\t\t\t\t$this->updatable[$package->get_name()] = $package;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn array_values($this->updatable);\n}", "protected static function updatePackages()\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages['devDependencies'] = static::updatePackageArray(\n $packages['devDependencies']\n );\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_PRETTY_PRINT)\n );\n }", "public function cloneJson()\n {\n $jsonData = array();\n try {\n $this->packages = $this->repo->getPackages();\n\n foreach ($this->packages as $package) {\n $this->packageName = $package->getPrettyName();\n\n if (!isset($this->packageName)) {\n throw new InvalidArgumentException(\"The package name was not found in the composer.json at '\"\n .$this->url.\"' in '\". $package->getPrettyVersion().\"' \");\n }\n\n if (!preg_match('{^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*$}i', $this->packageName)) {\n throw new InvalidArgumentException(\n \"The package name '{$this->packageName}' is invalid, it should have a vendor name,\n\t\t\t\t\t\ta forward slash, and a package name. The vendor and package name can be words separated by -, . or _.\n\t\t\t\t\t\tThe complete name should match '[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*' at \"\n .$this->url.\"' in '\". $package->getPrettyVersion().\"' \");\n }\n\n if (preg_match('{[A-Z]}', $this->packageName)) {\n $suggestName = preg_replace('{(?:([a-z])([A-Z])|([A-Z])([A-Z][a-z]))}', '\\\\1\\\\3-\\\\2\\\\4', $this->packageName);\n $suggestName = strtolower($suggestName);\n\n throw new InvalidArgumentException(\n \"The package name '{$this->packageName}' is invalid,\n\t\t\t\t\t\tit should not contain uppercase characters. We suggest using '{$suggestName}' instead. at '\"\n .$this->url.\"' in '\". $package->getPrettyVersion().\"' \");\n }\n }\n\n $this->latestReleasePackage = $this->repo->findPackage($this->packageName, '9999999-dev');\n } catch (Exception $e) {\n $jsonData['ErrorMsg'] = $e->getMessage();\n return $jsonData;\n }\n\n $jsonData['AllRelease'] = $this->packages;\n $jsonData['LatestRelease'] = $this->latestReleasePackage;\n return $jsonData;\n }", "public function getVersions();", "public function getVersions();", "public function getVersions();", "public function getVersions()\n {\n return json_decode(\n file_get_contents(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'version.json'),\n true\n );\n }", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "protected function packages()\n {\n $target = path('base').'repositories.json';\n\n if (! is_file($target)) {\n throw new \\Exception('Missing repository. Please contact rakit team.'.PHP_EOL);\n }\n\n $target = file_get_contents($target);\n\n // Lihat: https://www.php.net/manual/en/function.json-last-error.php#118165\n $packages = @json_decode($target);\n\n if (strlen(trim($target)) < 1 || JSON_ERROR_NONE !== json_last_error()) {\n throw new \\Exception('Broken repository. Please contact rakit team.');\n }\n\n // Paksa seluruh objek stdClass di data json menjadi array.\n $packages = json_decode(json_encode($packages), true);\n\n return $packages;\n }", "public function scanForUpdates() {\n\n $objManager = new class_module_packagemanager_manager();\n $arrVersions = $objManager->getArrLatestVersion();\n\n foreach($arrVersions as $strOneModule => $strOneVersion) {\n $objMetadata = $objManager->getPackage($strOneModule);\n if($objMetadata != null) {\n $objManager->updateAvailable($objManager->getPackageManagerForPath($objMetadata->getStrPath()), $strOneVersion);\n }\n }\n\n return $arrVersions;\n }", "function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}", "protected static function updatePackages($dev = true)\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n \n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n \n $dependencies = static::updatePackageArray(\n $packages\n );\n\n $packages['dependencies'] = $dependencies['dependencies'];\n $packages['devDependencies'] = $dependencies['devDependencies'];\n\n ksort($packages['dependencies']);\n ksort($packages['devDependencies']);\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "public function getUpdates()\n {\n $releaseData = @file_get_contents(config('services.website.api') . '/releases/latest');\n $version = @json_decode($releaseData, true)['version'];\n\n if (!$version) {\n return Redirect::route('about')->with([\n 'message' => trans('info.updates.error'),\n 'message_type' => 'danger',\n ]);\n }\n\n $version = substr($version, 1); // Strip \"v\" from the front\n\n if (version_compare($version, (new Codice)->getVersion(), 'gt')) {\n return Redirect::route('about')->with([\n 'message' => trans('info.updates.available', [\n 'url' => config('services.website.url'),\n 'version' => $version,\n ]),\n 'message_type' => 'warning',\n 'message_raw' => true,\n ]);\n } else {\n return Redirect::route('about')->with([\n 'message' => trans('info.updates.none'),\n 'message_type' => 'info',\n ]);\n }\n }", "public function do_download_update($protocol, $repo_to_update, $new_version)\n {\n try\n {\n global $wpdb;\n $repo = $protocol . '://' . esc_sql($repo_to_update) . '/@';\n $sql = \"SELECT a.post_title,b.post_id,b.meta_value FROM $wpdb->posts a inner join $wpdb->postmeta b on a.ID=b.post_id WHERE b.meta_key = '_scb_edd_repo_url' AND b.meta_value like '%$repo%' \";\n $posts = $wpdb->get_results($sql, ARRAY_A);\n\n p_l($posts);\n if (!is_array($posts) || !count($posts))\n {\n throw new Exception('nothing to process ' . $sql);\n }\n $failed = array();\n $passed = array();\n foreach ($posts as $download)\n {\n try\n {\n if (!isset($download['meta_value']))\n {\n throw new Exception('Download to update not found was looking for ' . $repo);\n }\n $repo_to_update_url = @unserialize($download['meta_value']);\n if (!is_array($repo_to_update_url))\n {\n throw new Exception('Download to update was found but data is not valid.Received ' . $download['meta_value']);\n }\n\n $files = get_post_meta($download['post_id'], 'edd_download_files', true);\n $found = false;\n foreach ($files as $index => $file)\n {\n if (isset($repo_to_update_url[$file['attachment_id']]))\n {\n $found = $index;\n break;\n }\n }\n if ($found === false || empty($repo_to_update_url[$file['attachment_id']]['url']))\n {\n throw new Exception('Unable to find correct download to update <pre>' . print_r($files, true) . \"----\" . print_r($repo_to_update_url, true) . \"</pre>\");\n }\n $file = array_merge($files[$index], scb_edd_merge_repo_input($repo_to_update_url[$file['attachment_id']]['url']));\n\n $file['new_tag'] = scb_edd_clean_tag_input($new_version);\n p_l($file);\n if (version_compare($file['new_tag'], $file['tag_num'], 'lt'))\n {\n p_l(\"lower version pushed skip\");\n throw new Exception('lower version pushed skipping ' . $file['new_tag'] . \"<\" . $file['tag_num']);\n\n return;\n }\n elseif (version_compare($file['new_tag'], $file['tag_num'], 'gt'))\n {\n $file = array_merge($file, scb_edd_merge_repo_input($protocol . '://' . $repo_to_update . '/@' . $file['new_tag']));\n //$file['repo_url'] = 'git://' . $repo_to_update . '/@' . $file['new_tag'];\n //$file['tag'] = $file['new_tag'];\n }\n elseif (version_compare($file['new_tag'], $file['tag_num'], 'eq'))\n {\n $file = array_merge($file, scb_edd_merge_repo_input($protocol . '://' . $repo_to_update . '/@' . $file['new_tag']));\n\n }\n else\n {\n throw new Exception('Unable to get new version');\n }\n p_l($file);\n $file = apply_filters('scb_repo_' . $protocol . '_save_edd_download_files', array($file), $download['post_id']);\n\n $files[$index] = scb_edd_clear_temp_indexes($file[0]);\n p_l($files);\n update_post_meta($download['post_id'], 'edd_download_files', $files);\n $passed[] = sprintf('Download %1$s updated succesfuly from %2$s respositry %3$s tag %4$s ',\n isset($download['post_title']) ? '\"' . $download['post_title'] . '\"' : '',\n $protocol,\n $repo_to_update,\n $new_version);\n\n }\n catch (Exception $e)\n {\n $failed[] = \"Failed to Update download :\" . (isset($download['post_title']) ? '\"' . $download['post_title'] . '\" ' : '') . $e->getMessage();\n }\n }\n\n if (count($passed) && count($failed))\n {\n $msg = \"Successfull:\\n\" . implode(\"\\n\", $passed) . \"\\n\\n\";\n $msg .= \"Failed:\\n\" . implode(\"\\n\", $failed);\n p_l($msg);\n scb_edd_send_email('Download Deploy Result', nl2br($msg));\n return array(1, 'done but few failed');\n }\n elseif (count($failed))\n {\n $msg = implode(\"\\n\", $failed);\n p_l($msg);\n scb_edd_send_email('Download Failed to deploy from repo', nl2br($msg));\n return array(0, 'failed');\n }\n elseif (count($passed))\n {\n $msg = implode(\"\\n\", $passed);\n p_l($msg);\n scb_edd_send_email('Download Deployed from repo succesfuly', nl2br($msg));\n return array(1, 'All done');\n }\n\n }\n catch (Exception $e)\n {\n $msg = \"Failed to Update download :\" . (isset($download['post_title']) ? '\"' . $download['post_title'] . '\" ' : '') . $e->getMessage();\n p_l($msg);\n scb_edd_send_email('Download Failed to deploy from repo', nl2br($msg));\n\n return array(0, $msg);\n }\n\n }", "private function getArrLatestVersion() {\n $arrPackages = $this->getAvailablePackages();\n\n $arrQueries = array();\n foreach($arrPackages as $objOneMetadata) {\n $arrQueries[$objOneMetadata->getStrTitle()] = $objOneMetadata;\n }\n\n $arrResult = array();\n $arrProvider = $this->getContentproviders();\n\n foreach($arrProvider as $objOneProvider) {\n $arrRemoteVersions = $objOneProvider->searchPackage(implode(\",\", array_keys($arrQueries)));\n if(!is_array($arrRemoteVersions))\n continue;\n\n foreach($arrRemoteVersions as $arrOneRemotePackage) {\n $arrResult[$arrOneRemotePackage[\"title\"]] = $arrOneRemotePackage[\"version\"];\n unset($arrQueries[$arrOneRemotePackage[\"title\"]]);\n }\n\n }\n\n return $arrResult;\n }", "public function getPackages(): array\n {\n $http = $this->getHttp();\n\n // Fetch data from\n try {\n $apiResponse = $http->get('https://get.typo3.org/json');\n } catch (ClientException $e) {\n throw new \\RuntimeException(\"Could not fetch releases for TYPO3\");\n }\n\n $branchList = json_decode((string) $apiResponse->getBody(), true);\n $packages = [];\n\n foreach ($branchList as $branch) {\n if (!is_array($branch)) {\n continue;\n }\n\n foreach ($branch[\"releases\"] as $version => $versionData) {\n if (in_array($version, self::IGNORES)) {\n continue;\n }\n\n $packages[$version] = [\n \"url\" => \"https://get.typo3.org\" . $versionData[\"url\"][\"tar\"],\n \"filename\" => $version . \".tgz\"\n ];\n }\n }\n\n return $packages;\n }", "public function getAllVersions(): Collection\n {\n $guzzleClient = new Client(['base_uri' => config('bitbucket.api_base_url')]);\n $response = $guzzleClient\n ->get(\"2.0/repositories/\" . config('bitbucket.vendor') . \"/\" . config('bitbucket.repo') . \"/refs/tags\", [\n 'auth' => [config('bitbucket.username'), config('bitbucket.password')]\n ])->getBody();\n\n return collect(\\GuzzleHttp\\json_decode($response)->values);\n }", "protected function packages(): void\n {\n $rootPackages = json_decode(file_get_contents(__DIR__.'/../../../package.json'), true);\n\n if (file_exists($this->laravel->basePath('package.json'))) {\n $packages = json_decode(file_get_contents($this->laravel->basePath('package.json')), true);\n\n $packages['dependencies'] = array_replace(\n $packages['dependencies'] ?? [], $rootPackages['dependencies']\n );\n\n ksort($packages['dependencies']);\n }\n\n file_put_contents(\n $this->laravel->basePath('package.json'),\n json_encode($packages ?? $rootPackages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n\n $this->info('The \"packages.json\" file has been updated.');\n }", "protected static function updateComposer()\n {\n $packages = json_decode(file_get_contents(base_path('composer.json')), true);\n $packages['require'] = static::updateComposerArray($packages['require']);\n ksort($packages['require']);\n\n file_put_contents(\n base_path('composer.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "protected static function updatePackagesScripts(): void\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages['scripts'] = static::updatePackagesScriptsArray(\n array_key_exists('scripts', $packages) ? $packages['scripts'] : []\n );\n\n ksort($packages['scripts']);\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "function update_repos() {\n\n\t$rc = -1;\n\t$out = NULL;\n\t$product_name = g_get('product_name');\n\n\t$res = exec(\"/usr/local/sbin/{$product_name}-repoc\", $out, $rc);\n\tif ($res === false || $out === NULL) {\n\t\treturn (array( \"error\" => 1,\n\t\t \"messages\" => array(\"We could not connect to Netgate servers. Please try again later.\")));\n\t}\n\t$rtrn = array( \"error\" => $rc, \"messages\" => array() );\n\tif (isset($out) && is_array($out) &&\n\t count($out) > 1 && $out[0] === \"Messages:\") {\n\t\tfor ($i = 1; $i < count($out); $i++) {\n\t\t\t$rtrn['messages'][] = $out[$i];\n\t\t}\n\t}\n\n\treturn ($rtrn);\n}", "public static function info ()\r\n {\r\n try {\r\n $latest = json_decode(@file_get_contents(\"https://cdn.rawgit.com/tetreum/mongolo/master/version.json\"));\r\n if ($latest == null) {\r\n throw new \\Exception(\"failed to fetch\");\r\n }\r\n } catch (\\Exception $e) {\r\n $latest = new \\stdClass();\r\n $latest->version = \"failed to fetch\";\r\n }\r\n\r\n return [\r\n \"current\" => self::CURRENT_VERSION,\r\n \"latest\" => $latest\r\n ];\r\n }", "function pm_update_packages($update_info, $tmpfile) {\n $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');\n\n $print = '';\n $status = array();\n foreach($update_info as $project) {\n $print .= $project['title'] . \" [\" . $project['name'] . '-' . $project['candidate_version'] . \"], \";\n $status[$project['status']] = $project['status'];\n }\n // We print the list of the projects that need to be updated.\n if (isset($status[UPDATE_NOT_SECURE])) {\n if (isset($status[UPDATE_NOT_CURRENT])) {\n $title = (dt('Security and code updates will be made to the following projects:'));\n }\n else {\n $title = (dt('Security updates will be made to the following projects:'));\n }\n }\n else {\n $title = (dt('Code updates will be made to the following projects:'));\n }\n $print = \"$title \" . (substr($print, 0, strlen($print)-2));\n drush_print($print);\n file_put_contents($tmpfile, \"\\n\\n$print\\n\\n\", FILE_APPEND);\n\n // Print the release notes for projects to be updated.\n if (drush_get_option('notes', FALSE)) {\n drush_print('Obtaining release notes for above projects...');\n $requests = pm_parse_project_version(array_keys($update_info));\n release_info_print_releasenotes($requests, TRUE, $tmpfile);\n }\n\n // We print some warnings before the user confirms the update.\n drush_print();\n if (drush_get_option('no-backup', FALSE)) {\n drush_print(dt(\"Note: You have selected to not store backups.\"));\n }\n else {\n drush_print(dt(\"Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.\"));\n drush_print(dt('Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.'));\n }\n if(!drush_confirm(dt('Do you really want to continue with the update process?'))) {\n return drush_user_abort();\n }\n\n // Now we start the actual updating.\n foreach($update_info as $project) {\n if (empty($project['path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_NO_PROJECT_PATH', dt('The !project project path is not available, perhaps the !type is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'])));\n }\n drush_log(dt('Starting to update !project code at !dir...', array('!project' => $project['title'], '!dir' => $project['path'])));\n // Define and check the full path to project directory and base (parent) directory.\n $project['full_project_path'] = $drupal_root . '/' . $project['path'];\n if (stripos($project['path'], $project['project_type']) === FALSE || !is_dir($project['full_project_path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_PATH_NOT_FOUND', dt('The !project directory could not be found within the !types directory at !full_project_path, perhaps the project is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'], '!full_project_path' => $project['full_project_path'])));\n }\n if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {\n return FALSE;\n }\n $project['base_project_path'] = dirname($project['full_project_path']);\n // Check we have a version control system, and it clears its pre-flight.\n if (!$version_control->pre_update($project)) {\n return FALSE;\n }\n\n // Package handlers want the name of the directory in project_dir.\n // It may be different to the project name for pm-download.\n // Perhaps we want here filename($project['full_project_path']).\n $project['project_dir'] = $project['name'];\n\n // Run update on one project.\n if (pm_update_project($project, $version_control) === FALSE) {\n return FALSE;\n }\n pm_update_complete($project, $version_control);\n }\n\n return TRUE;\n}", "public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }", "public function getVersionListByPackagist($user_repo) {\n extract($this->userRepoPairDivide($user_repo, 3));\n $pair_low = strtolower($git_user.'/' . $git_repo);\n $src_url = 'https://packagist.org/p/' . $pair_low . '.json';\n $json_arr = $this->jsonGetHttpsOrCache($src_url, 260, true);\n if(!isset($json_arr['packages'][$pair_low])) {\n if(isset($json_arr['error'])) {\n $err=$json_arr['error'];\n } else {\n $err=['message'=>'Unknown error','code'=>500];\n }\n throw new \\Exception($err['message'],$err['code']);\n }\n $versions_arr=[];\n foreach($json_arr['packages'][$pair_low] as $version=>$dist_arr) {\n $versions_arr[$version]=[\n 'version_normalized'=>$dist_arr['version_normalized'],\n 'time'=>$dist_arr['time'],\n 'dist_url'=>$dist_arr['dist']['url'],\n 'authors'=>$dist_arr['authors'],\n 'require'=>$dist_arr['require'],\n ];\n }\n return $versions_arr;\n }", "function pkg_build_repo_list() {\n\t$repos = pkg_list_repos();\n\t$list = array();\n\n\tforeach ($repos as $repo) {\n\t\t$list[$repo['name']] = $repo['descr'];\n\t}\n\n\treturn($list);\n}", "public function getVersions(): Collection;", "public function latest_version();", "public function getPackagesVersions()\n {\n $components = [\n 'core' => [],\n 'theme' => [],\n 'widget' => [],\n 'module' => [],\n ];\n\n $components['core']['ZEDx'] = Core::VERSION;\n\n foreach (Themes::all() as $theme) {\n $components['theme'][$theme['manifest']['name']] = $theme['manifest']['version'];\n }\n\n foreach (Widgets::noType()->noFilter()->all(null, true) as $namespace => $widget) {\n $components['widget'][$namespace] = $widget->get('version');\n }\n\n foreach (Modules::all() as $module) {\n $components['module'][$module->name] = $module->version;\n }\n\n return $components;\n }", "function pkg_update($force = false) {\n\tglobal $g;\n\n\treturn pkg_call(\"update\" . ($force ? \" -f\" : \"\"));\n}", "function checkCurrentVersion() {\n $request = new Request();\n $url = 'https://api.github.com/repos/pantheon-systems/cli/releases';\n $url .= '?per_page=1';\n $response = $request->simpleRequest($url, array('absolute_url' => true));\n $release = array_shift($response['data']);\n Terminus::getCache()->putData(\n 'latest_release',\n array('version' => $release->name, 'check_date' => time())\n );\n return $release->name;\n}", "private function retrieveLatestBundleMeta(): array\n {\n $filesystem = Storage::disk($this->lasso_disk);\n $base_path = $this->lasso_path;\n\n // Firstly, let's check if the local filesystem has a \"lasso-bundle.json\"\n // file in it's root directory.\n\n if ($this->local_filesystem->exists(base_path('lasso-bundle.json'))) {\n $this->use_git = true;\n $file = $this->local_filesystem->get(base_path('lasso-bundle.json'));\n return json_decode($file, true);\n }\n\n // If there isn't a \"lasso-bundle.json\" file in the root directory,\n // that's okay - this means that the commit is in \"non-git\" mode. So\n // let's just grab that file.If we don't have a file on the server\n // however; we need to throw an exception.\n\n if (!$filesystem->has($base_path . '/lasso-bundle.json')) {\n $this->rollBack(\n FetchCommandFailed::because('A valid \"lasso-bundle.json\" file could not be found for the current environment.')\n );\n }\n\n $file = $filesystem->get($base_path . '/lasso-bundle.json');\n return json_decode($file, true);\n }", "public function getNewReleases() {\n $url = 'https://api.spotify.com/v1/browse/new-releases?' . UrlHelper::buildQuery([\n 'country' => 'CO',\n 'limit' => 10,\n ]);\n $options = [\n 'headers' => [\n 'Accept' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->getAccessToken(),\n ],\n ];\n try {\n $request = $this->httpClient->request('get', $url, $options);\n if ($response = json_decode($request->getBody(), TRUE)) {\n return $response['albums']['items'];\n }\n } catch (RequestException $requestException) {\n if (function_exists('dpm')) {\n dpm($requestException->getMessage());\n }\n }\n return [];\n }", "protected function utilGitPull()\n {\n foreach (File::directories(plugins_path()) as $authorDir) {\n foreach (File::directories($authorDir) as $pluginDir) {\n if (!File::isDirectory($pluginDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $pluginDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }\n\n foreach (File::directories(themes_path()) as $themeDir) {\n if (!File::isDirectory($themeDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $themeDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating theme: '. basename($themeDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }", "private function getLatestVersionScripts() {\n $latest_version = $this->getLatestVersion();\n \n if($latest_version) {\n $latest_version_path = ROOT . \"/$latest_version\";\n \n return get_files(\"$latest_version_path/upgrade\", 'php');\n } else {\n return array();\n } // if\n }", "public function getPublishedPackages(Request $request = null)\n {\n $packages = $this->entityLibraryService->get('Package')->getPublishedPackages();\n $publishedPackages = array();\n\n // TODO: read from parameters\n $portalFullHost = 'http://app.localserver.dev/';\n $serviceFullHost = 'http://app-services.localserver.dev/';\n\n if (!is_null($request)) {\n $protocol = ($request->isSecure()) ? 'https://' : 'http://';\n $host = $request->getHost();\n $serviceFullHost = $protocol . $host . '/';\n $hostPortal = str_replace('-services', '', $host);\n $portalFullHost = $protocol . $hostPortal . '/';\n }\n\n foreach ($packages as $package) {\n /** @var $package Package */\n $thumbnailPath = $package->getThumbnail() == null ? 'images/default_thumbnail.png' : $package->getThumbnail()->getWebPath();\n\n // TODO: use serializer and normalizers\n $metadataArray = array();\n $metadataArrayCollection = $package->getMetadata();\n foreach($metadataArrayCollection as $metadata) {\n $metadataArray[$metadata->getName()] = $metadata->getValue();\n }\n\n if (empty($metadataArray)) {\n $metadataArray = new \\stdClass();\n }\n\n // TODO: remove courseCode\n $currentPackage = array(\n 'uniqueId' => $package->getUniqueId(),\n 'title' => $package->getTitle(),\n 'description' => $package->getDescription(),\n 'categories' => $package->getCategoriesArray(),\n 'username' => $package->getUser()->getUsername(),\n 'organisation' => $package->getUser()->getOrganisation()->getName(),\n 'thumbnailUrl' => $portalFullHost . $thumbnailPath,\n 'metadata' => $metadataArray,\n );\n\n $packageFiles = $package->getFiles();\n\n /* @var $packageFile \\Core\\Library\\EntityBundle\\Entity\\PackageFile */\n foreach ($packageFiles as $packageFile) {\n /* @var $packageFile \\Core\\Library\\EntityBundle\\Entity\\File */\n $file = $packageFile->getFile();\n if (!$file) continue;\n\n $currentFile = array(\n 'version' => $packageFile->getVersion(),\n 'md5sum' => $file->getMD5sum(),\n 'size' => $file->getSize(),\n 'url' => $serviceFullHost . 'package-layer/packages/' . $package->getId() . '/files/' . $packageFile->getId(),\n );\n\n $fileMetadata = array();\n $metadataCollection = $packageFile->getMetadata();\n foreach ($metadataCollection as $metadata) {\n $fileMetadata[$metadata->getName()] = $metadata->getValue();\n }\n\n if (empty($fileMetadata)) {\n $fileMetadata = new \\stdClass();\n }\n\n $currentFile['metadata'] = $fileMetadata;\n $currentPackage['files'][] = $currentFile;\n }\n\n $publishedPackages[] = $currentPackage;\n }\n\n return $publishedPackages;\n }", "private function get_repository_info() {\n if ( is_null( $this->github_response ) ) {\n $request_uri = sprintf( 'https://api.github.com/repos/%s/%s/releases', $this->username, $this->repository );\n\n $response = json_decode( wp_remote_retrieve_body( wp_remote_get( $request_uri ) ), true );\n if( is_array( $response ) ) {\n $response = current( $response );\n }\n $this->github_response = $response;\n }\n }", "function get_repos() {\n\t\tadd_filter( 'use_fsockopen_transport', '__return_false' );\n\t\tadd_filter( 'use_fopen_transport', '__return_false' );\n\t\tadd_filter( 'use_streams_transport', '__return_false' );\n\t\tadd_filter( 'use_http_extension_transport', '__return_false' );\n\t\t\n\t\t// list all repos\n\t\t$url = 'https://api.github.com/users/' . $this->github_user . '/repos';\n\t\t\n\t\t$args = array(\n\t\t\t'method' => 'GET',\n\t\t\t'sslverify' => false\n\t\t);\n\n\t\t$github = wp_remote_request( $url, $args );\n\t\t\n\t\t// exit on error..\n\t\tif( empty( $github ) || ! empty( $github->errors ) ) {\n\t\t\t$this->repos = array();\n\t\t}\n\t\t\n\t\t$github_datas = $github['body'];\n\n\t\t$gits = json_decode( $github_datas );\n\t\t$sort_by = array();\n\t\t\n\t\tif ( is_array( $gits ) ) {\n\n\t\t\tforeach( $gits as $git ) {\n\t\t\t\t$this->repos[] = array( \n\t\t\t\t\t'name' => $git->name,\n\t\t\t\t\t'description' => $git->description,\n\t\t\t\t\t'url' => $git->html_url,\n\t\t\t\t\t'download' => trailingslashit( $git->html_url ) . 'archive/master.zip',\n\t\t\t\t\t'last_update' => $git->updated_at,\n\t\t\t\t\t'stargazers' => $git->stargazers_count,\n\t\t\t\t\t'watchers' => $git->watchers_count\n\t\t\t\t);\n\n\t\t\t\t$sort_by[] = $git->updated_at;\n\t\t\t}\n\n\t\t\tif ( ! empty( $sort_by ) )\n\t\t\t\tarray_multisort( $sort_by, SORT_DESC, $this->repos );\n\n\t\t// Github is not reachable rate limit exceeded\n\t\t} else {\n\t\t\t$this->repos = array();\n\t\t}\n\t\t\n\t}", "public function updateRepository($reset = true)\n\t{\n\t\t$this->command->info('Pulling changes');\n\t\t$tasks = array($this->scm->update());\n\n\t\t// Reset if requested\n\t\tif ($reset) {\n\t\t\tarray_unshift($tasks, $this->scm->reset());\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($tasks);\n\t}", "public function getVersions():array\n {\n return json_decode(\n copy_to_string($this->request('GET', '/unoconv/versions')->getBody()),\n true\n );\n }", "function package_reinstall_all() {\n\tglobal $g;\n\n\t$pkgs = config_get_path('installedpackages/package');\n\tif ($pkgs === null) {\n\t\treturn true;\n\t}\n\n\t/*\n\t * Configure default pkg repo for current version instead of\n\t * using it from backup, that could be older\n\t */\n\t$default_repo = pkg_get_default_repo();\n\t$current_repo_path = \"\";\n\tif (!empty(config_get_path('system/pkg_repo_conf_path'))) {\n\t\t$current_repo_path = config_get_path('system/pkg_repo_conf_path');\n\t}\n\n\tif ($current_repo_path != $default_repo['path']) {\n\t\tconfig_set_path('system/pkg_repo_conf_path', $default_repo['path']);\n\t\twrite_config( \"Configured default pkg repo after restore\");\n\t\tpkg_switch_repo($default_repo['path'], $default_repo['name']);\n\t}\n\n\t/* wait for internet connection */\n\tlog_error(gettext(\"Waiting for Internet connection to update pkg \" .\n\t \"metadata and finish package reinstallation\"));\n\t$ntries = 3;\n\twhile ($ntries > 0) {\n\t\tif (pkg_update(true)) {\n\t\t\tbreak;\n\t\t}\n\t\tsleep(1);\n\t\t$ntries--;\n\t}\n\n\tif ($ntries == 0) {\n\t\treturn false;\n\t}\n\n\tif (!empty($pkgs)) { \n\t\t$pkg_info = get_pkg_info();\n\t}\n\n\tforeach ($pkgs as $package) {\n\t\t$found = false;\n\t\tforeach ($pkg_info as $pkg) {\n\t\t\tpkg_remove_prefix($pkg['name']);\n\t\t\tif ($pkg['name'] == $package['internal_name']) {\n\t\t\t\tpkg_install(g_get('pkg_prefix') . $package['internal_name'], true);\n\t\t\t\t$found = true;\n\t\t\t} elseif ($pkg['name'] == $package['name']) {\n\t\t\t\t/* some packages use 'name' as the package name,\n\t\t\t\t * see https://redmine.pfsense.org/issues/12766 */\n\t\t\t\tpkg_install(g_get('pkg_prefix') . $package['name'], true);\n\t\t\t\t$found = true;\n\t\t\t}\n\t\t\tif ($found) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (!$found) {\n\t\t\tif (!function_exists(\"file_notice\")) {\n\t\t\t\trequire_once(\"notices.inc\");\n\t\t\t}\n\n\t\t\t/* Name of the package that cannot be found. If it has\n\t\t\t * an internal name, include that as well. */\n\t\t\t$pkgname = $package['name'];\n\t\t\tif (!empty($package['internal_name'])) {\n\t\t\t\t$pkgname .= \" ({$package['internal_name']})\";\n\t\t\t}\n\t\t\tfile_notice(gettext(\"Package reinstall\"),\n\t\t\t sprintf(gettext(\"Package %s does not exist in \" .\n\t\t\t \"current %s version and it has been removed.\"),\n\t\t\t $pkgname, g_get('product_label')));\n\t\t\tuninstall_package($package);\n\t\t}\n\t}\n\n\t/*\n\t * Verify remaining binary packages not present in current config\n\t * during backup restore and remove them\n\t */\n\t$installed_packages = get_pkg_info('all', true, true);\n\tforeach ($installed_packages as $package) {\n\t\t$shortname = $package['name'];\n\t\tpkg_remove_prefix($shortname);\n\t\tif (get_package_id($shortname) != -1) {\n\t\t\tcontinue;\n\t\t}\n\t\tpkg_delete($package['name']);\n\t}\n\n\treturn true;\n}", "protected static function updateComposerArray(array $packages)\n {\n return array_merge(['inertiajs/inertia-laravel' => '^0.1'], $packages);\n }", "public function requestDetails($version)\n {\n // Return cached deplink.json file.\n try {\n $archiveFile = $this->getArchiveCachePath($version);\n if ($this->fs->existsFile($archiveFile)) {\n $zip = new ZipArchive;\n $zip->open($archiveFile);\n $json = $zip->getFromName('deplink.json');\n return $this->packageFactory->makeFromJson($json);\n }\n }\n catch(\\Exception $e) {\n // Do nothing, but it means that something went wrong while retrieving cached version.\n // Details will be retrieved directly from the remote repository.\n }\n\n // Remove prefix (\"v\" or \"v.\") from version number.\n $version = preg_replace('/^(v\\.|v)/i', '', $version);\n\n // Request deplink.json file for specific package version.\n $uri = \"{$this->baseUrl}/api/v1/@{$this->packageName}/$version/deplink.json\";\n $response = $this->client->request('get', $uri);\n if ($response->getStatusCode() !== 200) {\n throw new UnreachableRemoteRepositoryException(\"Accessing remote repository endpoint $uri returned status code {$response->getStatusCode()}, the 200 status code expected.\");\n }\n\n try {\n // Parse json content, update cache and return value.\n $json = json_decode($response->getBody()->getContents());\n $this->cached[$version] = $this->packageFactory->makeFromJson($json->data);\n return $this->cached[$version];\n } catch (\\Exception $e) {\n $body = $response->getBody()->getContents();\n throw new UnreachableRemoteRepositoryException(\"Cannot parse body '$body' returned by remote repository endpoint $uri.\");\n }\n }", "function mainPull()\n {\n x_echoFlush('<pre>');\n x_EchoFlush('<h2>Looking For Andromeda Version</h2>');\n x_EchoFlush(\"\");\n\n // First take care of where we are pulling version\n // information from\n $def = \"http://andro.svn.sourceforge.net/svnroot/andro/releases/\";\n $row = SQL_OneRow(\n \"Select * from applications where application='andro'\"\n );\n if (!isset($row['svn_url'])) {\n x_EchoFlush(\"-- This looks like the first time this node has\");\n x_EchoFlush(\" been upgraded from Subversion. Using default\");\n x_echoFlush(\" URL to look for releases:\");\n x_EchoFlush(\" \".$def);\n $url = $def;\n } else {\n if (is_null($row['svn_url']) || trim($row['svn_url'])=='') {\n x_EchoFlush(\"-- Setting the Subversion URL to default:\");\n x_EchoFlush(\" \".$def);\n $url = $def;\n $row['svn_url'] = $def;\n SQLX_Update('applications', $row);\n } else {\n $url = trim($row['svn_url']);\n x_EchoFlush(\"-- Using the following URL for Subversion:\");\n x_EchoFlush(\" \".$url);\n }\n }\n\n // Find out what the latest version is\n x_EchoFlush(\"\");\n x_EchoFlush(\"-- Querying for latest version...\");\n $command = 'svn list '.$url;\n x_EchoFlush(\" Command is: \".$command);\n $rawtext = `$command`;\n if ($rawtext=='') {\n x_EchoFlush(\"-- NO VERSIONS RETRIEVED!\");\n x_EchoFlush(\" It may be that the Sourceforge site is down?\");\n x_EchoFlush(\"\");\n x_echoFlush(\" ---- Stopped Unexpectedly --- \");\n return;\n }\n $rawtext = str_replace(\"\\r\", \"\", $rawtext);\n $lines = explode(\"\\n\", $rawtext);\n // Pop off empty entry at end, then get latest version\n array_pop($lines);\n $latest=array_pop($lines);\n if (substr($latest, -1)=='/') {\n $latest = substr($latest, 0, strlen($latest)-1);\n }\n\n x_EchoFlush(\" Latest published version: \".$latest);\n\n // now find out what version we have\n x_EchoFlush(\" \");\n x_EchoFlush(\"-- Finding out what version the node manager is at\");\n $file=$GLOBALS['AG']['dirs']['application'].'_andro_version_.txt';\n x_EchoFlush(\" Looking at file: $file\");\n if (!file_exists($file)) {\n x_EchoFlush(\" File not found, it appears this is the first time\");\n x_EchoFlush(\" this node has been upgraded this way. Will proceed\");\n x_EchoFlush(\" to get latest version.\");\n } else {\n $version = file_get_contents($file);\n x_EchoFlush(\" Current version is \".$version);\n \n if ($version == $latest) {\n x_echoFlush(\" This node is current! Nothing to do!\");\n x_EchoFlush(\"\");\n x_echoFlush(\" ---- Processing completed normally ---- \");\n return;\n } else {\n x_echoFlush(\" Newer version available, will get latest.\");\n }\n }\n \n // now get the latest code\n $dir = $GLOBALS['AG']['dirs']['root'];\n $command = 'svn export --force '.$url.$latest.' '.$dir;\n x_EchoFlush(\"\");\n x_EchoFlush(\"-- Overwriting Node Manager now\");\n x_echoFlush(\" Command is \".$command);\n `$command`;\n x_echoFlush(\"\");\n file_put_contents($file, $latest);\n x_EchoFlush(\" ---- Processing completed normally ---- \");\n\n }", "public static function fetch_wordpress_versions()\n {\n //Cache File name for wordpress version\n $version_list = Package::get_config('package', 'version', 'file');\n\n //Connect To Wordpress API\n $list = \\WP_CLI_Helper::http_request(Package::get_config('wordpress_api', 'version'));\n if ($list != false) {\n //convert list to json file\n $list = json_decode($list, true);\n\n //Create Cache file for wordpress version list\n \\WP_CLI_FileSystem::create_json_file($version_list, $list, false);\n } else {\n //Show Error connect to WP API\n return array('status' => false, 'data' => Package::_e('wordpress_api', 'connect'));\n }\n\n return array('status' => true, 'data' => $list);\n }", "protected static function updatePackageArray(array $packages)\n {\n return [\n \"@ckeditor/ckeditor5-build-classic\" => \"^32.0.0\",\n \"@fontsource/nunito\" => \"^4.5.11\",\n \"@fortawesome/fontawesome-free\" => \"^5.15.4\",\n \"@icon/dripicons\" => \"^2.0.0-alpha.3\",\n \"@popperjs/core\" => \"^2.11.6\",\n \"apexcharts\" => \"^3.36.3\",\n \"bootstrap\" => \"5.2.3\",\n \"bootstrap-icons\" => \"^1.10.2\",\n \"chart.js\" => \"^4.1.1\",\n \"choices.js\" => \"^10.2.0\",\n \"cross-env\" => \"^7.0.3\",\n \"datatables.net\" => \"^1.13.1\",\n \"datatables.net-bs5\" => \"^1.13.1\",\n \"dayjs\" => \"^1.11.7\",\n \"dragula\" => \"^3.7.3\",\n \"feather-icons\" => \"^4.29.0\",\n \"filepond\" => \"^4.30.4\",\n \"filepond-plugin-file-validate-size\" => \"^2.2.8\",\n \"filepond-plugin-file-validate-type\" => \"^1.2.8\",\n \"filepond-plugin-image-crop\" => \"^2.0.6\",\n \"filepond-plugin-image-exif-orientation\" => \"^1.0.11\",\n \"filepond-plugin-image-filter\" => \"^1.0.1\",\n \"filepond-plugin-image-preview\" => \"^4.6.11\",\n \"filepond-plugin-image-resize\" => \"^2.0.10\",\n \"jsvectormap\" => \"^1.5.1\",\n \"laravel-mix\" => \"^6.0.49\",\n \"nunjucks\" => \"^3.2.3\",\n \"parsleyjs\" => \"^2.9.2\",\n \"perfect-scrollbar\" => \"^1.5.5\",\n \"quill\" => \"^1.3.7\",\n \"rater-js\" => \"^1.0.1\",\n \"rtlcss\" => \"^4.0.0\",\n \"simple-datatables\" => \"^4.0.8\",\n \"summernote\" => \"0.8.20\",\n \"sweetalert2\" => \"^11.6.16\",\n \"tinymce\" => \"^6.3.1\",\n \"toastify-js\" => \"^1.12.0\",\n \"vite\" => \"^4.0.4\",\n \"laravel-vite-plugin\" => \"^0.7.3\"\n ] + $packages;\n }", "public function gitPull ()\n {\n\n $this->updates[ ] = Hallmark_Misc::shell ( 'git pull ' . Hallmark_Misc::removeQuotes ( Hallmark_Misc::args () ) );\n\n }", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "public function getUpdatableInstances() {\n\t\t$packages = $this->getDuplicates();\n\t\t$updatable = array();\n\t\t$newVersion = $this->packageInfo['version'];\n\t\t\n\t\tforeach ($packages as $package) {\n\t\t\tif (Package::compareVersion($newVersion, $package['packageVersion']) == 1) {\n\t\t\t\t$updatable[$package['packageID']] = $package;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $updatable;\n\t}", "public function fixRepositoryUrls() {\n\t\t$update_count = 0;\n\n\t\t$packages = $this->Package->find('all', array(\n\t\t\t'contain' => array('Maintainer' => array('id', 'username')),\n\t\t\t'fields' => array('id', 'maintainer_id', 'name'),\n\t\t\t'order' => array('Package.id ASC')\n\t\t));\n\n\t\tforeach ($packages as $package) {\n\t\t\t$this->out(sprintf(\n\t\t\t\t__('Updating package id %s named %s'),\n\t\t\t\t$package['Package']['id'],\n\t\t\t\t$package['Package']['name']\n\t\t\t));\n\n\t\t\tif ($this->Package->fixRepositoryUrl($package)) $update_count++;\n\t\t}\n\n\t\t$this->out(sprintf(__('* Successfully updated %s out of %s package urls'), $update_count, count($packages)));\n\t\t$this->_stop();\n\t}", "public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }", "function pkg_list_repos() {\n\tglobal $g;\n\n\t$repo_base = \"{$g['pkg_repos_path']}/{$g['product_name']}-repo\";\n\t$result = array();\n\t$name_files = glob(\"{$repo_base}-*.name\");\n\tforeach ($name_files as $name_file) {\n\t\t$repo_name = file_get_contents($name_file);\n\t\tif ($repo_name == false || strlen($repo_name) <= 1) {\n\t\t\tcontinue;\n\t\t}\n\t\t$repo_name_base = \"{$repo_base}-{$repo_name}\";\n\t\t$descr_file = \"{$repo_name_base}.descr\";\n\t\tif (file_exists($descr_file)) {\n\t\t\t$descr = file_get_contents($descr_file);\n\t\t\tif ($descr == false) {\n\t\t\t\t$descr = 'Unknown';\n\t\t\t}\n\t\t} else {\n\t\t\t$descr = 'Unknown';\n\t\t}\n\t\t$entry = array(\n\t\t 'name' => $repo_name,\n\t\t 'path' => \"{$repo_name_base}.conf\",\n\t\t 'descr' => $descr\n\t\t);\n\t\tif (file_exists(\"{$repo_name_base}.default\")) {\n\t\t\t$entry['default'] = true;\n\t\t}\n\t\t$result[] = $entry;\n\t}\n\n\treturn $result;\n}", "function fetch_distro_from_internet() \n {\n $linux_distro_names = [\"ubuntu\",\"fedora\",\"centos\",\"mint\",\"suse\",\"freebsd\"];\n \n foreach($linux_distro_names as $key => $name )\n {\n $distro[$key]['name'] = $name; \n $version = fetch_linux_distro_latest_version($name);\n \n // Gets only version number without extra alphabets\n preg_match(\"/\\d+([\\.-]\\d+)?/\",$version,$matches);\n \n $distro[$key]['version'] = $matches[0]; \n }\n\n $json['result'] = $distro;\n \n // Send Json response to the browser\n return json_encode($json);\n\n }", "public function updateRepository() {\n $scheduledFile = __DIR__ . '/scheduled.txt';\n if (!file_exists($scheduledFile))\n return;\n\n $requested = file_get_contents($scheduledFile);\n if (!unlink($scheduledFile))\n return;\n\n if ((time() - intval(trim($requested))) > 600)\n return;\n\n $commands = [\n // Updates the local copy of the repository with the most recent remote changes.\n 'git fetch --all',\n\n // Resets the repository to the state the remote currently is in.\n 'git reset --hard origin/master',\n\n // Remove any left-over files that are not part of the checkout, and not in .gitignore.\n 'git clean -f -d',\n\n // Write the latest commit SHA to the VERSION file.\n 'git rev-parse HEAD > VERSION',\n ];\n\n $directory = realpath(__DIR__ . '/../../../');\n\n foreach ($commands as $command)\n Info(trim(shell_exec('cd ' . $directory . ' && ' . $command . ' 2>&1')));\n\n Info('AutoDeploy: Updated to revision ' . file_get_contents(__DIR__ . '/../../../VERSION') . '.');\n }", "public function getVersions()\n { \n return $this->versions;\n }", "public function checkTbVersion($forceRefresh = false)\n {\n if ($forceRefresh || !$this->allChannelsAreCached()) { // || $this->shouldRefresh()) {\n $guzzle = new Client(\n [\n 'base_uri' => self::CHANNELS_BASE_URI,\n 'timeout' => 10,\n 'verify' => __DIR__.'/../cacert.pem',\n ]\n );\n\n $promises = [\n 'alpha' => $guzzle->getAsync('alpha.json'),\n 'beta' => $guzzle->getAsync('beta.json'),\n 'rc' => $guzzle->getAsync('rc.json'),\n 'stable' => $guzzle->getAsync('stable.json'),\n ];\n\n $results = Promise\\settle($promises)->wait();\n foreach ($results as $key => $result) {\n $this->versionInfo[$key] = [];\n $value = null;\n if (isset($result['value'])) {\n $value = $result['value'];\n }\n if ($value instanceof GuzzleHttp\\Psr7\\Response) {\n $versionsInfo = (string) $value->getBody();\n $versionsInfo = json_decode($versionsInfo, true);\n foreach ($versionsInfo as $version => $versionInfo) {\n $this->versionInfo[$key][$version] = $versionInfo;\n }\n }\n }\n $this->saveVersionInfo();\n } else {\n $this->versionInfo = [\n 'alpha' => json_decode(file_get_contents(_PS_MODULE_DIR_.'tbupdater/json/thirtybees-alpha.json'), true),\n 'beta' => json_decode(file_get_contents(_PS_MODULE_DIR_.'tbupdater/json/thirtybees-beta.json'), true),\n 'rc' => json_decode(file_get_contents(_PS_MODULE_DIR_.'tbupdater/json/thirtybees-rc.json'), true),\n 'stable' => json_decode(file_get_contents(_PS_MODULE_DIR_.'tbupdater/json/thirtybees-stable.json'), true),\n 'file' => json_decode(file_get_contents(_PS_MODULE_DIR_.'tbupdater/json/thirtybees-stable.json'), true),\n ];\n }\n\n $channelWithLatestVersion = $this->findChannelWithLatestVersion($this->selectedChannel);\n if (!$channelWithLatestVersion) {\n $this->version = '';\n $this->channel = $this->selectedChannel;\n $this->coreLink = '';\n $this->extraLink = '';\n $this->md5Core = '';\n $this->md5Extra = '';\n $this->fileActionsLink = '';\n\n return false;\n }\n $versionsInfo = $this->versionInfo[$channelWithLatestVersion];\n $highestVersion = '0.0.0';\n foreach (array_keys($versionsInfo) as $version) {\n if (Version::gt($version, $highestVersion)) {\n $highestVersion = $version;\n }\n }\n if ($highestVersion === _TB_VERSION_) {\n $this->version = '';\n $this->channel = $this->selectedChannel;\n $this->coreLink = '';\n $this->extraLink = '';\n $this->md5Core = '';\n $this->md5Extra = '';\n $this->fileActionsLink = '';\n\n return false;\n }\n\n $versionsInfo = $versionsInfo[$highestVersion];\n\n $this->version = $highestVersion;\n $this->channel = $channelWithLatestVersion;\n $this->coreLink = $versionsInfo['core'];\n $this->extraLink = $versionsInfo['extra'];\n $this->md5Core = $versionsInfo['md5core'];\n $this->md5Extra = $versionsInfo['md5extra'];\n $this->fileActionsLink = $versionsInfo['fileActions'];\n if (isset($versionsInfo['requires'])) {\n $this->requires = $versionsInfo['requires'];\n }\n\n return true;\n }", "function update() {\n\t\t$CLI_url = escapeshellarg($this->URL);\n\n\t\t// Update LatestRev\n\t\tif($this->NeedsLatestRev) {\n\t\t\t$retVal = 0;\n\t\t\t$output = array();\n\t\t\texec(\"unset DYLD_LIBRARY_PATH && svn info --xml $CLI_url &> /dev/stdout\", $output, $retVal);\n\t\t\tif($retVal == 0 && preg_match(\"/\\<\\?xml/\", $output[0])) {\n\t\t\t\ttry {\n\t\t\t\t\t$info = new SimpleXMLElement(implode(\"\\n\", $output));\n\t\t\t\t\tif($info->entry->commit['revision']) {\n\t\t\t\t\t\t$this->LatestRevPacked = (string)$info->entry->commit['revision'];\n\t\t\t\t\t\t$this->LatestDatePacked = (string)$info->entry->commit->date;\n\t\t\t\t\t}\n\t\t\t\t} catch(Exception $e) {\n\t\t\t\t\tuser_error($e, E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"svn info failed \". $output, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\n\t\t// Update ChildDirs\n\t\tif($this->NeedsChildDirs) {\n\t\t\t$retVal = 0;\n\t\t\t$output = array();\n\n\t\t\texec(\"unset DYLD_LIBRARY_PATH && svn ls --xml $CLI_url\", $output, $retVal);\n\t\t\tif($retVal == 0) {\n\t\t\t\t$subdirs = new SimpleXMLElement(implode(\"\\n\", $output));\n\t\t\t\t\n\t\t\t\tif($subdirs) {\n\t\t\t\t\t$subdirInfo = array();\n\t\t\t\t\tforeach($subdirs->xpath('//entry') as $entry) {\n\t\t\t\t\t\t$name = (string)$entry->name;\n\t\t\t\t\t\t$date = (string)$entry->commit->date;\n\t\t\t\t\t\t$rev = (string)$entry->commit['revision'];\n\t\t\t\t\t\n\t\t\t\t\t\t$subdirInfo[$name] = array('date' => $date, 'rev' => $rev);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->ChildDirsPacked = serialize($subdirInfo);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"svn info failed \". $output, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\n\t\t$this->write();\n\t\t\n\t}", "protected static function updateComposerPackages(string $key = 'require')\n {\n if (! file_exists(base_path('composer.json'))) {\n return;\n }\n\n $packages = json_decode(file_get_contents(base_path('composer.json')), true);\n\n $packages[$key] = static::updateComposerPackageArray($packages[$key] ?? [], $key);\n\n ksort($packages[$key]);\n\n file_put_contents(\n base_path('composer.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "public function getVersions()\n {\n return $this->getData()->get('versions', array());\n }", "function check_packages() {\n global $xoopsDB, $xoopsModuleConfig, $xoopsConfig;\n $res = $xoopsDB->query(\"SELECT p1.*, p2.vcheck dirname, p2.pversion ppversion FROM \".UPDATE_PKG.\" p1 LEFT JOIN \".UPDATE_PKG.\" p2 ON p1.parent=p2.pkgid WHERE p1.pversion='HEAD' ORDER BY p1.vcheck\");\n $pkgs = get_packages('all', false);\n echo \"<div class='adminnavi'>\"._AM_CHECK_LIST.\"</div>\\n\";\n echo \"<table cellspacing='1' class='outer'>\\n\";\n echo \"<tr><th>\"._AM_PKG_PNAME.\"</th><th>\"._AM_PKG_CURRENT.\"</th><th>\".\n\t_AM_PKG_DIRNAME.\"</th><th>\"._AM_PKG_NEW.\"</th><th>\".\n\t_AM_PKG_DTIME.\"</th><th>\"._AM_CHANGES.\"</th><th>\".\n\t_AM_MODIFYS.\"</th><th></th></tr>\\n\";\n $n = 0;\n $update = false;\t// find update package?\n $modify = false;\n $errors = array();\n $module_handler =& xoops_gethandler('module');\n while ($data = $xoopsDB->fetchArray($res)) {\n\t$pname = $data['pname'];\n\t$dirname = $data['vcheck'];\t// real dirname\n\t$pdir = empty($data['dirname'])?$dirname:$data['dirname'];\n\t$bg = $n++%2?'even':'odd';\n\t$id = $data['pkgid'];\n\t$newpkg = isset($pkgs[$pdir])?$pkgs[$pdir]:array();\n\tif (empty($newpkg)) {\n\t foreach ($pkgs as $pkg) {\t// find by name\n\t\tif ($pname == $pkg['pname']) {\n\t\t $newpkg = $pkg;\n\t\t break;\n\t\t}\n\t }\n\t}\n\t$newver = isset($newpkg['pversion'])?$newpkg['pversion']:'';\n\t$curver = get_current_version($pname, $dirname);\n\t$modver = $curver[1];\t// version string (0: normalize, 1: raw)\n\tif (empty($data['parent']) ||\n\t !in_array($data['ppversion'], $curver)) {\n\n\t $par = import_new_package($pname, $modver, $pdir);\n\t if (empty($par)) {\n\t\t$errors[] = \"$pname $modver: \"._AM_PKG_NOTFOUND;\n\t } else {\n\t\t$pid = $data['parent'] = $par->getVar('pkgid');\n\t\t$pnm = $data['name'] = $par->getVar('name');\n\t\t$ctm = $data['ctime'] = time();\n\t\t$data['ppversion'] = $par->getVar('pversion');\n\t\t$xoopsDB->queryF(\"UPDATE \".UPDATE_PKG.\" SET parent=$pid, name=\".$xoopsDB->quoteString($pnm).\", mtime=0, ctime=$ctm WHERE pkgid=$id\");\n\t }\n\t}\n\tif (!empty($data['ppversion'])) {\n\t $pversion = $data['ppversion'];\n\t $past = time()-$data['mtime'];\n\t if ($past>$xoopsModuleConfig['cache_time']) {\n\t\t$pkg = new InstallPackage($data);\n\t\t$pkg->load();\n\t\t$count = count($pkg->checkFiles());\n\t\tif (!$count) $xoopsDB->queryF(\"UPDATE \".UPDATE_PKG.\" SET mtime=\".time().\" WHERE pkgid=\".$id);\n\t } else {\n\t\t$count = 0;\n\t }\n\t $opt = \"&pkgid=$id\";\n\t if (!$count) $opt .= \"&view=yes\";\n\t $op = \"<a href='index.php?op=detail$opt'><img src='\".XOOPS_URL.\"/images/icons/edit.png' alt='\".($count?_AM_MODIFY:_AM_DETAIL).\"' title='\".($count?_AM_MODIFY:_AM_DETAIL).\"' /></a>\";\n\t} else {\t\t// no manifesto\n\t $pversion = \"\";\n\t $op = \"\";\n\t $count = 0;\n\t}\n\tif ($count) $modify = true;\n\tif (!empty($newpkg)) {\n\t $newver = $newpkg['pversion'];\n\t $newdate = formatTimestamp($newpkg['dtime'], \"m\");\n\t} else {\n\t $newver = '-';\n\t $newdate = '-';\n\t}\n\t$mcount = count_modify_files($data['pkgid']);\n\tif ($pversion != $newver) {\n\t $bg = 'up';\n\t $uppkg = import_new_package($pname, $newver);\n\t if ($uppkg) {\n\t\t$pid = $uppkg->getVar('pkgid');\n\t\t$newver = \"<a href='index.php?op=detail&pkgid=$id&new=$pid&view=yes'>\".htmlspecialchars($newver).\"</a>\";\n\t\t$update = true;\n\t }\n\t} else {\n\t $newver = htmlspecialchars($newver);\n\t}\n\n\tif ($count) $bg = 'fix';\n\n\t// check module update\n\t$vers = htmlspecialchars($modver);\n\tif (!empty($dirname)) {\n\t $module = $module_handler->getByDirname($dirname);\n\t if (is_object($module)) { // installed?\n\t\t$mver = $module->getVar(\"version\")/100;\n\t\tif (!in_array($mver, $curver)) {\n\t\t $url = get_system_url(\"ModuleUpdate\", $dirname);\n\t\t $vers = \"<a href='$url' title='\"._AM_PKG_NEEDUPDATE.\"'>$vers ($mver)</a>\";\n\t\t}\n\t } else {\n\t\t$url = get_system_url(\"ModuleInstall\", $dirname);\n\t\t$vers = \"<a href='$url' title='\"._AM_PKG_NOTINSTALL.\"'>$vers (-)</span>\";\n\t }\n\t}\n\techo \"<tr class='$bg'><td><a href='index.php?op=opts&pkgid=$id'>\".\n\t htmlspecialchars($pname).\"</a></td><td>\".\n\t $vers.\"</td><td align='center'>$dirname</td><td align='center'>\".$newver.\n\t \"</td><td align='center'>$newdate</td><td align='right'>$count</td><td align='right'>$mcount</td><td align='center'>$op</td></tr>\\n\";\n }\n echo \"</table>\\n\";\n if ($update && !$modify) {\n\techo \"<table cellpadding='5'>\n<tr>\n <td><a href='pack.php?op=backup'>\"._AM_UPDATE_BACKUP.\"</a></td>\n <td><a href='pack.php?op=update'>\"._AM_UPDATE_ARCHIVE.\"</a></td>\n <td>\";\n\tif (preg_match('/^Yes/', mysystem(\"check\"))) {\n\t echo \"\n <form action='pack.php?op=exec' method='post'>\n <input type='submit' value='\"._AM_UPDATE_SUBMIT.\"'>\n </form>\";\n\t}\n\techo \"\n </td>\n</tr>\n</table>\\n\";\n }\n $rollback = ROLLBACK;\n if (file_exists($rollback)) {\n\t$ctime = filectime($rollback);\n\t$expire = $ctime+$xoopsModuleConfig['cache_time'];\n\tif ($expire < time()) unlink($rollback);\n\telse {\n\t $tm = _AM_UPDATE_TIME.' '.formatTimestamp($ctime, 'm');\n\t $until = _AM_UPDATE_EXPIRE.' '.formatTimestamp($expire, 'H:i');\n\techo \"<table cellpadding='5'>\n <tr><td>\n <form action='index.php?op=rollback' method='post'>\n <input type='submit' value='\"._AM_UPDATE_ROLLBACK.\"'></form></td>\n <td>$tm ($until)</td></tr>\n</table>\\n\";\n\t}\n }\n if ($errors) {\n\techo \"<br/><div class='errorMsg'>\\n\";\n\tforeach ($errors as $msg) {\n\t echo \"$msg<br/>\\n\";\n\t}\n\techo \"</div>\\n\";\n }\n}", "public function wp_check_update()\n\t{\n\t\t$content = file_get_contents('https://raw.githubusercontent.com/emulsion-io/wp-migration-url/master/version.json'.'?'.mt_rand());\n\t\t$version = json_decode($content);\n\n\t\t//var_dump($version); exit;\n\n\t\t$retour['version_courante'] = $this->_version;\n\t\t$retour['version_enligne'] = $version->version;\n\n\t\tif($retour['version_courante'] != $retour['version_enligne']) {\n\t\t\t$retour['maj_dipso'] = TRUE;\n\t\t} else {\n\t\t\t$retour['maj_dipso'] = FALSE;\n\t\t}\n\n\t\treturn $retour;\n\t}", "protected static function updatePackageArray(array $packages)\n {\n // packages to add to the package.json\n $packagesToAdd = [\n 'axios' => '^0.18',\n 'history' => '^4.7.2',\n 'localforage' => '^1.7.1',\n 'lodash' => '^4.17.4',\n 'normalizr' => '^3.2.4',\n 'pluralize' => '^7.0.0',\n 'react' => '^16.2.0',\n 'react-dom' => '^16.2.0',\n 'react-redux' => '^5.0.7',\n 'react-router' => '^4.3.1',\n 'react-router-redux' => '^5.0.0-alpha.9',\n 'react-select' => '^2.0.0-beta.6',\n 'redux' => '^4.0.0',\n 'redux-act' => '^1.7.4',\n 'redux-logger' => '^3.0.6',\n 'redux-persist' => '^5.10.0',\n 'redux-thunk' => '^2.3.0'\n ];\n\n // packages to add as dev dependency to the package.json\n $packagesToAddDev = [\n 'babel-eslint' => '^8.2.3',\n 'babel-preset-react' => '^6.23.0',\n 'cross-env' => '^5.1',\n 'eslint' => '^4.19.1',\n 'eslint-plugin-react' => '^7.9.1',\n 'laravel-mix' => '^2.0',\n 'laravel-mix-react-css-modules' => '^1.2.0'\n ];\n\n // packages to remove from the package.json\n $packagesToRemove = ['vue', 'jquery', 'bootstrap', 'popper.js', 'lodash', 'axios'];\n\n return [\n 'dependencies' => $packagesToAdd,\n 'devDependencies' => $packagesToAddDev + Arr::except($packages['devDependencies'], $packagesToRemove),\n ]; \n }", "public function getModuleVersions()\n {\n $this->moduleVersions = json_decode($this->cache->load(self::MODULES_CACHE_ID), true);\n\n if ($this->moduleVersions !== null) {\n return $this->moduleVersions;\n }\n\n $packagesToLog = C_RB_LOG_PACKAGES;\n $composer = json_decode(file_get_contents(BP . '/composer.lock'), true);\n\n $this->moduleVersions = [];\n foreach ($composer['packages'] as $package) {\n if (in_array($package['name'], $packagesToLog)) {\n $this->moduleVersions[ str_replace('/', '_', $package['name']) ] = $package['version'];\n }\n elseif ($package['name'] == 'magento/magento2-base') {\n $this->moduleVersions['_magento_version'] = $package['version'];\n }\n }\n\n $this->cache->save(json_encode($this->moduleVersions), self::MODULES_CACHE_ID, [], 86400);\n\n return $this->moduleVersions;\n }", "public function update() {\n\t\t$webhook_secret = $this->config->item ( 'github_webhook_secret' );\n\t\t$client_id = $this->config->item ( 'github_client_id' );\n\t\t$client_secret = $this->config->item ( 'github_client_secret' );\n\t\t\n\t\tif (! isset ( $_SERVER ['HTTP_X_HUB_SIGNATURE'] )) {\n\t\t\tthrow new \\Exception ( \"HTTP header 'X-Hub-Signature' is missing.\" );\n\t\t} elseif (! extension_loaded ( 'hash' )) {\n\t\t\tthrow new \\Exception ( \"Missing 'hash' extension to check the secret code validity.\" );\n\t\t}\n\t\t\n\t\tlist ( $algo, $hash ) = explode ( '=', $_SERVER ['HTTP_X_HUB_SIGNATURE'], 2 ) + array (\n\t\t\t\t'',\n\t\t\t\t'' \n\t\t);\n\t\tif (! in_array ( $algo, hash_algos (), TRUE )) {\n\t\t\tthrow new \\Exception ( \"Hash algorithm '$algo' is not supported.\" );\n\t\t}\n\t\t$rawPost = file_get_contents ( 'php://input' );\n\t\tif ($hash !== hash_hmac ( $algo, $rawPost, $webhook_secret )) {\n\t\t\tthrow new \\Exception ( 'Hook secret does not match.' );\n\t\t}\n\t\t\n\t\t$url = \"https://api.github.com/users/UoLCompSoc/repos?per_page=10&client_id=\" . $client_id . \"&client_secret=\" . $client_secret;\n\t\t\n\t\t$decoded = json_decode ( $this->_getContent ( $url ) );\n\t\t\n\t\t$github_data = array ();\n\t\t\n\t\tforeach ( $decoded as $repo ) {\n\t\t\tif ($repo->fork === TRUE) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$collaborators = json_decode ( $this->_getContent ( $repo->contributors_url ) );\n\t\t\t$repo->collaborator_count = sizeof ( $collaborators );\n\t\t\t\n\t\t\tarray_push ( $github_data, $repo );\n\t\t}\n\t\t\n\t\t$filepath = APPPATH . 'cache/repocache.json';\n\t\t\n\t\tif (! write_file ( $filepath, json_encode ( $github_data ), 'w' )) {\n\t\t\tlog_message ( 'error', 'Cannot write to github cache file at ' . $filepath );\n\t\t}\n\t\t\n\t\t// $this->load->view ( 'admin' );\n\t}", "public static function install($package_name, $version_param = false, $die_on_duplicate = true) {\n $package_info = json_decode(file_get_contents(self::URL.\"/$package_name.json\"), true);\n if(!isset($package_info['status'])) {\n //has package already been added to the app's packagist file\n $exists = isset(self::$_packages[$package_name]) ? self::$_packages[$package_name] : false;\n //check for matching version either new or existing ugradable\n $to_install = self::match($package_info, $version_param);\n if(($to_install===false)&&($exists!==true)&&($exists!==false)) {\n $to_install = self::match($package_info, $exists);\n }\n if($to_install!==false) {\n echo \"Downloading $package_name \".$to_install[\"version\"].\"\\n\";\n //download requires\n if(isset($to_install[\"require\"])) {\n foreach($to_install[\"require\"] as $rpackage => $version) {\n if($rpackage==\"php\") {\n $php_vmatch = []; preg_match('/([\\>\\=]+)\\s*([0-9\\.]+)/', $version, $php_vmatch);\n if(version_compare(phpversion(), $php_vmatch[2], $php_vmatch[1])==false) {\n die(\"PHP version $version required\"); }\n } elseif(strpos($rpackage, '/')!==false) {\n self::install($rpackage, $version, false);\n }\n }\n }\n //get directory names and create if not existing yet\n $name=$to_install[\"source\"][\"url\"];\n $name=substr($name, strlen('https://github.com/'));\n $name=str_replace('/', '-', substr($name, 0, strrpos($name, '.')));\n $id=substr($to_install[\"dist\"][\"reference\"], 0, 7);\n $package_directory = App::libs()->directory('Packagist.'.strtolower($name));\n $package_sub = $package_directory->directory(\"$name-$id\");\n if($package_sub->exists()) {\n if($die_on_duplicate) {\n die(\"Package version already installed\\n\");\n } else {\n echo \"Package version already installed\\n\";\n return false;\n }\n }\n if(!$package_directory->exists()) { $package_directory->create(); }\n //download file\n $package_zip = (string)FileHandler::system('package.zip');\n $fp = fopen($package_zip, 'w');\n $ch = curl_init($to_install[\"dist\"][\"url\"]);\n curl_setopt($ch, CURLOPT_TIMEOUT, 50);\n curl_setopt($ch, CURLOPT_FILE, $fp);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');\n curl_exec($ch);\n curl_close($ch);\n fclose($fp);\n //extract package.zip\n $zip=new \\ZipArchive;\n $zip->open($package_zip);\n $zip->extractTo($package_directory);\n //remove zip\n unlink($package_zip);\n //add .exclude file\n $package_sub->file(\".exclude\")->write('');\n //get existing installed version\n $prev_versions = $package_directory->directories();\n //remove any existing key from autoload\n $prev_version_found = false;\n foreach($prev_versions as $prev_version) {\n $prev_version_name = $prev_version->name();\n if(($prev_version_name!==\"$name-$id\")&&isset(self::$_autoload[$prev_version_name])) {\n $prev_version_found = $prev_version_name;\n unset(self::$_autoload[$prev_version_name]);\n }\n }\n //let the user know the previous version has been removed from autoload\n if($prev_version_found!==false) {\n echo \"A previously installed version was detected and removed from the autoload.json in favor of the new version. The package files still exist in Libs/Packagist/$name/$prev_version_found\\n\";\n }\n //add autoload\n $classmap=[];\n if(isset($to_install['autoload'])) {\n // go through autoload\n foreach($to_install['autoload'] as $spec => $mapping) {\n if($spec=='classmap') {\n // loop through the files and fetch the fully qualified classnames\n // through regex\n foreach($mapping as $file) {\n // can also be directory\n $d=$package_sub->directory($file);\n $f=$package_sub->file($file, substr_count($file, '.'));\n if($d->exists()) {\n // look up files inside directory\n $d_files = $d->files(true);\n foreach($d_files as $d_f) {\n $classes = $d_f->classes();\n foreach($classes as $class) {\n $source = substr(\"$d_f\", strlen(\"$d\")+1);\n $classmap[$class]=\"$file/$source\";\n }\n }\n } else {\n $classes=$f->classes();\n foreach($classes as $class) {\n $classmap[$class]=$file;\n }\n }\n }\n } else if($spec=='files') {\n if(!isset($classmap['files'])) {\n $classmap['files']=[];\n }\n foreach($mapping as $file) {\n $classmap['files'][]=$file;\n }\n } else {\n // psr -> go through mapping\n foreach($mapping as $prefix => $source) {\n // get all files in source\n $directory=$package_sub->directory($source);\n $files=$directory->files(true);\n // loop through files and add to class mapping\n foreach($files as $file) {\n $classes=$file->classes();\n foreach($classes as $class) {\n $classmap[$class]=$source.substr($file, strlen($directory));\n }\n }\n }\n }\n }\n self::$_autoload[\"$name-$id\"] = $classmap; }\n\n self::$_packages[$package_name]='^'.trim($to_install[\"version\"], 'v');\n self::save();\n return true;\n }\n }\n return false;\n }", "public function fetchAllZf2Changelogs()\n {\n $data = array();\n $this->console->writeLine(\"Fetching list of all tags\");\n\n if ($this->githubToken) {\n $httpRequest = $this->httpClient->getRequest();\n $httpRequest->getHeaders()->addHeaderLine('Authorization', 'token ' . $this->githubToken);\n }\n\n $uri = sprintf(self::GITHUB_TAGS, 'zf2');\n $this->httpClient->setUri($uri);\n\n $response = $this->httpClient->send();\n\n if (!$response->isOk()) {\n $this->emitError(sprintf('Received response code %d with body %s', $response->getStatusCode(), $response->getBody()));\n return;\n }\n\n $tags = json_decode($response->getBody());\n foreach ($tags as $info) {\n $tag = $info->name;\n if (preg_match('/dev(?:el)?(?:\\d+(?:[a-z]+)?)?$/', $tag)) {\n // skip development tags\n continue;\n }\n \n $tagData = $this->fetchGithubChangelog('zf2', $tag);\n\n if (!$tagData) {\n return;\n }\n\n $tag = str_replace('release-', '', $tag);\n $data[$tag] = $tagData;\n }\n \n $fileContent = \"<\" . \"?php\\n\\$tags = \" \n . var_export($data, 1) \n . \";\\nreturn \\$tags;\";\n \n $this->console->writeLine(\"Writing to {$this->zf2DataFile}\");\n file_put_contents($this->zf2DataFile, $fileContent);\n\n $this->console->writeLine('[DONE]', Color::GREEN);\n }", "public function getAllPackageVersions(\n string $project,\n string $repository,\n string $packageName,\n array $request,\n array $response = []\n ): array {\n $uri = 'projects/{project}/packages/repositories/{repository}/packages/name:{packageName}/versions';\n $required = [\n 'query' => self::TYPE_STRING,\n 'sortColumn' => self::TYPE_STRING,\n 'sortOrder' => self::TYPE_STRING,\n ];\n $this->throwIfInvalid($required, $request);\n $uriArguments = [\n 'project' => $project,\n 'repository' => $repository,\n 'packageName' => $packageName,\n ];\n\n return $this->client->get($this->buildUrl($uri, $uriArguments), $response, $request);\n }", "public function _updateFeeds()\n\t{\n\t\t$EE =& get_instance();\n\n\t\trequire PATH_THIRD . \"nsm_addon_updater/libraries/Epicurl.php\";\n\n\t\t$sources = FALSE;\n\t\t$feeds = FALSE;\n\t\t$mc = EpiCurl::getInstance();\n\n\t\tforeach($EE->addons->_packages as $addon_id => $addon)\n\t\t{\n\t\t\t$config_file = PATH_THIRD . '/' . $addon_id . '/config.php';\n\n\t\t\tif(!file_exists($config_file))\n\t\t\t\tcontinue;\n\n\t\t\tinclude $config_file;\n\n\t\t\t# Is there a file with the xml url?\n\t\t\tif(isset($config['nsm_addon_updater']['versions_xml']))\n\t\t\t{\n\t\t\t\t$url = $config['nsm_addon_updater']['versions_xml'];\n\n\t\t\t\t# Get the XML again if it isn't in the cache\n\t\t\t\tif($this->test_mode || ! $xml = $this->_readCache(md5($url)))\n\t\t\t\t{\n\n\t\t\t\t\tlog_message('debug', \"Checking for updates via CURL: {$addon_id}\");\n\n\t\t\t\t\t$c = FALSE;\n\t\t\t\t\t$c = curl_init($url);\n\t\t\t\t\tcurl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\t\t@curl_setopt($c, CURLOPT_FOLLOWLOCATION, 1);\n\t\t\t\t\t$curls[$addon_id] = $mc->addCurl($c);\n\t\t\t\t\t$xml = FALSE;\n\t\t\t\t\tif($curls[$addon_id]->code == \"200\" || $curls[$addon_id]->code == \"302\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$xml = $curls[$addon_id]->data;\n\t\t\t\t\t\t$this->_createCacheFile($xml, md5($url));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t# If there isn't an error with the XML\n\t\t\tif($xml = @simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA))\n\t\t\t{\n\t\t\t\t$feeds[$addon_id] = $xml;\n\t\t\t}\n\n\t\t\tunset($config);\n\t\t}\n\n\t\treturn $feeds;\n\t}", "public function GetVersionInfo(&$args) {\n $composer = json_decode(file_get_contents(__DIR__ . '/../composer.json'));\n $args['commit'] = file_get_contents(__DIR__ . '/../version.txt');\n $args['version'] = 'git';\n $args['copy'] = '&copy; <a href=\"'.\n $composer->homepage.\n '\" target=\"_blank\">'.\n $composer->authors[0]->name.\n \"</a> \".\n date('Y').\n \". All rights reserved.\";\n }", "protected function check_update() {\n\n\t\t$response = $this->remote_query();\n\n\t\tif ( ! $response ) {\n\t\t\treturn array( 'version' => false );\n\t\t}\n\n\t\tif ( version_compare( $this->api['version'], $response->version, '<' ) ) {\n\t\t\treturn array(\n\t\t\t\t'version' => $response->version,\n\t\t\t\t'package' => $response->package,\n\t\t\t);\n\t\t}\n\n\t\treturn array( 'version' => false );\n\n\t}", "function getCurrentVersion() {\n return json_decode(file_get_contents(storage_path('app/version.json')), true);\n}", "function source_handle_on_daily() {\n \n require_once(ANGIE_PATH.'/classes/xml/xml2array.php');\n \n $results = 'Repositories updated: ';\n \n $repositories = Repositories::findByUpdateType(REPOSITORY_UPDATE_DAILY);\n foreach ($repositories as $repository) {\n // don't update projects other than active ones\n $project = Projects::findById($repository->getProjectId());\n if ($project->getStatus() !== PROJECT_STATUS_ACTIVE) {\n continue;\n } // if\n \n $repository->loadEngine();\n $repository_engine = new RepositoryEngine($repository, true);\n \n $last_commit = $repository->getLastCommit();\n $revision_to = is_null($last_commit) ? 1 : $last_commit->getRevision();\n \n $logs = $repository_engine->getLogs($revision_to);\n \n if (!$repository_engine->has_errors) {\n $repository->update($logs['data']);\n $total_commits = $logs['total'];\n \n $results .= $repository->getName().' ('.$total_commits.' new commits); ';\n \n if ($total_commits > 0) {\n $repository->sendToSubscribers($total_commits, $repository_engine);\n $repository->createActivityLog($total_commits);\n } // if\n } // if\n \n } // foreach\n \n return is_foreachable($repositories) && count($repositories) > 0 ? $results : 'No repositories for daily update';\n }", "public function testRefreshRepository(string $fixturesSet, array $expectedUpdatedVersions): void\n {\n $expectedStartVersion = static::getFixtureClientStartVersions($fixturesSet);\n // Use the memory storage used so tests can write without permanent\n // side-effects.\n $this->localRepo = $this->memoryStorageFromFixture($fixturesSet, 'tufclient/tufrepo/metadata/current');\n $this->testRepo = new TestRepo($fixturesSet);\n\n $this->assertClientRepoVersions($expectedStartVersion);\n $updater = $this->getSystemInTest($fixturesSet);\n $this->assertTrue($updater->refresh($fixturesSet));\n // Confirm the local version are updated to the expected versions.\n $this->assertClientRepoVersions($expectedUpdatedVersions);\n\n // Create another version of the client that only starts with the root.json file.\n $this->localRepo = $this->memoryStorageFromFixture($fixturesSet, 'tufclient/tufrepo/metadata/current');\n $this->testRepo = new TestRepo($fixturesSet);\n foreach (array_keys($expectedStartVersion) as $role) {\n if ($role !== 'root') {\n // Change the expectation that client will not start with any files other than root.json.\n $expectedStartVersion[$role] = null;\n // Remove all files except root.json.\n unset($this->localRepo[\"$role.json\"]);\n }\n }\n $this->assertClientRepoVersions($expectedStartVersion);\n $updater = $this->getSystemInTest($fixturesSet);\n $this->assertTrue($updater->refresh());\n // Confirm that if we start with only root.json all of the files still\n // update to the expected versions.\n $this->assertClientRepoVersions($expectedUpdatedVersions);\n }", "function currentVersion()\n{\n $curl = curl_init('https://plex.tv/api/downloads/1.json?channel=plexpass');\n // Set the options for this request\n curl_setopt_array($curl, array(\n CURLOPT_FOLLOWLOCATION => true, // Yes, we want to follow a redirect\n CURLOPT_RETURNTRANSFER => true, // Yes, we want that curl_exec returns the fetched data\n CURLOPT_TIMEOUT => 8,\n CURLOPT_SSL_VERIFYPEER => true,\n ));\n // Fetch the data from the URL\n $data = curl_exec($curl);\n // Close the connection\n curl_close($curl);\n $data = json_decode($data, TRUE);\n return $data['computer']['Linux']['version'];\n //return $data;\n}", "public function get_repositories(){\n\t\t\n\t\t$repos = array();\n\t\t$res = $this->request_api('GET', 'user/repositories', $params = array());\n\t\tif( !empty($res['response']) ){\n\t\t\t$repos = json_decode($res['response']);\n\t\t}\n\t\t\n\t\t//pa($repos,1);\n\t\treturn $repos;\n\t}", "public function get_library_updates() {\n if (get_option('h5p_hub_is_enabled', TRUE) || get_option('h5p_send_usage_statistics', TRUE)) {\n $core = $this->get_h5p_instance('core');\n $core->fetchLibrariesMetadata();\n }\n }", "public function syncPackageDetails(Download $download) {\n\t\treturn elgg_call(ELGG_IGNORE_ACCESS | ELGG_SHOW_DISABLED_ENTITIES, function () use ($download) {\n\t\t\t$name = $download->{'github:package_name'};\n\t\t\tif (!$name) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$owner = $download->getOwnerEntity();\n\t\t\tif (!$owner instanceof \\ElggUser) {\n\t\t\t\tunset($download->{'github:package_name'});\n\t\t\t\tunset($download->{'composer:package_name'});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->query->authenticate($download->getOwnerEntity());\n\n\t\t\t$package = $this->query->getPackage($name);\n\t\t\tif (!$package) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!$download->title) {\n\t\t\t\t$download->title = $package['name'];\n\t\t\t}\n\n\t\t\tif (!$download->excerpt) {\n\t\t\t\t$download->excerpt = $package['description'];\n\t\t\t}\n\n\t\t\tif (!$download->description) {\n\t\t\t\tforeach (['README.md', 'readme.md', 'readme', 'readme.txt', 'README.txt'] as $path) {\n\t\t\t\t\t$readme = $this->query->getFile($name, $path);\n\t\t\t\t\tif ($readme) {\n\t\t\t\t\t\t$description = MarkdownExtra::defaultTransform($readme);\n\t\t\t\t\t\t$download->description = $description;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!$download->changelog) {\n\t\t\t\tforeach (['CHANGELOG.md', 'changelog.md', 'changelog'] as $path) {\n\t\t\t\t\t$changelog = $this->query->getFile($name, $path);\n\t\t\t\t\tif ($changelog) {\n\t\t\t\t\t\t$changelog = htmlspecialchars($changelog);\n\t\t\t\t\t\t$changelog = MarkdownExtra::defaultTransform($changelog);\n\t\t\t\t\t\t$download->changelog = $changelog;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$download->{'composer.json'} = $this->query->getFile($name, 'composer.json');\n\t\t\tif ($download->{'composer.json'}) {\n\t\t\t\t$composer = json_decode($download->{'composer.json'});\n\t\t\t\t$download->{'composer:package_name'} = $composer->name;\n\t\t\t\tif (!$download->tags) {\n\t\t\t\t\t$download->tags = $composer->keywords;\n\t\t\t\t}\n\n\t\t\t\tif ($composer->type === 'elgg-plugin') {\n\t\t\t\t\t$download->{'manifest.xml'} = $this->query->getFile($name, 'manifest.xml');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$download->{'package.json'} = $this->query->getFile($name, 'package.json');\n\n\t\t\t$this->query->authenticate();\n\t\t});\n\t}", "protected function pickRepos(InputInterface $input, OutputInterface $output) {\n $repos = [];\n if ($feedUrl = $input->getOption('git-feed')) {\n $schemes = preg_match(';^file://;', $feedUrl)\n ? ['https', 'http', 'git', 'file']\n : ['https', 'http', 'git'];\n $repos = array_merge($repos, $this->getFilteredFeed($output, $feedUrl, 'ready', $schemes));\n }\n if ($repoDirs = $input->getArgument('git-repos')) {\n $repos = array_merge($repos, $this->getRepos($output, $repoDirs));\n }\n usort($repos, function ($a, $b) {\n return strcmp($a['key'], $b['key']);\n });\n if ($input->getOption('limit')) {\n $repos = array_slice($repos, 0, $input->getOption('limit'));\n return $repos;\n }\n return $repos;\n }", "function checkVersions() {\n //TODO: Put the version checker service online instead of localhost\n $curl_request = curl_init(\"0.0.0.0:3002\");\n\n //By default the request type is \"GET\"\n curl_setopt_array($curl_request, array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_CONNECTTIMEOUT => 10, //Must connect within 10 seconds\n CURLOPT_TIMEOUT => 20, //Must finish the whole request in 20 seconds... or else\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_2_0, //Falls back to 1.1 if 2.0 won't work\n ));\n\n //Get a response or a returned error (or if failed to connect)\n $response = curl_exec($curl_request);\n $err = curl_error($curl_request);\n //Don't needlessly call logMsg if no error was thrown:\n if(isset($err)) {\n logMsg($err);\n curl_close($curl_request);\n return false;\n }\n\n //A sample successful response body would look like this: \"7.3.1 1.0.3\"\n //where \"7.3.1\" is the PHP version and \"1.0.3\" is the Web Mill version.\n\n //Close the connection and free up $curl_request's resources:\n curl_close($curl_request);\n\n //Put the PHP version and Web Mill version into an array\n //They are currently separated by a space:\n $versions = explode(\" \", $response);\n return $versions;\n }", "public function calculateLatestVersions(Package &$package)\n {\n $versions = $package->getVersions();\n\n foreach ($versions as $version) {\n\n $functionName = 'Unstable';\n if ('stable' == $this->parseStability($version->getVersion())) {\n $functionName = 'Stable';\n }\n\n if ($version->getVersion() > $package->{'getLatest' . $functionName . 'Version'}()) {\n $package->{'setLatest' . $functionName . 'Version'}($version->getVersion());\n }\n }\n\n return $package;\n }", "function rpull() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path, BR;\n\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\ttry {\n\t\t\t\t$exists = $this->rexists($deployPath);\n\t\t\t\tif ($exists) {\n\t\t\t\t\t$remoteCmd = 'cd ' . $deployPath . ' && hg pull';\n\t\t\t\t\t$this->ssh_exec($remoteCmd);\n\t\t\t\t} else {\n\t\t\t\t\techo TAB, '*** path ', $deployPath, ' does not exist', BR;\n\t\t\t\t}\n\t\t\t} catch (\\SystemCommandException $e) {\n\t\t\t\techo 'Error: '.$e, BR;\n\t\t\t}\n\t\t}\n\t}", "protected function composerUpdate()\n {\n $this->runCommand(['composer', 'update'], getcwd(), $this->output);\n }", "function get_pkg_info($pkgs = 'all', $remote_repo_usage_disabled = false,\n $installed_pkgs_only = false) {\n\tglobal $g, $input_errors;\n\n\t$out = $err = $extra_param = '';\n\t$rc = 0;\n\n\tunset($pkg_filter);\n\n\tif (is_array($pkgs)) {\n\t\t$pkg_filter = $pkgs;\n\t\t$pkgs = g_get('pkg_prefix') . '*';\n\t} elseif ($pkgs == 'all') {\n\t\t$pkgs = g_get('pkg_prefix') . '*';\n\t}\n\n\t$base_packages = (substr($pkgs, 0, strlen(g_get('pkg_prefix'))) !=\n\t g_get('pkg_prefix'));\n\n\tif ($installed_pkgs_only && !is_pkg_installed($pkgs)) {\n\t\t/*\n\t\t * Return early if the caller wants just installed packages\n\t\t * and there are none. Saves doing any calls that might\n\t\t * access a remote package repo.\n\t\t */\n\t\treturn array();\n\t}\n\n\tif (!function_exists('is_subsystem_dirty')) {\n\t\trequire_once(\"util.inc\");\n\t}\n\n\t/* Do not run remote operations if pkg has a lock */\n\tif (is_subsystem_dirty('pkg')) {\n\t\t$remote_repo_usage_disabled = true;\n\t\t$lock = false;\n\t} else {\n\t\t$lock = true;\n\t}\n\n\tif ($lock) {\n\t\tmark_subsystem_dirty('pkg');\n\t}\n\n\tif ($remote_repo_usage_disabled) {\n\t\t$extra_param = \"-U \";\n\t}\n\n\t$did_search = false;\n\t$search_rc = 0;\n\t$info_rc = 0;\n\t$search_items = array();\n\t$info_items = array();\n\n\tif ($base_packages) {\n\t\t$repo_param = \"\";\n\t} else {\n\t\t$repo_param = \"-r {$g['product_name']}\";\n\t}\n\n\t/*\n\t * If we want more than just the currently installed packages or\n\t * we want up-to-date remote repo info then do a full pkg search\n\t */\n\tif (!$installed_pkgs_only || !$remote_repo_usage_disabled) {\n\t\t$did_search = true;\n\t\t/* Update the repository access credentials. */\n\t\tmwexec(\"/usr/local/sbin/{$g['product_name']}-repo-setup\");\n\t\t$search_rc = pkg_exec(\"search {$repo_param} \" .\n\t\t \"{$extra_param}-R --raw-format json-compact \" .\n\t\t $pkgs, $search_out, $search_err);\n\t\tif ($search_rc == 0) {\n\t\t\t$search_items = explode(\"\\n\", chop($search_out));\n\t\t\tarray_walk($search_items, function(&$v, &$k) {\n\t\t\t\t$v = json_decode($v, true);\n\t\t\t});\n\t\t}\n\t}\n\n\t/*\n\t * We always should look for local items to detect packages that\n\t * were removed from remote repo but are already installed locally\n\t *\n\t * Take pkg search return code into consideration to fallback to local\n\t * information when remote repo is not accessible\n\t */\n\tif (is_pkg_installed($pkgs) || $search_rc != 0) {\n\t\t$info_rc = pkg_exec(\"info -R --raw-format json-compact \" .\n\t\t $pkgs, $info_out, $info_err);\n\t\tif ($info_rc == 0) {\n\t\t\t$info_items = explode(\"\\n\", chop($info_out));\n\t\t\tarray_walk($info_items, function(&$v, &$k) {\n\t\t\t\t$v = json_decode($v, true);\n\t\t\t});\n\t\t}\n\t}\n\n\tif ($lock) {\n\t\tclear_subsystem_dirty('pkg');\n\t}\n\n\tif ($search_rc != 0 && $info_rc != 0) {\n\t\tupdate_status(\"\\n\" . gettext(\n\t\t \"ERROR: Error trying to get packages list. Aborting...\")\n\t\t . \"\\n\");\n\t\tupdate_status($search_err . \"\\n\" . $info_err);\n\t\t$input_errors[] = gettext(\n\t\t \"ERROR: Error trying to get packages list. Aborting...\") .\n\t\t \"\\n\";\n\t\t$input_errors[] = $search_err . \"\\n\" . $info_err;\n\t\treturn array();\n\t}\n\n\t/* It was not possible to search, use local information only */\n\tif ($search_rc != 0 || !$did_search) {\n\t\t$search_items = $info_items;\n\t} else {\n\t\tforeach ($info_items as $pkg_info) {\n\t\t\tif (empty($pkg_info['name'])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (array_search($pkg_info['name'], array_column(\n\t\t\t $search_items, 'name')) === FALSE) {\n\t\t\t\t$pkg_info['obsolete'] = true;\n\t\t\t\t$search_items[] = $pkg_info;\n\t\t\t}\n\t\t}\n\t}\n\n\t$result = array();\n\tforeach ($search_items as $pkg_info) {\n\t\tif (empty($pkg_info['name'])) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (isset($pkg_filter) && !in_array($pkg_info['name'],\n\t\t $pkg_filter)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$pkg_info['shortname'] = $pkg_info['name'];\n\t\tpkg_remove_prefix($pkg_info['shortname']);\n\n\t\t/* XXX: Add it to globals.inc? */\n\t\t$pkg_info['changeloglink'] =\n\t\t \"https://github.com/pfsense/FreeBSD-ports/commits/devel/\" .\n\t\t $pkg_info['categories'][0] . '/' . $pkg_info['name'];\n\n\t\t$pkg_is_installed = false;\n\n\t\tif (is_pkg_installed($pkg_info['name'])) {\n\t\t\t$rc = pkg_exec(\"query %R {$pkg_info['name']}\", $out,\n\t\t\t $err);\n\t\t\tif (!$base_packages &&\n\t\t\t rtrim($out) != g_get('product_name')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$pkg_info['installed'] = true;\n\t\t\t$pkg_is_installed = true;\n\n\t\t\t$rc = pkg_exec(\"query %v {$pkg_info['name']}\", $out,\n\t\t\t $err);\n\n\t\t\tif ($rc != 0) {\n\t\t\t\tupdate_status(\"\\n\" . gettext(\"ERROR: Error \" .\n\t\t\t\t \"trying to get package version. \" .\n\t\t\t\t \"Aborting...\") . \"\\n\");\n\t\t\t\tupdate_status($err);\n\t\t\t\t$input_errors[] = gettext(\"ERROR: Error \" .\n\t\t\t\t \"trying to get package version. \" .\n\t\t\t\t \"Aborting...\") . \"\\n\";\n\t\t\t\t$input_errors[] = $err;\n\t\t\t\treturn array();\n\t\t\t}\n\n\t\t\t$pkg_info['installed_version'] = str_replace(\"\\n\", \"\",\n\t\t\t $out);\n\n\t\t\t/*\n\t\t\t * We used pkg info to collect pkg data so remote\n\t\t\t * version is not available. Lets try to collect it\n\t\t\t * using rquery if possible\n\t\t\t */\n\t\t\tif ($search_rc != 0 || !$did_search) {\n\t\t\t\t$rc = pkg_exec(\n\t\t\t\t \"rquery -U %v {$pkg_info['name']}\", $out,\n\t\t\t\t $err);\n\n\t\t\t\tif ($rc == 0) {\n\t\t\t\t\t/*\n\t\t\t\t\t * just consider the first line of output from rquery\n\t\t\t\t\t * ref: https://github.com/freebsd/pkg/issues/2164\n\t\t\t\t\t */\n\t\t\t\t\t$pkg_info['version'] = explode(\"\\n\", $out)[0];\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if (is_package_installed($pkg_info['shortname'])) {\n\t\t\t$pkg_info['broken'] = true;\n\t\t\t$pkg_is_installed = true;\n\t\t}\n\n\t\t$pkg_info['desc'] = preg_replace('/\\n+WWW:.*$/', '',\n\t\t $pkg_info['desc']);\n\n\t\tif (!$installed_pkgs_only || $pkg_is_installed) {\n\t\t\t$result[] = $pkg_info;\n\t\t}\n\t\tunset($pkg_info);\n\t}\n\n\t/* Sort result alphabetically */\n\tusort($result, function($a, $b) {\n\t\treturn(strcasecmp ($a['name'], $b['name']));\n\t});\n\n\treturn $result;\n}", "public function fetchInstalledPHPVersions() : array {\n $queryBuilder = $this->httpClient->queryStringBuilder();\n $queryBuilder->addParameter(\"program\", \"list-php-versions\");\n $queryBuilder->addParameter(\"name-only\");\n\n $this->httpClient->sendRequest();\n\n return $this->httpClient->getResponseMessage()->data;\n }", "public function install(Event $event) {\n $composer = $event->getComposer();\n\n $installed_json_file = new JsonFile($this->getInstalledJsonPath(), NULL, $this->io);\n\n $installed = NULL;\n if ($installed_json_file->exists()) {\n $installed = $installed_json_file->read();\n }\n\n // Reset if the schema doesn't match the current version.\n if (!isset($installed['schema-version']) || $installed['schema-version'] !== static::SCHEMA_VERSION) {\n $installed = [\n 'schema-version' => static::SCHEMA_VERSION,\n 'installed' => [],\n ];\n }\n\n $applied_drupal_libraries = $installed['installed'];\n\n // Process the root package first.\n $root_package = $composer->getPackage();\n $processed_drupal_libraries = $this->processPackage([], $applied_drupal_libraries, $root_package);\n\n // Process libraries declared in dependencies.\n if (!empty($root_package->getExtra()['drupal-libraries-dependencies'])) {\n $allowed_dependencies = $root_package->getExtra()['drupal-libraries-dependencies'];\n $local_repo = $composer->getRepositoryManager()->getLocalRepository();\n foreach ($local_repo->getCanonicalPackages() as $package) {\n if (\n $allowed_dependencies === TRUE ||\n (is_array($allowed_dependencies) && in_array($package->getName(), $allowed_dependencies, TRUE))\n ) {\n if (!empty($package->getExtra()['drupal-libraries'])) {\n $processed_drupal_libraries += $this->processPackage(\n $processed_drupal_libraries,\n $applied_drupal_libraries,\n $package\n );\n }\n }\n }\n }\n\n // Remove unused libraries from disk before attempting to download new ones.\n // Avoids the edge-case where the removed folder happens to be the same as the one where the new one is being\n // installed to.\n $removed_libraries = array_diff_key($applied_drupal_libraries, $processed_drupal_libraries);\n if ($removed_libraries) {\n $this->removeUnusedLibraries($removed_libraries);\n }\n\n // Attempt to download the libraries.\n $this->downloadLibraries($processed_drupal_libraries, $applied_drupal_libraries);\n\n // Write the lock file to disk.\n if ($this->io->isDebug()) {\n $this->io->write(static::PACKAGE_NAME . ':');\n $this->io->write(\n sprintf(' - Writing to %s', $this->fileSystem->normalizePath($installed_json_file->getPath()))\n );\n }\n\n $installed['installed'] = $processed_drupal_libraries;\n $installed_json_file->write($installed);\n }", "public static function fetch_github()\n {\n $username = Config::get('ProjectLister::username');\n\n $projects = array();\n\n $url = \"https://api.github.com/users/$username/repos\";\n $json = Utility::get($url);\n\n if(!is_array($json = json_decode($json)))\n return FALSE;\n\n foreach($json as $repo)\n {\n $proj = new ProjectLister;\n $proj->url = $repo->html_url;\n $proj->name = $repo->name;\n $proj->description = $repo->description;\n $proj->watchers = $repo->watchers;\n $proj->source = \"GitHub\";\n $proj->watcher_noun = ($repo->watchers == 1 ? 'watcher' : 'watchers');\n $proj->updated = strtotime($repo->pushed_at);\n\n $projects[] = $proj;\n }\n\n return $projects;\n }", "public function getUpdatesList($force = false)\n {\n static $result;\n\n if ($result) {\n return $result;\n }\n\n $result = [\n 'core' => [],\n 'theme' => [],\n 'widget' => [],\n 'module' => [],\n ];\n\n $setting = setting();\n\n if ($force || ($setting->api_checked_at && $setting->api_checked_at->diffInHours() >= 12)) {\n $this->updateVersionsFromApi();\n }\n\n $packages = Package::all();\n $componentsVersions = $this->getPackagesVersions();\n\n foreach ($packages as $package) {\n if (array_get($componentsVersions, $package->type.'.'.$package->namespace) == $package->api_version) {\n continue;\n }\n\n $result[$package->type][$package->namespace] = [\n 'namespace' => $package->namespace,\n 'date' => $package->date,\n 'version' => $package->api_version,\n ];\n }\n\n return $result;\n }", "public function getApiVersions()\n {\n $version = array(\n \"2006-03-01\" => \"2006-03-01 (default)\",\n \"latest\" => \"latest\",\n );\n return $version;\n }", "public function multiple_update_package()\n\t{\n\t\t$this->breadcrumbs->unshift(2, 'Service And Package', 'master/package');\n\t\t$this->breadcrumbs->unshift(3, 'Update Package', \"master/getpackage\");\n\n\t\t$this->page_title->push('Master', 'Update Package');\n\n\t\t$this->data = array(\n\t\t\t'title' => \"Update Package\",\n\t\t\t'breadcrumb' => $this->breadcrumbs->show(),\n\t\t\t'page_title' => $this->page_title->show(),\n\t\t\t'js' => $this->load->get_js_files(),\n\t\t\t'rooms' => $this->package->getRoom()\n\t\t);\n\t\t$this->template->view('multiple_update_package', $this->data);\n\t}", "function githubDownload($date){\n global $githubOutput;\n\n $githubOutput = array();\n $githubUrl = \"https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/{$date}.csv\";\n\n $init = curl_init();\n curl_setopt($init,CURLOPT_URL,$githubUrl);\n curl_setopt($init,CURLOPT_SSL_VERIFYPEER,false);\n curl_setopt($init,CURLOPT_VERBOSE,true);\n curl_setopt($init,CURLOPT_RETURNTRANSFER,true);\n curl_setopt($init,CURLOPT_CONNECTTIMEOUT,15);\n\n $curl = curl_exec($init);\n\n if (!curl_errno($init)) {\n $lines = array_filter(explode(PHP_EOL, $curl));\n $first_line = str_getcsv($lines[0]);\n $first_line = str_replace(\"_\",\"/\",$first_line);\n $first_line = str_replace(array(\"Last Update\",\"Last_Update\",\"Last/Update\"),array(\"Update\",\"Update\",\"Update\"),$first_line);\n\n //riadky v csv\n for ($i = 1; $i < count($lines); $i++) {\n $line = str_getcsv($lines[$i]);\n $result = array();\n\n //polozky v riadku\n foreach ($line as $key => $val) {\n $needles = array(\",\",\"&\",\"'\");\n $newValues = array(\"\",\"\\&\",\"´\");\n $lineItem = str_replace($needles,$newValues,trim($val));\n\n //ulozenie nacitanych dat do pola\n if (strpos($first_line[$key],\"State\")!== false) {\n $result[\"State\"] = trim($lineItem);\n }\n if (strpos($first_line[$key],\"Country\")!== false) {\n $result[\"Country\"] = trim($lineItem);\n }\n if (strpos($first_line[$key],\"Update\")!== false) {\n $result[\"Update\"] = trim($lineItem);\n }\n if (strpos($first_line[$key],\"Confirmed\")!== false) {\n $result[\"Confirmed\"] = (int)$lineItem;\n }\n if (strpos($first_line[$key],\"Deaths\")!== false) {\n $result[\"Deaths\"] = (int)$lineItem;\n }\n if (strpos($first_line[$key],\"Recovered\")!== false) {\n $result[\"Recovered\"] = (int)$lineItem;\n }\n $result[\"ReportDate\"] =str_replace(\"-\",\"/\",$date);\n }\n //do $githubOutput sa zapise novy zaznam = riadok\n array_push($githubOutput, $result);\n }\n //uprava dat\n fixGithubData();\n }\n}", "abstract protected function getRepoReleaseInfo();", "public function Index() {\n\t\t$this->checkLogin();\n\n\t\t$servicesCheckVersionUrl = $this->Setting->get('services_check_version_url');\n\t\t$servicesData = @file_get_contents($servicesCheckVersionUrl);\n\t\tif (!$servicesData) {\n\t\t\tdie('Network error, can not load newest version from cloud!');\n\t\t}\n\t\t$servicesData = json_decode($servicesData);\n\t\tif (!$servicesData OR !is_object($servicesData) OR !$servicesData->current_version) {\n\t\t\tdie('Cloud data error! Please try again!');\n\n\t\t}\n\t\t$servicesVersion = $servicesData->current_version;\n\t\t$currentVerion = $this->Setting->get('version');\n\n\t\t$compare = version_compare($servicesVersion, $currentVerion);\n\n\t\tif ($compare < 0) {\n\t\t\tdie('Opp! System things you have some problem!');\n\t\t}\n\n\t\tif ($compare == 0) {\n\t\t\tdie('No thing to update, your system is current newest verion, relaxing!');\n\t\t}\n\n\t\t$downloadFile = $servicesData->file;\n\t\tif (!$this->_downloadUpdatePack($downloadFile)) {\n\t\t\tdie('System can not reach to update pack :( ');\n\t\t}\n\n\t\tprint_r($compare);die;\n\t}", "public function onPostUpdateInstall(Event $event)\n {\n $extra = $event->getComposer()->getPackage()->getExtra();\n\n $installDev = $event->isDevMode();\n $isWin = $this->isWinOs();\n $packagesList = array();\n $prefix = \"extra-require\";\n foreach (array(\"\", \"-dev\") as $dev) {\n foreach (array(\"\", \"-win\", \"-unix\") as $os) {\n $option = $prefix . $dev . $os;\n if (!isset($extra[$option])\n || ($dev && !$installDev)\n || ($os == \"-win\" && !$isWin)\n ) {\n continue;\n }\n\n $packagesList = array_merge($packagesList, $extra[$option]);\n }\n }\n\n $this->removeUnusedPackages($packagesList, $installDev);\n if (!empty($packagesList)) {\n $this->installPackages($packagesList, $installDev);\n }\n }", "function colormag_demo_importer_packages( $packages ) {\n\t$new_packages = array(\n\t\t'colormag-free' => array(\n\t\t\t'name' => __( 'ColorMag', 'colormag' ),\n\t\t\t'preview' => 'http://demo.themegrill.com/colormag/',\n\t\t),\n\t\t'colormag-beauty-blog' => array(\n\t\t\t'name' => __( 'ColorMag Beauty Blog', 'colormag' ),\n\t\t\t'preview' => 'https://demo.themegrill.com/colormag-beauty-blog/',\n\t\t),\n\t\t'colormag-business-magazine' => array(\n\t\t\t'name' => __( 'ColorMag Business Magazine', 'colormag' ),\n\t\t\t'preview' => 'https://demo.themegrill.com/colormag-business-magazine/',\n\t\t),\n\t\t'colormag-dark' => array(\n\t\t\t'name' => __( 'ColorMag Dark', 'colormag' ),\n\t\t\t'preview' => 'https://demo.themegrill.com/colormag-dark/',\n\t\t),\n\t\t'colormag-pro' => array(\n\t\t\t'name' => __( 'ColorMag Pro', 'colormag' ),\n\t\t\t'preview' => 'https://demo.themegrill.com/colormag-pro/',\n\t\t\t'pro_link' => 'https://themegrill.com/themes/colormag/',\n\t\t),\n\t\t'colormag-pro-fashion' => array(\n\t\t\t'name' => __( 'ColorMag Pro Fashion', 'colormag' ),\n\t\t\t'preview' => 'https://demo.themegrill.com/colormag-pro-fashion/',\n\t\t\t'pro_link' => 'https://themegrill.com/themes/colormag/',\n\t\t),\n\t\t'colormag-pro-technology' => array(\n\t\t\t'name' => __( 'ColorMag Pro Technology', 'colormag' ),\n\t\t\t'preview' => 'https://demo.themegrill.com/colormag-pro-technology/',\n\t\t\t'pro_link' => 'https://themegrill.com/themes/colormag/',\n\t\t),\n\t\t'colormag-pro-sports' => array(\n\t\t\t'name' => __( 'ColorMag Pro Sports', 'colormag' ),\n\t\t\t'preview' => 'https://demo.themegrill.com/colormag-pro-sports/',\n\t\t\t'pro_link' => 'https://themegrill.com/themes/colormag/',\n\t\t),\n\t\t'colormag-pro-recipes' => array(\n\t\t\t'name' => __( 'ColorMag Food Recipe', 'colormag' ),\n\t\t\t'preview' => 'https://demo.themegrill.com/colormag-pro-recipes/',\n\t\t\t'pro_link' => 'https://themegrill.com/themes/colormag/',\n\t\t),\n\t\t'colormag-pro-health-blog' => array(\n\t\t\t'name' => __( 'ColorMag Health Blog', 'colormag' ),\n\t\t\t'preview' => 'https://demo.themegrill.com/colormag-pro-health-blog/',\n\t\t\t'pro_link' => 'https://themegrill.com/themes/colormag/',\n\t\t),\n\t\t'colormag-pro-music' => array(\n\t\t\t'name' => __( 'ColorMag Pro Music', 'colormag' ),\n\t\t\t'preview' => 'https://demo.themegrill.com/colormag-pro-music/',\n\t\t\t'pro_link' => 'https://themegrill.com/themes/colormag/',\n\t\t),\n\t);\n\n\treturn array_merge( $new_packages, $packages );\n}", "public function searchPackages($name)\n {\n try {\n $url = $this->config->getBasePackagesUrl() . 'search/' . $name;\n $response = $this->githubClient->getHttpClient()->get($url);\n\n return json_decode($response->getBody(true), true);\n } catch (RequestException $e) {\n throw new RuntimeException(sprintf('Cannot get package list from %s.', str_replace('/packages/', '', $this->config->getBasePackagesUrl())));\n }\n }", "function checkForUpdate() {\n $cache_data = Terminus::getCache()->getData(\n 'latest_release',\n array('decode_array' => true)\n );\n if (!$cache_data\n || ((int)$cache_data['check_date'] < (int)strtotime('-7 days'))\n ) {\n $logger = Terminus::getLogger();\n try {\n $current_version = checkCurrentVersion();\n if (version_compare($current_version, TERMINUS_VERSION, '>')) {\n $logger->info(\n 'An update to Terminus is available. Please update to {version}.',\n array('version' => $current_version)\n );\n }\n } catch (\\Exception $e) {\n $logger->info($e->getMessage());\n $logger->info('Cannot retrieve current Terminus version.');\n }\n }\n}", "function getProjectList() {\n\n\t$outFileNew = \"/var/www/html/projectList.new\";\n\t$outFileOrig = \"/var/www/html/projectList.txt\";\n\t$repos = array();\n\t$lodRE = '/br_[0-9]+.[0-9]+.[0-9]+/';\n\t$github_repos_url = 'https://github.com/api/v2/json/repos/show/CanoeVentures'; \n\t$curlResponse = curlRequest($github_repos_url);\n\n\tif (empty($curlResponse)) {\n\t\tprint \"Sorry - no data was returned.<p>\";\n\t}\n\telse {\n\t\t$jsonResult = json_decode($curlResponse);\t\t\n\t\tforeach($jsonResult->repositories as $r) {\n\t\t\t$repos[] = $r->name;\t\n\t\t}\n\t}\n\tsort($repos);\n\t$valid_branch = \" \";\n $valid_tag = \" \";\n\t$fileHandle = fopen($outFileNew, 'w') or die(\"cannot open file \" . $outFileNew);\n\tforeach ($repos as $repo) {\n\t\t$curlResponse = curlRequest($github_repos_url . '/' . $repo . '/branches');\t\t\n\t\t$jsonResult = json_decode($curlResponse);\n\t\tsleep(2);\n\t\t\n\t\tforeach($jsonResult->branches as $key => $val) {\n\t\t\tif (preg_match($lodRE, $key)) {\n\t\t\t\t$valid_branch = \"true\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$valid_branch = \"false\";\n\t\t\t}\n\t\t}\n\t\tif ($valid_branch == \"true\") {\n\t\t\tfwrite($fileHandle, $repo . \"=enabled\\n\");\n\t\t\t$valid_branch = \"false\";\n\t\t}\n\t\telse {\n\t\t\tfwrite($fileHandle, $repo . \"=disabled\\n\");\n\t\t}\t\t\n\t}\n\tfclose($fileHandle);\n\t// may need to put in a semaphore here\n\tcopy($outFileNew, $outFileOrig);\n}", "protected function get_versions()\n\t{\n\t\t// determine the current versions\n\t\t$data = array(0 => '&nbsp;');\n\n\t\tforeach (\\Documentation\\Model_Version::query()->order_by('major', 'ASC')->order_by('minor', 'ASC')->order_by('branch', 'ASC')->get() as $version)\n\t\t{\n\t\t\t$data[$version->id] = $version->major.'.'.$version->minor.'/'.$version->branch;\n\t\t}\n\n\t\treturn $data;\n\t}", "public function getLockedRepository(bool $withDevReqs = false): LockArrayRepository\n {\n $lockData = $this->getLockData();\n $packages = new LockArrayRepository();\n\n $lockedPackages = $lockData['packages'];\n if ($withDevReqs) {\n if (isset($lockData['packages-dev'])) {\n $lockedPackages = array_merge($lockedPackages, $lockData['packages-dev']);\n } else {\n throw new \\RuntimeException('The lock file does not contain require-dev information, run install with the --no-dev option or delete it and run composer update to generate a new lock file.');\n }\n }\n\n if (empty($lockedPackages)) {\n return $packages;\n }\n\n if (isset($lockedPackages[0]['name'])) {\n $packageByName = [];\n foreach ($lockedPackages as $info) {\n $package = $this->loader->load($info);\n $packages->addPackage($package);\n $packageByName[$package->getName()] = $package;\n\n if ($package instanceof AliasPackage) {\n $packageByName[$package->getAliasOf()->getName()] = $package->getAliasOf();\n }\n }\n\n if (isset($lockData['aliases'])) {\n foreach ($lockData['aliases'] as $alias) {\n if (isset($packageByName[$alias['package']])) {\n $aliasPkg = new CompleteAliasPackage($packageByName[$alias['package']], $alias['alias_normalized'], $alias['alias']);\n $aliasPkg->setRootPackageAlias(true);\n $packages->addPackage($aliasPkg);\n }\n }\n }\n\n return $packages;\n }\n\n throw new \\RuntimeException('Your composer.lock is invalid. Run \"composer update\" to generate a new one.');\n }" ]
[ "0.63468957", "0.6128971", "0.5906176", "0.5762853", "0.5762853", "0.5762853", "0.575414", "0.5726493", "0.56422204", "0.55780244", "0.5555245", "0.5490769", "0.54845524", "0.54644066", "0.5426084", "0.5392912", "0.53787833", "0.5378026", "0.5365938", "0.53623855", "0.5354967", "0.5277754", "0.52657694", "0.52528715", "0.5244423", "0.523332", "0.5192437", "0.51521116", "0.5150266", "0.5141027", "0.51310337", "0.51177835", "0.5096997", "0.507366", "0.5069156", "0.5068346", "0.5042971", "0.500724", "0.49944854", "0.4983499", "0.49730307", "0.49640942", "0.49432662", "0.49423495", "0.49367827", "0.49364552", "0.4921947", "0.4913658", "0.4913658", "0.4896457", "0.4888742", "0.48852864", "0.48664185", "0.48641917", "0.4847197", "0.48445168", "0.48410422", "0.4818706", "0.48116398", "0.48084885", "0.48071432", "0.48007926", "0.47980905", "0.47964755", "0.47912458", "0.47671396", "0.4757139", "0.4755136", "0.47390604", "0.47283122", "0.4715592", "0.46860978", "0.46736532", "0.46642107", "0.46558267", "0.46468", "0.46391082", "0.46350417", "0.46267527", "0.4625641", "0.46215", "0.46157193", "0.46007645", "0.4594101", "0.45912865", "0.45911315", "0.45882222", "0.45838714", "0.458229", "0.45760342", "0.45756707", "0.45630726", "0.45600352", "0.4558718", "0.4545629", "0.45423338", "0.45408136", "0.45362732", "0.45252752", "0.4521029" ]
0.6538907
0
/ To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor.
function auth() { loadTemplate("login_template", "welcomePage"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __() {\n }", "public function library()\n\t{\n\t\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "private function _i() {\n }", "public function main()\r\n {\r\n \r\n }", "public function main()\n\t{\n\t}", "public function __construct ()\n { // TODO Auto-generated constructor\n }", "function __construct()\r\n\t{\t\t//Yeah bro! Freaking PhP yo..\r\n\t}", "private function __construct( )\n {\n\t}", "private function __construct () \n\t{\n\t}", "public function package()\n\t{\n\t\t\n\t}", "public function main()\n {\n\n }", "function __construct() {\n\t\t\n\t//TODO - Insert your code here\n\t}", "private function j() {\n }", "private function __construct()\t{}", "private function __construct()\r\r\n {\r\r\n // TODO - Insert your code here\r\r\n }", "private function __construct() {\r\n\t\t\r\n\t}", "function __construct()\n\t{\n\t\t\n\t\t\n\t}", "public function __construct() {\n\n \t}", "private function __construct() {;}", "public function __construct ()\n {\n // TODO Auto-generated constructor\n }", "public function __construct ()\n {\n // TODO Auto-generated constructor\n }", "public function helper()\n\t{\n\t\n\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "private function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t// nothing to do\t\n\t}", "public function __construct()\r\n {\r\n // TODO Auto-generated constructor\r\n }", "public function __construct()\r\n {\r\n // TODO Auto-generated constructor\r\n }", "function init() {\n\t\t\n\t}", "private function __construct()\r\r\n\t{\r\r\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct()\n {\n // TODO Auto-generated constructor\n }", "public function __construct() {\r\n\t\t\r\n\t}", "private function __construct() \n {\n\t\t\n }", "private function __construct() { \n\t\t\n\n\t}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function ex4()\n {\n }", "function __construct()\r\n\t{\r\n\t\t\r\n\t}", "function __construct()\n\t{\n\t}", "function __construct()\n\t{\n\t}", "function __construct()\n\t{\n\t}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}", "public function main() {}" ]
[ "0.61105454", "0.6072232", "0.59959894", "0.59885836", "0.5949097", "0.59370124", "0.59295547", "0.58852404", "0.57794154", "0.5777335", "0.5754763", "0.5737722", "0.573144", "0.5720117", "0.5719703", "0.571485", "0.5707871", "0.5702033", "0.5667513", "0.56666225", "0.5659823", "0.5659823", "0.56462353", "0.5644097", "0.5644097", "0.564372", "0.56306297", "0.56304157", "0.56304157", "0.5625545", "0.56146514", "0.5612213", "0.5612213", "0.5612213", "0.5612213", "0.5612213", "0.5594542", "0.5594542", "0.5594542", "0.5594542", "0.5594542", "0.5594542", "0.5594542", "0.5594542", "0.55944085", "0.5593232", "0.55931425", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.558768", "0.55876225", "0.5587153", "0.5587152", "0.5587152", "0.5587152", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138", "0.5586138" ]
0.0
-1
=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=> A handler with which a specific file is searched for by conditions using callback <=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=
private function handlerFs(callable $handler): FinderInterface { $fs = $this->fs; foreach ($fs as $index => $value) { call_user_func($handler, $value, $index); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drush_drushutils_find_callback() {\n $matches = array();\n $match_type = drush_get_option('match');\n\n $args = drush_get_arguments();\n $path_to_find = $args[1];\n\n foreach (module_implements('menu') as $module) {\n $menu_callbacks = module_invoke($module, 'menu');\n if (!empty($menu_callbacks)) {\n foreach ($menu_callbacks as $path => $callback) {\n switch ($match_type) {\n case 'partial':\n if (FALSE !== strpos($path, $path_to_find)) {\n $matches[] = array($module, $path);\n }\n break;\n\n case 'full':\n default:\n if ($path == $path_to_find) {\n $matches[] = array($module, $path);\n continue 2;\n }\n break;\n }\n }\n }\n }\n _drushutils_output_results($matches, $match_type);\n}", "function find_file( $ServerID, $AsteriskID, $QMUserID, $QMUserName ) {\n\tglobal $FILE_FOUND;\n\tglobal $FILE_LISTEN_URL;\n\tglobal $FILE_LENGTH;\n\tglobal $FILE_ENCODING;\n\tglobal $FILE_DURATION;\n\n\t$FILE_FOUND = true;\n\n\t// if found single file...\n\t// note that the parameters returned are just strings, so you can put anything in them\n\t$FILE_LISTEN_URL = \"http://listennow.server/$ServerID/$AsteriskID/$QMUserID/$QMUserName\";\n\t$FILE_LENGTH = \"125k\";\n\t$FILE_ENCODING = \"mp3\";\t\n\t$FILE_DURATION = \"1:12\"; \t\n\n\t// if found multiple files\n\t// add MULTI: to FILE_LISTEN_URL\n\t// separate entries with a space\n\t// add the same number of entries for each record\n\t//$FILE_LISTEN_URL = \"MULTI:http://listennow.server/$ServerID/$AsteriskID/$QMUserID/$QMUserName http://file2 http://file3\";\n\t//$FILE_LENGTH = \"125000 100 200\";\n\t//$FILE_ENCODING = \"mp3 - -\";\t\n\t//$FILE_DURATION = \"1:12 1:10 -\"; \t\n\n}", "public function get_matched_handler()\n {\n }", "public static function usesCustomHandler();", "function xmlrpc_find_file( $params ) {\n\tglobal $FILE_FOUND;\n\tglobal $FILE_LISTEN_URL;\n\tglobal $FILE_LENGTH;\n\tglobal $FILE_ENCODING;\t\n\tglobal $FILE_DURATION;\n\t\n\t$p0 = $params->getParam(0)->scalarval(); // server ID\n\t$p1 = $params->getParam(1)->scalarval(); // Asterisk call ID\n\t$p2 = $params->getParam(2)->scalarval(); // QM User ID\n\t$p3 = $params->getParam(3)->scalarval(); // Qm user name\n\t\n\tfind_file( $p0, $p1, $p2, $p3 ); \t\t\n\t\n\t$response = new xmlrpcval(array(\n new xmlrpcval( $FILE_FOUND, 'boolean' ),\n new xmlrpcval( $FILE_LISTEN_URL ),\n new xmlrpcval( $FILE_LENGTH ),\n new xmlrpcval( $FILE_ENCODING ),\n new xmlrpcval( $FILE_DURATION ), \n ), \"array\");\n\t\n\treturn new xmlrpcresp($response);\n}", "public function findFiles();", "function searchFile($sn){\n\t$authHub['auth'] = 0;\n\t$authHub['hub'] = 0;\n\t\n\t$A = file_get_contents('AH/A.txt');\n\tif(strpos($A, $sn) !== false)\n\t\t$authHub['auth'] = 1;\n\tfclose($handleA);\n\t\n\t\n\t\n\t$H = file_get_contents('AH/H.txt');\n\tif(strpos($H, $sn) !== false)\n\t\t$authHub['hub'] = 3;\n\tfclose($handleH);\n\t\n\treturn $authHub;\n}", "public function find($file);", "abstract public function search($files, array $includedFiles);", "function callback_file(array $args)\n {\n }", "public function set_matched_handler($handler)\n {\n }", "function gethandler($handler) {\n if (file_exists(HANDLER_PATH.'/'.$handler.'.php')) {\n include_once HANDLER_PATH. '/'.$handler.'.php';\n return ( new $handler() );\n }\n throw new FLException('Unknown Handler.', array('status' => 404));\n}", "public function getHandler($check = true) {}", "abstract public function handler() : void;", "function fn_find_file($prefix, $file, $company_id = null)\n{\n $file = Bootstrap::stripSlashes($file);\n\n // Url\n if (strpos($file, '://') !== false) {\n return $file;\n }\n\n $prefix = fn_normalize_path(rtrim($prefix, '/'));\n $file = fn_normalize_path($file);\n $files_path = fn_get_files_dir_path($company_id);\n\n // Absolute path\n if (is_file($file) && strpos($file, $files_path) === 0) {\n return $file;\n }\n\n // Path is relative to files directory\n if (is_file($files_path . $file)) {\n return $files_path . $file;\n }\n\n // Path is relative to prefix inside files directory\n if (is_file($files_path . $prefix . '/' . $file)) {\n return $files_path . $prefix . '/' . $file;\n }\n\n // Prefix is absolute path\n if (strpos($prefix, $files_path) === 0 && is_file($prefix . '/' . $file)) {\n return $prefix . '/' . $file;\n }\n\n return false;\n}", "public function func_search() {}", "function searchFile($directory, $file)\n{\n // Blacklisted directory names - not doing so will provoke an endless loop\n $blacklist = array ( '.idea', '.git', '.', '..');\n\n // Getting a handle on the directory\n $dir_handle = opendir($directory);\n\n // Looping on all the directorie's entry to find the right file\n while(false !== ($entry = readdir($dir_handle)))\n {\n //if($entry != '.' && $entry != '..' && $entry != '.idea' && $entry != '.git')\n if(!in_array($entry, $blacklist))\n {\n // if it's a directory - call back the same function recursively\n if(is_dir($directory. DIRECTORY_SEPARATOR .$entry))\n {\n searchFile($directory . DIRECTORY_SEPARATOR . $entry, $file);\n }\n // If it's a file, test against class name to know if it is the right file\n else if(str_replace(\".php\", \"\", $entry) == get_class_name($file))\n {\n $path = $directory . DIRECTORY_SEPARATOR . $entry;\n add_to_cache($file, $path);\n\n return;\n }\n }\n }\n\n closedir($dir_handle);\n\n\n}", "public function ProcessCustomHandlers (& $handlers = []);", "function OnIterateFiles(){\n\treturn 'IterateFiles';\n}", "function check_files($this_file)\n{\n// if you want to search for other strings replace base64_decode with the string you want to search for.\n \n $str_to_find=$_POST['val']; // the string(code/text) to search for \n \n if(!($content = file_get_contents($this_file))) { echo(\"<p>Could not check $this_file</p>\\n\"); }\n else { if(stristr($content, $str_to_find)) { echo(\"<p>$this_file -> contains $str_to_find</p> <p><a href='\".substr($this_file,1).\"' target='_blank'>Open File</a></p>\\n\"); }}\n\t\n unset($content); \n}", "public function listenTo($file);", "function filewalk($file, $search, $counter, $webpath) {\n if (strtolower(substr($file, stripos($file, \".htm\"))) == \".htm\"\n || strtolower(substr($file, stripos($file, \".html\"))) == \".html\"\n || strtolower(substr($file, stripos($file, \".asp\"))) == \".asp\"\n || strtolower(substr($file, stripos($file, \".php\"))) == \".php\") {\n $all = file_get_contents($file);\n $body = substr($all, stripos($all,\"<body\"),stripos($all,\"</body>\") - stripos($all,\"<body\"));\n $body = preg_replace('/<br \\/>/i', ' ', $body);\n $body = preg_replace('/<br>/i', ' ', $body);\n $body = compress($body,\"<noscript\",\"</noscript>\");\n $body = compress($body,\"<script\",\"</script>\");\n $body = compress($body,\"<iframe\",\"</iframe>\");\n $body = compress($body,\"<noframe\",\"</noframe>\");\n $body = strip_tags($body);\n $body = html_entity_decode($body, ENT_QUOTES);\n $body = preg_replace('/\\s+/', ' ', $body);\n // Scans and displays the results\n if (stripos($body, $search)) {\n $title = substr($all, stripos($all,\"<title>\") + 7,stripos($all,\"</title>\") - stripos($all,\"<title>\") - 7);\n $title = html_entity_decode($title, ENT_QUOTES);\n $title = preg_replace('/\\s+/', ' ', $title); \n echo '<p><a style=\"color:#202073;\" href=\"' . $file . '\">' . $title . '</a></br>';\n echo '<span id=\"webpath\">' . $webpath . substr($file, stripos($file, \"/\")) . '</span><br />';\n // echo textpart($body, $search) .. '</p>';\n $counter = $counter + 1;\n }\n }\n return $counter;\n}", "public function testFindsFilesWithMatchingStatusCode()\n {\n $assembly = $this->commonFindingTemplate(array(\n 'resourceName' => $this->resourceName,\n 'options' => array('type' => 'html', 'method' => 'GET', 'status' => 200),\n 'foundFiles' => array('FooResource.200.html.php')\n ));\n $this->assertEquals('FooResource.200.html.php', $assembly->getFile());\n }", "private function _doDirectMatch(array $path) {}", "public function onResult() {\n $args = func_get_args();\n $event = array_shift( $args );\n $op = array_shift( $args );\n $id = array_shift( $args );\n switch ($op) {\n case 'list':\n $status = array_shift( $args );\n $path = array_shift( $args );\n $files = array();\n if ($status) {\n $dirFile = $this->fileFromResult( $path, $args[0] );\n $dirFile->entries = array();\n if (isset($args[1])) {\n foreach ($args[1] as $file) {\n $cf = $this->fileFromResult( $path.$this->getDirSeparator().$file[0], $file );\n $dirFile->entries[$file[0]] = $cf;\n }\n }\n } else {\n $dirFile = NULL;\n }\n\n if (isset($this->_handlersList[$id]) && is_array($this->_handlersList[$id])) {\n call_user_func_array( $this->_handlersList[$id], array($this,$status,$dirFile) );\n }\n break;\n case 'createDirectory':\n $status = array_shift( $args );\n $path = array_shift( $args );\n if ($status) {\n $file = array_shift( $args );\n $dirFile = $this->fileFromResult( $path, $file );\n $dirFile->entries = array();\n } else {\n $dirFile = NULL;\n }\n if (isset($this->_handlersCreateDirectory[$id]) && is_array($this->_handlersCreateDirectory[$id])) {\n\n call_user_func_array( $this->_handlersCreateDirectory[$id], array($this,$status,$dirFile) );\n }\n break;\n case 'removeDirectory':\n $status = array_shift( $args );\n $path = array_shift( $args );\n\n if (isset($this->_handlersRemoveDirectory[$id]) && is_array($this->_handlersRemoveDirectory[$id])) {\n\n call_user_func_array( $this->_handlersRemoveDirectory[$id], array($this,$status,$path));\n }\n break;\n case 'removeFile':\n $status = array_shift( $args );\n $path = array_shift( $args );\n\n if (isset($this->_handlersRemoveFile[$id]) && is_array($this->_handlersRemoveFile[$id])) {\n\n call_user_func_array( $this->_handlersRemoveFile[$id], array($this,$status,$path));\n }\n break;\n case 'fileChanged':\n $path = $id;\n list($exists,$modificationTime,$size) = $args;\n call_user_func_array( $this->_handlersMonitorFile[$path], array($this,$path,$exists,$modificationTime,$size) );\n break;\n case 'executeFile':\n list($status) = $args;\n\n if (isset($this->_handlersExecuteFile[$id]) && is_array($this->_handlersExecuteFile[$id])) {\n\n call_user_func_array( $this->_handlersExecuteFile[$id], array($this,$status));\n }\n break;\n case 'getFileInfo':\n $status = array_shift( $args );\n $fileInfo = array_shift( $args );\n if (isset($this->_handlersGetFileInfo[$id]) && is_array($this->_handlersGetFileInfo[$id])) {\n call_user_func_array( $this->_handlersGetFileInfo[$id], array($this, $status, ($status ? $this->fileFromResult($id, $fileInfo) : $fileInfo)));\n }\n break;\n case 'getCryptoHash':\n $status = array_shift( $args );\n $hash = array_shift( $args );\n\n if (isset($this->_handlersGetCryptoHash[$id]) && is_array($this->_handlersGetCryptoHash[$id])) {\n call_user_func_array( $this->_handlersGetCryptoHash[$id], array($this, $id, $status, $hash));\n }\n break;\n case 'renameFile':\n $status = array_shift( $args );\n $newFile = array_shift( $args );\n\n if (isset($this->_handlersRenameFile[$id]) && is_array($this->_handlersRenameFile[$id])) {\n call_user_func_array( $this->_handlersRenameFile[$id], array($this, $status, $newFile));\n }\n break;\n case 'copyFile':\n $status = array_shift( $args );\n $newFile = array_shift( $args );\n\n if (isset($this->_handlersCopyFile[$id]) && is_array($this->_handlersCopyFile[$id])) {\n call_user_func_array( $this->_handlersCopyFile[$id], array($this, $status, $newFile));\n }\n break;\n case 'extractZip':\n if (!empty($this->_handlersExtractZip[$id])) {\n list($status, $targetPath, $files) = $args;\n call_user_func_array($this->_handlersExtractZip[$id], array($this, $status, $targetPath, $files));\n }\n break;\n }\n }", "function get_handler() {\r\n }", "function OnGetFileObject($file){\n\tGetFileFromDatabase($file);\t\n\tif ($file->scanned != 1){\n\t\tScanFileOnVirusTotal($file);\n\t}\n\tif ($file->ck_scanned == -1){\t\t//Waiting for a result\n\t\tGetFileResultsOnCuckoo($file);\n\t}\n}", "function hcpu_catch_file_request() {\n\tif ( ! isset( $_GET['hc-get-file'] ) ) {\n\t\treturn;\n\t}\n\n\t// Serve file or redirect to login.\n\tif ( is_user_member_of_blog() ) {\n\t\thcpu_serve_file();\n\t} else {\n\t\tbp_do_404();\n\t}\n}", "abstract protected function doDetect($filePath);", "public function run() {\r\n\t\t$i = 1;\r\n\t\twhile ($i < self::NBR_OF_FILES) {\r\n\t\t\t$this->explore_path[0] = $this->get_path(0, $i);\r\n\t\t\t$j = 0;\r\n\t\t\twhile ($j < self::NBR_OF_FILES) {\r\n\t\t\t\t$this->explore_path[1] = $this->get_path(1, $j);\r\n\t\t\t\t$k = 0;\r\n\t\t\t\twhile ($k < self::NBR_OF_FILES) {\r\n\t\t\t\t\t$this->explore_path[2] = $this->get_path(2, $k);\r\n\t\t\t\t\tif (is_numeric(file_get_contents(self::FULL_URL.implode(\"\", $this->explore_path).'README')[0])) {\r\n\t\t\t\t\t\techo \"flag : \".file_get_contents(self::FULL_URL.implode(\"\", $this->explore_path).'README'). \"was found at path \".self::FULL_URL.implode(\"\", $this->explore_path);\r\n\t\t\t\t\t\treturn (0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$k++;\r\n\t\t\t\t}\r\n\t\t\t\t$j++;\r\n\t\t\t}\r\n\t\t\t$i++;\r\n\t\t}\r\n\t}", "function IncludeResource($name, $handler, $extension, $directory)\n\t{\n\t\t// Collect all the links\n\t\t$found = HTML::LinkToResource($name, $handler, $extension, $directory);\n\t\t\n\t\t// For each link in array\n\t\tfor($index = 0; $index < sizeof($found); $index++)\n\t\t{\n\t\t\t// Make a warning log about non-optimized JS include because of search\n\t\t\terror_log('[WARNING] Non-optimized include: ' . $found[$index] . ' (trying to include: ' . $name . ');');\n\t\t\t// Call specified handler\n\t\t\techo $handler($found[$index]);\n\t\t}\n\t}", "public function onFind(string $pattern, callable $listener);", "function mainEvent(&$req, &$t) {\n\t\t//try to find content in the system via the SITE AREAS or SITE STRUCTURE\n\t\tif($this->findSiteStructure($req,$t)) {\n\t\t\treturn true;\n\t\t}\n\t\tCgn_ErrorStack::pullError('php');\n\t\theader('HTTP/1.0 404 Not Found');\n\t\t$t['message'] = '<h2>File Not Found.</h2>';\n\t\t$t['message2'] = '<p>Sorry, the requested URL could not be found.</p>';\n\t}", "public function file() {\n $args = func_get_args();\n if(empty($args)) return $this->files()->first();\n return call_user_func_array(array($this->files(), 'find'), $args);\n }", "public function getFileAndFolderNameFilters() {}", "public function getHandler();", "public function getHandler();", "public function getActualHandler();", "function searchFiles($search, $path, $video){\n $searchFiles = scandir($path);\n foreach($searchFiles as $sFile){\n if(($sFile!=\".\")&&($sFile!=\"..\")){\n if(is_dir($path.$sFile)){\n $search = glob($path.$sFile.'/'.$video);\n if(!empty($search)){\n return $search;\n }\n }\n }\n }\n return array('did', 'not', 'work');\n}", "public static function get_handler($location, $filename, $extension)\n {\n }", "public function testFindingFilesPrioritizesStatusCodeOverMethodTemplate()\n {\n $assembly = $this->commonFindingTemplate(array(\n 'resourceName' => $this->resourceName,\n 'options' => array('type' => 'html', 'method' => 'GET', 'status' => 200),\n 'foundFiles' => array('FooResource.200.html.php', 'FooResource.GET.html.php')\n ));\n $this->assertEquals('FooResource.200.html.php', $assembly->getFile());\n }", "public function scan($filename){ }", "function drush_drushutils_find_callback_validate() {\n $args = drush_get_arguments();\n if (1 == count($args)) {\n return drush_set_error('ERROR', dt('The path (or partial path) to search for must be passed as an argument.'));\n }\n return TRUE;\n}", "public function testFindsFilesWithDifferentOptions()\n {\n $assembly = $this->commonFindingTemplate(array(\n 'resourceName' => $this->resourceName,\n 'options' => array('type' => 'xml', 'method' => 'POST', 'status' => 201),\n 'foundFiles' => array('FooResource.POST.xml.php')\n ));\n $this->assertEquals('FooResource.POST.xml.php', $assembly->getFile());\n }", "public function lookForFiles()\n\t{\n\t\t$this->_jobOptions = [];\n\n\t\tforeach ($this->getProject()->jobs as $job) {\n\t\t\tif ($job->paramountProjectJob instanceof ParamountProjectJob){\n\n\t\t\t\t$this->setProjectJob($job);\n\n\t\t\t\t$this->buildJobOptionsForService();\n\t\t\t}\n\t\t}\n\n\t}", "function search() {}", "public function getHandler() {}", "public function get_handler()\n {\n }", "public function findFile($class);", "function _search_img_file($theme, $lang, $id, $dir = 'images')\n{\n $extensions = array('png', 'jpg', 'jpeg', 'gif', 'ico', 'svg');\n $url_base = 'themes/';\n foreach (array(get_custom_file_base(), get_file_base()) as $_base) {\n $base = $_base . '/themes/';\n\n foreach ($extensions as $extension) {\n $file_path = $base . $theme . '/';\n if ($dir != '') {\n $file_path .= $dir . '/';\n }\n if (($lang !== null) && ($lang != '')) {\n $file_path .= $lang . '/';\n }\n $file_path .= $id . '.' . $extension;\n if (is_file($file_path)) { // Theme+Lang\n $path = $url_base . rawurlencode($theme) . '/' . $dir . '/';\n if (($lang !== null) && ($lang != '')) {\n $path .= rawurlencode($lang) . '/';\n }\n $path .= $id . '.' . $extension;\n return $path;\n }\n }\n }\n return null;\n}", "function find_file($file) {\n if($results = glob($file)) {\n if($file = array_shift($results)) {\n return $file;\n } else {\n return false;\n }\n } else {\n return false;\n }\n}", "function searchForFile($dir, $searchfile)\r\n{\r\n\tglobal $total_loops;\r\n\t// Make sure we do not exceed 80% memory usage. If so, return false to prevent hitting memory limit.\r\n\t// if (memory_get_usage()/1048576 > (int)ini_get('memory_limit')*0.8) return false;\r\n\t// Set max number of loops we'll do\r\n\t$max_loops = 20000;\r\n\t// Trim $dir and make sure it ends with directory separator\r\n\t$dir = rtrim(trim($dir), DS) . DS;\r\n\t// Loop through all files and subdirectories\r\n\tforeach (getDirFiles($dir) as $thisFileOrDir) \r\n\t{\r\n\t\t// Increment loop\r\n\t\t$total_loops++;\r\n\t\t// Stop if we've done over $max_loops loops and reset $total_loops for other processes\r\n\t\tif ($total_loops > $max_loops) {\r\n\t\t\t$total_loops = 0;\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t// Set full path of file/dir we're looking at\r\n\t\t$fullPath = $dir.$thisFileOrDir;\r\n\t\t// If it's a file, check if it's the one we're looking for\r\n\t\tif (isFile($fullPath)) {\r\n\t\t\t// Found the file! Return the current directory.\r\n\t\t\tif ($thisFileOrDir == $searchfile) return $dir;\r\n\t\t}\r\n\t\t// If it's a directory, then recursively check all files in that subdirectory\r\n\t\telseif (is_dir($fullPath)) {\r\n\t\t\t// Get return value for this directory\r\n\t\t\t$returnedDir = searchForFile($fullPath, $searchfile);\r\n\t\t\t// If returned a filename and it matches teh search file, return the returned directory\r\n\t\t\tif ($returnedDir !== false) return $returnedDir;\r\n\t\t}\r\n\t}\r\n\t// If didn't find it, return false\r\n\treturn false;\r\n}", "function scan_files( ){\n\n // List of all the audio files found in the directory and sub-directories\n $audioFileArray = array();\n\n // List of filenames already handled during the scan. To detect dupe filenames.\n $alreadyhandledFileArray = array();\n\n // Make list of all files in db to remove non existent files\n $DBaudioFileArray = array();\n foreach ( $this->get_list_of_files()->fetchAll() as $row ) {\n $DBaudioFileArray[] = $row['filename'];\n }\n\n // Prepare variables for file urls\n //$base_dir = dirname(dirname(realpath($this->filedirectorypath))); // Absolute path to your installation, ex: /var/www/mywebsite\n $doc_root = preg_replace(\"!{$_SERVER['SCRIPT_NAME']}$!\", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www\n $protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https';\n $port = $_SERVER['SERVER_PORT'];\n $disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : \":$port\";\n $domain = $_SERVER['SERVER_NAME'];\n // variables for file urls\n\n // Create recursive dir iterator which skips dot folders\n $dir = new RecursiveDirectoryIterator( $this->filedirectorypath , FilesystemIterator::SKIP_DOTS);\n\n // Flatten the recursive iterator, consider only files, no directories\n $it = new RecursiveIteratorIterator($dir);\n\n // Find all the mp3 files\n foreach ($it as $fileinfo) {\n if ($fileinfo->isFile() && !strcmp($fileinfo->getExtension(), \"mp3\")) {\n $audioFileArray[] = $fileinfo;\n\n //Warning: files with same md5key in different folders will not be inserted into the db.\n //print md5_file($fileinfo) . \"<br />\\n\";\n }\n }\n\n foreach ($audioFileArray as $key => $fileinfo) {\n\n $filename = $fileinfo->getFilename();\n\n //For each file found on disk remove entry from list from DB\n // if any left at the end, they are files that no longer are present on the drive.\n //print \"unsetting: \" . $filename . \"<br>\";\n unset($DBaudioFileArray[array_search($filename,$DBaudioFileArray,true)]);\n\n // check file not in db\n if( !$this->is_file_in_db( $filename ) ) {\n\n //decode filename date if named according to our naming scheme\n $date = $this->decode_filename($filename);\n\n // Build file url based on server path\n $filepath = realpath($fileinfo->getRealPath());\n $base_url = preg_replace(\"!^{$doc_root}!\", '', $filepath); # ex: '' or '/mywebsite'\n $full_url = \"$protocol://{$domain}{$disp_port}{$base_url}\"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc.\n\n //print $filename . \" - \" . $full_url . \"<br />\\n\";\n\n //insert audiofile in db for first time\n $this->insert_new_file_into_db( $filename, $full_url, $fileinfo->getRealPath(), $fileinfo->getSize(), $date );\n\n $alreadyhandledFileArray[$key] = $filename;\n\n } else {\n // if file in alreadyhandled array, then duplicate named files have been found\n // how to check for duplicate file names?\n // if we're here then the name has already ben added to the db (but maybe during a previous run)\n //we still need to look for the file in the alreadyhandledFileArray\n if( in_array($filename, $alreadyhandledFileArray) ){\n // flag file\n $this->flag_file($filename, \"Il y a 2 ou plusieurs fichiers audio avec le même nom dans le dossier audio du serveur ftp. Veuillez changer les noms ou supprimer les doublons.\");\n }\n }\n\n\n }\n\n // If there are files from the database that weren't found in the audio folder,\n // flag them and add a comment stating that the file can no longer be found.\n if( count($DBaudioFileArray) ){\n //print_r($DBaudioFileArray);\n foreach($DBaudioFileArray as $key => $fn){\n $this->flag_file($fn, \"Le fichier en question n'est plus présent dans le dossier audio du serveur ftp. Il faut le supprimer de la base de données.\");\n $this->set_file_not_new($fn);\n }\n }\n\n return true;\n }", "function searchFile($filePath, $currentPathKey, $files)\n{\n if ($currentPathKey == (count($filePath) - 1)) {\n return $files[$filePath[$currentPathKey]];\n } else {\n return searchFile($filePath, ($currentPathKey + 1), $files[$filePath[$currentPathKey]]['children']);\n }\n}", "public function check_files()\n {\n }", "protected function processChangedAndNewFiles() {}", "public function runOnFiles(): bool;", "function findFile ($file) \n{\n global $sublist;\n $foundlist = \"\";\n \n foreach ($sublist as $eachlist) \n {\n if (in_array($file, $eachlist[url])) \n {\n $foundlist = $eachlist;\n }\n }\n \n menuPrinter ($file, $foundlist);\n}", "public function getFoundPath() {}", "private function execRunHandler()\n {\n // guarantee that only one process can be run at one time\n // use socket as lock\n Log::info('Try to start handling process...');\n\n // bounce\n $handlers = BounceHandler::get();\n Log::info(sizeof($handlers).' bounce handlers found');\n $count = 1;\n foreach ($handlers as $handler) {\n Log::info('Starting handler '.$handler->name.\" ($count/\".sizeof($handlers).')');\n $handler->start();\n Log::info('Finish processing handler '.$handler->name);\n $count += 1;\n }\n\n // abuse\n $handlers = FeedbackLoopHandler::get();\n Log::info(sizeof($handlers).' feedback loop handlers found');\n $count = 1;\n foreach ($handlers as $handler) {\n Log::info('Starting handler '.$handler->name.\" ($count/\".sizeof($handlers).')');\n $handler->start();\n Log::info('Finish processing handler '.$handler->name);\n $count += 1;\n }\n }", "public function enumerateFiles($callback);", "function handlerFunction($module, $obj, $URI_function){\n //debugECHO($URI_function);\n $functions = simplexml_load_file(MODULES_PATH . $module . \"/resources/functions.xml\");\n $exist=false;\n\n foreach($functions->function as $function){\n if(($URI_function === (String)$function->uri)){\n $exist=true;\n $event=(String)$function->name;\n //debugECHO($event);\n break;\n }//enf if\n\n }//End foreach\n\n if(!$exist){\n //debugECHO(\"entra al exists false\");\n showErrorPage(4,\"\",'HTTP/1.0 400 Bad Request', 400);\n }else{\n //debugECHO($event);\n call_user_func(array($obj,$event));\n }\n}", "static function AJAX_Scan() {\n\t\t$list = RecursiveScanDir(__DIR__);\n\t\tusort($list, \"strnatcasecmp\");\n\t\t\n\t\t// No files?\n\t\tif (!$list || !count($list)) die(\"No .php files located in this<br />folder and/or subfolders\");\n\t\t\n\t\t// For each file we'll present something nice\n\t\t$out = \"\";\n\t\tforeach($list as $file) {\n\t\t\t\n\t\t\t// If Mode is set to 1, we need to parse the file and check the completion\n\t\t\t$analysis = \"\";\n\t\t\tif ($_POST['Mode']) {\n\t\t\t\t$analysis = DocBlock::AnalyzeFile($file);\n\t\t\t}\n\t\t\t\n\t\t\t$out .= \"\n\t\t\t\t$analysis<a href='#' data-filename='\".rawurlencode($file).\"' class='filelink'>$file</a><br />\n\t\t\t\";\n\t\t}\n\t\t\n\t\t// Ouptut\n\t\techo $out;\n\t\t\n\t\t// Exit \"Gracefully\"\n\t\texit(0);\n\t}", "abstract protected function createHandler();", "private function getFileHandler() {\n $mode = $this->replace ? \"w+\" : \"a+\";\n return fopen($this->pathFilename(), $mode);\n }", "public function handle()\n {\n\n $finder = new Finder();\n $finder->files()->in(base_path('exports'));\n $finder->sortByChangedTime();\n\n foreach ($finder as $key => $file) {\n if (!empty($file->getRealPath())) {\n $rr[$key]['f'] = $file->getRealPath();\n $file = $file->getRelativePathname();\n if ($file == 'product.csv') {\n $this->getParse($rr[$key]['f']);\n $this->getParseCategory($rr[$key]['f']);\n }\n }\n }\n return 0;\n }", "abstract protected function registerHandlers();", "function choose_handler(): callable\n {\n return \\Yurun\\Util\\Swoole\\Guzzle\\choose_handler();\n }", "public function respond() {\n\n\t\tBillrun_Factory::dispatcher()->trigger('beforeResponse', array('type' => self::$type, 'responder' => &$this));\n\n\t\t$retPaths = array();\n\n\t\tforeach ($this->getProcessedFilesForType(self::$type) as $filename => $logLine) {\n\t\t\t$filePath = $this->workspace . DIRECTORY_SEPARATOR . self::$type . DIRECTORY_SEPARATOR . $filename;\n\t\t\tif (!file_exists($filePath)) {\n\t\t\t\tBillrun_Factory::log()->log(\"NOTICE : SKIPPING $filename for type : \" . self::$type . \"!!! ,path - $filePath not found!!\", Zend_Log::NOTICE);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$responseFilePath = $this->processFileForResponse($filePath, $logLine, $filename);\n\t\t\tif ($responseFilePath) {\n\t\t\t\t$retPaths[] = $this->respondAFile($responseFilePath, $this->getResponseFilename($filename, $logLine), $logLine);\n\t\t\t}\n\t\t}\n\n\t\tBillrun_Factory::dispatcher()->trigger('afterResponse', array('type' => self::$type, 'responder' => &$this));\n\n\t\treturn $retPaths;\n\t}", "function get_video_file($vdetails,$return_default=true,$with_path=true,$multi=false,$count_only=false,$hq=false)\r\n{\r\n global $Cbucket;\r\n # checking if there is any other functions\r\n # available\r\n if(is_array($Cbucket->custom_video_file_funcs))\r\n foreach($Cbucket->custom_video_file_funcs as $func)\r\n if(function_exists($func))\r\n {\r\n $func_returned = $func($vdetails, $hq);\r\n if($func_returned)\r\n return $func_returned;\r\n }\r\n\r\n\r\n $fileDirectory = \"\";\r\n if(isset($vdetails['file_directory']) && !empty($vdetails['file_directory'])){\r\n $fileDirectory = \"{$vdetails['file_directory']}/\";\r\n }\r\n //dump($vdetails['file_name']);\r\n\r\n #Now there is no function so lets continue as\r\n if(isset($vdetails['file_name']))\r\n $vid_files = glob(VIDEOS_DIR.\"/\".$fileDirectory . $vdetails['file_name'].\"*\");\r\n // if($hq){\r\n // var_dump(glob(VIDEOS_DIR.\"/\".$fileDirectory . $vdetails['file_name'].\"*\"));\r\n // }\r\n\r\n #replace Dir with URL\r\n if(is_array($vid_files))\r\n foreach($vid_files as $file)\r\n {\r\n // if($hq){\r\n // echo \"filesize = \" . filesize($file); \r\n // }\r\n if(filesize($file) < 100) continue;\r\n $files_part = explode('/',$file);\r\n $video_file = $files_part[count($files_part)-1];\r\n\r\n if($with_path)\r\n $files[] = VIDEOS_URL.'/' . $fileDirectory . $video_file;\r\n else\r\n $files[] = $video_file;\r\n }\r\n\r\n\r\n if(count($files)==0 && !$multi && !$count_only)\r\n {\r\n if($return_default)\r\n {\r\n\r\n if($with_path)\r\n return VIDEOS_URL.'/no_video.flv';\r\n else\r\n return 'no_video.flv';\r\n }else{\r\n return false;\r\n }\r\n }else{\r\n if($multi)\r\n return $files;\r\n if($count_only)\r\n return count($files);\r\n\r\n\r\n foreach($files as $file)\r\n {\r\n if($hq)\r\n {\r\n if(getext($file)=='mp4')\r\n {\r\n return $file;\r\n break;\r\n }\r\n }else{\r\n return $file;\r\n break;\r\n }\r\n }\r\n return $files[0];\r\n }\r\n}", "public function getHandler()\n {\n }", "function _filter_query_attachment_filenames($clauses)\n {\n }", "function searchByPLU()\n{ //variables needed\n global $database_info;\n global $search;\n global $item_file;\n $was_found = FALSE; // hasn't been found yet.\n \n if (! empty($search)) {\n $fp = fopen($item_file, \"r\") or die (\"The items file was not found\");\n $index = 0;\n /** While loop will iterate throughout the entire file, populating the array with the elements of the database file. */\n while (! feof($fp)) {\n $database_info[$index] = fgets($fp);\n $index ++;\n }\n /** For loop will go through the database file and split the file by new line.*/\n for ($i = 0; $i < sizeof($database_info); $i ++) {\n $keep_track = preg_split(\"/[\\s,]+/\", $database_info[$i]);\n \n if (strcmp($keep_track[1], $search) == 0) { // checking if a comparing returns 0, if true then the strings are the same and the PLU is found. Index 1 contains the PLU\n echo '<img src=\"' . $keep_track[2] . '\" alt=\"image\" width=\"500\" height=\"500\" />'; // return image that user uploaded\n echo $keep_track[0] . \" \" . $keep_track[1] . \"<br/>\"; // return the name and the PLU.\n $was_found = TRUE; // variable needs to be updated if the condition is met.\n break;\n }\n }\n /** The PLU was never changed, thus never found. */\n if ($was_found == FALSE) {echo \"PLU not in the system.\"; }\n }\n\n}", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function upload_handler( $file ) {\n\t\t$this->add_ping( 'uploads', array( 'upload' => str_replace( $this->resolve_upload_path(), '', $file['file'] ) ) );\n\t\treturn $file;\n\t}", "function handle() ;", "function fn_filter_uploaded_data($name, $filter_by_ext = array())\n{\n $udata_local = fn_rebuild_files('file_' . $name);\n $udata_other = !empty($_REQUEST['file_' . $name]) ? $_REQUEST['file_' . $name] : array();\n $utype = !empty($_REQUEST['type_' . $name]) ? $_REQUEST['type_' . $name] : array();\n\n if (empty($utype)) {\n return array();\n }\n\n $filtered = array();\n\n foreach ($utype as $id => $type) {\n if ($type == 'local' && !fn_is_empty(@$udata_local[$id])) {\n $filtered[$id] = fn_get_local_data(Bootstrap::stripSlashes($udata_local[$id]));\n\n } elseif ($type == 'server' && !fn_is_empty(@$udata_other[$id]) && (Registry::get('runtime.skip_area_checking') || AREA == 'A')) {\n fn_get_last_key($udata_other[$id], 'fn_get_server_data', true);\n $filtered[$id] = $udata_other[$id];\n\n } elseif ($type == 'url' && !fn_is_empty(@$udata_other[$id])) {\n fn_get_last_key($udata_other[$id], 'fn_get_url_data', true);\n $filtered[$id] = $udata_other[$id];\n } elseif ($type == 'uploaded' && !fn_is_empty(@$udata_other[$id])) {\n fn_get_last_key($udata_other[$id], function ($file_path) {\n return fn_get_server_data($file_path, array(Storage::instance('custom_files')->getAbsolutePath('')));\n }, true);\n\n $filtered[$id] = $udata_other[$id];\n }\n\n if (isset($filtered[$id]) && $filtered[$id] === false) {\n unset($filtered[$id]);\n fn_set_notification('E', __('error'), __('cant_upload_file', ['[product]' => PRODUCT_NAME]));\n continue;\n }\n\n if (!empty($filtered[$id]['name'])) {\n $filtered[$id]['name'] = \\Tygh\\Tools\\SecurityHelper::sanitizeFileName(urldecode($filtered[$id]['name']));\n \n if (!fn_check_uploaded_data($filtered[$id], $filter_by_ext)) {\n unset($filtered[$id]);\n }\n }\n }\n\n static $shutdown_inited;\n\n if (!$shutdown_inited) {\n $shutdown_inited = true;\n register_shutdown_function('fn_remove_temp_data');\n }\n\n /**\n * Executed after filtering uploaded files.\n * It allows to change or extend the filtered files.\n *\n * @param string $name name of uploaded data\n * @param array $filter_by_ext allow file extensions\n * @param array $filtered filtered file data\n * @param array $udata_local List of uploaded files\n * @param array $udata_other List of files object types\n * @param array $utype List of files sources\n */\n fn_set_hook('filter_uploaded_data_post', $name, $filter_by_ext, $filtered, $udata_local, $udata_other, $utype);\n\n return $filtered;\n}", "public function testFindFiles()\n {\n\n }", "function checkForNew(){\n\t// setup variable scope\n\tglobal $filesInQubev;\n\t// empty array for filenames\n\t$allFiles = array();\n\t// restructures the array\n\tforeach ($filesInQubev as $row) {\n\t\t$allFiles[]=$row['filename'];\n\t}\n\n\t//Iterates over each value in the array passing them to the callback function.\n\t//If the callback function returns true, the current value from array is returned into the result array.\n\t$newFiles = array_filter(\n\t\t// passes in file from array into the callback function\n\t\t$allFiles, function ($file) {\n\t\t// setup varibale scope\n\t\tglobal $filesInMainDatabase;\n\t\t// file found flag\n\t\t$fileFound = false;\n\t\t// loops through file in main database\n\t\tforeach ($filesInMainDatabase as $row) {\t\n\t\t\tif ($row['source_file']===$file){\n\t\t\t\t$fileFound = true;\n\t\t\t}\n\t\t}// end while\n\t\t// returns true if file is not found\n\t\treturn (!$fileFound);\n\t\t}\n\t);\n\t// if there are new files pass them to the dataLoader function\n\tif ($newFiles){\n\t\tdataloader($newFiles);\n\t}\n}", "public function file_exists($file);", "function _on_handle($handler, $args)\n {\n $this->_request_data['schemadb'] = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb'));\n $this->_request_data['schemadb_location'] = midcom_helper_datamanager2_schema::load_database($this->_config->get('schemadb_location'));\n $this->_request_data['prefix'] = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX);\n $this->_request_data['datamanager'] = new midcom_helper_datamanager2_datamanager($this->_request_data['schemadb']);\n $this->_request_data['datamanager_location'] = new midcom_helper_datamanager2_datamanager($this->_request_data['schemadb_location']);\n \n $_MIDCOM->add_link_head(array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => MIDCOM_STATIC_URL . '/fi.kilonkipinat.events/fi_kilonkipinat_events.css', 'media' => 'all'));\n \n $_MIDCOM->add_link_head\n (\n array\n (\n 'rel' => 'alternate',\n 'type' => 'application/rss+xml',\n 'title' => $this->_l10n->get('rss 2.0 feed'),\n 'href' => $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX) . 'rss.xml',\n )\n );\n\n $this->_populate_node_toolbar();\n\n return true;\n }", "public function files();", "public function files();", "public function files();", "function getFilesByCond(){\n\t\t\t\t\n if( $this->cond == '') return ;\n \n $sql = \"SELECT * FROM \".$this->tableImages().\" WHERE $this->cond \";\n return $this->db->query($sql)->result('array');\n\t\t\n\t}", "public function handle()\n {\n\n $items = new \\DirectoryIterator(public_path('Files/'));\n foreach ($items as $item)\n {\n if ($item->getExtension())\n {\n $result = (new ParserManager($item->getPath() .'/'. $item->getFilename(),\n $item->getExtension()))->handle();\n }else{\n continue;\n }\n\n }\n echo ($result) ? 'Information added successful' . PHP_EOL : 'Something went wrong' . PHP_EOL;\n\n\n }", "public function files($index){\n $this->httpRequest->files($index);\n }", "function __construct($routes) {\n\t\t\t$uri = isset($_GET['uri']) ? '/' . trim($_GET['uri'], '/') : '/';\n\t\t\tforeach ($routes as $key => $value) {\n\t\t\t\tif ($key === $uri) {\n\t\t\t\t\tif (file_exists($value)) {\n\t\t\t\t\t\trequire_once $value;\n\t\t\t\t\t\texit();\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"<h1>The requested file exists but could not be found.</h1>\";\n\t\t\t\t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \"<h1>404 File not found</h1>\";\n\t\t\texit();\n\t\t}", "function _ft_search_find_files($dir, $q){\r\n\t$output = array();\r\n\tif (ft_check_dir($dir) && $dirlink = @opendir($dir)) {\r\n\t\twhile(($file = readdir($dirlink)) !== false){\r\n\t\t\tif($file != \".\" && $file != \"..\" && ((ft_check_file($file) && ft_check_filetype($file)) || (is_dir($dir.\"/\".$file) && ft_check_dir($file)))){\r\n\t\t\t\t$path = $dir.'/'.$file;\r\n\t\t\t\t// Check if filename/directory name is a match.\r\n\t\t\t\tif(stristr($file, $q)) {\r\n\t\t\t\t\t$new['name'] = $file;\r\n\t\t\t\t\t$new['shortname'] = ft_get_nice_filename($file, 20);\r\n\t\t\t\t\t$new['dir'] = substr($dir, strlen(ft_get_root()));\r\n\t\t\t\t\tif (is_dir($path)) {\r\n if (ft_check_dir($path)) {\r\n \t\t\t\t\t\t$new['type'] = \"dir\";\t\t\t\t\t \r\n \t\t\t\t\t$output[] = $new;\r\n }\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t $new['type'] = \"file\";\r\n \t\t\t\t\t$output[] = $new;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Check subdirs for matches.\r\n\t\t\t\tif(is_dir($path)) {\r\n\t\t\t\t\t$dirres = _ft_search_find_files($path, $q);\r\n\t\t\t\t\tif (is_array($dirres) && count($dirres) > 0) {\r\n\t\t\t\t\t\t$output = array_merge($dirres, $output);\r\n\t\t\t\t\t\tunset($dirres);\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tsort($output);\r\n\t\tclosedir($dirlink);\r\n\t\treturn $output;\r\n\t} else {\r\n\t\treturn FALSE;\r\n\t}\r\n}", "function smart_search($filename, $search_term) {\n $last = tail($filename, NUM_LINES);\n $line_num = -sizeof($last);\n $match_count = 0;\n foreach($last as $line) {\n if (strstr($line, $search_term)) {\n echo \"Match on line \".$line_num.\": \".$line;\n ++$match_count;\n }\n ++$line_num;\n }\n echo \"Found $match_count \".(($match_count > 1)? \"matches\" : \"match\").\"\\n\";\n}", "function check_event($Request){\n\n $action = $Request[\"action\"];\n if($Request[\"event\"] != NULL && !empty($Request[\"event\"])){\n switch($Request[\"event\"]){\n\n case \"@mkdir\":\n if($action !=\"false\" && !is_dir($Request[\"action\"]))\n\n\n\n if(!$create = mkdir($action, 0700)){\n throw new Exception(\"Não Foi Possivel Criar A Pasta ! \");\n }\n\n else\n $out = \"Diretorio Já Existente\";\n\n if(isset($create) && $create == true)\n $out = \"Pasta Criada Com Sucesso em : \" . $action;\n else\n $out = \"Falha Ao tentar Criar Pasta !\";\n break;\n\n case \"@rmdir\":\n if($action !=\"false\" && is_dir($action))\n $del = rmdir($action);\n else\n $out = \"Diretório Não Existe ! \";\n\n if(isset($del) && $del == true)\n $out = \"Pasta Removida Com Sucesso ! \";\n else\n $out = \"Falha Ao Tentar Remover Diretório\";\n\n break;\n\n case \"@listdir\":\n if($action != NULL && $action != \"undefined\"){\n if(is_dir($action)){\n $path = array_diff(scandir($action), array(\".\", \"..\"));\n $count = 0;\n\n foreach($path as $files){\n ++$count;\n echo \"</br>\". $count . \" - \" . $files . \"</br>\";\n }\n $out = \"</br> sucess\";\n }else{\n $out = \"Diretório não encontrado ! \";\n }\n }\n break;\n\n case \"@readfile\":\n if($action != NULL && $action != \"undefined\"){\n if(file_exists($action) && is_file($action)){\n $read = @file_get_contents($action);\n $out = \"<pre>\" . $read . \"</pre>\";\n\n }else{\n $out = \"Arquivo não econtrado ! \";\n }\n }\n break;\n\n case \"@unlink\":\n if($action != NULL && $action != \"undefined\"){\n if(file_exists($action) && is_file($action)){\n $unlink = unlink($action);\n $out = $unlink == true?\"Arquivo Deletado Com Sucesso\":\"Falha Ao Tentar Deletar O Arquivo ! \";\n }else{\n $out = \"Não É Um Arquivo Ou Ele Não Existe ! \";\n }\n }\n break;\n\n case \"@writefile\":\n if($action != NULL && $action != \"undefined\"){\n $open = fopen($action, \"a+\");\n if(!$open){\n $out = \"Arquivo Já Existe ! \";\n }else {\n $text = Request::Get([\"content\"]);\n $write = fwrite($open, $text[\"content\"]);\n fclose($open);\n $out = $write == true?\"Arquivo Criado Com Sucesso Em : \" . $action:\"Falha Ao Tentar Criar Arquivo ! \";\n }\n\n }\n break;\n\n\n default:\n $out = \"Evento Não Encontrado . \";\n break;\n\n }\n }\n return $out;\n}", "function enumerateFiles($callback) { if (!$this->isInitialized()) { // NO: Initialize before use...\n throw new \\Exception('File System has not been initialize');\n }\n\n if (!isset($callback) || !is_callable($callback)) {\n throw new \\Exception('Missing or Invalid Callback Function');\n }\n\n // Create an Iterator for the Input Path\n $iterator = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($this->inputPath), \\RecursiveIteratorIterator::SELF_FIRST\n );\n\n // Iterate Files in Directory\n $break = false;\n $inputPathLength = strlen($this->inputPath) + 1;\n foreach ($iterator as $name => $element) {\n if ($element->isFile() && $element->isReadable()) {\n // Return Relative Path Only\n $name = substr($name, $inputPathLength);\n $break = !$callback($name);\n if ($break) {\n break;\n }\n }\n }\n }", "abstract public function processFile($fileName);", "private function searchFile( $fileName )\r\n\t{\r\n\t\t$index = -1;\r\n\t\tfor($fileIndex = 0; $fileIndex < $this->filesCollection->size(); $fileIndex++)\r\n\t\t{\r\n\t\t\tif( strcasecmp( $fileName, $this->filesCollection->get( $fileIndex )->getName( ) ) == 0 )\r\n\t\t\t{\r\n\t\t\t\t$index = $fileIndex;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $index;\r\n\t}", "function get_video_files($vdetails,$return_default=true,$with_path=true,$multi=false,$count_only=false,$hq=false){\r\n\r\n global $Cbucket;\r\n # checking if there is any other functions\r\n # available\r\n define('VIDEO_VERSION',$vdetails['video_version']);\r\n\r\n if(is_array($Cbucket->custom_video_file_funcs))\r\n foreach($Cbucket->custom_video_file_funcs as $func)\r\n if(function_exists($func))\r\n {\r\n $func_returned = $func($vdetails, $hq);\r\n if($func_returned)\r\n return $func_returned;\r\n }\r\n \r\n \r\n $fileDirectory = \"\";\r\n if(isset($vdetails['file_directory']) && !empty($vdetails['file_directory'])){\r\n $fileDirectory = \"{$vdetails['file_directory']}/\";\r\n }\r\n //dump($vdetails['file_name']);\r\n\r\n \r\n \r\n #Now there is no function so lets continue as\r\n\r\n if(isset($vdetails['file_name'])){\r\n if(VIDEO_VERSION == '2.7'){\r\n $vid_files = glob(VIDEOS_DIR.\"/\".$fileDirectory . $vdetails['file_name'].\"*\");\r\n }\r\n else{\r\n $vid_files = glob(VIDEOS_DIR.\"/\".$vdetails['file_name'].\"*\"); \r\n }\r\n }\r\n // if($hq){\r\n // var_dump(glob(VIDEOS_DIR.\"/\".$fileDirectory . $vdetails['file_name'].\"*\"));\r\n // }\r\n\r\n #replace Dir with URL\r\n if(is_array($vid_files))\r\n foreach($vid_files as $file)\r\n {\r\n // if($hq){\r\n // echo \"filesize = \" . filesize($file); \r\n // }\r\n if(filesize($file) < 100) continue;\r\n $files_part = explode('/',$file);\r\n $video_file = $files_part[count($files_part)-1];\r\n\r\n if($with_path){\r\n if(VIDEO_VERSION == '2.7')\r\n $files[] = VIDEOS_URL.'/' . $fileDirectory. $video_file ;\r\n else if(VIDEO_VERSION == '2.6')\r\n $files[] = VIDEOS_URL.'/' . $video_file ;\r\n }\r\n else\r\n $files[] = $video_file;\r\n }\r\n\r\n if(count($files)==0 && !$multi && !$count_only)\r\n {\r\n if($return_default)\r\n {\r\n\r\n if($with_path)\r\n return VIDEOS_URL.'/no_video.mp4';\r\n else\r\n return 'no_video.mp4';\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }\r\n else\r\n {\r\n return $files;\r\n }\r\n\r\n\r\n}", "public function dispatch(){\n //Execute the fn, pass in the content of placeholders in order\n $matches = array();\n foreach ($this->routes as $regex => $callback){\n if (preg_match($regex, $this->request, $matches) == 0) continue;\n array_shift($matches); //The first match is the full request\n call_user_func_array($callback, $matches);\n return true;\n }\n throw new \\Exception(\"Page not found\", 404);\n }", "function getAllItems($fileName){\n\n\nreturn\n}", "public function indexCrawledDocuments() {\n\t\tforeach ( $this->aFiles as $sFile ) {\n\t\t\t$oRepoFile = new SplFileInfo( $sFile );\n\t\t\tif ( !$oRepoFile->isFile() ) continue;\n\n\t\t\t$sFileName = $oRepoFile->getFilename();\n\t\t\t$sDocType = $this->mimeDecoding( $oRepoFile->getExtension() );\n\t\t\tif ( !$this->checkDocType( $sDocType, $sFileName ) ) continue;\n\n\t\t\tif ( !$this->oMainControl->bCommandLineMode ) set_time_limit( $this->iTimeLimit );\n\n\t\t\tif ( $this->sizeExceedsMaxDocSize( $oRepoFile->getSize(), $sFileName ) ) continue;\n\n\t\t\t//Insert URL to Filename\n\t\t\t$rURL = BsConfig::get( 'MW::ExtendedSearch::ExternalRepo' );\n\t\t\t$sURL = BsConfig::get( 'MW::ExtendedSearch::ExternalRepoUrl' );\n\t\t\t//Replace realpath with webserver url only if $sUrl is set, otherwise work as before\n\t\t\tif($sURL == \"\"){\n\t\t\t $sRepoFileRealPath = \"file:///\" . $oRepoFile->getRealPath();\n\t\t\t}else{\n\t\t\t $sRepoFileRealPath = $this->getFilePath( $rURL, $sURL, $oRepoFile );\n\t\t\t}\n\n\t\t\t$timestampImage = wfTimestamp( TS_ISO_8601, $oRepoFile->getMTime() );\n\n\t\t\tif ( $this->checkExistence( $oRepoFile->getRealPath(), 'external', $timestampImage, $sFileName ) ) continue;\n\n\t\t\t$text = $this->getFileText( $oRepoFile->getRealPath(), $sFileName );\n\n\t\t\t$doc = $this->makeRepoDocument( $sDocType, utf8_encode( $sFileName ), $text, utf8_encode( $sRepoFileRealPath ), $timestampImage );\n\t\t\t$this->writeLog( $sFileName );\n\n\t\t\twfRunHooks( 'BSExtendedSearchBeforeAddExternalFile', array( $this, $oRepoFile, &$doc ) );\n\n\t\t\tif ( $doc ) {\n\t\t\t\t// mode and ERROR_MSG_KEY are only passed for the case when addsFile fails\n\t\t\t\t$this->oMainControl->addDocument( $doc, $this->mode, self::S_ERROR_MSG_KEY );\n\t\t\t}\n\t\t}\n\t}", "public function lookup($src) {}", "public function lookup($src) {}" ]
[ "0.63592476", "0.6012525", "0.5940096", "0.57891154", "0.5704988", "0.5681717", "0.5669224", "0.56426346", "0.5574544", "0.55109155", "0.54525214", "0.5448414", "0.5441939", "0.5396625", "0.53909993", "0.53756446", "0.53701353", "0.5345641", "0.5342261", "0.53383446", "0.5338069", "0.53352183", "0.5311759", "0.5294886", "0.5272616", "0.5252678", "0.5239672", "0.5238426", "0.5214403", "0.51995337", "0.5196249", "0.5180838", "0.51400584", "0.5136527", "0.5130408", "0.50948703", "0.50948703", "0.50939673", "0.50692815", "0.5055864", "0.5046586", "0.50443625", "0.5033473", "0.50273156", "0.50257474", "0.50255144", "0.50117475", "0.49844086", "0.49814525", "0.49802336", "0.49799728", "0.4972805", "0.49614635", "0.49565202", "0.49328187", "0.4931831", "0.49166375", "0.49158508", "0.4915411", "0.49072006", "0.49015903", "0.48947155", "0.48933953", "0.4888385", "0.4880962", "0.48751938", "0.48681548", "0.48645553", "0.4858719", "0.4853957", "0.48510545", "0.48477978", "0.48369288", "0.48333982", "0.48215395", "0.48208398", "0.48185843", "0.48057732", "0.47974268", "0.4794864", "0.47841465", "0.47824475", "0.47824475", "0.47824475", "0.47811496", "0.47804084", "0.47762966", "0.47705814", "0.4761337", "0.4750996", "0.4747209", "0.47447595", "0.4739387", "0.47262576", "0.4704533", "0.46978128", "0.4694795", "0.4692979", "0.4682063", "0.4682063" ]
0.503655
42
=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=> Deleting a file or directory from an array if they & do not match the conditions <=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=<=
private function removeFs(int $index): void { unset($this->fs[$index]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function deleteUnexistingFiles() {\n\t\t$files = array (\n\t\t\t\t// Release 2.0\n\t\t\t\t'/administrator/language/de-DE/de-DE.com_clm_turnier.sys.ini',\n\t\t\t\t'/administrator/language/en-GB/en-GB.com_clm_turnier.sys.ini',\n\t\t\t\t// Release 3.2.0\n\t\t\t\t'/administrator/components/com_clm_turnier/layouts/form/fields/sonderranglisten-j4.php',\n\t\t\t\t'/components/com_clm_turnier/helpers/html/clm_turnier.php',\n\t\t\t\t// Release 3.2.1\n\t\t\t\t'/media/com_clm_turnier/js/sonderranglisten-j4.php'\n\t\t);\n\n\t\t$folders = array (\n\t\t\t\t// Release 3.0\n\t\t\t\t'/components/com_clm_turnier/includes',\n\t\t\t\t// Release 3.2.0\n\t\t\t\t'/administrator/components/com_clm_turnier/helpers/html',\n\t\t\t\t'/administrator/components/com_clm_turnier/helpers',\n\t\t\t\t// Release 3.2.1\n\t\t\t\t'/components/com_clm_turnier/classes/'\n\t\t);\n\n\t\tjimport('joomla.filesystem.file');\n\t\tforeach ($files as $file) {\n\t\t\tif (JFile::exists(JPATH_ROOT . $file) &&\n\t\t\t\t\t! JFile::delete(JPATH_ROOT . $file)) {\n\t\t\t\t$this->enqueueMessage(JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $file), 'warning');\n\t\t\t}\n\t\t}\n\n\t\tjimport('joomla.filesystem.folder');\n\t\tforeach ($folders as $folder) {\n\t\t\tif (JFolder::exists(JPATH_ROOT . $folder) &&\n\t\t\t\t\t! JFolder::delete(JPATH_ROOT . $folder)) {\n\t\t\t\t$this->enqueueMessage(JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $folder), 'warning');\n\t\t\t}\n\t\t}\n\t}", "function verifyDeletion($filename, $target_file)\n{\n // Check if file exists\n if (!file_exists($target_file))\n {\n echo \"File not found.<br>\";\n return false;\n }\n\n // check if file in list\n $list = read_file_list();\n\n if(!in_array($filename, $list)) {\n echo \"Not an image.<br>\";\n return false;\n }\n \n return true;\n}", "function delete_files($target) { \n if(is_dir($target)){\n $files = glob( $target . '*', GLOB_MARK ); //GLOB_MARK adds a slash to directories returned\n \n foreach( $files as $file )\n {\n delete_files( $file ); \n }\n \n rmdir( $target );\n } elseif(is_file($target)) {\n unlink( $target ); \n }\n}", "private static function toDelete(){\n $filesNotToDelete = [];\n $dir = public_path().'/images/';\n $filesInPublicFolder = scandir($dir);\n\n // izbacivanje assets foldera, .. i .\n $ignoreFiles = ['assets', '.', '..', 'pig.png', 'placeholder.png', 'logo.png', 'index.php'];\n foreach ($ignoreFiles as $toIgnore) {\n if (($key = array_search($toIgnore, $filesInPublicFolder)) !== false) {\n unset($filesInPublicFolder[$key]);\n }\n }\n // dd($filesInPublicFolder);\n $images = [];\n $collectionsOfObjectsWithImages = [Product::all(), ProductGroup::all(), Manufacturer::all(),\n Suggestion::all(), ImageSuggestion::all(), MainAd::all(),SecondAd::all()];\n\n foreach ($collectionsOfObjectsWithImages as $collection) {\n foreach ($collection as $object) {\n if($object->images->count()){\n foreach ($object->images as $image) {\n $images[] = $image->name;\n }\n }\n }\n }\n\n // dd($images);\n // dd(array_diff($filesInPublicFolder, $images));\n // dd($filesNotToDelete, $filesInPublicFolder);\n return $toDelete = array_diff($filesInPublicFolder, $images); //za fju array_dif vazan je redoslijed argumenata\n\n }", "function deleteImage($filename, $target_file)\n{\n // remove from list\n $list = read_file_list();\n $pivot = array_search($filename, $list);\n $left = array_slice($list, 0, $pivot);\n $right = array_slice($list, $pivot+1);\n $list = array_merge($left, $right);\n\n // remove file and output modified list\n unlink($target_file);\n write_file_list($list);\n\n echo $target_file . \" deleted successfully.<br>\";\n}", "private function _deleteDiscoveryFilesArray()\n {\n if (count($this->files) > 0) {\n foreach ($this->files as $file) {\n unlink($file);\n }\n }\n\n return;\n }", "function delete_files($target) {\n if(is_dir($target)){\n $files = glob( $target . '*', GLOB_MARK ); //GLOB_MARK adds a slash to directories returned\n\n foreach( $files as $file ){\n delete_files( $file ); \n }\n\n rmdir( $target );\n } elseif(is_file($target)) {\n unlink( $target ); \n }\n}", "public function deleteUnexistingFiles()\n\t{\n\t\tinclude JPATH_ADMINISTRATOR . '/components/com_hierarchy/deletelist.php';\n\n\t\tjimport('joomla.filesystem.file');\n\n\t\tforeach ($files as $file)\n\t\t{\n\t\t\tif (JFile::exists(JPATH_ROOT . $file) && !JFile::delete(JPATH_ROOT . $file))\n\t\t\t{\n\t\t\t\t$app->enqueueMessage(JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $file));\n\t\t\t}\n\t\t}\n\n\t\tjimport('joomla.filesystem.folder');\n\n\t\tforeach ($folders as $folder)\n\t\t{\n\t\t\tif (JFolder::exists(JPATH_ROOT . $folder) && !JFolder::delete(JPATH_ROOT . $folder))\n\t\t\t{\n\t\t\t\t$app->enqueueMessage(JText::sprintf('FILES_JOOMLA_ERROR_FILE_FOLDER', $folder));\n\t\t\t}\n\t\t}\n\t}", "public function checkDeleteFiles($arrFilelist)\n {\n $arrReturn = array();\n\n foreach ($arrFilelist as $keyItem => $valueItem)\n {\n if (!file_exists(TL_ROOT . \"/\" . $valueItem[\"path\"]))\n {\n $arrReturn[$keyItem] = $valueItem;\n $arrReturn[$keyItem][\"state\"] = SyncCtoEnum::FILESTATE_DELETE;\n $arrReturn[$keyItem][\"css\"] = \"deleted\";\n }\n }\n\n return $arrReturn;\n }", "function files_delete()\n{\n // remove module vars and masks\n xarModDelAllVars('files');\n xarRemoveMasks('files');\n\n // Deletion successful\n return true;\n}", "function delete_files($target) {\r\n\t\t\t\tif(is_dir($target)){\r\n\t\t\t\t\t//GLOB_MARK adds a slash to directories returned\r\n\t\t\t\t\t$files = glob( $target . '*', GLOB_MARK ); \r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach( $files as $file )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tdelete_files( $file ); \r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\trmdir( $target );\r\n\t\t\t\t} elseif(is_file($target)) {\r\n\t\t\t\t\tunlink( $target ); \r\n\t\t\t\t}\r\n\t\t\t}", "protected function removeFiles() {}", "function delete_files($obj,$where)\n\n\t{\n\n\t\t\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::delete_files() - PARAMETER LIST : ', $param_array);\n\n\n\n\t\tif(strlen(trim($obj->file_flds)) > 0)\n\n\t\t{\n\n\t\t\t\n\n\t\t\t$res = $this->fetch_flds($obj->cls_tbl, $obj->file_flds, $where);\n\n\t\t\t\n\n\t\t\t$fld_count = count(explode(\",\", $obj->file_flds));\n\n\n\n\t\t\twhile($data = mysql_fetch_row($res[0]))\n\n\t\t\t{\n\n\t\t\t\tfor($i = 0;$i < $fld_count; $i++)\n\n\t\t\t\t{\n\n\t\t\t\t\t$file_path = $obj->attachment_path . $data[$i];\n\n\t\t\t\t\t\n\n\t\t\t\t\tif(file_exists($file_path) && is_file($file_path))\n\n\t\t\t\t\tunlink($file_path);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\n\n\t\t}\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::delete_files() - Return Value : ', 'Deletes all the attachments made to the particular record and returns void');\n\n\n\n\t}", "function deletePhotos($inputArr) {\n $ro = new BaseRO();\n $album = $inputArr[\"albumName\"];\n $filesToDel = $inputArr[\"picurls\"];\n $numfiles = count($filesToDel);\n\n for ($i=0; $i < $numfiles; $i++)\n {\n $ro->success = unlink($filesToDel[$i]);\n $ro->retmsg = \"Deleted \" . $filesToDel[$i];\n if (!($ro->success)) {\n $ro->retcode = 4;\n $ro->retmsg = \"Couldn't delete files\";\n return $ro;\n }\n }\n\n return $ro;\n}", "private function cleanFiles($files) {\n foreach ($files as $v) {\n $file = $this->tmpFolder . '/' . $v;\n if(file_exists($file)) {\n unlink($file);\n }\n }\n }", "function scorm_delete_files($directory) {\n if (is_dir($directory)) {\n $files=scorm_scandir($directory);\n set_time_limit(0);\n foreach($files as $file) {\n if (($file != '.') && ($file != '..')) {\n if (!is_dir($directory.'/'.$file)) {\n unlink($directory.'/'.$file);\n } else {\n scorm_delete_files($directory.'/'.$file);\n }\n }\n }\n rmdir($directory);\n return true;\n }\n return false;\n}", "private function removeFiles($db, array $fileids, $linktype)\n {\n \tLogger::log($fileids, Zend_Log::DEBUG);\n \t$linktype = $db->quote($linktype);\n \tforeach ($fileids as $fileid)\n \t{Logger::log('FileID=' . $fileid . ' AND LinkType=' . $linktype);\n \t\t$db->delete('Files', 'FileID=' . $fileid . ' AND LinkType=' . $linktype);\n \t}\n }", "public function delete($files);", "function cleanTrash() {\n\t\t$result = $this->select(\"logo_url\", \"status=2\");\n\t\tif ($result)\n\t\tforeach ($result as $image){\n\t\t\tunlink(ROOT_PATH.\"gallery/avatar_upload/flash/storage/\".$image['logo_url']);\n\t\t}\n\t\t$results = $this->delete(\"status=2\");\n\t\tif ($results)\n\t\t\treturn 1;\n\t\treturn 0;\n\t}", "function delete_dir_and_allfiles ($path) {\n jimport('joomla.filesystem.file');\n jimport('joomla.filesystem.folder'); \n\n if (!is_dir ($path)) {\n return -1;\n }\n $dir = @opendir ($path);\n if (!$dir) {\n return -2;\n }\n\n while (($entry = @readdir($dir)) !== false) {\n if ($entry == '.' || $entry == '..') continue;\n if (is_dir ($path.'/'.$entry)) {\n $res = delete_dir_and_allfiles ($path.'/'.$entry);\n // manage errors\n if ($res == -1) {\n @closedir ($dir); \n return -2; \n } else if ($res == -2) {\n @closedir ($dir); \n return -2; \n } else if ($res == -3) {\n @closedir ($dir); \n return -3; \n } else if ($res != 0) { \n @closedir ($dir); \n return -2; \n }\n } else if (is_file ($path.'/'.$entry) || is_link ($path.'/'.$entry)) {\n // delete file\n $res = JFile::delete($path.'/'.$entry);\n if (!$res) {\n @closedir ($dir);\n return -2; \n }\n } else {\n @closedir ($dir);\n return -3;\n }\n }\n @closedir ($dir);\n // delete dir\n $res = JFolder::delete($path);\n if (!$res) {\n return -2;\n }\n return 0;\n}", "function cleanDirectories($aBooksDone, $aDirectories)\r\n{\r\n\t$result = 0;\r\n\r\n\t$originaltifdirectory = $aDirectories['original'];\r\n\tforeach ($aBooksDone as $itemnumber) {\r\n\t\t$orgitemdirectory = $originaltifdirectory . '\\\\' . $itemnumber;\r\n\r\n\t\t//check if there is a Thumbs.db file and if so, delete it\r\n\t\t$thumbsfile = $orgitemdirectory. '\\Thumbs.db';\r\n\t\tif (file_exists($thumbsfile)) {\r\n\t\t\t@unlink($thumbsfile);\r\n\t\t}\r\n\t\t$result = @rmdir($orgitemdirectory);\r\n\r\n\t}\r\n\r\n\treturn $result;\r\n}", "function serendipity_removeFiles($files = null) {\n global $serendipity, $errors;\n\n if (!is_array($files)) {\n return;\n }\n\n $backupdir = S9Y_INCLUDE_PATH . 'backup';\n if (!is_dir($backupdir)) {\n @mkdir($backupdir, 0777);\n if (!is_dir($backupdir)) {\n $errors[] = sprintf(DIRECTORY_CREATE_ERROR, $backupdir);\n return false;\n }\n }\n\n if (!is_writable($backupdir)) {\n $errors[] = sprintf(DIRECTORY_WRITE_ERROR, $backupdir);\n return false;\n }\n\n foreach($files AS $file) {\n $source = S9Y_INCLUDE_PATH . $file;\n $sanefile = str_replace('/', '_', $file);\n $target = $backupdir . '/' . $sanefile;\n\n if (!file_exists($source)) {\n continue;\n }\n\n if (file_exists($target)) {\n $target = $backupdir . '/' . time() . '.' . $sanefile; // Backupped file already exists. Append with timestamp as name.\n }\n\n if (!is_writable($source)) {\n $errors[] = sprintf(FILE_WRITE_ERROR, $source) . '<br />';\n } else {\n rename($source, $target);\n }\n }\n}", "public function deleteFile(array $data) {\n\n try {\n\n $entries = sizeof($data);\n // check size input params\n if ($entries == 1)\n {\n $files =$this->modelsManager->createBuilder()\n ->columns('TagsFiles.*')\n ->from(['TagsFiles'=>'App\\Models\\TagsFiles'])\n ->leftJoin('App\\Models\\Files', 'TagsFiles.file_id = Files.id', 'Files')\n ->leftJoin('App\\Models\\Tags', 'TagsFiles.tag_id = Tags.id', 'Tags')\n ->where('Tags.name = ?1', [1 => $data[array_keys($data)[0]]] )\n ->getQuery()\n ->execute();\n\n }elseif ($entries == 4) {\n\n // get user id\n $userId = $this->session->get(\"userId\");\n\n // find correct tagId\n $tag = Tags::findFirst(\n [\n \"name = :tag:\",\n \"bind\" => [\"tag\" => $data['tag']],\n ]);\n\n $single = explode(\".\", $data['file_name']);\n $search['name'] = $single[0];\n $search['extension'] = $single[1];\n\n // looking for user´s files\n $files =$this->modelsManager->createBuilder()\n ->columns('TagsFiles.*')\n ->from(['TagsFiles'=>'App\\Models\\TagsFiles'])\n ->leftJoin('App\\Models\\Files', 'TagsFiles.file_id = Files.id', 'Files')\n ->leftJoin('App\\Models\\Tags', 'TagsFiles.tag_id = Tags.id', 'Tags')\n ->where('Files.userId = ?1 AND Tags.id = ?2 AND Files.'.array_keys($search)[0].' = ?3 AND Files.'.array_keys($search)[1].' = ?4 \n AND Files.version = ?5 AND Files.date = ?6',\n [1 => $userId,\n 2 => $tag->id,\n 3 => $search[array_keys($search)[0]],\n 4 => $search[array_keys($search)[1]],\n 5 => $data['version'],\n 6 => $data['date'],\n ])\n ->getQuery()\n ->execute();\n\n }\n\n $count = $files->count();\n // for each file find Client, and Tags\n foreach ($files as $file){\n\n if ($count == 1 && $file->tag->counttagsFiles() == 1){\n\n $client = Clients::findFirst(\n [\n 'conditions' => 'name = :name:',\n 'bind' => [\n 'name' => $this->session->get(\"client_id\")\n ]\n ]\n );\n\n $client_tags = ClientsTags::findFirst(\n [\n 'conditions' => 'client_id = :client_id: AND tag_id = :tag_id:',\n 'bind' => [\n 'client_id' => $client->id,\n 'tag_id' => $file->tag->id\n\n ]\n ]\n );\n // delete them\n $client_tags->delete();\n $file->file->delete();\n $file->tag->delete();\n\n\n }\n $count --;\n\n $file->file->delete();\n\n $userId = $this->session->get(\"userId\");\n $dir = FILES_PATH.$userId.'/';\n // delete the file from space\n unlink($dir.$file->file->id.'_'.$file->file->name.'.'.$file->file->extension);\n if ($this->is_dir_empty($dir)) {\n rmdir($dir);\n }\n }\n\n } catch (\\PDOException $e) {\n if ($e->getCode() == 12004) {\n throw new ServiceException('Cannot find files', self::ERROR_UNABLE_TO_FIND_FILES);\n } else {\n throw new ServiceException($e->getMessage(). $e->getCode(), $e); }\n }catch (\\Exception $e){\n $this->response->setStatusCode(500, 'Internal Server Error');\n }\n\n }", "public static function delete($_paths)\r\n {\r\n $paths = is_array($_paths) ? $_paths : func_get_args();\r\n\r\n $success = true;\r\n\r\n foreach ($paths as $path)\r\n {\r\n try\r\n {\r\n if(! @unlink($path))\r\n {\r\n $success = false;\r\n }\r\n\r\n }\r\n catch(ErrorException $_e)\r\n {\r\n $success = false;\r\n }\r\n }\r\n\r\n return $success;\r\n }", "public function maybe_delete_files() {\n\n\t\t// If there are files to delete, delete them.\n\t\tif ( ! empty( gf_dropbox()->files_to_delete ) ) {\n\n\t\t\t// Log files being deleted.\n\t\t\t$this->log_debug( __METHOD__ . '(): Deleting local files => ' . print_r( gf_dropbox()->files_to_delete, 1 ) );\n\n\t\t\t// Delete files.\n\t\t\tarray_map( 'unlink', gf_dropbox()->files_to_delete );\n\n\t\t}\n\n\t}", "public static function checkFileExistsnDelete(array $files)\n {\n $status = false;\n foreach($files as $key => $file)\n {\n if(Storage::exists($file))\n {\n $status = Storage::delete($file);\n }\n }\n\n return $status;\n }", "function eliminarDirectorio($directorio){\n foreach(glob($directorio . \"/*\") as $archivos_carpeta){\n if (is_dir($archivos_carpeta)){\n eliminarDirectorio($archivos_carpeta);\n }\n else{\n unlink($archivos_carpeta);\n }\n }\n rmdir($directorio);\n}", "public function remove($files)\r\n {\r\n if (is_array($files)) {\r\n /* percorre o array escluindo os arquivos */\r\n foreach ($files as $file) {\r\n @unlink($this->_destination . $file);\r\n }\r\n } else if (is_string($files)) {\r\n /* excluir o arquivo passado */\r\n @unlink($this->_destination . $files);\r\n }\r\n }", "function deleteFileFromUpload( $files, $folder ){\n\tforeach( $files as $file ){\n\t\tif ( $file ){\n\t\t\tif ( !( @unlink( WP_CONTENT_DIR . '/uploads/rsjp/' . $folder . '/' . $file ) ) ) {\n\t\t\t\t$message = '<p style=\"color:#A83434;\"><b>' . __( 'Could not delete the attached file(s).' ) . '</b></p>';\n\t\t\t\t$deleted = false;\n\t\t\t} else {\n\t\t\t\t$message = '<p style=\"color:#369B38;\"><b>' . __( 'Attached file(s) were successfully deleted.' ) . '</b></p>';\n\t\t\t\t$deleted = true;\n\t\t\t}\n\t\t}\n\t}\t\n\t\n\treturn array( $message, $deleted );\n}", "function borrarCarpeta($carpeta) {\r\n foreach(glob($carpeta . \"/*\") as $archivos_carpeta){ \r\n if (is_dir($archivos_carpeta)){\r\n if($archivos_carpeta != \".\" && $archivos_carpeta != \"..\") {\r\n borrarCarpeta($archivos_carpeta);\r\n }\r\n } else {\r\n unlink($archivos_carpeta);\r\n }\r\n }\r\n rmdir($carpeta);\r\n}", "function delete_dir_with_file($target)\n{\n if (is_dir($target)) {\n $files = glob($target . '*', GLOB_MARK); //GLOB_MARK adds a slash to directories returned\n\n foreach ($files as $file) {\n delete_dir_with_file($file);\n }\n\n if (file_exists($target)) {\n rmdir($target);\n }\n } elseif (is_file($target)) {\n unlink($target);\n }\n}", "function fileError($basePath, $filelist)\n{\n\tforeach($filelist as $kx => $vx)\n\t{\n\t\tif ($vx != NULL)\n\t\t{\n\t\t\tunlink($basePath . '/' . $vx);\n\t\t}\n\t}\n}", "private function cleanupFiles() {\n\t\t$this -> loadModel('Archivo');\n\t\t$items = $this -> Archivo -> find('all');\n\t\t$db_files = array();\n\t\tforeach ($items as $key => $item) {\n\t\t\t$db_files[] = $item['Archivo']['ruta'];\n\t\t}\n\t\t$dir_files = array();\n\t\t$dir_path = APP . 'webroot/files/uploads/solicitudesTitulacion';\n\t\tif ($handle = opendir($dir_path)) {\n\t\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\t\tif ($entry != 'empty' && is_file($dir_path . DS . $entry))\n\t\t\t\t\t$dir_files[] = 'files/uploads/solicitudesTitulacion/' . $entry;\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\tforeach ($dir_files as $file) {\n\t\t\tif (!in_array($file, $db_files)) {\n\t\t\t\t$file = explode('/', $file);\n\t\t\t\t$file = $file[count($file) - 1];\n\t\t\t\t$tmp_file_path = $dir_path . DS . $file;\n\t\t\t\tunlink($tmp_file_path);\n\t\t\t}\n\t\t}\n\t}", "static function deleteFiles($pool) {\n $path = JPATH_COMPONENT.DS.\"data\".DS.$pool;\n system(\"rm -rf \".$path);\n $path = JPATH_COMPONENT.DS.\"private\".DS.$pool;\n system(\"rm -rf \".$path);\n }", "function deleteBandwidthMedia ($files) {\n foreach ($files as $index => $file) {\n unlink ($file);\n }\n}", "function chkFileExists($fileName, $fileFolder, $dspTxt)\n{\n// list($refNumber, $section) = explode('_', $fileName);\n $baseDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;\n //$folder2Scan = $baseDir . $fileFolder . DIRECTORY_SEPARATOR . $fileRefNumber;\n $folder2Scan = $baseDir . $fileFolder;\n\n if (!empty($fileName)) {\n //$directory = getcwd() . $folder2Scan;\n $files2 = glob($folder2Scan . DIRECTORY_SEPARATOR . $fileName . \"*\");\n\n if ($files2) {\n $filecount = count($files2);\n for ($iFiles2 = 0; $iFiles2 < $filecount; ++$iFiles2) {\n ?>\n <!-- <div class=\"col-sm-3\">-->\n <?php\n $tmpGenID4DelIcon = explode(\".\", str_replace($baseDir . $fileFolder . DIRECTORY_SEPARATOR, '', $files2[$iFiles2]));\n $genID4DelIcon = $tmpGenID4DelIcon[0];\n ?>\n <a id=\"id4DelFile_<?= $genID4DelIcon; ?>\"\n href=\"./deleteFile.php?file2Del=<?= $files2[$iFiles2]; ?>&file2Ret=<?= $_SERVER['SCRIPT_NAME']; ?>\"><i\n class=\"far fa-minus-square text-danger\"></i></a>\n <a href=\"<?= str_replace($baseDir, '', $folder2Scan) . str_replace($folder2Scan, '', $files2[$iFiles2]); ?>\"\n target=\"_blank\"><span\n class=\"badge badge-pill badge-primary\"> <?= $dspTxt; ?><!--ที่ --><?/*= $iFiles2 + 1*/; ?>\n </a>\n <!-- </div>-->\n <?php\n }\n } else {\n // Do nothing.....\n echo \"<span class=\\\"badge badge-pill badge-warning\\\">-</span>\";\n }\n }\n}", "function narrative_delete_pictures($pictures, $new_narrative_dir, $pictures_for_deletion = array())\n{\n foreach ($pictures as $i => $picture)\n {\n if (in_array(basename($picture), $pictures_for_deletion))\n {\n $picture_dest = $new_narrative_dir . 'deleted/' . basename($picture);\n }\n else\n {\n $picture_dest = $new_narrative_dir . basename($picture);\n }\n rename($picture, $picture_dest);\n }\n}", "public function deleteTempFiles($data = null): void\n {\n $data = $data ?? $this->files;\n if(is_array($data)) {\n // Determina si el array es asociativo, esto indica que contiene un sol archivo\n // Si no es asociativo es un array con varios archivos\n $isAssoc = function (array $arr): bool {\n if (array() === $arr) {\n return false;\n }\n return array_keys($arr) !== range(0, count($arr) - 1);\n };\n\n // Realiza la conversión del array a un archivo\n $delete = function ($fileData) {\n @unlink(storage_path('app/'.$fileData['path'].'/'.$fileData['name']));\n $file_system = new Filesystem();\n // Directorio queda vacío\n if($file_system->exists(storage_path('app/'.$fileData['path'])) && empty($file_system->files(storage_path('app/'.$fileData['path'])))) {\n $file_system->deleteDirectory(storage_path('app/'.$fileData['path']));\n }\n };\n\n if($isAssoc($data)) {\n $delete($data);\n } else {\n for($i = 0; $i < count($data); $i++) {\n if(is_array($data[$i]) && $isAssoc($data[$i])) {\n $delete($data[$i]);\n }\n }\n }\n }\n }", "function DeleteUploadedFiles($pSet, $deleted_values)\n{\n\tforeach($deleted_values as $field => $value)\n\t{\n\t\tif(($pSet->getEditFormat($field) == EDIT_FORMAT_FILE || $pSet->getPageTypeByFieldEditFormat($field, EDIT_FORMAT_FILE) != \"\") \n\t\t\t&& $pSet->isDeleteAssociatedFile($field))\n\t\t{\n\t\t\tif(!strlen($value))\n\t\t\t\treturn;\n\t\t\t\t\n\t\t\t$filesArray = my_json_decode($value);\n\t\t\tif(!is_array($filesArray) || count($filesArray) == 0)\n\t\t\t{\n\t\t\t\t$filesArray = array(array(\"name\" => $pSet->getUploadFolder($field).$value));\n\t\t\t\tif($pSet->getCreateThumbnail($field))\n\t\t\t\t\t$filesArray[0][\"thumbnail\"] = $pSet->getUploadFolder($field).$pSet->getStrThumbnail($field).$value;\n\t\t\t}\n\t\t\n\t\t\tforeach($filesArray as $delFile)\n\t\t\t{\n\t\t\t\t$filename = $delFile[\"name\"];\n\t\t\t\t$isAbs = $pSet->isAbsolute($field) || isAbsolutePath($filename);\n\t\t\t\tif(!$isAbs)\n\t\t\t\t\t$filename = getabspath($filename);\n\t\t\t\trunner_delete_file($filename);\n\t\t\t\tif($delFile[\"thumbnail\"] != \"\")\n\t\t\t\t{\n\t\t\t\t\t$filename = $delFile[\"thumbnail\"];\n\t\t\t\t\tif(!$isAbs)\n\t\t\t\t\t\t$filename = getabspath($filename);\n\t\t\t\t\trunner_delete_file($filename);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function cleanUpTmpFiles($target){\n if (is_dir($target)) {\n $files = glob($target . '*', GLOB_MARK); //GLOB_MARK adds a slash to directories returned\n\n foreach ($files as $file) {\n cleanUpTmpFiles($file);\n }\n\n // Checks if dir is empty\n if (!(new FilesystemIterator($target))->valid()) {\n rmdir($target);\n }\n } elseif (is_file($target)) {\n unlink($target);\n }\n}", "public function deleteFiles($del){\n\t\tforeach ($del as $file) {\n\t\t\techo \" : deleting : \" .$file. \" <br/>\";\n\t\t\tunlink($file);\n\t\t}\n\t}", "public function delete( $filePath )\n { \n $this->accumulatorStart();\n \n if ( is_array( $filePath ) )\n {\n foreach( $filePath as $file )\n {\n if(strpos($file,'/storage/') !== FALSE )\n { \n try\n {\n $this->s3->deleteObject(array('Bucket' => $this->bucket,\n 'Key' => $file ));\n $ret = true;\n }catch(S3Exception $e)\n {\n $ret = false;\n eZDebug::writeError( \"There was an error deletting the object.$file\\n\" );\n }\n }\n else\n {\n $item = $this->pool->getItem($file);\n $item->clear();\n\n $dfsPath = $this->makeDFSPath( $file );\n $ret = @unlink( $dfsPath );\n\n if ( $ret )\n eZClusterFileHandler::cleanupEmptyDirectories( $dfsPath );\n }\n }\n }\n else\n {\n if(strpos($filePath,'/storage/') !== FALSE )\n {\n try\n {\n $this->s3->deleteObject(array('Bucket' => $this->bucket,\n 'Key' => $filePath));\n $ret=true;\n }catch(S3Exception $e)\n {\n $ret=false;\n eZDebug::writeError( \"There was an error deletting the object.$file\\n\" );\n }\n }\n else\n {\n $item = $this->pool->getItem($filePath);\n $item->clear();\n\n $dfsPath = $this->makeDFSPath( $filePath );\n $ret = @unlink( $dfsPath );\n\n if ( $ret )\n eZClusterFileHandler::cleanupEmptyDirectories( $dfsPath );\n }\n }\n \n $this->accumulatorStop();\n\n return $ret;\n }", "function delete() {\n try {\n $delete = \"Name: \" . $_POST[\"username\"] . \" , Email: \" . $_POST[\"email\"] . \" , Phone: \" . $_POST[\"phone\"];\n $data = file($this->directory);\n $out = array();\n \n foreach ($data as $line) {\n if (trim($line) != $delete) {\n $out[] = $line;\n }\n }\n\n $file = fopen($this->directory, \"w+\");\n flock($file, LOCK_EX);\n foreach ($out as $line) {\n fwrite($file, $line);\n }\n flock($file, LOCK_UN);\n fclose($file);\n return true;\n }\n catch(Exception $e) {\n echo \"Delete not successful: \" . $e;\n return false;\n }\n }", "function deleteFiles($fileIds) {\n\n $this->connection = $this->ConnectDB();\n\n if ($this->connection == NULL) {\n try {\n $this->CloseConnectionDB();\n } catch (Exception $exc) {\n \n }\n return FALSE;\n }\n\n $qry = \"DELETE FROM files WHERE id_file in ($fileIds)\";\n\n if (!mysql_query($qry, $this->connection)) {\n try {\n $this->CloseConnectionDB();\n } catch (Exception $exc) {\n \n }\n return FALSE;\n }\n\n try {\n $this->CloseConnectionDB();\n } catch (Exception $exc) {\n \n }\n\n return TRUE;\n }", "public function purgeAllClone($stri_extra_id='')\n {\n $stri_file_name=serialisable::constructFileName($stri_extra_id);\n $stri_user_temp_path=serialisable::constructUserTempPath();\n $stri_file=$stri_user_temp_path.\"/\".$stri_file_name;\n $lenght = strlen($stri_file)-4;//calcule la taille de la chaine -4 (qui correspond a l'extension .slz)\n \n $obj_dir_reader=new file_reader_writer($stri_user_temp_path);\n $arra_file=$obj_dir_reader->readDirectory();\n \n foreach($arra_file as $stri_file2)//parcours le repertoire\n {\n $va=substr_compare($stri_file,$stri_file2,'0',$lenght);\n \n if($va==0)\n { unlink($stri_file2);\n //echo $stri_file.\" \".$stri_file2.\" \".$va.\"<br />\";\n }\n }\n \n return false; \n }", "public function delete_files($ret, $files, $storage_arr = false) {// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.Found\n\n\t\tif (is_string($files)) $files = array($files);\n\n\t\tif ($storage_arr) {\n\t\t\t$url = $storage_arr['url'];\n\t\t} else {\n\t\t\t$this->bootstrap();\n\t\t\t$options = $this->get_options();\n\t\t\tif (!array($options) || !isset($options['url'])) {\n\t\t\t\t$this->log('No '.$this->desc.' settings were found');\n\t\t\t\t$this->log(sprintf(__('No %s settings were found', 'updraftplus'), $this->desc), 'error');\n\t\t\t\treturn 'authentication_fail';\n\t\t\t}\n\t\t\t$url = untrailingslashit($options['url']);\n\t\t}\n\n\t\t$logurl = preg_replace('/:([^\\@:]*)\\@/', ':(password)@', $url);\n\t\t\n\t\t$ret = true;\n\t\t\n\t\tforeach ($files as $file) {\n\t\t\t$this->log(\"Delete remote: $logurl/$file\");\n\t\t\tif (!unlink(\"$url/$file\")) {\n\t\t\t\t$this->log(\"Delete failed\");\n\t\t\t\t$ret = 'file_delete_error';\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "private function clean() {\n foreach (glob($this->dir . '/*') as $file) {\n $name = basename($file);\n if (!preg_match('/^\\d{10}/', $name))\n throw new \\Exception('Unexpected filename. Make sure \"' . $this->dir . '\" contains only build artefacts (and is thus safe to clean) and try again.');\n $deleted = unlink($file);\n if (!$deleted)\n throw new \\Exception('Failed to delete \"' . $file . '\". Make sure target directory is writable to allow delete of other users files.');\n }\n }", "public function beforeDelete(){\n $files = $this->getFiles()->all();\n foreach($files as $file)\n $file->delete();\n\n return parent::beforeDelete();\n }", "function fm_del_shared($ids) {\r\n\tglobal $USER;\r\n\t\r\n\tif (isset($_POST['yesdel'])) {\r\n\t\tif (is_array($ids)) {\r\n\t\t\tforeach($ids as $id) {\r\n\t\t\t\t// Ensures they can even view file to delete permission to view it\r\n\t\t\t\tif ($id != 0) {\r\n\t\t\t\t\tdelete_records('fmanager_shared', 'id', $id);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t} else if (isset($_POST['nodel'])) {\r\n\t\treturn true;\r\n\t}\r\n}", "function eliminarDirectorio($directorio,$rutaActual){\n\t$carpeta = @scandir($rutaActual.\"/\".$directorio);\n\tif (count($carpeta) > 2){\n\t echo \"El directorio contiene Archivos, verifique la informacion\";\n\t}else{\n\t if(rmdir($rutaActual.\"/\".$directorio)){\n\t\techo \"<script type='text/javascript'> abrirDirectorio('\".$rutaActual.\"'); </script>\";\n\t }else{\n\t\techo \"<script type='text/javascript'> alert('Error al ejecutar la operacion'); </script>\";\n\t }\n\t}\n }", "public static function delete($paths)\n\t{\n\t\t$paths = is_array($paths) ? $paths : func_get_args();\n\t\t$success = true;\n\n\t\tforeach ($paths as $path){\n\t\t\ttry{\n\t\t\t\tif(! @unlink($path)){\n\t\t\t\t\t$success = false;\n\t\t\t\t}\n\t\t\t}catch(Exception $e){\n\t\t\t\t$success = false;\n\t\t\t}\n\t\t}\n\n\t\treturn $success;\n\t}", "public function file_cleanup(){\n\t\t$query = $this->db->get('carousels');\n\t\t$map = directory_map('./carousel/', 1);\n\t\t$g = \"x\";\n\t\tforeach($map as $file)\n\t\t{\n\t\t\t\t\t\t\t\n\t\t\t//return $query->result();\n\t\t\t$g = $g . \"--\";\n\t\t\t$x = 0;\n\t\t\t$soundfile=\"\";\n\t\t\tforeach($query->result() as $row){\n\t\t\t\t//return $row;\n\t\t\t\t$picture = $row->image;\n\t\t\t\t$g = $g . \"<\" . $soundfile . \"-\" . $file . \">\";\n\t\t\t\tif ($file==$picture)\t{\n\t\t\t\t\t$g = $g . \"files are the same\";\n\t\t\t\t\t$x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($x==0 )\n\t\t\t{\n\t\t\t \t$g = $g . \"we're in the loop\";\n\t\t\t\tunlink(\"./carousel/\" . $file);\n\t\t\t\t\t$g = $g . \" removed: \" . \"./carousel/\" . $file . \" - \";\n\t\t\t\t\n\t\t\t}\n\t\t\tif (strlen($g) > 700)\n \t\t\t\t$g = substr($g, 0, 700);\n\t\t}\n\t\t//return $g;\n\t\t//$this->session->set_flashdata('carousel_saved', $file . \"--\" . $soundfile );\n\t}", "public function delete($paths)\n {\n $paths = is_array($paths) ? $paths : func_get_args();\n\n $success = true;\n\n foreach ($paths as $path) {\n if (array_key_exists($path, $this->files)) {\n unset($this->files[$path]);\n $success = true;\n }\n else {\n $success = false;\n }\n }\n\n return $success;\n }", "public function deleteByFileIds()\n\t{\n\t\tif ( isset( \\IPS\\Request::i()->fileIds ) )\n\t\t{\n\t\t\t$ids = \\IPS\\Request::i()->fileIds;\n\t\t\t\n\t\t\tif ( ! \\is_array( $ids ) )\n\t\t\t{\n\t\t\t\t$try = json_decode( $ids, TRUE );\n\t\t\t\t\n\t\t\t\tif ( ! \\is_array( $try ) )\n\t\t\t\t{\n\t\t\t\t\t$ids = array( $ids );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ids = $try;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( \\count( $ids ) )\n\t\t\t{\n\t\t\t\t\\IPS\\cms\\Media::deleteByFileIds( $ids );\n\t\t\t}\n\t\t}\n\t}", "function borrar ($arrayLineas,$id,$foto){\n $valorRetornado=false; \n foreach ($arrayLineas as $key => $value) {\n $auxArray= (array)$value; \n if($auxArray){\n if($auxArray[\"patente\"] === $id){\n var_dump($foto[\"name\"]);\n var_dump($auxArray[\"foto\"]);\n if($foto[\"name\"] !== $auxArray[\"foto\"] ){\n var_dump(\"./imagenes/\".$auxArray[\"foto\"]);\n //cambia de directorio la imagen vieja a backUpFotos, pero no la conserva.\n //rename(\"./imagenes/\".$auxArray[\"foto\"], './backUpFotos/'.$auxArray[\"patente\"].$auxArray[\"foto\"]);\n //cambia de directorio la imagen vieja a backUpFotos, pero la conserva en ambos directorios.\n copy(\"./imagenes/\".$auxArray[\"foto\"], './backUpFotos/'.$auxArray[\"patente\"].$auxArray[\"foto\"]);\n }\n unset($arrayLineas[$key]);\n $valorRetornado=true;\n break;\n }\n } \n } \n if($valorRetornado){\n echo(\"Se Removio: \".$id.\"\\n\\n\");\n }\n else{\n echo('No se encontro'.\"\\n\\n\");\n $arrayLineas=null;\n } \n return $arrayLineas;\n}", "function file_delete($file,$path)\n{\n\tif(unlink($path.\"/\".$file))\n\t{\n\t\treturn true;\n\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function removeUnusedFiles( )\r\n{\r\n // select all files that aren't referenced anymore\r\n $sql = \"SELECT DISTINCT f.id, f.filename\r\n\t\t\tFROM \" . dropbox_cnf(\"tbl_file\") . \" f\r\n\t\t\tLEFT JOIN \" . dropbox_cnf(\"tbl_person\") . \" p ON f.id = p.file_id\r\n\t\t\tWHERE p.user_id IS NULL\";\r\n $result = api_sql_query($sql,__FILE__,__LINE__);\r\n while ( $res = mysql_fetch_array( $result))\r\n {\r\n\t\t//delete the selected files from the post and file tables\r\n $sql = \"DELETE FROM \" . dropbox_cnf(\"tbl_post\") . \" WHERE file_id='\" . $res['id'] . \"'\";\r\n $result1 = api_sql_query($sql,__FILE__,__LINE__);\r\n $sql = \"DELETE FROM \" . dropbox_cnf(\"tbl_file\") . \" WHERE id='\" . $res['id'] . \"'\";\r\n $result1 = api_sql_query($sql,__FILE__,__LINE__);\r\n\r\n\t\t//delete file from server\r\n @unlink( dropbox_cnf(\"sysPath\") . \"/\" . $res[\"filename\"]);\r\n }\r\n}", "function deleteTmpFiles()\n{\n global $tmpFiles1;\n global $tmpFiles2;\n\n foreach ($tmpFiles1 as $tmpFile){\n exec(\"rm -f $tmpFile\");\n }\n\n foreach ($tmpFiles2 as $tmpFile){\n exec(\"rm -f $tmpFile\");\n }\n}", "public function delete($paths)\n {\n $paths = is_array($paths) ? $paths : func_get_args();\n\n $result = [];\n return all(array_map(function ($path) use (&$success, &$result) {\n return $this->asyncFs->file($path)\n ->remove()\n ->then(fn() => $result[] = true)\n ->otherwise(fn() => $result[] = true);\n }, $paths))->then(fn($results) => !in_array(false, $result));\n }", "private function deleteFile($deletedFiles, $ownerSeq)\r\n\t{\r\n\t\tif($deletedFiles != \"\"){\r\n\t\t\t$arrDeletedFiles = split(\",\", $deletedFiles);\r\n\t\t\tforeach ($arrDeletedFiles as $deletedSeq){\t\t\r\n\t\t\t\t$fileVo \t= VOHelper::prepareFileVo($_SERVER[\"REMOTE_ADDR\"], $this->get(\"session\")->get(\"userSession\")[\"username\"]);\r\n\t\t\t\t$fileVo->setSeq($deletedSeq);\r\n\t\t\t\t$fileVo->setOwnerSeq($ownerSeq);\r\n\t\t\t\t\r\n\t\t\t\t$this->get(\"my.common.fileService\")->delete($fileVo);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function testDeleteFile()\n {\n\n }", "private function deleteRecords(){\r\n\t\r\n\t\t$fileNames = explode(',', $this->collection['images']);\r\n\t\t// remove imagerecords which are not used anymore\r\n\t\tforeach($this->images as $filename => $image){\r\n\t\t\tif(array_search($filename, $fileNames) === false){\r\n\t\t\r\n\t\t\t\t$this->db->exec_DELETEquery('tx_gorillary_images', \"image='$filename' AND collection='\".$this->collection['uid'].\"'\");\r\n\t\t\t\t//unset ($this->images[$filename]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function delete_all_files($user){\n $data['acc_yr'] = str_replace('/','-' ,$this->acc_year[0]['academic_year']);\n $acc_yr = str_replace('/','-' ,$this->acc_year[0]['academic_year']);\n \n $files = glob('./sProMAS_documents/'. $acc_yr.'/registration_files/'.$user.'/*'); // get all file names\n foreach($files as $file){ // iterate files\n if(is_file($file)){\n if(unlink($file)){\n $file_del=TRUE;\n } // delete file\n }\n }\n $data['user']=$user;\n if($file_del==TRUE){\n $data['message'] = 'File deleted successfully';\n } else {\n $data['message'] = 'File not deleted, Try again';\n } \n //$data['views']= array('manage_users/add_group_view');\n //page_load($data);\n \n }", "private function clean() {\n\t\t$types = ['.aux', '.fdb_latexmk', '.fls', '.log', '.out', '.tex', '.toc'];\n\t\t$s = '';\n\t\tforeach (scandir($this -> directory) as $file) {\n\t\t\tif ($file === '.' || $file === '..') continue;\n\t\t\tforeach ($types as $t) {\n\t\t\t\t$extension = substr($file, 0-strlen($t));\n\t\t\t\tif (in_array($extension, $types) && file_exists($this -> directory . '/' . $file)) {\n\t\t\t\t\tunlink($this -> directory . '/' . basename($file));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function deleteUnusedFiles(){\n \n }", "function clear($dir,$mode='all',$filter=null) {\n\t\t$handle = opendir($dir);\n\t\twhile (false!==($item = readdir($handle))) {\n\t\t\tif($item != '.' && $item != '..') {\n\t\t\t\t$delete=false;\n\t\t\t\tif(is_dir($dir.'/'.$item)) {\n\t\t\t\t\tcmfcDirectory::clear($dir.'/'.$item,$mode,$filter);\n\t\t\t\t\tif ($mode=='all') {\n\t\t\t\t\t\t$delete=true;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$delete=true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!is_null($filter)) {\n\t\t\t\t\tif ($delete) {\n\t\t\t\t\t\tif (isset($filter['path'])) {\n\t\t\t\t\t\t\t$r=preg_match($filter['path'],$dir.'/'.$item);\n\t\t\t\t\t\t\tif ($filter['path'][0]=='!') {\n\t\t\t\t\t\t\t\tunset($filter['path'][0]);\n\t\t\t\t\t\t\t\t$r=($r==true)?false:true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!$r) {\n\t\t\t\t\t\t\t\t$delete=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\tif ($delete and is_dir($dir.'/'.$item)) {\n\t\t\t\t\t\tif (isset($filter['directory'])) {\n\t\t\t\t\t\t\t$r=preg_match($filter['directory'],$item);\n\t\t\t\t\t\t\tif ($filter['directory'][0]=='!') {\n\t\t\t\t\t\t\t\tunset($filter['directory'][0]);\n\t\t\t\t\t\t\t\t$r=($r==true)?false:true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!$r) {\n\t\t\t\t\t\t\t\t$delete=false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (isset($filter['file'])) {\n\t\t\t\t\t\t\t$r=preg_match($filter['file'],$item);\n\t\t\t\t\t\t\tif ($filter['file'][0]=='!') {\n\t\t\t\t\t\t\t\tunset($filter['file'][0]);\n\t\t\t\t\t\t\t\t$r=($r==true)?false:true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!$r) {\n\t\t\t\t\t\t\t\t$delete=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\t\n\t\t\t\tif ($delete==true) {\n\t\t\t\t\tunlink($dir.'/'.$item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($handle);\n\t\t$success = true;\n\t\treturn $success;\n\t}", "function deleteFile($db, $strDetailID = \"\")\n{\n global $words;\n $bolNewData = true;\n if ($strDetailID != \"\") {\n $strSQL = \"SELECT * FROM hrd_training_request \";\n $strSQL .= \"WHERE id = '$strDetailID' \";\n $resDb = $db->execute($strSQL);\n if ($rowDb = $db->fetchrow($resDb)) {\n $strFile = $rowDb['doc'];\n if ($strFile != \"\") {\n if (file_exists(\"trainingdoc/\" . $strFile)) {\n unlink(\"trainingdoc/\" . $strFile);\n }\n $strSQL = \"UPDATE hrd_training_request SET doc = '' WHERE id = '$strDetailID' \";\n $resExec = $db->execute($strSQL);\n //writeLog(ACTIVITY_DELETE, MODULE_PAYROLL,\"file $strDetailID\",0);\n }\n }\n }\n return true;\n}", "public function delete(array|string $paths): bool\n {\n $paths = Arr::is($paths) ? $paths : func_get_args();\n\n $success = true;\n\n foreach ($paths as $path) {\n try {\n if (!@unlink($path)) {\n $success = false;\n }\n } catch (Exception) {\n $success = false;\n }\n }\n\n return $success;\n }", "function DeleteFile($id, $CheminU) {\r\n if (is_file($CheminU.\"/\".$id)) unlink($CheminU.\"/\".$id);\r\n}", "public function wp_clean_files()\n\t{\n\n\t\tforeach ($this->_fileswp as $key => $file) {\n\t\t\tif(is_dir($file)) {\n\t\t\t\t$this->rrmdir($file);\n\t\t\t} else {\n\t\t\t\t@unlink($file);\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function scan_directory($directory) {\n $dir = scandir($directory);\n foreach ($dir as $d) {\n if ($d === '.' or $d === '..')\n continue;\n\n if (is_dir($directory . '/' . $d)) {\n //code to use if directory\n scan_directory($directory . '/' . $d);\n } else {\n //code to use if file \n $type = pathinfo($directory . '/' . $d, PATHINFO_EXTENSION);\n if ($type == \"mp4\" || $type == \"html\") {\n //do nothing \n continue;\n } else {\n if (unlink($directory . '/' . $d)) {\n echo '<strong>Deleted</strong>'.$directory . '/' . $d . '<br/><br/>';\n }\n }\n }\n }\n}", "public function deleteJunk()\n\t{\n\t\t$path = $this->path();\n\t\t$dir = dirname($path);\n\n\t\t/* If the attachment already doesn't exist, we're \"clean\" */\n\t\tif(!is_dir($dir))\n\t\t\treturn true;\n\n\t\t$valid = array(basename($path));\n\n\t\tif(isset($this->_options['styles']))\n\t\t\tforeach($this->_options['styles'] as $k => $v)\n\t\t\t\t$valid[] = basename($this->path($k));\n\n\t\t$valid = array_merge($valid, array('.', '..'));\n\n\t\t$objects = scandir(dirname($this->path()));\n\n\t\tforeach($objects as $object)\n\t\t\tif(!in_array($object, $valid))\n\t\t\t\tunlink(\"{$dir}/{$object}\");\t\t\t\t\t\n\n\t\treturn true;\n\t}", "function removePermanentlyDeletedFiles() {\n try {\n DB::beginWork('Start removing permanently deleted files');\n $files_to_delete = array();\n\n defined('STATE_DELETED') or define('STATE_DELETED', 0); // Make sure that we have STATE_DELETED constant defined\n\n if ($this->isModuleInstalled('files')) {\n // find file ids which are deleted\n $file_ids = DB::executeFirstColumn('SELECT id FROM ' . TABLE_PREFIX . 'project_objects WHERE type = ? AND state = ?', 'File', STATE_DELETED);\n // add their locations to cumulative list\n $files_to_delete = array_merge($files_to_delete, (array) DB::executeFirstColumn('SELECT varchar_field_2 FROM ' . TABLE_PREFIX . 'project_objects WHERE type = ? AND id IN (?)', 'File', $file_ids));\n // add file versions locations to the list\n $files_to_delete = array_merge($files_to_delete, (array) DB::executeFirstColumn('SELECT location FROM ' . TABLE_PREFIX . 'file_versions WHERE file_id IN (?)', $file_ids));\n // delete file versions\n DB::execute('DELETE FROM ' . TABLE_PREFIX . 'file_versions WHERE file_id IN (?)', $file_ids);\n } // if\n\n // add attachment locations to the list\n $files_to_delete = array_merge($files_to_delete, (array) DB::executeFirstColumn('SELECT location FROM ' . TABLE_PREFIX . 'attachments WHERE state = ?', STATE_DELETED));\n\n // delete all files related to previously deleted objects\n if (is_foreachable($files_to_delete)) {\n foreach ($files_to_delete as $file_to_delete) {\n $full_path_to_delete = UPLOAD_PATH . '/' . $file_to_delete;\n if (is_file($full_path_to_delete)) {\n @unlink($full_path_to_delete);\n } // if\n } // foreach\n } // if\n\n DB::commit('Successfully removed permanently deleted files');\n } catch (Exception $e) {\n DB::rollback('Failed to remove permanently deleted files');\n return $e->getMessage();\n } // if\n\n return true;\n }", "protected function preDelete($keyValueArray) {\n $resources = $this->getAllWhere($keyValueArray, 'e.*');\n if ($resources) {\n foreach ($resources as $resource) {\n if ($resource && file_exists($resource['file_path'] . $resource['file_name'])) {\n if (!@unlink($resource['file_path'] . $resource['file_name'])) {\n log_message('error', 'Could Not Delete: ' . $resource['file_path'] . $resource['file_name']);\n }\n }\n $thumbs[] = \"_tiny\";\n $thumbs[] = \"_small\";\n $thumbs[] = \"_big\";\n $thumbs[] = \"_admin\";\n foreach ($thumbs as $thumb) {\n $thumbPath = site_image_thumb_path($thumb, $resource);\n if (file_exists($thumbPath)) {\n @unlink($thumbPath);\n }\n }\n }\n }\n }", "public static function deleteUploadedFiles($filenames) {\n\n $resultOk = true;\n\n foreach($filenames as $filename) {\n if ($filename) {\n $resultOk = $resultOk && self::deleteUploadedFile($filename);\n }\n }\n return $resultOk;\n }", "function deleteAssignFile($id,$conn){\r\n\r\n //get file path\r\n\r\n $sql3 = \"SELECT * FROM assignmentFiles\r\n WHERE assignmentID = '\".$id.\"'\";\r\n\r\n $result3 = mysqli_query($conn, $sql3);\r\n\r\n if (mysqli_num_rows($result3) > 0) {\r\n // output data of each row\r\n while($row = mysqli_fetch_assoc($result3)){\r\n\r\n\r\n $Path = \"../assignment/\".$row3['file'];\r\n if (file_exists($Path)){\r\n unlink($Path); \r\n } \r\n\r\n }\r\n }\r\n\r\n //end of unlinking \r\n\r\n\r\n\r\n $sql = \"DELETE FROM assignmentFiles\r\n WHERE assignmentID = '\".$id.\"'\";\r\n\r\n mysqli_query($conn, $sql);\r\n\r\n\r\n}", "function zm_imagedeletionscheck ($data) {\n }", "function DeleteUnwantedFile($SPOOLPATH, $OrderNumber) {\n\t#example \"/apache/htdocs/myfile.pdf\" ( not \"http:xyz.com/myfile.pdf\" )\n\n\t# delete file if exists\n\t$DeleteTransitgraphFile = sprintf(\"%s/%d.transitgraph.pdf\", $SPOOLPATH, $OrderNumber);\n\t$DeleteWheelFile = sprintf(\"%s/%d.wheel.pdf\", $SPOOLPATH, $OrderNumber);\n\t$DeleteBundleFile = sprintf(\"%s/%d.bundle.pdf\", $SPOOLPATH, $OrderNumber);\n\n\tif (file_exists($DeleteTransitgraphFile)) {\n\t\t@unlink ($DeleteTransitgraphFile);\n\t}\n\n\tif (file_exists($DeleteWheelFile)) {\n\t\t@unlink ($DeleteWheelFile);\n\t}\n\n\tif (file_exists($DeleteBundleFile)) {\n\t\t@unlink ($DeleteBundleFile);\n\t}\n}", "public function testDeleteOrderFile()\n {\n }", "function uninstall(bool $deleteimages = false)\n{\n $meta = file_exists(DEFAULT_METAFILE) ? textFileToArray(DEFAULT_METAFILE) : null;\n $files = glob(VAR_FOLDER . DS . '{,.}[!.,!..]*', GLOB_MARK|GLOB_BRACE);\n foreach ($files as $file) {\n unlink($file);\n }\n\n if (true === $deleteimages) {\n $imagesdir = $meta && count($meta) && array_key_exists('imagesfolder', $meta) ? ROOT_FOLDER . DS . $meta['imagesfolder'] : DEFAULT_IMAGEFOLDER;\n\n $files = glob($imagesdir . DS . '{,.}[!.,!..]*', GLOB_MARK|GLOB_BRACE);\n foreach ($files as $file) {\n unlink($file);\n }\n }\n\n if ($meta) {\n unlink(DEFAULT_METAFILE);\n }\n}", "public function cleanUpFolder()\r\n {\r\n $fs = new Filesystem();\r\n\r\n foreach($this->file_list as $file) :\r\n if ( preg_match('#^'.$this->destination_dir.'/#', $file))\r\n $fs->remove($file);\r\n endforeach;\r\n }", "public static function deleteFiles() : void{\n $files = glob(self::DIRECTORY . '/*');\n foreach($files as $file){\n if(is_file($file))\n unlink($file);\n }\n }", "public function delete_files(){\r\n\t\t$post_id = $_POST['post_id'];\r\n\t\t$ids = $_POST['ids'];\r\n\t\t$filenames = array();\r\n\t\t$success_logs = array();\r\n\t\t$failed_logs = array();\r\n\t\t$rslt = array();\r\n\r\n\t\t$slug = get_post_field( 'post_name', $post_id );\r\n\t\t$title = get_post_field( 'post_title', $post_id );\r\n\t\t$path = wp_upload_dir()['basedir'].'/downloads/reports/'.$slug.'/'; \r\n\r\n\t\t$top_reports = get_option('iemop_top_reports', array());\r\n\t\t$total_size = 0;\r\n\t\t$log_files = array();\r\n\r\n\t\tforeach ($ids as $key => $id) {\r\n\t\t\t$file = $this->MD_Model->get_file($id);\r\n\t\t\t$filenames[] = $file['filename'];\r\n\t\t\tremove_report_from_top_page($id, $top_reports);\r\n\r\n\t\t\t$file_path = $path.$file['filename'];\r\n\t\t\t$file_size = filesize($file_path);\r\n\t\t\t$total_size += $file_size;\r\n\r\n\t\t\t$log_files[] = array(\r\n\t\t\t\t'filename'=>$file['filename'],\r\n\t\t\t\t'date_uploaded'=>$file['date_uploaded'],\r\n\t\t\t\t'target_date'=>$file['published_date'],\r\n\t\t\t\t'file_size'=>$file_size\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\t$delete_db = $this->MD_Model->delete_files($ids);\r\n\t\t$activity = 'Failed to delete file(s) on '.$title;\r\n\t\tif($delete_db){\r\n\t\t\t$activity = 'Successfully deleted file(s) on '.$title;\r\n\t\t\tforeach ($filenames as $key => $filename) {\r\n\t\t\t\t$file_path = $path.$filename; \r\n\t\t\t\t$rslt[] = $file_path;\r\n\t\t\t\tif(file_exists($file_path)){\r\n\t\t\t\t\t$rslt[] = unlink($file_path);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$insert_logs[] = \"(\".$post_id.\", '\".$activity.\"', '', 'Market Reports', '\".current_time(\"Y-m-d H:i:s\").\"', \".$total_size.\")\";\r\n\t\t$log_id = $this->MD_Model->insert_log($insert_logs);\r\n\t\t($log_id) ? $this->MD_Model->insert_log_files($log_id, $log_files) : '';\r\n\r\n\t\techo json_encode($rslt);\r\n\t\twp_die();\r\n\t}", "function deleteIcons($pathIcons){\n\t\t// get all the files\n\t\t$icons = glob($pathIcons);\n\t\t// delete files one by one\n\t\tforeach($icons as $icon){\n\t\t\tif(is_file($icon)){\n\t\t\t\tunlink($icon);\n\t\t\t}\n\t\t}\n\t\t// return true if all the files has been deleted\n\t\treturn true;\n\t}", "function deleteUserImageFiles($username) {\n $target_dir = \"uploads/\" . $username . \"/\";\n\n $files = glob(\"$target_dir/*.*\");\n foreach ($files as $file) {\n unlink($file);\n }\n if (is_dir($target_dir)) {\n rmdir($target_dir);\n }\n}", "function narrative_delete_tracks($tracks, $new_narrative_dir, $tracks_for_deletion = array())\n{\n foreach ($tracks as $i => $track)\n {\n if (in_array(basename($track), $tracks_for_deletion))\n {\n $track_dest = $new_narrative_dir . 'deleted/' . basename($track);\n }\n else\n {\n $track_dest = $new_narrative_dir . basename($track);\n }\n rename($track, $track_dest);\n }\n return TRUE;\n}", "function DeleteFile()\n{\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t\n\t$sFileUrl = $_REQUEST['file-path']; \n\t\n\tif(file_exists($sFileUrl) === false)\n\t{\n\t\techo '<fail>file not exist</fail>';\n\t\treturn;\n\t}\n\t\n\t\n\t$bIsFileDelete = false; \n\t\n\tif(is_dir($sFileUrl) === true)\n\t{\n\t\t$bIsFileDelete = UnlinkRecursive($sFileUrl);\n\t} else\n\t{\n\t\t$bIsFileDelete = unlink($sFileUrl);\n\t}\n\t\n\tif($bIsFileDelete === true)\n\t{\n\t\tif(file_exists($sFileUrl) === false)\n\t\t{\n\t\t\techo '<correct>correct delete file</correct>';\n\t\t}\n\t} else\n\t{\n\t\techo '<fail>cant delete file</fail>';\n\t}\n\t\n\treturn;\n}", "function remove_directory_junk($source_array)\n\t{\n\t\t//you can add other bits here if you want. may break directory deletion!\n\t\tforeach ($source_array as $source_key=>$source)\n\t\t{\n\t\t\tif ($source == '.')\n\t\t\t{\n\t\t\t\tunset($source_array[$source_key]);\n\t\t\t}\n\t\t\t\n\t\t\tif ($source == '..')\n\t\t\t{\n\t\t\t\tunset($source_array[$source_key]);\n\t\t\t}\n\t\t\t\n\t\t\tif ($source == '.DS_Store')\n\t\t\t{\n\t\t\t\tunset($source_array[$source_key]);\n\t\t\t}\n\t\t}\n\t\treturn $source_array;\n\t}", "public function deleteAllFiles(): bool {\n return $this->fileService->deleteDirectory('public/products');\n }", "function directoryRemove($option){\n\tglobal $mainframe, $jlistConfig;\n\n $marked_dir = JArrayHelper::getValue($_REQUEST, 'del_dir', array());\n\n // is value = root dir or false value - do nothing\n if ($marked_dir == '/'.$jlistConfig['files.uploaddir'].'/' || !stristr($marked_dir, '/'.$jlistConfig['files.uploaddir'].'/')) {\n $message = $del_dir.' '.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_ROOT_ERROR');\n \t$mainframe->redirect('index.php?option='.$option.'&task=directories.edit',$message);\n } else {\n // del marked dir complete\n $res = delete_dir_and_allfiles (JPATH_SITE.$marked_dir);\n\n switch ($res) {\n case 0:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_OK');\n break;\n case -2:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_ERROR');\n break;\n default:\n $message = $marked_dir.'<br />'.JText::_('COM_JDOWNLOADS_BACKEND_DIRSEDIT_DELETE_DIR_MESSAGE_ERROR_X');\n break;\n } \n\t $mainframe->redirect('index.php?option='.$option.'&task=directories.edit',$message);\n\t}\n}", "static public function delete($files, $locations = array('thumbnail', 'medium', 'upload'))\n\t{\n\t\tglobal $phpbb_container;\n\t\t$phpbb_gallery_url = $phpbb_container->get('phpbbgallery.core.url');\n\t\tif (!is_array($files))\n\t\t{\n\t\t\t$files = array(1 => $files);\n\t\t}\n\n\t\tforeach ($files as $image_id => $file)\n\t\t{\n\t\t\tforeach ($locations as $location)\n\t\t\t{\n\t\t\t\t@unlink($phpbb_gallery_url->path($location) . $file);\n\t\t\t}\n\t\t}\n\t}", "function delete() {\n\t\t$count = 0;\n\t\t\n\t\tif (!empty($this->_deleteLogs)) {\n\t\t\tlist($files, $ids) = $this->_getFilesAndIds($this->_deleteLogs);\n\t\t\t\n\t\t\tforeach ($files as $file) {\n\t\t\t\tif (JFile::exists($file)) {\n\t\t\t\t\tif (!JFile::delete($file)) {\n\t\t\t\t\t\t$this->setError(JText::_('Cannot delete file').': '.$file);\n\t\t\t\t\t\t$this->_deleteLogs = array();\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\t$count++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (count($ids)) {\n\t\t\t\t$this->setLogStatus($ids, 'deleted');\n\t\t\t}\n\t\t\t\n\t\t\t$this->removeFromFilesystemTable($files);\n\t\t\t$this->setLogStatus($ids, 'deleted');\n\t\t}\n\t\t\n\t\t// Empty the buffer\n\t\t$this->_deleteLogs = array();\n\t\t\n\t\treturn true;\n\t}", "public function cleanFolders() {\n if ($this->config->item('clean_folders') == true) {\n $dirs = array_diff(scandir($this->pathCreator), array('.', '..', '.DS_Store'));\n\n if (!empty($dirs)) {\n foreach ($dirs as $folder) {\n print(\"\\nFolder : \" . $folder);\n print(\"\\nMax Date : \" . date('Y-m-d H:i:s', strtotime('-' . $this->config->item('clean_folders_time'))));\n print(\"\\nCreated On : \" . date('Y-m-d H:i:s', filemtime($this->pathCreator . '/' . $folder)));\n\n if (strtotime('-' . $this->config->item('clean_folders_time')) > filemtime($this->pathCreator . '/' . $folder)) {\n print(\"\\n...Deleted !\");\n system('rm -rf ' . escapeshellarg($this->pathCreator . '/' . $folder), $retval);\n } else {\n print(\"\\n...Living...\");\n }\n }\n }\n print(\"\\n\\nProcess complete !\");\n } else {\n print(\"\\n\\nError : Active 'clean_folders' in /application/config.php\");\n }\n }", "public function file_delete($filename);", "public function testDeleteReplenishmentFile()\n {\n }", "public function deleteFiles()\r\n {\r\n $fileId = Input::get('FILE');\r\n $file = UploadedFiles::find($fileId);\r\n $path = public_path().'/';\r\n if($file!=null){\r\n $path.=$file->url;\r\n File::delete($path);\r\n $file->delete();\r\n Transaction::createTransaction('','',$file->fileName,'DELETE_FILE','FILE ID: '.$fileId,$file->project_id,'','','','','');\r\n return json_encode($fileId);\r\n }\r\n return \"-1\";\r\n }", "public function deleteCopyFiles() {\n if (!$this->copyFilePaths) return true;\n $success = true;\n\n // Delete a copy file\n foreach($this->copyFilePaths as $copyPath) {\n if (!$this->getFileSystem()->delete($copyPath)) {\n $success = false;\n\n // Inform the user if the file could not be deleted\n //File xxx could not be deleted.\n } else {\n // If file is deleted and this is a test, remove the path from test file paths.\n MediaService::getInstance()->removeTestFilePath($copyPath);\n }\n }\n\n return $success;\n }", "function delete_user_dir($userId) {\n\t$userDir=get_user_dir($userId);\t\n\tif($userDir) {\t\t\n\t\t//File destination\n\t\t$userPath=FS_PATH.$userDir;\"some/dir/*.txt\";\n\t\tarray_map('unlink', glob(FS_PATH.$userDir.\"/*.*\"));\n\t\tif(rmdir($userPath)) { \n\t\t\treturn true;\n\t\t} else return false;\t\t\n\t} else {\n\t\terror_log(\"delete_user_dir: user_dir could not be found.\",0);\n\t\treturn false;\n\t}\n}", "abstract function delete_dir($filepath);", "public function deleteSelect()\n {\n $selected=$this->getSelectedFiles();\n if ($selected[0]['type']=='folder')\n {\n $texttoshow=\"LA CARPETA\";\n }\n else\n {\n $texttoshow=\"EL ARCHIVO\";\n }\n $this->showConfirm(\"error\",\"¿SEGURO QUE DESEA ELIMINAR \".$texttoshow.\" \".$selected[0]['filename'].($selected[0]['type']=='folder'?\"\":\".\".$selected[0]['extension']).\"?\",\"BORRAR \".$texttoshow,\"deleteselectaction\",\"close\", null);\n }", "function fn_rm($source, $delete_root = true, $pattern = '')\n{\n // Simple copy for a file\n if (is_file($source)) {\n $res = true;\n if (empty($pattern) || (!empty($pattern) && preg_match('/' . $pattern . '/', fn_basename($source)))) {\n $res = @unlink($source);\n }\n\n return $res;\n }\n\n // Loop through the folder\n if (is_dir($source) && $dir = dir($source)) {\n while (false !== $entry = $dir->read()) {\n // Skip pointers\n if ($entry == '.' || $entry == '..') {\n continue;\n }\n if (fn_rm($source . '/' . $entry, true, $pattern) == false) {\n return false;\n }\n }\n // Clean up\n $dir->close();\n\n return ($delete_root == true && empty($pattern)) ? @rmdir($source) : true;\n } else {\n return false;\n }\n}" ]
[ "0.66106516", "0.6483744", "0.64549696", "0.6329994", "0.63210326", "0.6314271", "0.6297784", "0.6268937", "0.62335813", "0.6220408", "0.6203115", "0.61983", "0.619324", "0.61395115", "0.6111142", "0.6102004", "0.6094711", "0.60868514", "0.6083106", "0.6061261", "0.6056968", "0.60345864", "0.6032348", "0.6030613", "0.60025537", "0.5994442", "0.5992375", "0.59869117", "0.59793055", "0.5976309", "0.5970427", "0.59687895", "0.59585845", "0.5955552", "0.59554076", "0.5945312", "0.5932147", "0.59237677", "0.592176", "0.59090894", "0.5899476", "0.5892048", "0.5891558", "0.5883912", "0.58692634", "0.5868872", "0.58489245", "0.58488506", "0.58368355", "0.58283794", "0.5821578", "0.5820425", "0.5812304", "0.5786101", "0.57781553", "0.5773795", "0.5759054", "0.5754324", "0.57465076", "0.5741115", "0.5736633", "0.5728307", "0.5726528", "0.5719919", "0.5716418", "0.5714717", "0.57132477", "0.5709836", "0.5707801", "0.57040614", "0.5696803", "0.5684891", "0.5669827", "0.5667974", "0.566068", "0.5652072", "0.5645628", "0.5644582", "0.56312776", "0.562595", "0.56200916", "0.5619503", "0.5610798", "0.5609383", "0.56044084", "0.56037956", "0.56030434", "0.55976236", "0.55928147", "0.55886346", "0.55872506", "0.55791193", "0.55767316", "0.5575492", "0.55726945", "0.5568271", "0.5566694", "0.55649614", "0.5545881", "0.55429536", "0.5542744" ]
0.0
-1
Return identifiers for produced content
public function getIdentities() { return [\Ss\Collection\Model\Collection::CACHE_TAG . '_' . 'list']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdentifiers();", "public function getIdentifiers() {\n $fields = array('identifiers' => array(\n 'identifierDescriptor' => 'header',\n 'identifier',\n ));\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return (is_array($result)) ? reset($result) : $result;\n }", "public function getIdentifiers()\n {\n return $this->init()->_identifiers;\n }", "public function getAllIdentifiers() {}", "public function getIdentifiers()\n {\n return $this->identifiers;\n }", "public function getContentIdPool()\n {\n $aFilters = $this->getFilters();\n \n $oContentFinder = SGL_Finder::factory('content');\n \n if (array_key_exists('categoryId', $aFilters)) {\n $oContentFinder->addFilter('categoryId', $aFilters['categoryId']);\n }\n if (array_key_exists('typeId', $aFilters)) {\n $oContentFinder->addFilter('typeId', $aFilters['typeId']);\n }\n \n $aContent = $oContentFinder->retrieve();\n\n $aContentId = array();\n foreach ($aContent as $oContent) {\n $aContentId[] = $oContent->id;\n } \n return $aContentId;\n }", "function get_ids($file){\r\n $h1count = preg_match_all('/(id=\"(\\w*)\")/is',$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function identifier(): array;", "function get_content_id($file,$id){\r\n\t\t$h1tags = preg_match_all(\"/(<div id=\\\"{$id}\\\">)(.*?)(<\\/div>)/ismU\",$file,$patterns);\r\n\t\t$res = array();\r\n\t\tarray_push($res,$patterns[2]);\r\n\t\tarray_push($res,count($patterns[2]));\r\n\t\treturn $res;\r\n\t}", "public function getIdentifier(): void\n {\n self::assertEquals(\n 't3vcore_contentobject',\n ContentObjectUtility::getIdentifier('t3vcore', 'contentobject')\n );\n\n self::assertEquals(\n 't3vcore_contentobject',\n ContentObjectUtility::getIdentifier('T3v Core', 'Content Object')\n );\n }", "public abstract function get_ids();", "public function parts()\n {\n return $this->identifierParts;\n }", "public function getIds();", "public function getIds();", "protected function getIdField()\n {\n return 'Content-ID';\n }", "public function getAll()\n {\n return $this->_identifiers;\n }", "abstract public function getIdentifier();", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public function get_ids()\n {\n }", "public static function getIds($contents)\n { \n $return = [];\n foreach ($contents as $value) \n {\n $return[] = $value->id;\n }\n return $return;\n }", "public function getIdentifier() {}", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getIdentifier() {}", "public function getGeneratedIds() {}", "public function getObjectIds();", "function getIdentifierValues($object);", "public function getContentId()\n {\n return $this->contentId;\n }", "public abstract function getIdentifier();", "function eskript_enumerate( $content ) {\r\n\tif ( strlen( $content ) == 0 ) {\r\n\t\t// Would return xml preamble with empty content otherwise.\r\n\t\treturn '';\r\n\t}\r\n\t// NOTE: shortcodes are already resolved at this point\r\n\t// Preserves LaTeX source code (since shortcodes are already resolved).\r\n\t// Prevent the XML parser to remove the space between tags like <img ...> <b>foo</b>.\r\n\t$content = str_replace( '> <', '>&#32;<', $content );\r\n\tlibxml_use_internal_errors( true );\r\n\t$doc = new \\DOMDocument();\r\n\t$doc->loadHTML( '<?xml encoding=\"UTF-8\">' . $content );\r\n\t$references = eskript_reference_for_id();\r\n\tfor ( $i = 1; $i <= 6; $i++ ) {\r\n\t\t$sections = $doc->getElementsByTagName( \"h$i\" );\r\n\t\tforeach ( $sections as $node ) {\r\n\t\t\t$id = $node->getAttribute( 'id' );\r\n\t\t\t$ref = @$references[ $id ];\r\n\t\t\tif ( $ref === null ) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif ( ! $ref['list'] ) {\r\n\t\t\t\t// TODO: don't create references for !in_list or no id?\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t$index = eskript_index_for_reference( $id );\r\n\t\t\t$node->insertBefore( new \\DOMText( \"$index – \" ), $node->firstChild );\r\n\t\t}\r\n\t}\r\n\t$sections = $doc->getElementsByTagName( 'img' );\r\n\tforeach ( $sections as $node ) {\r\n\t\t$id = $node->getAttribute( 'id' );\r\n\t\t$ref = @$references[ $id ];\r\n\t\tif ( $ref === null ) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif ( ! $ref['list'] ) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t$index = eskript_index_for_reference( $id );\r\n\t\t$caption = eskript_find_caption_node( $node );\r\n\t\tif ( ! $caption ) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\t$desc = eskript_description_for_ref_type( $ref['type'], true );\r\n\t\t// if ($captionText===hex2bin('c2a0')) $captionText = ''; // &nbsp;\r\n\t\t$prefix = \"$desc $index\";\r\n\t\t// Use unicode flag to also capture non-breaking whitespace.\r\n\t\tif ( ! preg_match( '/^\\s*$/u', $caption->nodeValue ) ) {\r\n\t\t\t$prefix .= ' – ';\r\n\t\t}\r\n\t\t$caption->insertBefore( new DOMText( $prefix ), $caption->firstChild );\r\n\t}\r\n\t$html = $doc->saveHTML( $doc->documentElement ); // DEBUG: replaces ' with ’ -> problematic for latex shortcodes\r\n\t$html = str_replace( array( '<html>', '</html>', '<body>', '</body>' ), '', $html );\r\n\t$html = preg_replace( '#^<!DOCTYPE.+?>#', '', $html );\r\n\t$errors = libxml_get_errors();\r\n\tlibxml_clear_errors();\r\n\treturn $html;\r\n}", "public function speciesIds()\n {\n return $this->memoize('speciesIds', function () {\n return $this->species()->when($this->only_observed_taxa, function ($query) {\n $query->leftJoin('taxon_ancestors', 'taxon_ancestors.ancestor_id', '=', 'taxa.id')\n ->where(function ($query) {\n $query->addWhereExistsQuery(Observation::whereColumn('taxon_id', 'taxa.id')->getQuery())\n ->addWhereExistsQuery(Observation::whereColumn('taxon_id', 'taxon_ancestors.model_id')->getQuery(), 'or');\n });\n })->selectRaw('DISTINCT(id) as id')->pluck('id');\n });\n }", "public function getIdentities()\n {\n return [\\Algolia\\AlgoliaSearch\\Model\\LandingPage::CACHE_TAG . '_' . $this->getPage()->getId()];\n }", "public function getIdentifier()\n {\n return 1;\n }", "public function getIdentifier(): string;", "public function getIdentifier(): string;", "public function getIds()\n {\n\n }", "abstract public function getIdentifierValues($object);", "public function getIdentifier()\n {\n }", "abstract public function getIdent();", "public function getObjectIdent() {}", "public function getObjectIdent() {}", "public function getObjectIdent();", "public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }", "function getIdentifier();", "function getIdentifier();", "function getStringID() {\n\t\treturn '[#'.$this->data_array['artifact_id'].']';\n\t}", "public function getExternalIdentifiers()\n {\n return $this->external_identifiers;\n }", "public function get_content_item_ids() {\n\t\t$items = $this->get_content_items();\n\t\tif ( empty( $items ) ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// Map the IDs.\n\t\treturn array_map(\n\t\t\tfunction( $item ) {\n\t\t\t\treturn $item->get_data( 'post_id' );\n\t\t\t},\n\t\t\t$items\n\t\t);\n\t}", "function getIdentifierFieldNames();", "function getIdentifier() ;", "function getIdentifier() ;", "function getIdentifier() ;", "public function getID()\n\t{\n\t\treturn 'ojsxc';\n\t}", "public function generatorIdentifierProvider()\n {\n return [[\"a string\"]];\n }", "public function getIdentities() {\n\treturn [self::CACHE_TAG . '_' . $this->getId()];\n }", "function getEventIDs() {\n\t\t$return = array();\n\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$return[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function getIdentifier()\n {\n // TODO: Implement getIdentifier() method.\n }", "protected function dbIatiIdentifiers()\n {\n $activities = $this->dbActivities();\n $identifiers = [];\n\n foreach ($activities as $index => $activity) {\n $identifiers[] = getVal($activity->identifier, ['iati_identifier_text']);\n }\n\n return $identifiers;\n }", "private function buildIds(){\n\n\t\t$string = 'data-id=\"'.$this->fullId.'\" ';\n\t\t$string .= 'data-column_id=\"'.$this->id.'\" ';\n\t\t$string .= 'data-section_id=\"'.$this->section_id.'\" ';\n\t\t$string .= 'data-post_id=\"'.$this->post_id.'\" ';\n\n\t\treturn $string;\n\t}", "public function getCombinedIdentifier() {}", "public function getCombinedIdentifier() {}", "public function getCombinedIdentifier() {}", "function getIds( array $Objects );", "function identifiers($hookName, $params) {\n\t\t$journalOAI =& $params[0];\n\t\t$from = $params[1];\n\t\t$until = $params[2];\n\t\t$set = $params[3];\n\t\t$offset = $params[4];\n\t\t$limit = $params[5];\n\t\t$total = $params[6];\n\t\t$records =& $params[7];\n\t\t\n\t\t$records = array();\n\t\tif (isset($set) && strpos($set, 'ec_fundedresources') != false) {\n\t\t\t$journalId = $journalOAI->journalId;\n\t\t\t$openAIREDao =& DAORegistry::getDAO('OpenAIREDAO');\n\t\t\t$openAIREDao->setOAI($journalOAI);\n\t\t\t$records = $openAIREDao->getOpenAIREIdentifiers($journalId, $from, $until, $offset, $limit, $total);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function getIdentities()\n {\n return [self::CACHE_TAG.'_'.$this->getId()];\n }", "public function getDefinedObjectIds() {}", "public function getDefinedObjectIds() {}", "public function getDefinedObjectIds() {}", "public function getGathercontentTemplateId();", "public function getConsortialIDs()\n {\n return $this->getFieldArray('035', 'a', true);\n }", "public function getIdentifierFieldNames(): array;", "public function getIdentities(){\n return [self::CACHE_TAG.'_'.$this->getProductId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "public function getIdentities()\n {\n return [self::CACHE_TAG . '_' . $this->getId()];\n }", "function messageid($list) {\n\t\t$uid = 0;\n\t\t$mid = array();\n\t\t\n\t\tforeach($list as $line) {\n\t\t\tif(preg_match('#^\\* ([0-9]+) FETCH#', $line)) {\n\t\t\t\t$temp = explode(' ', $line);\n\t\t\t\t$uid = $temp[4];\n\t\t\t}\n\t\t\t\n\t\t\t$temp = strtoupper($line);\n\t\t\t\n\t\t\tif(substr($temp, 0, 12) == 'MESSAGE-ID: ')\n\t\t\t\t$mid[$line] = $uid;\n\t\t}\n\t\t\n\t\treturn $mid;\n\t}", "public function getIdentities()\n {\n }" ]
[ "0.6873616", "0.65991735", "0.6573252", "0.63796294", "0.62793267", "0.6241312", "0.6005117", "0.5942072", "0.5913409", "0.5870353", "0.58580136", "0.57500046", "0.57181937", "0.57181937", "0.56822616", "0.5678575", "0.56774807", "0.5668337", "0.5668337", "0.5668337", "0.5668337", "0.5668337", "0.5668337", "0.5668337", "0.5668337", "0.5661976", "0.5660364", "0.5660294", "0.5660294", "0.5660294", "0.5660294", "0.5660294", "0.5660294", "0.5660294", "0.5660294", "0.5660294", "0.5659911", "0.5659911", "0.5659911", "0.5659911", "0.5659911", "0.5659458", "0.5659458", "0.56463426", "0.5645558", "0.5643011", "0.5621265", "0.5611347", "0.5609109", "0.5595191", "0.5585404", "0.55810285", "0.557689", "0.557689", "0.55757636", "0.55730003", "0.55647165", "0.5561059", "0.55501175", "0.55501175", "0.5519941", "0.5513659", "0.55098444", "0.55098444", "0.5504568", "0.5504364", "0.54977435", "0.5494819", "0.54912037", "0.54910785", "0.54910785", "0.54889053", "0.54854256", "0.54746723", "0.5471539", "0.54600865", "0.5440733", "0.54374355", "0.54334664", "0.543253", "0.543253", "0.54260767", "0.5423155", "0.54205585", "0.5418845", "0.5417949", "0.5417949", "0.541661", "0.5410945", "0.5370245", "0.5370068", "0.53656924", "0.53656924", "0.53656924", "0.53656924", "0.53656924", "0.53656924", "0.53656924", "0.53656924", "0.5364388", "0.53581023" ]
0.0
-1
Get Match Now Title
public function getMatchNowTitle() { return $this->getData('match_now_title'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function rep_title_callback($match) {\r\n\t\t\r\n\t\t$query = substr($match[0],3,-3);\t\t\r\n\t\t$title = '<h2>'.$query.'</h2>';\r\n\t\treturn $title;\r\n\t\t\r\n\t}", "private function titleGuess(): string {\n $collaboration = $this->containsCollaboration($this->title);\n return $collaboration;\n }", "private function getTalkTitle()\n {\n $html = getSimpleHTMLDOMCached($this->getInput('url'));\n $title = $html->find('h1[class=thread-title]', 0)->plaintext;\n return $title;\n }", "function get_the_title() {\n\n md_get_the_title();\n \n }", "public function get_title();", "public function get_title() {\n\t\treturn __( 'Team', 'qazana' );\n\t}", "public function current_title()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" current_title ?\");\n\t}", "public function getMatch(): string\n {\n return $this->match;\n }", "public function getOriginalTitle() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('originalTitle' => array('originalTitleHeader' => 'header', \"originalTitleElement\")));\n return (is_array($result)) ? reset($result) : $result;\n }", "public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}", "public function getTitleFromDisplayPattern()\n {\n $formattedTitle = $this->getName();\n \n return $formattedTitle;\n }", "function extract_title_from_wiki_text($text)\n{\n if (preg_match(\"/--- DIVISION TITLE ---\\s*(.*)\\s*--- MOTION EFFECT/s\", $text, $matches)) {\n $title = $matches[1];\n }\n $title = trim(strip_tags($title));\n $title = str_replace(\" - \", \" &#8212; \", $title);\n return $title;\n}", "function return_title($source) {\r\n preg_match('@((<title\\s*)([a-zA-Z]+=(\"|\\')?[a-zA-Z0-9_-]*(\"|\\')?\\s*)*\\>)([a-zA-Z0-9()-_\\s.:|&#;]*)(</title>)@',$source, $output);\r\n\treturn html_entity_decode(strip_tags(trim($output[0])));\r\n}", "public function title() {\r\n\t\treturn trim(strtok($this->_content, \"\\n\"));\r\n\t}", "public function getTitle(){\n return $this->film['title'];\n }", "public function title()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" title ?\");\n\t}", "private function get_title( $html ) {\n\t\t$pattern = '#<title[^>]*>(.*?)<\\s*/\\s*title>#is';\n\t\tpreg_match( $pattern, $html, $match_title );\n\n\t\tif ( empty( $match_title[1] ) || ! is_string( $match_title[1] ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$title = trim( $match_title[1] );\n\n\t\treturn $this->prepare_metadata_for_output( $title );\n\t}", "public function getMovieTitle() {\n\t\treturn ($this->movieTitle);\n\t}", "public function getMetaTitle() {\n\t\t$title = $this->data()->getTitle();\n\t\t$filter = $this->FilterDescription();\n\t\tif($filter) {\n\t\t\t$title = \"{$title} - {$filter}\";\n\t\t}\n\n\t\t$this->extend('updateMetaTitle', $title);\n\t\treturn $title;\n\t}", "public function getMetaTitle();", "function regexgettitle($text, $rule=''){\n\t\t\t\t\t\t\t\t//make sure we call regexnoweirdwhite first on the text\n\t\t\t\t\t\t\t\t//regexnoweirdwhite removes spaces from around the < and > characters\n\t\t\t\t\t\t\t\t//regexnoweirdwhite also makes all runs of white spaces including breaks and nbsps into single spaces\n\t$regex_pattern=\"/<title\\s?[^>]*>(.+?)<\\/\\s?title>/i\";\t//will search for anything between and including the title tags (text insensitive)\n\t\t\t\t\t\t\t\t\t\t\t\t//the period followed by the plus will match any number of any characters\n\t\t\t\t\t\t\t\t\t\t\t\t//placing it within the parentheses will allow us to get just the title without grabbing the tags too\n\t$title=\"\";\n\tif(preg_match($regex_pattern,$text,$match))$title=$match[1];\n\t//get rid of unneeded spaces\n\t$title=regexspacecleaner($title);\n\treturn $title;\t\n}", "public function getTitle() {\n\t\t$titles = array(\n\t\t\t'CEO',\n\t\t\t'Assistant Regional Manager',\n\t\t\t'Champion of Light',\n\t\t\t'Usurper Lord',\n\t\t\t'Overlord Maximus',\n\t\t\t'Shadowpuppet Master',\n\t\t);\n\t\t$index = mt_rand(0, count($titles) - 1);\n\t\treturn $titles[$index];\n\t}", "public function computedTitle();", "public function getMatch();", "function getTitle() ;", "public function getTitleFromDisplayPattern()\n {\n $formattedTitle = ''\n . $this->getEventTitle();\n \n return $formattedTitle;\n }", "public function getTitle(){\n\t\t$title = $this->TitleText;\n\t\tif($title == ''){\n\t\t\t$title = \"New state\";\n\t\t}\n\n\t\t$textObj = new Text('TitleText');\n\t\t$textObj->setValue($title);\n\t\treturn $textObj->LimitWordCount(10);\n\t}", "public function getAlternativeTitle() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('alternativeTitle' => array('alternativeTitleDescriptor' => 'header', \"alternativeTitle\")));\n return $result;\n }", "public function getTitle(): string\n {\n return $this->title ?? $this->name;\n }", "public function getTitle()\n {\n return round($this->getTimeDiff()*1000, 3).' ms';\n }", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "function getTitle($url) {\n $str = file_get_contents($url);\n /* RegEx erzeugt ein Array in dem Der Seitentitel auf Index 1 liegt */\n preg_match('/\\<title\\>(.*)\\<\\/title\\>/', $str, $title);\n /* Seitentitel aus Index 1 zurückgeben */\n return $title[1];\n }", "public function get_title() {\n\t\treturn $this->format_string( $this->title );\n\t}", "private function _generateTitle()\n {\n $title = '';\n foreach ($this->_contents as $content)\n {\n $title = ('' == $title) ? $content->myGetSeoTitleTag() : $content->myGetSeoTitleTag().' | '.$title;\n }\n return $title;\n }", "function get_title()\n {\n }", "protected function getTitle() {\n\t\t$result = $this->overlayFile->getProperty('title');\n\t\tif (empty($result)) {\n\t\t\t$result = $this->overlayFile->getName();\n\t\t}\n\t\treturn htmlspecialchars($result);\n\t}", "function the_title() {\n\tglobal $discussion;\n\treturn $discussion['title'];\n}", "public function getTitle() {\n\t\treturn $this->title;\t\n\t}", "public static function title();", "function charity_is_hope_team_get_stream_page_title($title, $page) {\n\t\tif (!empty($title)) return $title;\n\t\tif (charity_is_hope_strpos($page, 'team')!==false) {\n\t\t\tif (($page_id = charity_is_hope_team_get_stream_page_id(0, $page=='team' ? 'blog-team' : $page)) > 0)\n\t\t\t\t$title = charity_is_hope_get_post_title($page_id);\n\t\t\telse\n\t\t\t\t$title = esc_html__('All team', 'trx_utils');\t\t\t\t\n\t\t}\n\t\treturn $title;\n\t}", "private static final function getPageTitle () {\r\n // Execute the <title tag> .tp file;\r\n $webHeaderString = new FileContent (FORM_TP_DIR . _S . 'frm_web_header_title.tp');\r\n return $webHeaderString->doToken ('[%TITLE_REPLACE_STRING%]',\r\n implode (_DCSP, ((self::$objPageTitleBackward->toInt () == 1) ? (self::$objPageTitle->arrayReverse ()->toArray ()) :\r\n self::$objPageTitle->toArray ())));\r\n }", "public function title(): string {\n\t\treturn $this->m_title;\n\t}", "public function displayCurrentTitle()\n {\n $entry = $this->getEntry();\n if ($entry) {\n return $entry->displayCurrentTitle();\n }\n }", "function getTitle(&$record) {\n\t\t$parsedContents =& $record->getParsedContents();\n\t\tif (isset($parsedContents['title'])) {\n\t\t\treturn array_shift($parsedContents['title']);\n\t\t}\n\t\treturn null;\n\t}", "function wruv_streamtitle($ts) {\n\t$onair = wruv_sched_slot($ts);\n\treturn wruv_streamtitle_str( $onair );\n\n}", "protected function getTitle() {\r\n\t\treturn $this->newsItem->getTitle();\r\n\t}", "public function title(){\n if (func_num_args() > 0){\n $this->title = func_get_arg(0);\n }\n \n return $this->title;\n }", "public function get_title() {\n return __( 'Video CTA', 'yx-super-cat' );\n }", "protected function getAlternativeTitle() {\r\n\t\treturn $this->newsItem->getAlternativeTitle();\r\n\t}", "private function getTitle(): string\n {\n /**\n * This is the title being overwritten by a middleware, view\n * composer, etc. by using the share() method.\n */\n $metaTitle = $this->context->get('__env')->shared('meta_title') ?? '';\n\n if (! $metaTitle) {\n if (! $this->context->get('is_term')) {\n $metaTitle = $this->augmented($this->context->get('meta_title'));\n }\n\n $metaTitle = $metaTitle ?? config('findable.default_meta_title');\n }\n\n $parsedTitle = $this->parseMergeTags($metaTitle);\n $parsedTitle = trim($parsedTitle, ' |');\n\n // Use regular title as fallback if the parsed is empty.\n return $parsedTitle ?? $this->augmented($this->context->get('title'));\n }", "public function get_title()\n\t{\n\t\treturn $this->title;\n\t}", "function wruv_current_streamtitle() {\n\t$onair = wruv_current_sched_slot();\n\treturn wruv_streamtitle_str( $onair );\n\n}", "function title($title) {\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn $title;\r\n\t\t}\r\n\r\n\t\t$season = Uwr1resultsController::season();\r\n\t\t$season = $season.'/'.($season+1); // TODO: make a function for that\r\n\r\n\t\t$view = Uwr1resultsController::WhichView();\r\n\t\tif ('index' == $view) {\r\n\t\t\t$title = 'Unterwasserrugby Liga Ergebnisse der Saison '.$season;\r\n\t\t} else if ('league' == $view) {\r\n\t\t\t$title = 'Ergebnisse der ' . Uwr1resultsModelLeague::instance()->name() . ' (Saison ' . $season . ')';\r\n\t\t} else if ('tournament' == $view) {\r\n\t\t\t$title = 'Ergebnisse des UWR Turniers ' . Uwr1resultsModelLeague::instance()->name();\r\n\t\t}\r\n\t\treturn $title;\r\n\t}", "public function getTitle()\r\n {\r\n return $this->m_title;\r\n }", "public function getTitle() {\r\n\t\treturn $this->title;\r\n\t}", "public function title_for_discovery() {\n\n\t\t$podcast = Podcast::get_instance();\n\n\t\t$media_location = $this->media_location();\n\n\t\tif ( ! $media_location )\n\t\t\treturn $this->name;\n\n\t\t$media_format = $media_location->media_format();\n\n\t\tif ( ! $media_format )\n\t\t\treturn $this->name;\n\n\t\t$file_extension = $media_format->extension;\n\n\t\t$title = sprintf( __( 'Podcast Feed: %s (%s)', 'podcast' ), $podcast->title, $this->name );\n\t\t$title = apply_filters( 'podlove_feed_title_for_discovery', $title, $this->title, $file_extension, $this->id );\n\n\t\treturn $title;\n\t}", "private function getTitle($deal)\n {\n $titleRoot = $deal->find('div[class*=threadGrid-title]', 0);\n $titleA = $titleRoot->find('a[class*=thread-link]', 0);\n $titleFirstChild = $titleRoot->first_child();\n if ($titleA !== null) {\n $title = $titleA->plaintext;\n } else {\n // In some case, expired deals have a different format\n $title = $titleRoot->find('span', 0)->plaintext;\n }\n\n return $title;\n }", "function title( &$contentObjectAttribute )\r\n {\r\n $classAttribute =& $contentObjectAttribute->contentClassAttribute();\r\n $classContent = $classAttribute->content();\r\n $content = $contentObjectAttribute->content();\r\n $index = \"\";\r\n\r\n if( is_array( $classContent['pattern_selection'] ) and count( $classContent['pattern_selection'] ) > 0 )\r\n {\r\n $res = @preg_match( $classContent['regexp'], $content, $matches );\r\n\r\n if( $res !== false )\r\n {\r\n foreach( $classContent['pattern_selection'] as $patternIndex )\r\n {\r\n if( isset( $matches[$patternIndex] ) )\r\n {\r\n $index .= $matches[$patternIndex];\r\n }\r\n }\r\n }\r\n }\r\n else\r\n {\r\n $index = $content;\r\n }\r\n\r\n return $index;\r\n }", "static function get_title($data_title){\r\n\r\n if(empty($data_title)) {\r\n return;\r\n }\r\n\r\n //explode after 'playlist_title'\r\n $explode_playlist_title = explode('playlist_title', $data_title);\r\n\r\n //get the title\r\n preg_match('/\\\"(.*?)\\\\\"/', $explode_playlist_title[1], $maches_title);\r\n\r\n //if the title is empty there will be only an \\ at the end\r\n if(empty($maches_title[1]) or $maches_title[1] == '\\\\') {\r\n return '';\r\n }\r\n\r\n //check the last chart in the title, could be \\\r\n if(substr($maches_title[1], -1, 1) == '\\\\') {\r\n $maches_title[1] = substr($maches_title[1], 0, -1);\r\n }\r\n\r\n //remove spaces\r\n if(!empty($maches_title[1])) {\r\n return trim(str_replace(array('&nbsp;'),array(''), htmlentities($maches_title[1], ENT_QUOTES)));//trim just in case\r\n } else {\r\n return '';\r\n }\r\n\r\n }", "function getTitle(&$record){\n $type = array('H' => 'Hydrological Station', 'M'=>'Meteorological Station');\n $title = \"\".$type[$record->val('type_station')].\" - id: \".$record->val('id_station');\n \n return $title;\n }", "public function getTitle()\n\t{\n\t\t$content = $this->getContent();\n\t\treturn $content->title;\n\t}", "public function getTitle()\n {\n\t\treturn $this->title;\n\t}", "public function getTitle()\n {\n return ts('Preview');\n }", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle(): string {\n\t\treturn $this->title;\n\t}", "function get_page_title($str) {\n if (strlen($str)>0) {\n $str = trim(preg_replace('/\\s+/', ' ', $str));\n preg_match(\"/\\<title\\>(.*)\\<\\/title\\>/i\",$str,$title);\n \n return trim($title[1]);\n }\n}", "function get_title($url){\n\t$str = file_get_contents($url);\n\tif(strlen($str)>0){\n\t\t$str = trim(preg_replace('/\\s+/', ' ', $str)); // supports line breaks inside <title>\n\t\tpreg_match(\"/\\<title\\>(.*)\\<\\/title\\>/i\",$str,$title); // ignore case\n\t\treturn $title[1];\n\t}\n}", "function getTitle();", "function getTitle();", "function get_title() \t{\n \t\treturn $this->title;\t\n \t}", "public function gettitle()\n {\n return $this->title;\n }", "public function title()\n\t{\n\t\treturn $this->title;\n\t}", "private function retrieve_title() {\n\t\t$replacement = null;\n\n\t\tif ( is_string( $this->args->post_title ) && $this->args->post_title !== '' ) {\n\t\t\t$replacement = stripslashes( $this->args->post_title );\n\t\t}\n\n\t\treturn $replacement;\n\t}", "public function title()\n {\n return $this->{static::$title};\n }", "public function title() {\n\t\tif ( ! is_object( $this->object ) ) {\n\t\t\treturn esc_html__( 'Page not found', 'nhg-seo' );\n\t\t}\n\n\t\t$title = Strategy::get_from_meta( 'post', $this->object->ID, $this->object, 'title' );\n\t\tif ( \\is_string( $title ) && '' !== $title ) {\n\t\t\treturn $title;\n\t\t}\n\n\t\treturn Strategy::get_title( 'post', $this->object->post_type, $this->object );\n\t}", "public function title() { \n $title = $this->content()->get('title');\n if($title != '') {\n return $title;\n } else {\n $title->value = $this->uid();\n return $title;\n }\n }", "public function getTitle()\n {\n return $this->title = $this->get()->post_title;\n }", "public function get_title()\n {\n }", "public function get_title()\n {\n }", "public function getTitle(): string\n\t{\n\t\treturn $this->title;\n\t}", "function wpvideocoach_custom_title()\r\n{\r\n\tglobal $wpvideocoach_custom_title;\r\n\tif(empty($wpvideocoach_custom_title)){\r\n\t\t$wpvideocoach_custom_title = __('WordPress Video Coach', 'wp-video-coach');\r\n\t}\r\n\treturn $wpvideocoach_custom_title;\r\n}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}" ]
[ "0.73566365", "0.7144896", "0.670221", "0.66354424", "0.64411277", "0.64210975", "0.63641554", "0.63528347", "0.62879276", "0.627547", "0.6252517", "0.624463", "0.6240199", "0.6239946", "0.62379575", "0.62182564", "0.62112147", "0.6208389", "0.6202894", "0.6190242", "0.6188978", "0.617557", "0.61703205", "0.6163746", "0.6163128", "0.6154874", "0.61418134", "0.6140591", "0.6137833", "0.61292636", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61234856", "0.61230457", "0.61217165", "0.61118174", "0.6108989", "0.60824335", "0.60648155", "0.60290843", "0.6022708", "0.6020181", "0.6014923", "0.60126114", "0.6011935", "0.6005731", "0.5997671", "0.59972304", "0.5988199", "0.5984106", "0.5978091", "0.59723526", "0.5965629", "0.59584117", "0.5955964", "0.59528387", "0.5947852", "0.59474945", "0.5944983", "0.594426", "0.5944228", "0.5943012", "0.59420305", "0.5940021", "0.5935871", "0.59310365", "0.59310365", "0.59310365", "0.59310365", "0.5923614", "0.5916034", "0.59146607", "0.59139585", "0.59139585", "0.59128493", "0.59118986", "0.5909617", "0.59088796", "0.59087867", "0.5908088", "0.5903918", "0.58940554", "0.5893831", "0.5893331", "0.588797", "0.58873916", "0.5884669", "0.5884669" ]
0.85028267
0
Get Match Now Url
public function getMatchNowUrl() { return $this->getData('match_now_url'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentUrlFromRoutes()\n {\n $input = &SGL_Registry::singleton();\n $url = $input->getCurrentUrl();\n $currUrl = $url->toString();\n $baseUrl = $url->getBaseUrl($skipProto = false, $includeFc = false);\n return str_replace($baseUrl, '', $currUrl);\n }", "public function getRegexurl() {\n }", "public function get_url();", "protected function getApiUrl(): string\n {\n return preg_replace($this->regexPattern,$this->currencyDate,$this->apiEndpoint);\n }", "public function getCurrentUrl();", "function get_twitch_url($api) {\n $url = null;\n\n $data = file_get_contents($api);\n $json = json_decode($data, TRUE);\n\n foreach($json['videos'] as $key => $val) {\n $rec_date_arr = getdate(strtotime($val['recorded_at']));\n $rec_date = str_pad($rec_date_arr['mon'], 2, \"0\", STR_PAD_LEFT) . \"/\"\n . str_pad($rec_date_arr['mday'], 2, \"0\", STR_PAD_LEFT) . \"/\"\n . $rec_date_arr['year'];\n\n if ($val['game'] == 'Spelunky' && $rec_date == date('m/d/Y')) {\n $url = $val['url'] . \"\\n\";\n }\n }\n\n return $url;\n }", "protected static function get_new_url()\n {\n return parse_url($_SERVER['REQUEST_URI'])['path'] . '?' . $_SERVER['QUERY_STRING'];\n }", "function formatCurrentUrl() ;", "abstract public function get_url_update();", "static function obtenerUrlActual() {\n $url = Util::crearUrl($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n return $url;\n }", "public static function getBNETHistoryURL($url)\r\n\t{\r\n\t\treturn $url . 'matches';\r\n\t}", "public static function getRequestedURL()\n {\n return self::getInstance()->requestedUrl;\n }", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function formatCurrentUrl() {}", "public function url()\n {\n return explode('?' ,$this->uri)[0];\n }", "public function getShopNowUrl()\n {\n return $this->getData('show_now_url');\n }", "protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }", "public function getUrl()\n {\n return $this->lastUrl;\n }", "function get_trackback_url()\n {\n }", "public static function getThisUrl() {}", "public function getURL();", "public function getURL();", "private function getVideoTutorialsUrl() {\n\t\t\treturn apply_filters('gsf-video-tutorials-url','#');\n\t\t}", "public function getURL ();", "public function url()\n\t{\n\t\tif( $this->modified === false ) return $this->url;\n\t\telse\n\t\t{\n\t\t\t$url = $this->generateString();\n\t\t\treturn htmlentities( $url );\n\t\t}\n\t}", "function GetPrewURI() /*added 16_05*/\n\t\t{\n\t\tif($this->history[count($this->history)-1])\n\t\t\t$ret = $this->history[count($this->history)-1];\n\t\telse\n\t\t\t$ret = $_SERVER['SERVER_NAME'];\n//\t\treturn $this->history[count($this->history)-1]; \n\t\treturn $ret;\n\t\t}", "public function getRegistrationCompareUrl () {\n\t $date = date('Y-m-d H:i:s', $this->regisrtime);\n\t $date = urlencode($date);\n return 'http://'.$_SERVER['HTTP_HOST'].'/users/confirmregistration/?date='.$date.'&id='.$this->id.'&code='.$this->getRegistrationCode();\n }", "public function getMatch();", "protected function getUrl(){\n\n\t\t//retornando a url aonde o usuario está\n\t\treturn parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n\n\t}", "public function getSuccessUrl();", "abstract public function getRouteMatch();", "public function getRouteMatch();", "public function getTakeUrl() { }", "abstract public function getCallUrl();", "public function getFailureUrl();", "public function getLastPageUrl();", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "protected function getUrl() {\n\t\treturn $this->getQueryParam ( self::URL_PARAM );\n\t}", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function getUrl();", "public function url();", "public function url();", "public function url();", "public function getUrl()\n {\n return $this->createUrl();\n }", "function getRandomVideoURL(){\n\t$response = getHTTPContent(\"http://youtube.com\", true);\n\t\n\tif(preg_match_all('~href=\"/?watch\\?v=(.+?)\"~', $response, $matches)){\n\t\t$matches_array = $matches[1];\n\n\t\tshuffle($matches_array);\n\n\t\treturn \"http://www.youtube.com/watch?v=\".$matches_array[0];\n\t}\n\n\t_log(\"getRandomVideoURL: no videos found\", true);\n\n\treturn false;\n}", "public function getMirrorUrl() {}", "public function url()\n\t{\n\t\t$this->buildImage();\n\t\treturn $this->buildCachedFileNameUrl;\n\t}", "protected function getUrl(){\n\t\treturn $this->apiUrl . $this->apiVersion . '/';\n\t}", "public function getMatchRoute()\n {\n return $this->_matchRoute;\n }", "public function getYoutubeUri($lastFmUrl) {\n // load document\n $doc = new \\DOMDocument();\n if(!@$doc->loadHTMLFile($lastFmUrl)) {\n return false;\n }\n\n // search for movie param\n $params = $doc->getElementsByTagName('param');\n for($i = 0; $i < $params->length; $i++) {\n $item = $params->item($i);\n if($item->getAttribute('name') == 'movie') {\n $url = current(explode('?',$item->getAttribute('value')));\n $url = explode('/',$url);\n return end($url);\n }\n }\n return false;\t\t\n }", "function get_url()\n {\n }", "public function getMatch(): string\n {\n return $this->match;\n }", "public function get_url()\n {\n }", "private function get_current_url() {\n\n\t\t$url = set_url_scheme(\n\t\t\t'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']\n\t\t);\n\n\t\t// We use 'msg' as parameter internally. Not needed for pagination.\n\t\treturn remove_query_arg( 'msg', $url );\n\t}", "protected function getRequestedUrl()\n {\n $scheme = $this->getScheme();\n\n return $scheme . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n }", "public function getCurrentURL()\n {\n return $this->getBaseUrl() . $this->getURI();\n }", "private function getLastURL() {\n\t\tif (!isset($_SERVER['REQUEST_URI'])) {\n\t\t\t$serverrequri = $_SERVER['PHP_SELF'];\n\t\t} else {\n\t\t\t$serverrequri = $_SERVER['REQUEST_URI'];\n\t\t}\n\n\t\t$slcurrentPageName=str_replace('?&no_cache=1', '', $serverrequri);\n\t\t$slcurrentPageName=str_replace('?no_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&no_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?&purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&purge_cache=1', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?&L=0', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('&L=0', '', $slcurrentPageName);\n\t\t$slcurrentPageName=str_replace('?L=0', '', $slcurrentPageName);\n\t\treturn $slcurrentPageName;\n\t}", "public function returnUrl(): string\n {\n return Request::url() . '?' . http_build_query([\n 'return' => 'return',\n 'oc-mall_payment_id' => $this->getPaymentId(),\n ]);\n }", "public function getURL(): string\n {\n return $this->url.$this->apiVersion.'/';\n }", "public function url(): string\n {\n return strtok($this->getUri(), '?');\n }", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "public function getCachedReturnUrl()\n {\n $key = 'oauth_return_url_'.$this->request->input('oauth_token');\n\n // If we have no return url stored, redirect back to root page\n $url = $this->cache->get($key, Config::get('hosts.app'));\n\n return $url;\n }", "protected function getUrl()\n {\n if (!empty($this->info['url'])) {\n return $this->info['url'];\n }\n }", "public function url() \n\t{\n\t\treturn static::protocol().'://'.static::host().$this->server('REQUEST_URI', '/' );\n\t}", "private function getTalkURI()\n {\n $url = $this->getInput('url');\n return $url;\n }", "public function getLastRequestURL()\n {\n return $this->requestUrl;\n \n }", "public function ___httpUrl() {\n\t\t$page = $this->pagefiles->getPage();\n\t\t$url = substr($page->httpUrl(), 0, -1 * strlen($page->url())); \n\t\treturn $url . $this->url(); \n\t}", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getRedirectUrl();", "public function getUrl() {\r\n\r\n // removing GET parameters from URL.\r\n return strtolower(rtrim(explode('?', $_SERVER['REQUEST_URI'], 2)[0], '/'));\r\n \r\n }", "public function getUrl() {\n\t\treturn $this->rawUrl;\n\t}", "public static function currentURL() {\n $pgurl = \"http\";\n if(!empty($_SERVER['HTTPS'])) $pgurl .= \"s\";\n $pgurl .= \"://\".$_SERVER[\"SERVER_NAME\"];\n if ($_SERVER[\"SERVER_PORT\"] != \"80\") $pgurl .= \":\".$_SERVER[\"SERVER_PORT\"];\n \n return ($pgurl .= $_SERVER[\"SCRIPT_NAME\"]);\n }", "public static function requestedURL()\n\t{\n\t\t$url = new SMURL;\n\t\t\n\t\t// set scheme\n\t\t$scheme = ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] == 'on' ) ? 'https' : 'http';\n\t\t$url->setScheme( $scheme );\n\t\t\n\t\t// set host\n\t\t$url->setHost( $_SERVER['HTTP_HOST'] );\n\t\t\n\t\t// set path and query\n\t\tif( isset( $_SERVER['REQUEST_URI'] ) )\n\t\t{\n\t\t\tpreg_match( '/\\/([^\\?]*)(?:\\?(.*))?$/', $_SERVER['REQUEST_URI'], $match );\n\t\t\t$url->setPath( $match[1] );\n\t\t\t$url->setQueryString( $match[2] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$url->setPath( $_SERVER['SCRIPT_NAME'] );\n\t\t\t$url->setQueryString( $_SERVER['QUERY_STRING'] );\n\t\t}\n\n\t\t// set port\n\t\t$url->setPort( $_SERVER['SERVER_PORT'] );\n\t\t\n\t\treturn $url;\n\t}", "public static function current_url()\r\n\t{\r\n\t\t$url = Request::factory()->uri();\r\n\t\tif($_GET)\r\n\t\t{\r\n\t\t\t$url .= '/?' . $_SERVER['QUERY_STRING'];\r\n\t\t}\r\n\t\t$url = URL::site( $url, TRUE);\r\n\t\treturn $url;\r\n\t}", "public static function current_url()\r\n\t{\r\n\t\t$url = Request::factory()->uri();\r\n\t\tif($_GET)\r\n\t\t{\r\n\t\t\t$url .= '/?' . $_SERVER['QUERY_STRING'];\r\n\t\t}\r\n\t\t$url = URL::site( $url, TRUE);\r\n\t\treturn $url;\r\n\t}", "function GetUrlPlan($url = '') {\n\tif (empty($url))\n\t\t$url = GetSelfUrl();\n\t$i = preg_match('/^(\\w+):\\/\\//', $url, $ar);\n\tif (1 == $i)\n\t\treturn $ar[1];\n\telse\n\t\treturn '';\n}", "public function getUrl(){\n return $this->server->getUrl() . \"/\" . $this->name;\n \n }", "public function get_renewal_url() {\n\t\t$renewal_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'subscription' => $this->get_id(),\n\t\t\t\t'key' => $this->get_key(),\n\t\t\t\t'action' => 'renew',\n\t\t\t), home_url()\n\t\t);\n\n\t\treturn $renewal_url;\n\t}", "public function siteUrl() {}", "protected function getUrl()\n {\n return str_replace('?' . $_SERVER['QUERY_STRING'], '', $_SERVER['REQUEST_URI']);\n }", "public function url(): string\n {\n return Uri::current()->setPath($this->name)->setSlash(true)->toString();\n }", "function get_header_video_url()\n {\n }", "function fs_get_youtube_id( $url ){\r\n\tpreg_match( \"#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\\/)[^&\\n]+|(?<=v=)[^&\\n]+|(?<=youtu.be/)[^&\\n]+#\", $url, $matches );\r\n\treturn $matches[0];\r\n}", "public function getHeartbeatUrl()\n {\n return $this->HeartbeatUrl;\n }", "public function GetMatch ();", "protected function verificationUrl()\n {\n return Url::temporarySignedRoute(\n 'verification.verify',\n Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)),\n ['id' => $this->user->getKey()]\n );\n }", "function getRedirectLink()\n {\n global $wgRequest;\n if($this->user->isTemporary)\n {\n // User is viewing this from liveshow, means we have to redirect back to ViewSurvey page,\n // and not the wiki page.\n // In this case 'returnto' value does not mean anything, we know where to return.\n $t = Title::newFromText('Special:ViewSurvey');\n\n $url = $t->getLocalURL('liveshow='.$this->user->getTemporaryKey($this->page_id)\n .'&id='.$this->page_id\n .'&userID='.$this->user->userID).'#survey_id_'.$this->page_id;\n return $url;\n }\n else\n {\n $title = Title::newFromText($wgRequest->getVal('returnto'));\n return $title->getLocalURL();\n }\n }" ]
[ "0.6147555", "0.597051", "0.59636706", "0.5956001", "0.59448093", "0.58937925", "0.5831257", "0.5823231", "0.58090425", "0.57796514", "0.577795", "0.577617", "0.5774891", "0.5774891", "0.5774891", "0.5774891", "0.5774891", "0.5774891", "0.57267094", "0.5710036", "0.57099426", "0.5694431", "0.568366", "0.56814736", "0.56595147", "0.56595147", "0.5650583", "0.56427896", "0.56422526", "0.564141", "0.56365365", "0.56238914", "0.5623828", "0.5612944", "0.5595629", "0.5588294", "0.55810696", "0.55656123", "0.5560576", "0.5553094", "0.5552392", "0.55476165", "0.5544917", "0.5544917", "0.5544917", "0.5544917", "0.5544917", "0.5544917", "0.5544917", "0.5544917", "0.5536355", "0.5536355", "0.5536355", "0.5535856", "0.5534689", "0.55185056", "0.54918534", "0.5487534", "0.5482779", "0.5478435", "0.5474471", "0.54599786", "0.54562336", "0.5453185", "0.5447024", "0.5444595", "0.54438055", "0.54423803", "0.5435079", "0.54341125", "0.5431034", "0.54274476", "0.5426023", "0.5419531", "0.5418916", "0.5412105", "0.54016566", "0.5401042", "0.5401042", "0.5401042", "0.5401042", "0.5401042", "0.53962886", "0.538968", "0.5388813", "0.53864044", "0.53770405", "0.53770405", "0.5375177", "0.5374933", "0.5372264", "0.5370033", "0.5365874", "0.53567904", "0.53557205", "0.5354776", "0.53452796", "0.53395367", "0.5339102", "0.5338611" ]
0.8403448
0
Get Shop Now Title
public function getShopNowTitle() { return $this->getData('shop_now_title'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hestia_shop_title_callback() {\n\treturn get_theme_mod( 'hestia_shop_title' );\n}", "public function get_title () {\r\n\t\treturn $this->get_info()['title'];\r\n\t}", "protected function getTitle() {\r\n\t\treturn $this->newsItem->getTitle();\r\n\t}", "public function get_title(): string {\n\t\treturn __( 'Tips to make the most of Web Stories', 'web-stories' );\n\t}", "public function get_title();", "public function get_title() {\n\t\treturn __( 'Gastenboek', 'elementor-gastenboek' );\n\t}", "public function get_title() {\n\t\treturn apply_filters( \"wpo_wcpdf_{$this->slug}_title\", __( 'Packing Slip', 'woocommerce-pdf-invoices-packing-slips' ), $this );\n\t}", "public function get_title() {\n\t\treturn $this->format_string( $this->title );\n\t}", "public function get_title() {\r\n\t\treturn esc_html__( 'Price Plan: 02', 'aapside-master' );\r\n\t}", "public function getTitle(): string\n {\n if (!empty( $this->title )) {\n return $this->title;\n } elseif (!empty( $this->stock )) {\n return $this->stock->title;\n } else {\n return '';\n }\n }", "function get_title()\n {\n }", "public function getTitle() {\n\t\treturn Template::getSiteTitle();\n\t}", "public function getSiteTitle() {\n\t\treturn isset($this->cache->siteTitle) ? $this->cache->siteTitle : 'Crystal-Web System';\n\t}", "public function get_title() {\n\t\treturn __( 'Hello World', 'elementor-hello-world' );\n\t}", "public function get_title() {\n return esc_html__( 'Onsale Product', 'Alita-extensions' );\n }", "public function getProdTitle()\n {\n return $this->prod_title;\n }", "public function getTitle() {\n\t\treturn $this->item->getTitle()->getText();\n\t}", "function get_title() {\n\t\treturn $this->settings['title'];\n\t}", "public function getTitle() {\n\t\treturn $this->title;\t\n\t}", "public function getTitle(): string\n {\n return $this->title ?? $this->name;\n }", "public function getTitle(): string {\n\t\treturn $this->title;\n\t}", "function get_the_title() {\n\n md_get_the_title();\n \n }", "public function get_title()\n\t{\n\t\treturn $this->title;\n\t}", "public function getMetaTitle();", "public function get_title(){\n\t\treturn $this->title;\n\t}", "public function get_title(){\n\t\treturn $this->title;\n\t}", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function getTitle(): string\n {\n return $this->title;\n }", "public function get_title() {\n return esc_html__( 'Onsale Product', 'electro-extensions' );\n }", "public function getTitle()\n {\n return isset($this->metas['title']) ? $this->metas['title'] : '';\n }", "public function get_title() { return $this->title; }", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle();", "public function getTitle()\n {\n\t\treturn $this->title;\n\t}", "public function getTitle() {\r\n\t\treturn $this->title;\r\n\t}", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function getTitle() {\n\t\treturn $this->title;\n\t}", "public function title()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" title ?\");\n\t}", "public static function getTitle()\n {\n return self::$title;\n }", "public function getTitle()\n {\n return $this->getProduct()->getTitle();\n }", "public function getTitle(): string\n {\n return $this->_title;\n }", "public function get_title()\n {\n }", "public function get_title()\n {\n }", "function getTitle() {\n\t\treturn $this->title;\n\t}", "public function current_title()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" current_title ?\");\n\t}", "public function getTitle(): string\n {\n return $this->title;\n }", "function get_title() \t{\n \t\treturn $this->title;\t\n \t}", "public function getTitle(): string\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle(): string;", "public function getTitle(): string;", "public function getTitle(): string;", "public function getTitle(): string;", "public function getTitle(): string;", "public function getTitle(): string;", "public function getTitle(): string;", "public function getTitle(): string;", "public function getTitle()\n {\n return $this->getData('title');\n }", "public function gettitle()\n {\n return $this->title;\n }", "static public function getTitle() {\n\t\treturn self::$page_title;\n\t}", "public function getTitle() : string\n {\n return $this->title;\n }", "public function getTitle() : string\n {\n return $this->title;\n }", "public function _get_item_title() {\n\t\treturn $this->_item_title;\n\t}", "public function getMatchNowTitle()\n {\n return $this->getData('match_now_title');\n }", "public function getTitle()\n\t\t{\n\t\t\tif(is_null($this->data))\n\t\t\t\treturn '';\n\t\t\t\n\t\t\tif(!array_key_exists('title', $this->data))\n\t\t\t\treturn '';\n\t\t\t\n\t\t\treturn $this->data['title'];\n\t\t}", "public function getTitle(){\n\n $title = $this->getField('title', '');\n if(empty($title)){ return $title; }//if\n\n if($title_prefix = $this->getTitlePrefix()){\n $title = $title_prefix.$this->getTitleSep().$title;\n }//if\n\n if($title_postfix = $this->getTitlePostfix()){\n $title .= $this->getTitleSep().$title_postfix;\n }//if\n\n return $title;\n\n }", "function get_site_title()\n\t{\n\t\tglobal $conn;\n\t\t\n\t\t$siteTitle = \"SELECT infoData FROM misc_info WHERE infoName='siteTitle' LIMIT 1\";\n\t\t\n\t\t$siteTitle = mysql_query($siteTitle, $conn);\n\t\t$siteTitle = mysql_fetch_assoc($siteTitle);\n\t\t\n\t\treturn array_shift($siteTitle);\n\t}", "function getTitle() ;", "public function getTitle(){\r\n\t\treturn $this->title;\r\n\t}", "public function getTitle()\n {\n if ($this->isPermit()) {\n $addresses = $this->getField('objectaddresses');\n if ($addresses != false) {\n $location = $addresses[0]['zipcode'];\n $location .= ' ' . $addresses[0]['addressnumber'];\n $location .= $addresses[0]['addressnumberadditional'];\n $location .= ' ' . $addresses[0]['city'];\n $result = sprintf(\n '%s %s %s',\n $this->getField('producttype'),\n $this->getField('productactivities'),\n $location\n );\n } else {\n $result = sprintf(\n '%s %s',\n $this->getField('producttype'),\n $this->getField('productactivities')\n );\n }\n } else {\n $result = $this->getField('title');\n }\n return $result;\n }", "public function getTitle(){\n\t\t\treturn $this->title;\n\t\t}", "public function getTitle()\n {\n return $this->getValue('title');\n }", "public function getTitle()\n {\n return Mage::helper('ddg')->__(\"Engagement Cloud Account Information\");\n }", "public function getTitle(){\r\n\t\t\treturn $this->title;\r\n\t\t}", "public function getTitle()\n {\n return $this->formattedData['title'];\n }", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function getTitle()\n\t{\n\t\treturn $this->title;\n\t}" ]
[ "0.7708132", "0.753332", "0.7376903", "0.7373858", "0.7337966", "0.7273591", "0.716291", "0.7120857", "0.7113418", "0.71119654", "0.70995754", "0.70971644", "0.7095166", "0.7070589", "0.70700467", "0.7057545", "0.70480055", "0.70457923", "0.70331323", "0.70267814", "0.70111924", "0.7010257", "0.70093185", "0.7004421", "0.700031", "0.700031", "0.6994075", "0.6994075", "0.6994075", "0.6994075", "0.6994075", "0.6994075", "0.6994075", "0.69908434", "0.69806236", "0.696085", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69551873", "0.69526905", "0.695146", "0.6949979", "0.6949979", "0.6949979", "0.6949979", "0.69483954", "0.69468886", "0.6946838", "0.6943995", "0.69409233", "0.69403434", "0.6938689", "0.6935622", "0.6931979", "0.692964", "0.69278246", "0.69273794", "0.69273794", "0.69273794", "0.69273794", "0.69273794", "0.69273794", "0.69273794", "0.69273794", "0.69257694", "0.6920857", "0.69146705", "0.69116217", "0.69116217", "0.6909263", "0.6906632", "0.690627", "0.6906059", "0.69051266", "0.6898926", "0.6897848", "0.6894218", "0.6892963", "0.6884725", "0.6884672", "0.6882867", "0.68787676", "0.68766207", "0.68766207", "0.68766207", "0.68766207", "0.68766207", "0.68766207" ]
0.86199474
0
Get Shop Now Url
public function getShopNowUrl() { return $this->getData('show_now_url'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShopUri()\n {\n return sprintf(self::SHOP_URI, $this->getShopName());\n }", "function _getHellaspayUrl($method) {\r\n\r\n\t\t$url = $method->hellaspay_production == '1' ? $method->hellaspay_production_url : $method->hellaspay_test_url;\r\n\r\n\t\treturn $url;\r\n\t}", "public function get_renewal_url() {\n\t\t$renewal_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'subscription' => $this->get_id(),\n\t\t\t\t'key' => $this->get_key(),\n\t\t\t\t'action' => 'renew',\n\t\t\t), home_url()\n\t\t);\n\n\t\treturn $renewal_url;\n\t}", "public function getMytripUrl() {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ()->get ( 'Magento\\Store\\Model\\StoreManagerInterface' )->getStore ();\n return $objectManager->getUrl('booking/mytrip/currenttrip/');\n }", "private function getServiceUrl()\n {\n $store = $this->storeRepository->getById($this->storeManager->getStore()->getId());\n return $this->url->getUrl(\n $this->service . \"/\" . $store->getCode() . \"/\" . $this->version\n );\n }", "public function getContinueShoppingURL() {\n\t\treturn BASKET_CONTINUE_SHOPPING_URL;\n\t}", "protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }", "protected function getUrl(){\n\t\treturn $this->apiUrl . $this->apiVersion . '/';\n\t}", "public function siteUrl() {}", "public function getCheckoutUrl()\n {\n return $this->helper('checkout/url')->getCheckoutUrl();\n }", "public function getOneClickUrl()\n {\n $store = Mage::getSingleton('adminhtml/session_quote')->getStore();\n\n return Zend_Json::encode($this->escapeUrl(Mage::getStoreConfig('oyst/oneclick/payment_url', $store->getId())));\n }", "public function getShopUrl($stripHttp = true): string\n {\n /** @var string $shopUrl */\n $shopUrl = $this->router->generate(\n 'frontend.home.page',\n [],\n $this->router::ABSOLUTE_URL\n );\n\n if ($stripHttp === true) {\n $shopUrl = str_ireplace('http://', '', $shopUrl);\n $shopUrl = str_ireplace('https://', '', $shopUrl);\n }\n\n if (substr($shopUrl, -1) === '/') {\n $shopUrl = substr($shopUrl, 0, -1);\n }\n\n return $shopUrl;\n }", "public function getMatchNowUrl()\n {\n return $this->getData('match_now_url');\n }", "public function getURL(): string\n {\n return $this->url.$this->apiVersion.'/';\n }", "public function getCurrentUrl();", "public function getStoreUrl()\r\n\t{\r\n\t\treturn Mage::getBaseUrl();\r\n\t}", "public function getUrl() {\n\t\treturn $this->siteURL;\n\t}", "public function get_url();", "public function getURL() {\n return $this->apiURL . $this->endPoint . $this->storeID . $this->jsonFile;\n }", "function get_checkout_url() {\n\t\t\t$checkout_page_id = get_option('cmdeals_checkout_page_id');\n\t\t\tif ($checkout_page_id) :\n\t\t\t\tif (is_ssl()) return str_replace('http:', 'https:', get_permalink($checkout_page_id));\n\t\t\t\treturn get_permalink($checkout_page_id);\n\t\t\tendif;\n\t\t}", "public function getServiceUrl()\n {\n if($this->testMode) {\n return 'https://www.alipay.com/cooperate/gateway.do';\n }\n\t\treturn 'https://www.alipay.com/cooperate/gateway.do';\n }", "public function getUrl() {\n return $this->_gatewayRedirect->getUrl ();\n }", "public function getUrl()\n\t{\n\t\treturn rtrim(Mage::helper('wordpress')->getUrlWithFront($this->getId()), '/') . '/';\n\t}", "private function getShopUrl($aShop)\n {\n $shop = $aShop;\n if (!strpos($aShop, \"https://\")) {\n $shop = \"https://\" . $aShop;\n }\n return $shop;\n }", "public function getUrl()\n {\n return Mage::getUrl('magna_news', array('news_id' => $this->getId(), '_secure' => true));\n }", "public function getConnectUrl()\n {\n return Mage::helper('adminhtml')->getUrl('adminhtml/shopgate/connect');\n }", "public static function getThisUrl() {}", "public function getWelcomeURL()\n\t{\n\t\t$merchantId = $this->settingsHelper->getMerchantId();\n\t\t$countryId = $this->localizationHelper->getShippingCountry();\n\t\t\n\t\tif($this->settingsHelper->isStagingEnabled())\n\t\t\treturn trim(Mage::getStoreConfig('borderfree_options/settings/welcomematstageurl')) . \"?merchId=$merchantId&countryId=$countryId&setCookie=Y\";\n\t\telse\n\t\t\treturn trim(Mage::getStoreConfig('borderfree_options/settings/welcomematprodurl')) . \"?merchId=$merchantId&countryId=$countryId&setCookie=Y\";\n\t}", "function getCurrentUrl() {\n\t\t$url = isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http';\n\t\t$url .= '://' . $_SERVER['SERVER_NAME'];\n\t\t$url .= in_array( $_SERVER['SERVER_PORT'], array('80', '443') ) ? '' : ':' . $_SERVER['SERVER_PORT'];\n\t\t$url .= $_SERVER['REQUEST_URI'];\n\t\treturn $url;\n\t}", "public function getUrl() {\n\t\t$url = $this->getBaseUrl().$this->getBasePath().$this->getOperation();\n\t\t$params = http_build_query($this->getUrlParameters());\n\t\tif ($params) {\n\t\t\t$url .= '?'.$params;\n\t\t}\n\t\treturn $url;\n\t}", "public function getCheckoutRedirectUrl()\n {\n return Mage::getUrl('radial_paypal_express/checkout/start');\n }", "public function getURL() {\n $defaultPorts= array(\n 'http' => 80,\n 'https' => 443\n );\n \n // Determine which settings we need to pass\n $xsr= array();\n if (\n ($this->getProduct() != $this->getDefaultProduct()) ||\n ($this->getLanguage() != $this->getDefaultLanguage())\n ) {\n $xsr[]= $this->getProduct();\n $xsr[]= $this->getLanguage();\n }\n if ($this->getSessionId()) $xsr[]= 'psessionid='.$this->getSessionId();\n\n $port= '';\n if (\n $this->getPort() &&\n (!isset($defaultPorts[$this->getScheme()]) ||\n $this->getPort() != $defaultPorts[$this->getScheme()])\n ) {\n $port= ':'.$this->getPort();\n }\n\n\n return sprintf(\n '%s://%s%s/xml/%s%s%s%s',\n $this->getScheme(),\n $this->getHost(),\n $port,\n (sizeof($xsr) ? implode('.', $xsr).'/' : ''),\n $this->getStateName(), \n $this->getQuery() ? '?'.$this->getQuery() : '',\n $this->getFragment() ? '#'.$this->getFragment() : ''\n );\n }", "public function get_url()\n {\n }", "function wpcr_stc_get_current_url() {\n\t$requested_url = ( !empty($_SERVER['HTTPS'] ) && strtolower($_SERVER['HTTPS']) == 'on' ) ? 'https://' : 'http://';\n\t$requested_url .= $_SERVER['HTTP_HOST'];\n\t$requested_url .= $_SERVER['REQUEST_URI'];\n\treturn $requested_url;\n}", "public function getSiteURL()\n {\n return $this->config->get('site.url').$this->config->get('site.dir');\n }", "protected function getUrl()\n {\n if (!empty($this->info['url'])) {\n return $this->info['url'];\n }\n }", "public static function getBaseGatewayUrl()\n {\n $url = Configuration::getGlobalValue(PostFinanceCheckoutBasemodule::CK_BASE_URL);\n\n if ($url) {\n return rtrim($url, '/');\n }\n return 'https://app-wallee.com';\n }", "public function getBaseUrl() {\n $storeManager = $this->objectManager->get ( 'Magento\\Store\\Model\\StoreManagerInterface' );\n\n return $storeManager->getStore ()->getBaseUrl ();\n }", "public function getURL();", "public function getURL();", "public function getUrl()\n {\n return $this->createUrl();\n }", "public function getStoreURL(){\r\n\t\t//$this->initDb();\r\n\t\t$this->store_url='';\r\n\t\tif($this->car_id !=0 && $this->getStoreId()!=''){\r\n\t\t\t$this->store_url = getValue(\"SELECT storeurl FROM tbl_store WHERE store_id=\".$this->getStoreId());\r\n\t\t}\r\n\t\treturn $this->store_url;\t\r\n\t}", "public function getUrl() {\n\t\t$this->getRublon()->log(__METHOD__);\n\t\treturn $this->getRublon()->getAPIDomain() .\n\t\t\tself::URL_PATH_CODE .\n\t\t\turlencode($this->getUrlParamsString());\n\t}", "public function getUrl()\n {\n $url = $params = '';\n $url .= $this->getProtocol() . '://' . self::EBAY_HOST . self::EBAY_URI . '?';\n foreach ($this->getParams() as $name => $value) {\n $params .= '&' . $name . '=' . urlencode($value);\n }\n\n return $url . substr($params, 1);\n }", "function url()\n {\n return $this->peopletag->homeUrl();\n }", "private function getCallbackURL()\n\t{\n\t\t$sandbox = $this->params->get('sandbox', 0);\n\n\t\tif ($sandbox)\n\t\t{\n\t\t\treturn 'ssl://sandbox.payfast.co.za';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 'ssl://www.payfast.co.za';\n\t\t}\n\t}", "public function getBaseUrlWithStoreCode() {\n return $this->_storeManager->getStore()->getBaseUrl();\n }", "public function getEndpointUrl()\n {\n if (empty($this->endpointUrl)) {\n $this->endpointUrl = \\TiTravel\\Constants::API_LIVE_ENDPOINT;\n }\n return \"{$this->endpointUrl}&\".$this->getCredentialsUrlParams().'&action=';\n }", "function st_woocommerce_shop_url() {\n\n return site_url() . '/product-category/pain-matters/';\n\n }", "function waves_shop_req(){\n global $wp;\n $output='';\n if(count($_GET)){\n foreach ( $_GET as $key => $value ) {\n if($key!=='shop_load'&&$key!=='_'){\n $output.=(empty($output)?'?':'&').$key.'='.$value;\n }\n }\n }\n return home_url( $wp->request ).$output;\n}", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "public function getStoreUrl($fromStore = true) {\r\n\t\treturn $this->_storeManager->getStore()->getCurrentUrl($fromStore);\r\n\t}", "function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}", "public static function get_webhook_url() {\n\t\treturn add_query_arg( 'wc-api', 'wc_stripe', trailingslashit( get_home_url() ) );\n\t}", "public function getURL ();", "function trueSiteUrl() {\n\t\treturn $GLOBALS[\"trueSiteUrl\"];\n\t}", "protected function getApiUrl(): string\n {\n return preg_replace($this->regexPattern,$this->currencyDate,$this->apiEndpoint);\n }", "static function obtenerUrlActual() {\n $url = Util::crearUrl($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n return $url;\n }", "public static function getWebsiteURL(){\n if(Cache::isStored('website_url'))return Cache::get('website_url'); \n $row = getDatabase()->queryFirstRow(\"SELECT `value` FROM `settings` WHERE `setting` = 'website_url'\");\n $url = $row['value'];\n #http:// prefix\n if(!is_numeric(strpos($url, \"http://\"))){\n $url = 'http://' . $url;\n }\n #/ suffix\n if(substr($url, -1) != '/'){\n $url .= '/';\n }\n Cache::store('website_url', $url);\n return $url;\n }", "public static function siteURL(): string\n {\n return sprintf(\"%s://%s\", Request::scheme(), Request::host());\n }", "public function getUrl(){\n return $this->server->getUrl() . \"/\" . $this->name;\n \n }", "private function site_url()\n\t{\n\t\t$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443)\n\t\t\t? \"https://\"\n\t\t\t: \"http://\";\n\t\t$domainName = $_SERVER['HTTP_HOST'];\n\n\t\treturn $protocol.$domainName;\n\t}", "private static function getSiteUrl()\n {\n return ( isset( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on' ? \"https\" : \"http\") . \"://\" . $_SERVER['HTTP_HOST'] . ( isset($_SERVER['SCRIPT_URL'] ) ? $_SERVER['SCRIPT_URL'] : '' );\n }", "public function url()\r\n {\r\n return $this->get_base_url() . http_build_query($this->get_query_params());\r\n }", "public function getCheckoutUrl($tempCart){\n $subdomain = (Mage::getStoreConfig('iglobal_integration/apireqs/igsubdomain') ? Mage::getStoreConfig('iglobal_integration/apireqs/igsubdomain') : \"checkout\");\n\t\t$storeNumber = (Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid') ? Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid') : \"3\");\n\t\t$countryCode = (isset($_COOKIE['igCountry']) ? $_COOKIE['igCountry'] : \"\");\n $url = 'https://' . $subdomain . '.iglobalstores.com/?store=' . $storeNumber . '&tempCartUUID=' . $tempCart . '&country=' . $countryCode;\n\n\n\t\t//grab customer info if logged in and carry over to iglobal checkout\n\t\tif(Mage::getSingleton('customer/session')->isLoggedIn()){\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $shipping_id = $customer->getDefaultShipping();\n\n if($shipping_id){\n $shipping_address = Mage::getModel('customer/address')->load($shipping_id);\n }\n\n $customer_params = '';\n\n if(!$shipping_address){\n $customer_params .= '&customerName=' . $customer['firstname'] . ' ' . $customer['lastname'];\n $customer_params .= '&customerCompany=' . $customer['company'];\n $customer_params .= '&customerEmail=' . $customer['email'];\n $customer_params .= '&customerPhone=' . $customer['telephone'];\n }else{\n $customer_params .= '&customerName=' . $shipping_address['firstname'] . ' ' . $shipping_address['lastname'];\n $customer_params .= '&customerCompany=' . $shipping_address['company'];\n $customer_params .= '&customerEmail=' . $customer['email'];\n $customer_params .= '&customerPhone=' . $shipping_address['telephone'];\n $customer_params .= '&customerAddress1=' . $shipping_address->getStreet(1);\n $customer_params .= '&customerAddress2=' . $shipping_address->getStreet(2);\n $customer_params .= '&customerCity=' . $shipping_address['city'];\n $customer_params .= '&customerState=' . $shipping_address['region'];\n $customer_params .= '&customerCountry=' . $shipping_address['country_id'];\n $customer_params .= '&customerZip=' . $shipping_address['postcode'];\n }\n $url .= $customer_params;\n }\n return $url;\n }", "protected function _getUrl()\n {\n $s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : '';\n\n $protocol = substr(strtolower($_SERVER['SERVER_PROTOCOL']), 0, strpos(strtolower($_SERVER['SERVER_PROTOCOL']), '/')) . $s;\n\n $port = ($_SERVER['SERVER_PORT'] == '80') ? '' : (':'.$_SERVER['SERVER_PORT']);\n\n return $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];\n }", "public function getActionUrl()\n {\n return Mage::getUrl('supplier/plan/buy');\n }", "public function getUrl() {\n\t\treturn sprintf(self::ENDPOINT, $this->_account);\n\t}", "public function getUrl() {\n return $this->get(self::URL);\n }", "public function url();", "public function url();", "public function url();", "public function getTakeUrl() { }", "static public function getCurrentURL() {\n\t\tif (self::checkSSL()) {\n\t\t\treturn self::getSecureURL();\n\t\t} else {\n\t\t\treturn self::getURL();\n\t\t}\n\t}", "public function getWebsiteURL() {\n return $this->getChaveValor('WEBSITE_URL');\n }", "function site_url(){\n\treturn config( 'site.url' );\n}", "public function getResetUrl()\n {\n /** @var $helper Mage_Core_Helper_Url */\n $helper = Mage::helper('core/url');\n\n // get current url\n $url = $helper->getCurrentUrl();\n\n // parse url\n $parsedUrl = parse_url($url);\n\n // build url\n $url = $parsedUrl['scheme'] . '://' . $parsedUrl['host'] . $parsedUrl['path'];\n\n // get query parameters\n if (isset($parsedUrl['query'])) {\n parse_str(html_entity_decode($parsedUrl['query']), $q);\n\n // remove bx filters\n foreach ($q as $k => $v) {\n if (strpos($k, 'bx_') === 0) {\n unset($q[$k]);\n }\n }\n\n // append query string\n if ($q) {\n $url .= '?' . http_build_query($q);\n }\n }\n\n // return url\n return $url;\n }", "public function get_url(){\n\n\t\t\treturn $this->api_urls['giturl'];\n\n\t\t}", "public function get_url(): string\n {\n return $this->get_url_internal();\n }", "public static function url(): string\n\t{\n\t\treturn static::$url;\n\t}", "static public function ctrRuta(){\n\n\t\treturn \"https://chocoshop.teamblack4ever.com/\";\n\t\n\t}", "function getUrl() {\n\t\t$url = @( $_SERVER[\"HTTPS\"] != 'on' ) ? 'http://'.$_SERVER[\"SERVER_NAME\"] : 'https://'.$_SERVER[\"SERVER_NAME\"];\n\t\t$url .= ( $_SERVER[\"SERVER_PORT\"] !== 80 ) ? \":\".$_SERVER[\"SERVER_PORT\"] : \"\";\n\t\t$url .= $_SERVER[\"REQUEST_URI\"];\n\t\treturn $url;\n\t}", "public function getFrontPageUrl();", "public function url(){\n $protocol = \"http://\";\n if ( !empty( $_SERVER['HTTPS'] ) ) {\n $protocol = \"https://\";\n }\n $url = $protocol . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n return $url;\n }", "public function getOrderPlaceRedirectUrl()\n {\n if (Mage::getStoreConfig('payment/bitcoin/fullscreen')) {\n if(Mage::helper(\"bitcoin\")->doesTheStoreHasSSL()){\n $target_url = Mage::getUrl(\"bitcoin/index/pay\" , array(\"_secure\" => true));\n }else{\n $target_url = Mage::getUrl(\"bitcoin/index/pay\" , array(\"_secure\" => false));\n }\n return $target_url;\n } else {\n return '';\n }\n }", "public function getNewsletterUrl()\n {\n return $this->urlBuilder->getUrl('walleycheckout/newsletter');\n }", "function vip_powered_wpcom_url() {\n\treturn 'https://vip.wordpress.com/';\n}", "public function getActionUrl() : string\n {\n return $this->getUrl('pramp/api_store/switch');\n }", "public function getMagentoConnectUrl() {\n\t\treturn Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB) . 'downloader/';\n\t}", "protected function getUrl() {\r\n\t\treturn $this->url;\r\n\t}", "protected function get_endpoint_url() {\n\n\t\t$args = http_build_query( array( 'apikey' => $this->api_key ) );\n\t\t$base = $this->route . $this->app_id;\n\t\t$url = \"$base?$args\";\n\n\t\treturn $url;\n\t}", "public function buildShopUrl() {\n\t\t\t$this->baseUrl = sprintf($this->baseUrl, $this->apiKey, $this->pass, $this->shopName);\n\t\t\treturn $this;\n\t\t}", "public function getSiteURL()\r\n {\r\n return $this->siteURL;\r\n }", "public function generate_url()\n {\n }", "static public function selfURL()\r\n {\r\n //global $cfgSite;\r\n $cfgSite = Warecorp_Config_Loader::getInstance()->getAppConfig('cfg.site.xml');\r\n $s = empty($_SERVER[\"HTTPS\"]) ? '' : ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" : \"\";\r\n $protocol = self::strleft(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\").$s;\r\n if ($cfgSite->use_port_in_URL == '1') {\r\n $port = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]);\r\n } else {$port = '';}\r\n return $protocol.\"://\".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];\r\n }", "public function get_url () {\r\n\t\treturn $this->url;\r\n\t}", "function getAppUrl() {\r\n\r\n $url = getHost() . getAppPath();\r\n\r\n return $url;\r\n\r\n }", "public function getEvoBaseUrl()\n\t{\n\t\tMage::log(\" --- Snap* Hosted Payments API : getEvoBaseUrl --- \");\n\t\t$bTestMode = $this->getConfigData('test_mode');\n\t\treturn ($bTestMode ? $this->_merchantCheckoutURLTest : $this->_merchantCheckoutURL);\n\t}", "public function getUrl();", "public function getUrl();" ]
[ "0.7105449", "0.7083607", "0.6912421", "0.6779383", "0.67741054", "0.6689031", "0.66760945", "0.6673764", "0.65760225", "0.65040964", "0.65006465", "0.64723665", "0.64637905", "0.64625484", "0.64383256", "0.64369553", "0.6436007", "0.6433064", "0.64321524", "0.63954127", "0.63546056", "0.6353899", "0.63498807", "0.63313437", "0.6320763", "0.6314525", "0.6311877", "0.63061345", "0.62938696", "0.62932354", "0.62907577", "0.6287449", "0.6286384", "0.6272763", "0.6269139", "0.6267892", "0.6266701", "0.6256088", "0.62525105", "0.62525105", "0.62439823", "0.6236972", "0.6232326", "0.62305987", "0.6226265", "0.6225996", "0.6224537", "0.62073267", "0.6206587", "0.6203171", "0.62008965", "0.6198517", "0.6197391", "0.6195122", "0.61876804", "0.6184552", "0.6174775", "0.61687857", "0.6166239", "0.6162704", "0.6159915", "0.615838", "0.6157246", "0.61458397", "0.6140193", "0.6139199", "0.6136498", "0.6136299", "0.6132486", "0.61309797", "0.61309797", "0.61309797", "0.6128211", "0.61276126", "0.6124556", "0.61178833", "0.6110359", "0.61093265", "0.60967684", "0.60956234", "0.609429", "0.6091275", "0.60894394", "0.6083151", "0.60798025", "0.60743475", "0.6068341", "0.6068302", "0.6061231", "0.60584664", "0.6055419", "0.60505116", "0.60464597", "0.6046003", "0.60459954", "0.60439444", "0.60427463", "0.60410935", "0.6039659", "0.6039659" ]
0.851698
0
Get source image url
public function getSrcMediaImage() { return $this->_designerHelper->getSrcMediaImage(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getImageSrc()\n {\n return $this->imageSrc;\n }", "public function getImageURL() {\n\n return $this->image_url;\n }", "public function getImage() {\n return Mage::helper('landingpage/image')->getImageUrl($this->getData('image'));\n }", "public function getImageUrl()\n\t{\n\t\treturn $this->image_url;\n\t}", "protected function getImageUrl() {\r\n\t\treturn $this->imageUrl;\r\n\t}", "public function get_image_url()\n {\n }", "public function getBaseImageSource()\n {\n $baseImage = $this->_rootElement->find($this->baseImage);\n return $baseImage->isVisible() ? $baseImage->getAttribute('src') : '';\n }", "public function getImageUrl()\n {\n return $this->image_url;\n }", "public function getImageUrl()\n {\n return $this->image_url;\n }", "public function getBaseImageSource()\n {\n return $this->getBaseImageAttribute('src');\n }", "public function getImageUrl()\n {\n return isset($this->image_url) ? $this->image_url : null;\n }", "static public function getImageURL() {\n\t\treturn self::$image_url;\n\t}", "public function getImageUrl() {\n return $this->image_url;\n\n }", "public function getImageUrl()\n {\n return $this->imageUrl;\n }", "public function getImageUrl(): string\n {\n return $this->imageUrl;\n }", "public function getSrc();", "public function getImageUrl();", "public function getImageUrl() {\n if ($this->_getData('image_url')) {\n if (strpos($this->_getData('image_url'), 'http://') === false) {\n $this->setImageUrl(Mage::getBaseUrl() . ltrim($this->_getData('image_url'), '/ '));\n }\n }\n\n return $this->_getData('image_url');\n }", "function getImageSource() {return $this->_imagesource;}", "public function getPictureUrl()\n {\n return $this->getImageurl();\n }", "public function getImageUrl()\n {\n $baseUrl = $this->getBaseImageUrl();\n if ($baseUrl) {\n $dimensions = $this->getImageDimensions();\n $imageData = $this->getImageData();\n $width = Kwf_Media_Image::getResponsiveWidthStep($dimensions['width'],\n Kwf_Media_Image::getResponsiveWidthSteps($dimensions, $imageData['file']));\n $ret = str_replace('{width}', $width, $baseUrl);\n $ev = new Kwf_Component_Event_CreateMediaUrl($this->getData()->componentClass, $this->getData(), $ret);\n Kwf_Events_Dispatcher::fireEvent($ev);\n return $ev->url;\n }\n return null;\n }", "public function getImageUrl()\n {\n if($this->imageUrl === null) {\n if (!empty($this->external_image_url)) {\n $this->imageUrl = $this->external_image_url;\n } elseif (isset($this->files[0]) && !empty($this->files[0]->path)) {\n $this->imageUrl = $this->filesByZone('bannerImage')->first()->path_string;\n }\n }\n\n return $this->imageUrl;\n }", "public function getSrc()\n {\n return $this->src;\n }", "public function getSrc()\n {\n return $this->src;\n }", "public function getSrc(): string {\n return $this->attributes()->getValue('src');\n }", "public function getImageUrl(){\n return $this->image_url;\n }", "public function getImageUrl()\n {\n return $this->info->thumbnail_url ? $this->info->thumbnail_url : null;\n }", "function getUrlImg(){\n\t\treturn $this->url_img;\n\t}", "public function mainImageURL()\n {\n if ($this->image) {\n $imageLocation = $this->image->location;\n } else {\n // If the image cannot be displayed, show a generic image.\n $imageLocation = 'generic/generic1.jpg';\n }\n\n return Storage::url($imageLocation);\n }", "function ImageSRC()\n\t{\treturn $this->imagelocation . (int)$this->id . \".jpg\";\n\t}", "public function getSrc()\n {\n $value = $this->get(self::SRC);\n return $value === null ? (string)$value : $value;\n }", "public function getImgSRC()\n {\n return $this->imgSRC;\n }", "private function getImageSourcePath()\r\n {\r\n // check if relative\r\n if(substr($this->_imagesource, 0, 2) == \"..\" || $this->_imagesource{0} == \".\")\r\n {\r\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/' . $this->_imagesource;\r\n }\r\n else\r\n {\r\n return $this->_imagesource;\r\n }\r\n }", "public function getFirstImageUrl()\n {\n $url = '';\n if ($image = $this->getFirstImage()) {\n $url = $image->getUrl();\n }\n return $url;\n }", "static public function getCurrentImageURL() {\n\t\tif (self::checkSSL()) {\n\t\t\treturn self::getSecureImageURL();\n\t\t} else {\n\t\t\treturn self::getImageURL();\n\t\t}\n\t}", "public function getSrc(): string {\n return (string) $this->getAttribute('src');\n }", "abstract public function get_thumbnail_source_path();", "public function getUrlImage(): ?string\n {\n return $this->url_image;\n }", "public function getImgMainSrcAttribute()\n {\n if (strpos($this->main_img, 'http') !== false) {\n return $this->main_img;\n } else if ($this->main_img) {\n return url(\"/api/images/catalogs/$this->id/main?ver=\" . rand(0, 1000000));\n }\n\n return null;\n }", "public function getPictureUrl() {\n\t\treturn $this->picture ? Storage::url(self::IMAGE_DIRECTORY.'/'.$this->picture) : null;\n\t}", "public function imageUrl()\n\t{\n\t\treturn \"/storage/$this->image\";\n\t}", "public function getImageUrl() \n {\n // return a default image placeholder if your source avatar is not found\n $imagen = isset($this->imagen) ? $this->imagen : 'default_product.jpg';\n return Url::to('@web/img/producto/'). $imagen;\n }", "public function src(){\n return $this->imageFirstInContent;\n }", "public function getImg()\n {\n return $this->imgLink;\n }", "public function getImageUrl()\n {\n return (string)$this->_getImageHelper()->init($this, 'image')->resize(265);\n }", "public function getThumbnailUrl();", "function cjpopups_get_image_url($image){\n\tif(strpos($image, 'img') > 0){\n\t\t$xpath = new DOMXPath(@DOMDocument::loadHTML($image));\n\t\t$src = $xpath->evaluate(\"string(//img/@src)\");\n\t\treturn $src;\n\t}else{\n\t\treturn $image;\n\t}\n}", "public function getImage()\n {\n if($this->image == null){\n return \"https://place-hold.it/50x50\";\n }\n else return IMG_PATH.\"/\".$this->image;\n }", "protected function _getUrl()\n {\n $url = false;\n if ($this->getValue()) {\n $url = $this->_imageModel->getBaseUrl().$this->getValue();\n }\n return $url;\n }", "public function getImageUrlAttribute()\n {\n return Storage::url($this->getImagePath());\n }", "public function getPhotoUrlAttribute()\n {\n return asset(env('FRONTEND_IMAGES_PATH') . $this->image);\n }", "function getLocalImageURL() {\n\t\tglobal $MAIN_ROOT;\n\t\t$returnVal = false;\n\t\tif($this->intTableKeyValue != \"\") {\n\t\t\t\t\t\n\t\t\tif(strpos($this->arrObjInfo['imageurl'], \"http://\") === false) {\n\t\t\t\t\n\t\t\t\t$returnVal = $this->arrObjInfo['imageurl'];\n\t\t\t\t\n\t\t\t}\n\n\t\t}\n\t\t\n\t\treturn $returnVal;\n\t}", "public function getAbsoluteSrc();", "public function getImage(){\n $images = $this->getImageUrls($this->image_size);\n return Utils::saveImage($images->attr('data-url'));\n }", "public function get_image() {\n\n return $this->image_id !== null ? $this->image->full_src() : null;\n }", "public function image()\n {\n if (isset($this->object->entities->media) && ! empty($this->object->entities->media)) {\n return $this->object->entities->media[0]->media_url;\n }\n }", "function getPicUrl()\n\t\t{\n\t\t\treturn $this->picurl;\n\t\t}", "public function getImageUrlAttribute()\n {\n if (!$this->image_extension) return null;\n return asset($this->imageDirectory . '/' . $this->imageFileName);\n }", "public function getSource()\n {\n return 'image';\n }", "public function getImageUrlUnwrapped()\n {\n return $this->readWrapperValue(\"image_url\");\n }", "public function getImageBaseURL()\r\n {\r\n return $this->base_url;\r\n }", "public function getImageUrlAttribute()\n {\n $image = $this->image;\n\n if (filter_var($image, FILTER_VALIDATE_URL)) {\n return $image;\n }\n\n return Storage::url($image);\n }", "public function getImage() {\n if ($this->item_image == null) {\n return Yii::app()->request->baseUrl . \"/images/box/default.jpg\";\n } else {\n return Yii::app()->request->baseUrl . \"/images/box/\" . $this->item_image;\n }\n }", "public function get_image_link()\n {\n }", "public function getPhotoUrl()\n\t{\n\t\treturn $this->photo_url;\n\t}", "public function get_image_url(){\n\t\tglobal $CFG;\n\n\t\trequire_once $CFG->libdir . \"/filelib.php\";\n\n\t\t$course = get_course($this->_courseid);\n\n\t\tif ($course instanceof stdClass) {\n\t\t\trequire_once $CFG->libdir . '/coursecatlib.php';\n\t\t\t$course = new course_in_list($course);\n\t\t}\n\n\t\tforeach ($course->get_course_overviewfiles() as $file) {\n\t\t\t$isImage = $file->is_valid_image();\n\n\t\t\tif ($isImage) {\n\t\t\t\treturn file_encode_url(\"$CFG->wwwroot/pluginfile.php\",\n\t\t\t\t\t'/' . $file->get_contextid() . '/' . $file->get_component() . '/' .\n\t\t\t\t\t$file->get_filearea() . $file->get_filepath() . $file->get_filename(), !$isImage);\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function getThumbnail() {\n return Mage::helper('landingpage/image')->getImageUrl($this->getData('thumbnail'));\n }", "public function getPictureURL() {\n return $this->picture_url;\n }", "public function getRelativeLinkToImg()\n {\n return ImgUpload::getRelativeLinkToImg($this);\n }", "public function url()\n\t{\n\t\t$this->buildImage();\n\t\treturn $this->buildCachedFileNameUrl;\n\t}", "public function getImage()\n {\n if (isset($this->response['image']) && isset($this->response['image']['url']))\n {\n return (!empty($this->response['image']['url'])) ? $this->response['image']['url'] : null;\n }\n\n return null;\n }", "public function getAllImagesUrls() {\n $matches = [];\n preg_match_all('@src=\"([^\"]+)\"@', $this->description, $matches);\n return $matches[1];\n }", "function wprss_get_feed_image( $source_id ) {\n return get_post_meta( $source_id, 'wprss_feed_image', true );\n }", "function ThumbSRC()\n\t{\treturn $this->imagelocation . \"thumbs/\" . (int)$this->id . \".jpg\";\n\t}", "public function getUrl()\n\t{\n\t\treturn '/images/blog/' . $this->name;\n\t}", "public function getImageUrl()\n {\n return WEB_SERVER_BASE_URL . '/badges/images/' . $this->data['id'];\n }", "public function getPictureUrl()\n\t{\n\t\treturn 'http://local.postcard.com' . $this->getPictureUri();\n\t}", "public function getPreviewImageUrl()\n {\n return isset($this->preview_image_url) ? $this->preview_image_url : null;\n }", "public function get_image_url( $image ) {\n\t\treturn TYPES_RELPATH . '/public/images' . $image;\n\t}", "public function getLinkToImg()\n {\n return ImgUpload::getLinkToImg($this);\n }", "public function getPhotoUrl()\n {\n if (filter_var($this->photoUrl, FILTER_VALIDATE_URL)) {\n return $this->photoUrl;\n }\n\n if (null !== $this->photoUrl) {\n return \"/uploads/photos/$this->photoUrl\";\n }\n }", "public function getSrcPath()\n {\n return $this->getSettingArray()[\"src_path\"];\n }", "public function getUrl()\n {\n if (!$this->filename) {\n return null;\n }\n\n return $this->base_url . '/' . $this->filename;\n }", "public function getPhotoUrlAttribute()\n {\n return data_get($this, 'photo.s3url', 'https://s3.ap-southeast-1.amazonaws.com/flb-assets/static/parcels/medium.png');\n }", "public function getPreviewImageUrlUnwrapped()\n {\n return $this->readWrapperValue(\"preview_image_url\");\n }", "public function getImageUrlAttribute()\n {\n return self::IMAGE_PATH . $this->image;\n }", "public function getImageUrlAttribute()\n {\n return self::IMAGE_PATH . $this->image;\n }", "public function getCoverAttribute(): string\n {\n if ($this->hasMedia('image') && $this->relationLoaded('media') && config('filesystems.default') !== 'public') {\n return $this->getFirstTemporaryUrl(Carbon::now()->addHour(), 'image', 'sm');\n }\n\n if ($this->getFirstMediaUrl('image', 'sm')) {\n return $this->getFirstMediaUrl('image', 'sm');\n }\n\n return \\Storage::url('images/not-found.jpg');\n }", "public function getMediaImageUrl() {\n return $this->objectManager->get ( 'Magento\\Store\\Model\\StoreManagerInterface' )->getStore ()->getBaseUrl ( \\Magento\\Framework\\UrlInterface::URL_TYPE_MEDIA ) . 'catalog/product';\n }", "function cl_wp_get_attachment_image_src($id, $type) {\n $url = wp_get_attachment_image_src($id, $type);\n if ( defined('FBRWEB_OFFLOAD_HOST') && ($rep = constant('FBRWEB_OFFLOAD_HOST')) ) {\n return str_replace( '//' . $_SERVER['HTTP_HOST'], '//' . $rep, $url);\n }\n return $url;\n}", "public function getPictureURL()\n {\n return $this->pictureURL;\n }", "public function cover_image_absolute_url() {\n // If the URL does not already start with http, assume it's stored locally and add the app URL\n if(!preg_match('/^https?:\\/\\//', $this->cover_image))\n return env('APP_URL').$this->cover_image;\n\n return $this->cover_image;\n }", "static function imgurl($img_path) {\r\n static $urlpre;\r\n if (!isset($urlpre)) $urlpre = C('env.site.merchant');\r\n $img_path = Media::path($img_path);\r\n return preg_match('/^http(s?):\\/\\//i', $img_path) ? $img_path : ($urlpre.$img_path);\r\n }", "public function picture_url() {\n return $this->_adaptee->user_photo(\"\", true);\n }", "public function getUrlAttribute(){\n if(substr($this->image,0,4)=== \"http\"){\n return $this->image;\n }\n //o si viene de la carpeta public\n return '/images/products/' . $this->image;\n }", "public function getUrl() {\n\t\treturn $this->rawUrl;\n\t}", "public function getImgSubSrcAttribute()\n {\n if (strpos($this->sub_img, 'http') !== false) {\n return $this->sub_img;\n } else if ($this->sub_img) {\n return url(\"/api/images/catalogs/$this->id/sub?ver=\" . rand(0, 1000000));\n }\n\n return null;\n }", "public function getAvatar()\n {\n return $this->getImageurl();\n }", "public function getSourceFullUrl()\n {\n return $this->source_full_url;\n }", "public function getImageUrl()\n {\n try {\n $product = $this->itemResolver->getFinalProduct($this->itemOptionsLocator->getOptions($this->getItem()));\n $imageUrl = $this->imageHelper->getDefaultPlaceholderUrl('thumbnail');\n if ($product !== null) {\n $imageUrl = $this->imageHelper->init($product, 'product_thumbnail_image')->getUrl();\n }\n return $imageUrl;\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return null;\n }\n }" ]
[ "0.79458183", "0.7918484", "0.7764495", "0.7702377", "0.7697044", "0.7694876", "0.7682878", "0.7671464", "0.7671464", "0.7661315", "0.76557606", "0.76474756", "0.76287943", "0.75579876", "0.751189", "0.7500117", "0.7485153", "0.747322", "0.7456374", "0.7433859", "0.7429461", "0.7424429", "0.7415909", "0.7415909", "0.74078554", "0.7364533", "0.7340173", "0.73179144", "0.7299816", "0.7279839", "0.7245087", "0.7240171", "0.72114563", "0.72025824", "0.7197809", "0.71789527", "0.71723914", "0.71641517", "0.7129794", "0.7122031", "0.7090548", "0.7087973", "0.70839083", "0.7080313", "0.7071861", "0.70715743", "0.7065127", "0.70648247", "0.70091254", "0.7002934", "0.694767", "0.69409776", "0.6939066", "0.6935772", "0.6935318", "0.69349384", "0.69332093", "0.6919023", "0.6878376", "0.6841525", "0.68262106", "0.68220395", "0.6800231", "0.67908555", "0.67784345", "0.6777991", "0.6753051", "0.6752295", "0.674852", "0.67412525", "0.6715677", "0.6709211", "0.6680441", "0.66787153", "0.6670878", "0.66424066", "0.66421264", "0.6641783", "0.66394734", "0.66364", "0.6619007", "0.6613459", "0.66044074", "0.65916336", "0.65851045", "0.65580094", "0.65580094", "0.6556789", "0.6543094", "0.65386295", "0.65318406", "0.65302694", "0.6529349", "0.6528467", "0.65216947", "0.6502541", "0.65023494", "0.649051", "0.648901", "0.64676595" ]
0.66500795
75
Remove nonnumeric characters from $cc_no
function clean_no ($cc_no) { return ereg_replace ('[^0-9]+', '', $cc_no); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function cleanCCNumber($cc = '') {\n $cc = preg_replace('/[^0-9]/', '', trim($cc));\n return (string)$cc;\n }", "protected function strip_non_numeric($cardno) {\n return preg_replace('/[^0-9]/', null, $cardno);\n }", "function cardNumberClean($number)\n {\n return preg_replace(\"/[^0-9]/\", \"\", $number);\n }", "protected function cleanCardNumber($number) {\n\t\t$result = preg_replace('/\\D/', '', $number);\n\t\treturn $result;\n\t}", "function clean_number($phone_number){\n\treturn preg_replace(\"/[^0-9]/\", \"\", $phone_number);\n}", "function format_phone_plain($number) {\n return preg_replace('/[^0-9]/', '', $number);\n}", "public function clean($cpf)\n {\n return preg_replace(\"/[^0-9]/\", \"\", $cpf);\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 soNumero($str) {\r\nreturn preg_replace(\"/[^0-9]/\", \"\", $str);\r\n\r\n}", "function get_phone_number( $phone_number ) {\n return str_replace( array( '-', '(', ')', ' ' ), '', $phone_number );\n}", "function clean_phone($phone_number){\n $clean = str_replace(array('+','(',')','-',' '),'',$phone_number);\n return $clean;\n }", "public static function normalize($number) {\n\t\t$number = preg_replace('#[^0-9]#','',''.$number);\n\t\t$norm = array('ccc'=>'');\n\t\tswitch (true) {\n\t\t\t\n\t\t\tcase (strlen($number)==10 && substr($number,0,1)=='0'):\n\t\t\t\t$number = substr($number,1);\n\t\t\tcase (strlen($number)==9 && substr($number,0,1)!=='0'):\t\n\t\t\t\t$norm['ccc'] = '33';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$found = false;\n\t\t\t\t$number = preg_replace('#^[0]+#', '', $number);\n\t\t\t\t$found = false;\n\t\t\t\tfor ($i=4; $i>0; $i--) {\n\t\t\t\t\t$ccc = substr($number,0,$i);\n\t\t\t\t\tif (in_array($ccc,self::$ccc)) {\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($found) {\n\t\t\t\t\t$norm['ccc'] = $ccc;\n\t\t\t\t\t$number = preg_replace('#^'.$ccc.'0*#','',$number);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow new PhoneNumberException($number,1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t$norm['number'] = $number;\n\t\treturn $norm;\n\t}", "function MaskCreditCard($cc){\n\t$cc_length = strlen($cc);\n\t// Replace all characters of credit card except the last four and dashes\n\tfor($i=0; $i<$cc_length-4; $i++){\n\t\tif($cc[$i] == '-'){continue;}\n\t\t$cc[$i] = 'X';\n\t}\n\t// Return the masked Credit Card #\n\treturn $cc;\n}", "protected function clean(string $number): string {\n $number = preg_replace('#[^\\d]#', '', $number);\n return trim($number);\n }", "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 fn_validate_cc_number($number, $show_error = false)\n{\n if (empty($number)) {\n return false;\n }\n\n $number = str_replace(array('-',' '), '', $number);\n\n if (preg_match('/^([?0-9]{13,19}|[?*\\d]+)$/', $number)) {\n return true;\n } elseif ($show_error) {\n fn_set_notification('E', __('error'), __('text_not_valid_cc_number', array(\n '[cc_number]' => $number\n )));\n }\n\n return false;\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 removerMascaraCpf($valor)\n{\n return preg_replace([\"/\\\\D+/\"], [''], $valor);\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 }", "function remove_dash_ic($nric) {\n $ic = str_replace(\"-\",\"\",$nric);\n return $ic;\n}", "function clean_account($account)\n{\n\t$account = rtrim($account, \"0\");\n\n\treturn $account;\n}", "public static function maskCPF_CNPJ($_input = NULL) {\n\n $number = self::getNumbers($_input);\n $length = strlen($number);\n\n if ($length != 11 && $length != 14) {\n return $_input;\n }\n\n $return = ($length == 11) ? '###.###.###-##' : '##.###.###/####-##';\n $key = -1;\n\n for ($i = 0, $size = strlen($return); $i < $size; $i++) {\n\n if ($return[$i] == '#') {\n $return[$i] = $number[++$key];\n }\n }\n\n return $return;\n }", "function FormatCreditCard($cc)\n{\n\t$cc = str_replace(array('-',' '),'',$cc);\n\t// Get the CC Length\n\t$cc_length = strlen($cc);\n\t// Initialize the new credit card to contian the last four digits\n\t$newCreditCard = substr($cc,-4);\n\t// Walk backwards through the credit card number and add a dash after every fourth digit\n\tfor($i=$cc_length-5;$i>=0;$i--){\n\t\t// If on the fourth character add a dash\n\t\tif((($i+1)-$cc_length)%4 == 0){\n\t\t\t$newCreditCard = '-'.$newCreditCard;\n\t\t}\n\t\t// Add the current character to the new credit card\n\t\t$newCreditCard = $cc[$i].$newCreditCard;\n\t}\n\t// Return the formatted credit card number\n\treturn $newCreditCard;\n}", "function trimPhone($phone){\n\treturn preg_replace('/[^+0-9]/', '', $phone);\n}", "function justNumbers($var)\n{\n return preg_replace('/[^0-9]/', '', $var);\n}", "function clean_postcode ($postcode) {\n\n\t\t$postcode = str_replace(' ','',$postcode);\n\t\t$postcode = strtoupper($postcode);\n\t\t$postcode = trim($postcode);\n\t\t$postcode = preg_replace('/(\\d[A-Z]{2})/', ' $1', $postcode);\n\t\n\t\treturn $postcode;\n\n\t}", "function remove_non_coding_prot($seq) {\r\n // change the sequence to upper case\r\n $seq=strtoupper($seq);\r\n // remove non-coding characters([^ARNDCEQGHILKMFPSTWYVX\\*])\r\n $seq = preg_replace (\"([^ARNDCEQGHILKMFPSTWYVX\\*])\", \"\", $seq);\r\n return $seq;\r\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}", "function mask_format($nric) {\n if (is_numeric($nric) == 1) {\n return $nric;\n } else {\n $new_nric = substr_replace($nric, 'XXXXX', 0, 5);\n //$new_nric = substr_replace($nric,'XXXX',5); \n return $new_nric;\n }\n }", "private function cleanPhoneNumber($phone = '') {\n $phone = preg_replace('/[^0-9-]/', '', trim($phone));\n return (string)$phone;\n }", "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}", "function nrua_sanitize_phone_number( $phone_mobile )\n{\n\t// = Remove all non int chars\n\t$phone_mobile = filter_var( $phone_mobile, FILTER_SANITIZE_NUMBER_INT );\n\t$phone_mobile = str_replace(\"+\", \"\", $phone_mobile);\n\t$phone_mobile = str_replace(\"-\", \"\", $phone_mobile);\n\t\n\t// = Add the international char\n\t$phone_mobile = '+' .$phone_mobile;\n\t\n\t// = Check lenght\n\tif ( ( strlen( $phone_mobile ) < 10 ) || ( strlen( $phone_mobile ) > 14 ) ) \n\t{\n\t\t$phone_mobile = null;\n\t}\n\t\n\treturn $phone_mobile;\n}", "private function correctNumbers() {\n $prefix = '+'.self::COUNTRY_CODE;\n for($i=0; $i < count($this->arNumbers); $i++) {\n if(strpos($this->arNumbers[$i], $prefix) === FALSE){\n if(strpos($this->arNumbers[$i], self::COUNTRY_CODE) === 0)\n $this->arNumbers[$i] = str_replace(self::COUNTRY_CODE, '', $this->arNumbers[$i]); \n $this->arNumbers[$i] = $prefix.$this->arNumbers[$i];\n }\n } \n }", "public static function unmaskCPF_CNPJ($_input = NULL) {\n\n return self::getNumbers($_input);\n }", "function process($callnum)\n{\n // Make all alphabets uppercase\n $callnum = strtoupper($callnum);\n\n // Delete the year of the call number if exist (the year must have a space\n // in front, starts with digit 1 or 2, and may or may not have a single\n // character after the year. It must also consist of more than 2 parts.\n if (count_parts($callnum) > 2) {\n $pattern = '/ [12]\\d\\d\\d[A-Za-z]{0,1}$/';\n $replacement = '';\n $callnum = preg_replace($pattern, $replacement, $callnum);\n }\n\n // Replace the decimal to *, to easily identify decimals\n $pattern = '/([\\d])\\.([\\d])/';\n $replacement = '$1*$2';\n $callnum = preg_replace($pattern, $replacement, $callnum);\n\n // Delete all occurence of '.' and ' '\n // Note that the decimal is still in place because of the '*'\n $pattern = '/[\\. ]/';\n $replacement = '';\n $callnum = preg_replace($pattern, $replacement, $callnum);\n\n return $callnum;\n}", "function mswReverseTicketNumber($num) {\n return ltrim($num,'0');\n}", "private static function formatPhoneNumber($phone_number)\n {\n return ereg_replace(\"[^0-9]\", '', $phone_number);\n }", "function justAlphanumeric($var)\n{\n return preg_replace('/[^0-9A-Za-z]/', '', $var);\n}", "function vCC( $cc )\r\n\t\t{\r\n\t\t\t#eg. 718486746312031\r\n\t\t\treturn preg_match('/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$/', $cc);\r\n\t\t\t\r\n\t\t}", "function OnlyNumericSolution($Number) {\r\n// Ensure number is no more than 19 characters long.\r\n return substr(ereg_replace('[^0-9]', '', $Number) , 0, 19);\r\n }", "static function cleanaddress($address) {\n\t\t$address = trim($address,',');\n\t\t// remove suite suffix\n\t\t$address = preg_replace('/((Ste|Suite|PO|POBOX|PO Box|ll|office|room|floor)([ \\-\\.\\:]+)([0-9]+))/ie','',$address);\n\t\t// remove any prefix, before the numbers (like the mall name\n\t\t$address = preg_replace('/^([a-z ]+)([0-9]+)/i','${2}',$address);\n\t\t// clean whitespace\n\t\t$address = preg_replace('/\\t/', ' ',$address);\n\t\t$address = str_replace(\"\\n\",' ',$address);\n\t\t$address = preg_replace('/\\s\\s+/', ' ',$address);\n\t\t// clean double-commas\n\t\t$address = str_replace(',,', ', ',$address);\n\t\t$address = str_replace(', ,', ', ',$address);\n\t\t// clean whitespace (again)\n\t\t$address = preg_replace('/\\s\\s+/', ' ',$address);\n\t\treturn trim($address);\n\t}", "function telto($phone) {\n\treturn str_replace(['+', '(', ')', '-', ' '], '', $phone);\n}", "protected function doClean($value)\n {\n // based on http://stackoverflow.com/questions/406230/regular-expression-to-match-string-not-containing-a-word\n $value = preg_replace('/((?![0-9]).)*/', '', $value);\n\n if (!self::isValidCreditCard($value, $this->options['card_type']))\n {\n throw new sfValidatorError($this, 'invalid', array('value' => $value));\n }\n\n return $value;\n }", "private function strip_agency($id) {\n return preg_replace('/\\D/', '', $id);\n }", "function sanitizeAlphaNum($var)\n{\n return preg_replace('/[^a-zA-Z0-9]/', '', $var);\n}", "function cryptCCNumberDeCrypt( $cifer, $key )\r\n{\r\n\treturn base64_decode($cifer);\r\n}", "public static function filterNumber($value)\n {\n return preg_replace('/[^0-9]/', '', $value);\n }", "protected function filterAlphanum($value) {\n return preg_replace(\"/[^a-z0-9]/i\", \"\", $value);\n }", "function buildCustNo($db_link){\n\t\t// Determine biggest customer ID\n\t\t$sql_maxID = \"SELECT MAX(cust_id) AS maxid FROM customer\";\n\t\t$query_maxID = mysqli_query($db_link, $sql_maxID);\n\t\tcheckSQL($db_link, $query_maxID);\n\t\t$result_maxID = mysqli_fetch_array($query_maxID);\n\n\t\t// Read customer number format\n\t\t$cnParts = explode(\"%\", $_SESSION['set_cno']);\n\t\t$cnCount = count($cnParts);\n\n\t\t// Build customer number\n\t\t$i = 0;\n\t\t$custNo = \"\";\n\t\tfor ($i = 1; $i < $cnCount; $i++) {\n\t\t\tswitch($cnParts[$i]){\n\t\t\t\tcase \"N\":\n\t\t\t\t\t$custNo = $custNo.($result_maxID['maxid'] + 1);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"Y\":\n\t\t\t\t\t$custNo = $custNo.date(\"Y\",time());\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"M\":\n\t\t\t\t\t$custNo = $custNo.date(\"m\",time());\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"D\":\n\t\t\t\t\t$custNo = $custNo.date(\"d\",time());\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$custNo = $custNo.$cnParts[$i];\n\t\t\t}\n\t\t}\n\n\t\t// Return customer number\n\t\treturn $custNo;\n\t}", "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}", "function Strip_Bad_chars($input)\n{\n //$output = preg_replace(\"/[^a-zA-Z0-9_-]/\", \"\", $input);\n $output = preg_replace(\"/[^0-9]/\", \"\", $input);\n return $output;\n}", "function remove_nonalphanum( $data ) {\n\t$text = trim( $data, ' ' );\n\t$text = str_replace( ' ', '-', $text );\n\t$text = preg_replace( '/[^A-Za-z0-9-]/', '', $text );\n\treturn strtolower( $text );\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 }", "public function telephoneNumberCleaning($phoneNumber)\n {\n $phoneNumber = preg_replace(\"/[^0-9]/\", \"\", $phoneNumber);\n\n if (strlen($phoneNumber) > 9) {\n $phoneNumber = preg_replace(\"/^48/\", \"\", $phoneNumber);\n }\n \n return $phoneNumber;\n }", "public static function cc_number_exists_in_str( $str ) {\n\t\t$luhnRegex = <<<EOT\n/\n(?#amex)(3[47][0-9]{13})|\n(?#bankcard)(5610[0-9]{12})|(56022[1-5][0-9]{10})|\n(?#diners carte blanche)(300[0-5][0-9]{11})|\n(?#diners intl)(36[0-9]{12})|\n(?#diners US CA)(5[4-5][0-9]{14})|\n(?#discover)(6011[0-9]{12})|(622[0-9]{13})|(64[4-5][0-9]{13})|(65[0-9]{14})|\n(?#InstaPayment)(63[7-9][0-9]{13})|\n(?#JCB)(35[2-8][0-9]{13})|\n(?#Laser)(6(304|7(06|09|71))[0-9]{12,15})|\n(?#Maestro)((5018|5020|5038|5893|6304|6759|6761|6762|6763|0604)[0-9]{8,15})|\n(?#MasterCard)(5[1-5][0-9]{14})|\n(?#Solo)((6334|6767)[0-9]{12,15})|\n(?#Switch)((4903|4905|4911|4936|6333|6759)[0-9]{12,15})|((564182|633110)[0-9]{10,13})|\n(?#Visa)(4([0-9]{15}|[0-9]{12}))\n/\nEOT;\n\n\t\t$nonLuhnRegex = <<<EOT\n/\n(?#china union pay)(62[0-9]{14,17})|\n(?#diners enroute)((2014|2149)[0-9]{11})\n/\nEOT;\n\n\t\t// Transform the regex to get rid of the new lines\n\t\t$luhnRegex = preg_replace( '/\\s/', '', $luhnRegex );\n\t\t$nonLuhnRegex = preg_replace( '/\\s/', '', $nonLuhnRegex );\n\n\t\t// Remove common CC# delimiters\n\t\t$str = preg_replace( '/[\\s\\-]/', '', $str );\n\n\t\t// Now split the string on everything else and join again so the regexen have an 'easy' time\n\t\t$str = join( ' ', preg_split( '/[^0-9]+/', $str, PREG_SPLIT_NO_EMPTY ) );\n\n\t\t// First do we have any numbers that match a pattern but is not luhn checkable?\n\t\t$matches = array();\n\t\tif ( preg_match_all( $nonLuhnRegex, $str, $matches ) > 0 ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Find potential CC numbers that do luhn check and run 'em\n\t\t$matches = array();\n\t\tpreg_match_all( $luhnRegex, $str, $matches );\n\t\tforeach ( $matches[0] as $candidate ) {\n\t\t\tif ( DataValidator::luhn_check( $candidate ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// All our checks have failed; probably doesn't contain a CC number\n\t\treturn false;\n\t}", "function format_phone($number)\n{\n\t$no = preg_replace('/[^0-9+]/', '', $number);\n\n\tif(strlen($no) == 11 && substr($no, 0, 1) == \"1\")\n\t\t$no = substr($no, 1);\n\telseif(strlen($no) == 12 && substr($no, 0, 2) == \"+1\")\n\t\t$no = substr($no, 2);\n\n\tif(strlen($no) == 10)\n\t\treturn \"(\".substr($no, 0, 3).\") \".substr($no, 3, 3).\"-\".substr($no, 6);\n\telseif(strlen($no) == 7)\n\t\treturn substr($no, 0, 3).\"-\".substr($no, 3);\n\telse\n\t\treturn $no;\n\n}", "private function preparePhone($val)\n {\n /**\n * Only numbers, 7-15 digits.\n */\n $res = preg_replace('/[^0-9]+/', '', $val);\n if (strlen($res) < 7 || strlen($res) > 15) {\n $res = '';\n }\n return $res;\n }", "function fixPostalCode($str = \"\") {\n\t$str = strtoupper($str);\n\t// Remove anything but uppercase letters and numbers.\n\t$str = preg_replace(\"/[^A-Z\\d]/\", \"\", $str);\n\t// Format: A9A 9A9\n\t// Leaves non-postal-code content alone.\n\t$str = preg_replace(\"/([A-Z]\\d[A-Z])(\\d[A-Z]\\d)/\", \"$1 $2\", $str);\n\treturn($str);\n//fixPostalCode\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 non_breaking_phone_number() {\r\n\t\tif($this->config['non_breaking_type'] === 'noWrap') {\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t//print('here33495905060<br>');\r\n\t\t\t\t//$this->code = preg_replace('/(\\([0-9]{3}\\))(' . $this->spaceRegex . ')+([0-9]{3}\\-[0-9]{4})/is', '<span class=\"noWrap\">$1 $3</span>', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5 $8 $11</span>$12', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+))(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5.$8.$11</span>$12', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5 $8</span>$9', $this->code, -1, $d);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5.$8</span>$9', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2 $5</span>$6', $this->code, -1, $g);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2.$5</span>$6', $this->code, -1, $i);\r\n\t\t\t\t\r\n\t\t\t// I am guessing; not necessary\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span class=\"noWrap\">$1 $4 $7</span>', $this->code, -1, $d);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span class=\"noWrap\">$1-$4-$7</span>', $this->code, -1, $e);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span class=\"noWrap\">$1.$4.$7</span>', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span class=\"noWrap\">$1 $4</span>', $this->code, -1, $g);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span class=\"noWrap\">$1-$4</span>', $this->code, -1, $h);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '<span class=\"noWrap\">$1.$4</span>', $this->code, -1, $i);\r\n\t\t\t} else {\r\n\t\t\t\t//print('here33495905061<br>');\r\n\t\t\t\t//$this->code = preg_replace('/(1((\\.|\\-|' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((\\.|\\-|' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((\\.|\\-|' . $this->spaceRegex . ')+)[0-9]{4})/is', '<span style=\"white-space: nowrap;\">$0</span>', $this->code, -1, $a);\r\n\t\t\t//\t$this->code = preg_replace('/(1((' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((' . $this->spaceRegex . ')+)[0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4 $7 $10</span>', $this->code, -1, $a);\r\n\t\t\t//\t$this->code = preg_replace('/(1)((' . implode(\"|\", $this->dashes_array) . '))(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . '))([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4-$7-$10</span>', $this->code, -1, $b);\r\n\t\t\t//\t$this->code = preg_replace('/(1)((\\.)+){0,1}(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4.$7.$10</span>', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4 $7</span>', $this->code, -1, $d);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4-$7</span>', $this->code, -1, $e);\r\n\t\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4.$7</span>', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1 $4</span>', $this->code, -1, $g);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1-$4</span>', $this->code, -1, $h);\r\n\t\t\t//\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '<span style=\"white-space: nowrap;\">$1.$4</span>', $this->code, -1, $i);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)((\\(?[0-9]{3}\\)?)(' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5 $8 $11</span>$12', $this->code, -1, $a);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+)(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5.$8.$11</span>$12', $this->code, -1, $c);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5 $8</span>$9', $this->code, -1, $d);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5.$8</span>$9', $this->code, -1, $f);\r\n\t\t\t\t\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2 $5</span>$6', $this->code, -1, $g);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2.$5</span>$6', $this->code, -1, $i);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t//print('here33495905062<br>');\r\n\t\t\t//$this->code = preg_replace('/(\\([0-9]{3}\\))(' . $this->spaceRegex . ')+([0-9]{3}\\-[0-9]{4})/is', '$1&nbsp;$3', $this->code, -1, $b);\r\n\t\t//\t$this->code = preg_replace('/(1)((' . $this->spaceRegex . ')+){0,1}(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7&nbsp;$10', $this->code, -1, $b);\r\n\t\t//\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7', $this->code, -1, $c);\r\n\t\t//\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4', $this->code, -1, $d);\r\n\t//\t\t$this->code = preg_replace('/(1((' . $this->spaceRegex . ')+)){0,1}(\\(?[0-9]{3}\\)?((' . $this->spaceRegex . ')+)){0,1}([0-9]{3}((' . $this->spaceRegex . ')+)[0-9]{4})/is', '$1&nbsp;$4&nbsp;$7&nbsp;$10', $this->code, -1, $a);\r\n\t//\t\t$this->code = preg_replace('/(1)((' . implode(\"|\", $this->dashes_array) . '))(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . '))([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4-$7-$10', $this->code, -1, $b);\r\n\t//\t\t$this->code = preg_replace('/(1)((\\.)+){0,1}(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4.$7.$10', $this->code, -1, $c);\r\n\t\t\t\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+){0,1}([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4&nbsp;$7', $this->code, -1, $d);\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')){0,1}([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4-$7', $this->code, -1, $e);\r\n\t//\t\t$this->code = preg_replace('/(\\(?[0-9]{3}\\)?)((\\.)+){0,1}([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4.$7', $this->code, -1, $f);\r\n\t\t\t\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})/is', '$1&nbsp;$4', $this->code, -1, $g);\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((' . implode(\"|\", $this->dashes_array) . '))([0-9]{4})/is', '$1-$4', $this->code, -1, $h);\r\n\t//\t\t$this->code = preg_replace('/([0-9]{3})((\\.)+)([0-9]{4})/is', '$1.$4', $this->code, -1, $i);\r\n\t\t\t\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . $this->spaceRegex . ')+)(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5&nbsp;$8&nbsp;$11$12', $this->code, -1, $a);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . $this->spaceRegex . ')+)([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5&nbsp;$8$9', $this->code, -1, $d);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . $this->spaceRegex . ')+)([0-9]{4})([^;0-9])/is', '$1$2&nbsp;$5$6', $this->code, -1, $g);\r\n\t\t\t\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(1)((\\.)+)(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5.$8.$11$12', $this->code, -1, $c);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((\\.)+)([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5.$8$9', $this->code, -1, $f);\r\n\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((\\.)+)([0-9]{4})([^;0-9])/is', '$1$2.$5$6', $this->code, -1, $i);\r\n\t\t\tif(ReTidy::is_clf2()) {\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span class=\"noWrap\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t} else {\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(1)((' . implode(\"|\", $this->dashes_array) . ')+)(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8-$11</span>$12', $this->code, -1, $b);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])(\\(?[0-9]{3}\\)?)((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5-$8</span>$9', $this->code, -1, $e);\r\n\t\t\t\t$this->code = preg_replace('/([^;0-9])([0-9]{3})((' . implode(\"|\", $this->dashes_array) . ')+)([0-9]{4})([^;0-9])/is', '$1<span style=\"white-space: nowrap;\">$2-$5</span>$6', $this->code, -1, $h);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$count = $a + $b + $c + $d + $e + $f + $g + $h + $i;\r\n\t\t//$count = $a + $b + $c;\r\n\t\t//var_dump($a, $b, $c, $d, $e);\r\n\t\t$this->logMsgIf(\"non_breaking_phone_number\", $count);\r\n\t}", "function catalogue_format_tel($value) {\n\t$value_array = str_split($value);\n\t$value = '';\n\n\tforeach ($value_array as $char) {\n\t\tif (is_numeric($char) || $char == '+' || $char == '(' || $char == ')') {\n\t\t\t$value .= $char;\n\t\t}\n\t}\n\n\treturn $value;\n}", "function US_phone_number($sPhone)\n {\n $sPhone = ereg_replace(\"[^0-9]\", '', $sPhone);\n if (strlen($sPhone) != 10) return (False);\n $sArea = substr($sPhone, 0, 3);\n $sPrefix = substr($sPhone, 3, 3);\n $sNumber = substr($sPhone, 6, 4);\n $sPhone = \"(\" . $sArea . \")\" . $sPrefix . \"-\" . $sNumber;\n return ($sPhone);\n }", "function fixPhone($str = \"\") {\n\t$str_orig = $str;\n\t$str = preg_replace(\"/[^\\d]/\", \"\", $str);\n\t$str = preg_replace(\"/^(\\d{3})(\\d{3})(\\d{4})$/\", \"$1-$2-$3\", $str);\n\tif ( preg_match(\"/^(\\d{3})-(\\d{3})-(\\d{4})$/\", $str) ) {\n\t\treturn($str);\n\t} else {\n\t\t$str_orig = str_replace(\"'\", \"''\", $str_orig);\n\t\treturn($str_orig);\n\t}\n//fixPhone\n}", "public static function onlyAlphaNum($value)\n {\n return preg_replace('#[^[:alnum:]]#', '', $value);\n }", "public static function fixPostalCode($postalCode)\n {\n return preg_replace(\"/[^0-9]/\", \"\", $postalCode);\n }", "public function unicDigits ($string)\n {\n return preg_replace(\"/[^0-9]/\",\"\", $string);\n }", "public function filter($value) {\n\t\t$value = preg_replace(\"/[^0-9]+/\", \"\", $value);\n\t\t\n\t\t// sformatowanie nipu na ogolny zapis XXX-XXX-XX-XX\n\t\t$value = preg_replace('/([0-9]{3})([0-9]{3})([0-9]{2})([0-9]{2})/i', '$1-$2-$3-$4', $value);\n return $value;\n }", "function cryptCCNumberCrypt( $cc_number, $key )\r\n{\r\n\treturn base64_encode($cc_number);\r\n}", "public function cleanToName($name){\n // Remove empty space\n $name = str_replace(' ', '', $name);\n // Remove special character\n $name = preg_replace('/[^A-Za-z0-9\\-]/', '', $name);\n // Return without numbers\n return preg_replace('/[0-9]+/', '', $name);\n \n }", "private function intlPhone($phone)\n\t{ \n\t\t$norm = preg_replace('~[^0-9]~', '', $phone);\n\n\t\tif (10 === strlen($norm)) {\n\t\t\treturn '1' . $norm; // US\n\t\t}\n\n\t\treturn $norm;\n\t}", "function alphaNumeric($string) {\n\treturn preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $string);\n}", "function fAlfaNum($string) {\r\n $s = preg_replace(\"[^a-zA-Z0-9_]\", \"\", strtr($string, \"áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ \", \"aaaaeeiooouucAAAAEEIOOOUUC_\"));\r\n $s = strtr($s, \"_\", \"\");\r\n return $s;\r\n }", "public static function cep($number)\n\t{\n\t\t// Remove o que não for número\n\t\t$number = preg_replace('/\\D/', '', $number);\n\n\t\t// Nenhum formato conhecido\n\t\tif (strlen($number) != 8) {\n\t\t\treturn $number;\n\t\t}\n\n\t\treturn preg_replace('/(\\d{5})(\\d*)/', '$1-$2', $number);\n\t}", "function ntp_no_canon() {\n return '';\n}", "function format($line) {\n return preg_replace(\"/[^A-Za-z0-9]/\", '', $line);\n}", "function scrub($str) {\n\t$str = preg_replace('/[^A-Za-z0-9]/','',$str);\n\treturn $str;\n}", "function normalize_phone($phone)\n {\n $phone = preg_replace('/\\D/', '', $phone);\n return (strlen($phone) > 10) ? $phone : (getenv('PHONE_DEFAULT_COUNTRY_CODE') ?: '91') . $phone;\n }", "protected function numbersOnly( $value )\n {\n return preg_replace('/[^0-9]/', '', $value);\n }", "public static function cleanCoord($coord)\n {\n return preg_replace('/[^\\d.-]/i', \"\", $coord);\n }", "function snmp_fix_numeric($value)\n{\n if (is_numeric($value)) { return $value + 0; } // If already numeric just return value\n\n $numeric = trim($value, \" \\t\\n\\r\\0\\x0B\\\"\");\n list($numeric) = explode(' ', $numeric);\n $numeric = preg_replace('/[^0-9a-z\\-,\\.]/i', '', $numeric);\n // Some retarded devices report data with spaces and commas: STRING: \" 20,4\"\n $numeric = str_replace(',', '.', $numeric);\n if (is_numeric($numeric))\n {\n // If cleaned data is numeric return number\n return $numeric + 0;\n } else {\n // Else return original value\n return $value;\n }\n}", "function GetProperUSN($usn){\r\n\t$formattedusn = preg_replace('/\\s+/', '', $usn);\r\n\t$formattedusn = strtolower($formattedusn);\r\n\treturn $formattedusn;\r\n}", "function formatPhone($num)\n{\n$num = preg_replace('/[^0-9]/', '', $num);\n$len = strlen($num);\n\n\tif($len<=6)\n\t{\n\t\t$num = preg_replace('/([0-9]{3})([0-9]{3})/', ' $1 $2', $num);\t\n\t}\n\telse if(($len>6)&&($len<=9))\n\t{\n\t\t$num = preg_replace('/([0-9]{3})([0-9]{3})([0-9]{1})/', ' $1 $2 $3', $num);\t\n\t}\n\telse if($len == 10)\n\t{\n\t\t$num = preg_replace('/([0-9]{3})([0-9]{3})([0-9]{4})/', ' $1 $2 $3', $num);\n\t}\n\telse if($len>10)\n\t{\n\t\t$num = preg_replace('/([0-9]{3})([0-9]{3})([0-9]{4})([0-9]{1})/', ' $1 $2 $3 $4', $num);\t\n\t}\nreturn $num;\n}", "function in8nPhone($phone_)\n{\n\t//FIX, let it be Nigerian numbers only\n\t$rPLUS = \"/^\\+/\";\n\t//strip the plus, if there\n\t$phone = preg_replace($rPLUS, \"\", $phone_);\n\t$ptn = \"/^0/\"; // Regex\n\t$str = $phone; //\n\t$rpltxt = \"234\"; // Replacement string\n\t$i81n_phone = preg_replace($ptn, $rpltxt, $str);\n\tif (strlen($i81n_phone) != 13) {\n\t return \"\";\n\t\t//return (\"error:SMS to phone number;$i81n_phone not supported\");\n\t} else {\n\t\treturn $i81n_phone;\n\t}\n}", "protected static function remover_formatacao_numero($strNumero) {\n\t\t$strNumero = trim(str_replace(\"R$\", null, $strNumero));\n\n\t\t$vetVirgula = explode(\",\", $strNumero);\n\t\tif (count($vetVirgula) == 1) {\n\t\t\t$acentos = array(\".\");\n\t\t\t$resultado = str_replace($acentos, \"\", $strNumero);\n\t\t\treturn $resultado;\n\t\t} else if (count($vetVirgula) != 2) {\n\t\t\treturn $strNumero;\n\t\t}\n\n\t\t$strNumero = $vetVirgula[0];\n\t\t$strDecimal = mb_substr($vetVirgula[1], 0, 2);\n\n\t\t$acentos = array(\".\");\n\t\t$resultado = str_replace($acentos, \"\", $strNumero);\n\t\t$resultado = $resultado . \".\" . $strDecimal;\n\n\t\treturn $resultado;\n\n\t}", "public static function formatPhone($number){\n \t$phone_numbers = substr($number, -9);\n\n \t\n\n \t//add 254 at the front\n \t$phone_number = '254'.''.$phone_numbers;\n\n \n\n \treturn $phone_number;\n }", "function make_clean($value) {\n\t\t$legal_chars = \"%[^0-9a-zA-Z������� ]%\"; //allow letters, numbers & space\n\t\t$new_value = preg_replace($legal_chars,\"\",$value); //replace with \"\"\n\t\treturn $new_value;\n\t}", "function do_phone() {\n global $phone;\n global $clean_phone;\n $phone = get_field('phone', 'options');\n $clean_phone = preg_replace('/[^0-9]/','',$phone); // Strip out any non-numeric characters to use in the phone link\n}", "public function sanitizeNumber($data){\n $data = filter_var($data, FILTER_SANITIZE_NUMBER_INT);\n return $data;\n }", "function tel_cyf($telstr)\r\n{\r\n $tel = 0; \r\n $i = 0; \r\n $len = strlen($telstr);\r\n while($i < $len)\r\n {\r\n $kr = substr($telstr, $i, 1); \r\n if(is_numeric($kr)) \r\n { \r\n $tel ++; \r\n } \r\n $i ++;\r\n }\r\n return $tel;\r\n}", "function cleanForBundleIdentifier($toClean) {\n $retVal = preg_replace('/[^A-Za-z0-9\\-\\.]/', '', $toClean);\n return $retVal;\n}", "public function setCCNumber($number = '') {\n $cc = array(\n 'x_card_num'=>$this->cleanCCNumber($number),\n );\n $this->NVP = array_merge($this->NVP, $cc); \n }", "function unmaskString($val)\n {\n return preg_replace(\"/[^a-zA-Z 0-9]+/\", \"\", $val);\n }", "public function prepareMobileNb($mobileNumber) {\n\t\t$parts = split ( \"-\", $mobileNumber );\n\t\t$countryCode = $parts [0];\n\t\t$extension = $parts [1];\n\t\t$phoneNumber = $parts [2];\n\t\t\n\t\tif ($extension == \"03\") {\n\t\t\t$finalFormat = $countryCode . \"3\" . $phoneNumber;\n\t\t\treturn $finalFormat;\n\t\t\n\t\t} else {\n\t\t\treturn $countryCode . $extension . $phoneNumber;\n\t\t}\n\t}", "function filter_alphanum($input) {\n return preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $input);\n}", "function intTOmon($cdn){\n\t\t$cdn = trim($cdn) ;\n\t\t$CadLen = strlen($cdn) ;\n\t\t$Newcdn = \"\";\n\t\tif ($CadLen == 0){$cdn = 0; }\n\t\tif ($CadLen > 3)\n\t \t{\n\t \t\t$cdnDp = \"G\".$cdn;\n\t\t\t\t$mmc = 0;\n\t\t\t\t\tfor ( $i = $CadLen ; $i >= 1 ; $i-- )\n\t\t\t \t{\n\t \t\t\t\t$Newcdn = $cdnDp{$i} . $Newcdn ;\n\t\t\t\t \t\t\t$mmc++ ;\n\t\t\t\t \t\t\tif(( $mmc == 3 ) && ( $i > 1 ))\n\t\t\t\t \t\t\t{\n\t \t\t \t\t\t\t$mmc = 0; \t\n\t \t\t \t\t\t\t$Newcdn = \",\" . $Newcdn ;\n\t \t\t\t} \t\n\t\t \t\t\t}\n\t\t \t\t$cdn = $Newcdn; \n \t\t}\n\t \t$cdn = \"$\" . $cdn . \".00\" ;\n\t\treturn $cdn ;\n\t}\n}", "function remove_version_number() {\n return '';\n}", "function testFormatPhone() {\n\n\t\t$ff = new Cgn_ActiveFormatter('888.123.4567');\n\t\t$phone = $ff->printAs('phone');\n\n\t\t$this->assertEquals('(888) 123-4567', $phone);\n\n setlocale(LC_ALL, 'en_US.UTF-8');\n\t\t$clean = $ff->cleanVar(utf8_encode('abc ABC 999 '.chr(0xF6) .'()()') );\n\t\t$this->assertEquals($clean, 'abc ABC 999 ');\n\n\t}", "function formatAccountNumber($accountNumber){\r\n\t\t$parts = array(0=>2,2=>4,6=>4,10=>4,14=>4,18=>4,22=>4);\r\n\t\tforeach($parts as $key => $val){\r\n\t\t\t$newNumber .= substr($accountNumber, $key, $val).' ';\r\n\t\t}\r\n\t\treturn trim($newNumber);\r\n\t}", "function upload_sanitize_identifier($identifier) {\n\treturn preg_replace('/[^0-9a-zA-Z_-]/im', '', $identifier);\n}", "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.8084143", "0.7543891", "0.73490924", "0.70768434", "0.6868711", "0.64037097", "0.63835174", "0.6351201", "0.6348136", "0.6306462", "0.61999434", "0.6092688", "0.6074876", "0.6041102", "0.60364217", "0.59928334", "0.596019", "0.593639", "0.5930621", "0.5922269", "0.5916077", "0.5912353", "0.5908119", "0.58878165", "0.5838883", "0.58239233", "0.58080554", "0.5787867", "0.57871056", "0.5767699", "0.57576066", "0.5753743", "0.57446855", "0.57312006", "0.5723201", "0.57104886", "0.568888", "0.56857216", "0.5671357", "0.56670266", "0.5666728", "0.565509", "0.56523764", "0.5642228", "0.564173", "0.5632197", "0.5624664", "0.56171983", "0.56094533", "0.5601395", "0.55819243", "0.5548463", "0.55473524", "0.5540507", "0.55297005", "0.5513794", "0.5506593", "0.55048543", "0.55036926", "0.54836255", "0.5476523", "0.547228", "0.54582703", "0.545223", "0.5444646", "0.5427522", "0.542593", "0.54185617", "0.5416532", "0.5413835", "0.53943914", "0.53923035", "0.5385104", "0.5358891", "0.5356731", "0.5356043", "0.53502876", "0.53500956", "0.53462726", "0.53456134", "0.53194743", "0.531873", "0.53142196", "0.53036803", "0.5302038", "0.5301384", "0.52954", "0.52938646", "0.5291634", "0.52914715", "0.5289076", "0.5287066", "0.5281715", "0.527858", "0.52730155", "0.5267038", "0.5265264", "0.526097", "0.52603567", "0.52593684" ]
0.87696636
0
Set the toolbar title
function display() { JToolBarHelper::title(JText::_('AKEEBA').':: <small>'.JText::_('AKEEBA_ACL_TITLE').'</small>','akeeba'); // Add some buttons JToolBarHelper::back('Back', 'index.php?option='.JRequest::getCmd('option')); JToolBarHelper::spacer(); // Add references to CSS and JS files AkeebaHelperIncludes::includeMedia(false); // Add live help AkeebaHelperIncludes::addHelp(); // Get the users from manager and above $model = JModel::getInstance('Acl','AkeebaModel'); $list =& $model->getUserList(); $this->assignRef('userlist', $list); parent::display(JRequest::getCmd('tpl',null)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setTitle()\n\t{\n\t\tglobal $APPLICATION;\n\n\t\tif ($this->arParams[\"SET_TITLE\"] == 'Y')\n\t\t\t$APPLICATION->SetTitle(Localization\\Loc::getMessage(\"SPOL_DEFAULT_TITLE\"));\n\t}", "function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }", "public function setTitle($title = '')\n {\n $this->title = $title;\n }", "function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "function setTitle($title) {\r\n $this->_title = $title;\r\n }", "function setTitle($title) {\r\n $this->_title = $title;\r\n }", "public function setTitle($title){\n $this->title = $title;\n }", "function set_title($title) \r\n\t{\r\n\t\t//$this->title = $title;\r\n\t\t$this->data['title_for_layout'] = $title;\r\n\t\t$this;\r\n\t}", "function setTitle($title)\r\n\t{\r\n\t\t$this->title = $title;\r\n\t}", "public function setTitle($title) {\r\n $this->title = $title;\r\n }", "public function setTitle($title){\n $this->title = $title;\n }", "function setTitle($title)\n {\n $this->title = $title;\n }", "function setTitle($title)\n {\n $this->title = $title;\n }", "function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "public function setTitle($title);", "function setTitle($title) {\n\t\t$this->_title = $title;\n\t}", "public function setTitle($title) {\n $this->title = $title ;\n }", "public function setTitle($title){\n \t$this->title = $title;\n }", "public function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }", "function setTitle($title)\n {\n $this->m_title = $title;\n }", "public function setTitle($title) {\r\n $this->_title = $title;\r\n }", "public function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle($value)\n {\n $this->_title = $value;\n }", "public function setTitle($title) {\n $this->_title = $title;\n }", "function set_title($title){\r\n\t\t$this->_title = $title;\r\n\t}", "public function setTitle($title) {\n $this->title = $title;\n }", "public function setTitle($title) {\n $this->title = $title;\n }", "public function setTitle($value)\n {\n $this->title = $value;\n }", "public function setTitle($title)\r\n\t\t{\r\n\t\t\t$this->_title = $title;\r\n\t\t}", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title)\n {\n $this->title = $title;\n }", "public function setTitle($title) {\n $this->_title = $title;\n }", "public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\t}", "public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\t}", "public function setTitle($title) {\n\t\t\n\t\t\t$this->_title = $title;\n\t\t\n\t\t}", "public function setTitle($title)\n {\n $this->_title = $title;\n }", "public function setTitle($title)\n {\n $this->_title = $title;\n }", "public function setTitle($title = ''){\n $this->setVar('TITLE', $title);\n }", "public function set_title($title)\n {\n $this->title = $title;\n }", "public function setTitle($newTitle) { $this->Title = $newTitle; }", "public function setTitle($var)\n {\n $this->_title = $var;\n }", "public function setPageTitle($title);", "protected function setPageTitle() {\r\n\t\t$pageTitleText = (empty($this->settings['news']['semantic']['general']['pageTitle']['useAlternate'])) ? $this->newsItem->getTitle() : $this->newsItem->getAlternativeTitle();\r\n\t\t$pageTitleAction = $this->settings['news']['semantic']['general']['pageTitle']['action'];\r\n\r\n\t\tif (!empty($pageTitleAction)) {\r\n\t\t\tswitch ($pageTitleAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$pageTitleText .= ': ' . $GLOBALS['TSFE']->page['title'];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$pageTitleText = $GLOBALS['TSFE']->page['title'] . ': ' . $pageTitleText;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t\t$this->pageTitle = html_entity_decode($pageTitleText, ENT_QUOTES, \"UTF-8\");\r\n\t\t\t$GLOBALS['TSFE']->page['title'] = $this->pageTitle;\r\n\t\t\t$GLOBALS['TSFE']->indexedDocTitle = $this->pageTitle;\r\n\t\t}\r\n\t}", "public function setTitle($title) {\n\t\t$title = str_replace(\"\\r\\n\", \"|\", $title);\n\t\t$title = str_replace(\" \", \"+\", $title);\n\t\t$this -> setProperty('chtt', $title);\n\t}", "public function setTitle(string $title);", "public function setTitle($title)\n {\n $this->setValue('title', $title);\n }", "public static function setTitle(string $title) {}", "public function setTitle($value);", "public function setTitle($title){\n $this->p_title = $title;\n }", "public function set_title($text){\n $this->title=$text;\n }", "function setTitle($a_title)\n\t{\n\t\t$this->title = $a_title;\n\t}", "public function setTitle($title) {\n\t\tTemplate::setSiteTitle($title);\n\t}", "public static function setTitle($projectTitle=\"Default App\")\n {\n global $application_name;\n $application_name = $projectTitle;\n }", "function setTitle(string $title): void\n {\n $this->data['head']['title'] = $title;\n }", "public function setTitle($title)\n {\n $this->title = (string) $title;\n }", "function setTitle( $title )\n {\n $title = trim( $title );\n $this->properties['TITLE'] = $title;\n }", "public function setTitle( $newTitle )\n {\n\t\t$this->title = $newTitle;\n\t}", "public function set_title($title){\n\t\t$this->set_channel_element('title', $title);\n\t}", "public function setTitle($title)\n\t{\n\t\tif (!empty($title)) {\n\t\t\t$this->title = $title;\n\t\t}\n\t}", "public function setTitle(string $value)\n {\n $this->title = $value;\n }", "function setHeaderTitle($value) {\n $this->header_title = $value;\n}", "public function setTitle($title){\n\t\t$this->mail_title = $title;\n\t}", "public function setTitle(string $title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle(string $title = null);", "function setTitle( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Title = $value;\n }", "public function setTitle($newTitle) {\n\t\t$this->title = $newTitle;\n\t}", "public function set_pagetitle($title)\n {\n $this->pagetitle = $title;\n }", "public function setTitle($t){\n\t\t$this->title = $t;\n\t}", "public function setTitle(string $title): void {\n\t\t$this->m_title = $title;\n\t}", "function set_the_title($title) {\n\n md_set_the_title($title);\n \n }", "public function setTitleTag($title)\n {\n $this->_title_tag = $title;\n }", "public function setPageTitle($title)\n\t{\n\t\t$this->_themeExtras['title'] = $title;\n\t}", "public function setTitle(string $title): void\n {\n $this->_title = $title;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function setTitle(string $title): void\n {\n $this->title = $title;\n }", "public function set_title($title)\n {\n $this->set_default_property(self::PROPERTY_TITLE, $title);\n }", "private function setTitle()\n {\n $this->title = $this->start_date;\n\n if ($this->start_date != $this->end_date) {\n $this->title .= ' - '.$this->end_date;\n }\n }", "function SetTitle($title, $isUTF8 = false) {\n parent::SetTitle($title, $isUTF8);\n $this->title = ($isUTF8 ? utf8_encode($title) : $title);\n }", "private function setTitle(\\Scrivo\\Str $title) {\n\t\t$this->title = $title;\n\t}", "public function setTitle(string $title)\n {\n $this->title = $title;\n }", "public function setTitle(string $title)\n {\n $this->title = $title;\n }", "function set_title() {\n \tglobal $pageTitle;\n \tif (isset($pageTitle))\n \t\techo 'Tanqeeb | ' . $pageTitle;\n \telse\n \t\techo 'Tanqeeb';\n}", "public static function setPageTitle($title)\n\t{\n\t\tYii::app()->controller->pageTitle = $title;\n\t}", "public function setTitle(?WorkbookChartAxisTitle $value): void {\n $this->getBackingStore()->set('title', $value);\n }", "function setup_title() {\n\t\tglobal $bp;\n\n\t\tif ( bp_is_messages_component() ) {\n\t\t\tif ( bp_is_my_profile() ) {\n\t\t\t\t$bp->bp_options_title = __( 'My Messages', 'buddypress' );\n\t\t\t} else {\n\t\t\t\t$bp->bp_options_avatar = bp_core_fetch_avatar( array(\n\t\t\t\t\t'item_id' => bp_displayed_user_id(),\n\t\t\t\t\t'type' => 'thumb',\n\t\t\t\t\t'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )\n\t\t\t\t) );\n\t\t\t\t$bp->bp_options_title = bp_get_displayed_user_fullname();\n\t\t\t}\n\t\t}\n\n\t\tparent::setup_title();\n\t}", "public function setTitle($str)\n\t{\n\t\t$this->headerTitle = $str;\n\t}" ]
[ "0.73789245", "0.72489953", "0.7227653", "0.72212565", "0.7207196", "0.7207196", "0.7180871", "0.71783894", "0.7177645", "0.717257", "0.7164447", "0.7154137", "0.7154137", "0.7154137", "0.7146805", "0.7146805", "0.7146805", "0.7146805", "0.7146805", "0.7146805", "0.7146805", "0.71394444", "0.7135205", "0.71276027", "0.7109481", "0.71077824", "0.7105884", "0.7093334", "0.7093334", "0.7093334", "0.7091284", "0.7091179", "0.70862556", "0.7064347", "0.7064347", "0.7060999", "0.70439017", "0.70401436", "0.7007851", "0.7007851", "0.7007851", "0.7007851", "0.7007851", "0.7007851", "0.7004645", "0.69805753", "0.69805753", "0.6977617", "0.6969051", "0.6969051", "0.6949283", "0.6923992", "0.69236654", "0.69174343", "0.6899647", "0.6865152", "0.68167704", "0.6815256", "0.68035", "0.67890507", "0.6775435", "0.6771914", "0.6769997", "0.67462707", "0.67364657", "0.6725214", "0.67163044", "0.670694", "0.6696485", "0.6691746", "0.66818595", "0.66785055", "0.6657818", "0.6656244", "0.66486955", "0.66403294", "0.66373175", "0.66290987", "0.66160417", "0.66084796", "0.6607238", "0.65883774", "0.65798545", "0.65610945", "0.6543872", "0.653888", "0.65330684", "0.65330684", "0.65330684", "0.65330684", "0.6511694", "0.6500511", "0.6479376", "0.6474683", "0.64621395", "0.64621395", "0.6460338", "0.64342445", "0.64316887", "0.64219886", "0.64037067" ]
0.0
-1
Get JSON WEB TOKEN methods.
public function getJWTIdentifier() { return $this->getKey(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionGetToken() {\n\t\t$token = UserAR::model()->getToken();\n\t\t$this->responseJSON($token, \"success\");\n\t}", "public function getToken();", "public function getToken();", "public function getToken();", "public function getToken();", "public function LoginToken_get()\n {\n $tokenData['user_id'] = '1';\n $tokenData['role'] = 'admin';\n $tokenData['first_name'] = 'Al';\n $tokenData['last_name'] = 'Mobin';\n $tokenData['phone'] = '+8801921040960';\n $jwtToken = $this->tokenHandler->GenerateToken($tokenData);\n $token = $jwtToken;\n echo json_encode(array('Token'=>$jwtToken));\n }", "public function token() {\n try {\n $payload = JWTUtils::inst()->byBasicAuth($this->request);\n\n return $this->returnArray($payload);\n } catch (JWTUtilsException $e) {\n return $this->httpError(403, $e->getMessage());\n }\n }", "function decode_get() {\n $token = $this->head('Token');\n $auth = $this->head('Auth');\n $resp = array();\n\n if ($token) {\n $tokendt = JWT::decode($token, $this->config->item('jwt_key'));\n $resp['token'] = $tokendt;\n }\n\n if ($auth) {\n $authdt = JWT::decode($auth, $this->config->item('jwt_key'));\n $resp['auth'] = $authdt;\n }\n\n $this->response($resp, 200); \n }", "public function getTokens();", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getToken(): string;", "public function getToken()\n {\n return array($this->_token, $this->_token_secret);\n }", "private function getoken()\n {\n $data=[\n \"username\"=> $this->chronos_user,\n \"password\"=> $this->chronos_password\n ];\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.'login/');\n $client->setMethod(\\Zend_Http_Client::POST);\n $client->setHeaders(['Content-Type: application/json', 'Accept: application/json']);\n $client->setRawData(json_encode($data));\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $token_data=json_decode($string);\n if (property_exists($token_data,'non_field_errors')) {\n return false;\n }else{\n return $token_data->token;\n }\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos Product save helper', [\"error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function getMethod()\n {\n return 'getFederationToken';\n }", "public function getUserTokens();", "private function getJsonWenToken()\n {\n $respContent = $this->post(\n \"auth\",\n ['public_key' => $this->publicKey]\n );\n\n return json_decode($respContent)->content;\n }", "public function getToken()\n\t{\n\n\t}", "public function GetTokenData()\n {\n $received_Token = $this->input->request_headers('Authorization');\n try\n {\n $jwtData = $this->objOfJwt->DecodeToken($received_Token['Token']);\n echo json_encode($jwtData);\n }\n catch (Exception $e)\n {\n http_response_code('401');\n echo json_encode(array( \"status\" => false, \"message\" => 'Token incorrect'));\n exit;\n }\n }", "public function getJWT();", "public function getToken()\n {\n return self::TOKEN;\n }", "public function GetTokenData()\n {\n $received_Token = $this->input->request_headers('Authorization');\n if (isset($received_Token['Token'])) {\n try\n {\n $jwtData = $this->tokenHandler->DecodeToken($received_Token['Token']);\n return json_encode($jwtData);\n }\n catch (Exception $e)\n {\n http_response_code('401');\n echo json_encode(array( \"status\" => false, \"message\" => $e->getMessage()));\n exit;\n }\n }else{\n echo json_encode(array( \"status\" => false, \"message\" => \"Invalid Token\"));\n }\n }", "public static function get_tokens()\n\t{\n\t\treturn static::$client->get_tokens();\n\t}", "function getAllowedHttpMethods();", "abstract public function getAuthToken();", "public function GetToken($data){ \n \n return $this->token;\n \n }", "public function getToken() {\n\t\treturn $this->jwt;\n\t}", "private function _getToken()\n {\n $postData = array(\n 'UserApiKey' => $this->username,\n 'SecretKey' => $this->password,\n 'System' => 'joomla_acy_3_5_v_3_0'\n );\n $postString = json_encode($postData);\n\n $ch = curl_init($this->apidomain.$this->getApiTokenUrl());\n curl_setopt(\n $ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json'\n )\n );\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);\n\n $result = curl_exec($ch);\n curl_close($ch);\n\n $response = json_decode($result);\n $resp = false;\n if (is_object($response)) {\n @$IsSuccessful = $response->IsSuccessful;\n if ($IsSuccessful == true) {\n @$TokenKey = $response->TokenKey;\n $resp = $TokenKey;\n } else {\n $resp = false;\n }\n }\n return $resp;\n }", "public function getToken() {\n $this->token = $this->cUrlRequest($this->url . '/rest/V1/integration/admin/token', null, 'POST');\n\n return json_decode($this->token);\n }", "function app_token($id, $method) {\n $app_token = base64_decode(getenv('APP_TOKEN'));\n $api_token = getenv('API_TOKEN');\n $status = [\n 'token' => $api_token,\n 'code' => $id,\n 'visitors' => null,\n ];\n $request = [\n 'token' => $api_token,\n 'id' => $id,\n 'visitors' => null,\n ];\n $get = [\n 'token' => $api_token,\n 'id' => $id,\n 'visitors' => null,\n ];\n $mail = [\n 'token' => $api_token,\n 'id' => $id,\n 'visitors' => null,\n ];\n switch ($method) {\n case \"get\":\n return trim($app_token . '/tripadvisor/get?' . http_build_query($get));\n break;\n case \"request\":\n return trim($app_token . '/tripadvisor/request?' . http_build_query($request));\n break;\n case \"mail\":\n return trim($app_token . '/tripadvisor/mail?' . http_build_query($mail));\n break;\n case \"status\":\n return trim($app_token . '/tripadvisor/status?' . http_build_query($status));\n }\n }", "protected function endpoint()\n {\n return 'system/members/'.$this->member_id.'/tokens';\n }", "public function getToken(): TokenInterface;", "public function getToken(): TokenInterface;", "public function readToken() {}", "public function index()\n {\n $user = Auth::user();\n $tokens = $user->token();\n return response()->json(['success' => ['user' => $user, 'tokens' => $tokens]], 200);\n }", "public function getToken ()\n {\n return $this->token;\n }", "#[\n OpenApi\\Operation(\n tags: ['Auth/Tokens'],\n security: 'AccessTokenSecurityScheme'\n )\n ]\n #[OpenApi\\Parameters(factory: AuthTokenParameters::class)]\n #[OpenApi\\Response(factory: TokenIndexResponse::class, statusCode: 200)]\n #[OpenApi\\Response(factory: UnauthorizedResponse::class, statusCode: 401)]\n #[\n OpenApi\\Response(\n factory: TooManyRequestsResponse::class,\n statusCode: 429\n )\n ]\n public function index() {\n $this->verifyNoDemo();\n\n return response()->pagination(\n fn($perPage) => AuthTokenResource::collection(\n authUser()\n ->tokens()\n ->active()\n ->type(TokenType::REFRESH)\n ->paginate($perPage)\n )\n );\n }", "function &get_xoops_token()\n{\n\tif ( class_exists('XoopsMultiTokenHandler') )\n\t{\n\t\t$token =& XoopsMultiTokenHandler::quickCreate( $this->_TOKEN_NAME );\n\t\t$name = $token->getTokenName();\n\t\t$value = $token->getTokenValue();\n\t}\n\telse\n\t{\n\t\t$name = 'token';\n\t\t$value = 0;\n\t}\n\t$arr = array($name, $value);\n\treturn $arr;\n}", "public function generateToken();", "public function getToken() {\n return \\Firebase\\JWT\\JWT::encode($this->elements, self::$secret);\n }", "public function getAuthorizationMethod()\n {\n return 'bearer';\n }", "public function getTokenType();", "public function getMethods();", "public function getMethods();", "public function getMethods();", "private function get_token() \n {\n if ($this->last_token === 'TK_TAG_SCRIPT' || $this->last_token === 'TK_TAG_STYLE') { //check if we need to format javascript\n $type = substr($this->last_token, 7);\n $token = $this->get_contents_to($type);\n if (!is_string($token)) {\n return $token;\n }\n return array($token, 'TK_' . $type);\n }\n if ($this->current_mode === 'CONTENT') {\n $token = $this->get_content();\n \n if (!is_string($token)) {\n return $token;\n } else {\n return array($token, 'TK_CONTENT');\n }\n }\n\n if ($this->current_mode === 'TAG') {\n $token = $this->get_tag();\n\n if (!is_string($token)) {\n return $token;\n } else {\n $tag_name_type = 'TK_TAG_' . $this->tag_type;\n return array($token, $tag_name_type);\n }\n }\n }", "public function GetToken()\n {\n $args['method'] = 'getToken';\n $args['secretkey'] = $this->SecretKey;\n $response = $this->GetPublic('apiv1','payexpress',$args);\n\n return (!empty($response['token'])) ? $response['token'] : '';\n }", "public function getToken()\r\n {\r\n return $this->token;\r\n }", "public function getToken()\r\n {\r\n return $this->token;\r\n }", "public function get_allowedMethods() {\n\t\treturn Response::make('', '200',\n\t\t\t\tarray('Allow' => 'GET,PUT,POST,DELETE'));\n\t}", "abstract public function url_access_token();", "public function getApiToken()\n {\n return $this->apiGenerator->getApiToken();\n }", "public function getToken() {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public static function getToken(): string\n {\n $token = static::generateToken();\n while (key_exists($token, static::$callbacks)) {\n $token = static::generateToken();\n }\n\n return $token;\n }", "function generate() {\n\n if ($_SERVER[\"REQUEST_METHOD\"] !== 'POST') {\n http_response_code(403);\n echo 'Forbidden';\n die();\n } else {\n //fetch posted data\n $posted_data = file_get_contents('php://input');\n $input = (array) json_decode($posted_data);\n $data = $this->_pre_token_validation($input);\n }\n\n $token = $this->_generate_token($data);\n http_response_code(200);\n echo $token;\n }", "private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}", "function getUserRightsToken() {\n\tglobal $endPoint;\n\n\t$params3 = [\n\t\t\"action\" => \"query\",\n\t\t\"meta\" => \"tokens\",\n\t\t\"type\" => \"userrights\",\n\t\t\"format\" => \"json\"\n\t];\n\n\t$url = $endPoint . \"?\" . http_build_query( $params3 );\n\n\t$ch = curl_init( $url );\n\n\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $ch, CURLOPT_COOKIEJAR, \"cookie.txt\" );\n\tcurl_setopt( $ch, CURLOPT_COOKIEFILE, \"cookie.txt\" );\n\n\t$output = curl_exec( $ch );\n\tcurl_close( $ch );\n\n\t$result = json_decode( $output, true );\n\treturn $result[\"query\"][\"tokens\"][\"userrightstoken\"];\n}", "public function getAllowedMethods(): array;", "function archimedes_get_token() {\n $keys = module_invoke_all('archimedes_id'); sort($keys);\n return drupal_hmac_base64(implode('|', $keys), drupal_get_private_key() . drupal_get_hash_salt());\n}", "public function getTokenParsers();", "public function getResponseType()\n {\n return OAuth2Protocol::OAuth2Protocol_ResponseType_Token;\n }", "public function getAllowedMethods()\n {\n return ['loomisrate' => __('Loomis')];\n }", "public function getToken()\n {\n return $this->controller->getToken();\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "public function getToken()\n {\n return $this->token;\n }", "abstract public function token();", "private function RequestTokens() {\n return (array)$this->oauth->getRequestToken();\n }", "public function getToken()\n {\n $api_key = \"lv_I4EE93OHHDADBW7DVLNJ\";\n $secret_key = \"lv_HTCYZPYLQG7O12C0DC5PXMLWLZ02T2\";\n \\Unirest\\Request::verifyPeer(false);\n $headers = array('content-type' => 'application/json');\n $query = array('apiKey' => $api_key, 'secret' => $secret_key);\n $body = \\Unirest\\Request\\Body::json($query);\n $response = \\Unirest\\Request::post('https://live.moneywaveapi.co/v1/merchant/verify', $headers, $body);\n $response = json_decode($response->raw_body, true);\n $status = $response['status'];\n if (!$status == 'success') {\n echo 'INVALID TOKEN';\n } else {\n $token = $response['token'];\n return $token;\n }\n }", "public function get_token() {\n\t\treturn $this->token;\n\t}", "abstract protected function token_url();", "public function getToken() {\n\t\treturn $this->_token;\n\t}", "private function get_token() {\n\n\t\t$query = filter_input( INPUT_GET, 'mwp-token', FILTER_SANITIZE_STRING );\n\t\t$header = filter_input( INPUT_SERVER, 'HTTP_AUTHORIZATION', FILTER_SANITIZE_STRING );\n\n\t\treturn ( $query ) ? $query : ( $header ? $header : null );\n\n\t}", "public function get_auth_methods()\n {\n return [\n 'hooks' => [\n 'title' => 'Event-Hooks',\n 'type' => 'boolean',\n 'rights' => [\n isys_auth::VIEW,\n isys_auth::EDIT\n ]\n ],\n 'history' => [\n 'title' => _L('LC__MODULE__EVENTS__HISTORY'),\n 'type' => 'boolean',\n 'rights' => [\n isys_auth::VIEW,\n isys_auth::EDIT\n ]\n ]\n /*,\n\t\t\t'config' => array(\n\t\t\t\t'title' => _L('LC__CONFIGURATION'),\n\t\t\t\t'type' => 'boolean',\n\t\t\t\t'rights' => array(isys_auth::VIEW, isys_auth::EDIT)\n\t\t\t)*/\n ];\n }", "public function getToken()\n\t{\n\t\treturn $this->token;\n\t}", "public function index(){\n\t\t$token = $this->getToken();\n\t\t$expiryDate = $this->getExpiryDate();\n\t\t$passwordSet = $this->getPasswordSet();\n\t\treturn [\n\t\t\t'token' => $token,\n\t\t\t'expiryDate' => $expiryDate,\n\t\t\t'passwordSet' => $passwordSet\n\t\t];\n\t}", "public function getToken(): string\n {\n return $this->token;\n }", "public function getToken(): string\n {\n return $this->token;\n }", "public function getToken(): string\n {\n return $this->token;\n }", "public function getToken() {\n return $this->token;\n }", "public function getTokenAuth()\n {\n \treturn $this->_token_auth;\n }", "public function getToken() : string {\n return $this->token;\n }", "public function getToken()\n {\n return $this->getAttr('access_token');\n }", "public function generate_token($method = 1) \n {\n $token = '';\n if($method == 2) {\n $token = mt_rand(100000, 999999);\n\n } else {\n $token = str_random(10);\n }\n return $token;\n }", "public function actionToken(){\n try{\n $params = Yii::$app->request->post();\n\n $user = $this->auth($params['username'], $params['password']);\n if ($user === null){\n throw new UnauthorizedHttpException('Wrong username or password');\n }\n $response['success'] = true;\n $response['token'] = User::findByUsername($user->username)->auth_key;\n $response['id'] = $user->id;\n } catch (\\Exception $e){\n throw $e;\n }\n return $response;\n }", "public function getMethods(): array;", "public function getMethods(): array;" ]
[ "0.6630293", "0.64589083", "0.64589083", "0.64589083", "0.64589083", "0.6390394", "0.6276102", "0.62331", "0.62292004", "0.6216538", "0.6216538", "0.6216538", "0.6216538", "0.6210375", "0.6193331", "0.6191475", "0.6158668", "0.613476", "0.61125845", "0.6083285", "0.6065921", "0.60612756", "0.60451466", "0.6043288", "0.60208005", "0.59520096", "0.5925408", "0.5921235", "0.5902791", "0.5877029", "0.5874406", "0.5855219", "0.5836139", "0.5836139", "0.5835275", "0.58192044", "0.58187836", "0.5807828", "0.5775172", "0.5759966", "0.57502866", "0.5747744", "0.5734606", "0.57332546", "0.57332546", "0.57332546", "0.5723908", "0.57085735", "0.5706299", "0.5706299", "0.5701014", "0.5699087", "0.5681538", "0.5672969", "0.5671938", "0.56691974", "0.56634676", "0.56610096", "0.5660193", "0.5660003", "0.5653529", "0.5635927", "0.5600609", "0.55987346", "0.5589987", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.55779904", "0.556805", "0.5562815", "0.5559621", "0.5556068", "0.55498254", "0.55496335", "0.55471325", "0.55445135", "0.5543231", "0.55425197", "0.55396175", "0.55396175", "0.55396175", "0.5539128", "0.5523946", "0.55185664", "0.55172163", "0.5509026", "0.55088466", "0.55068237", "0.55068237" ]
0.0
-1
Removes the comment user from the database when a user is deleted
function comments_remove_user($user_id) { PHPWS_Core::initModClass('comments', 'Comment_User.php'); $comment_user = new Comment_User($user_id); if (!$comment_user->user_id) { return; } return $comment_user->kill(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteUser()\n {\n $this->delete();\n }", "public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}", "public function delete(User $user, Comment $comment)\n {\n //\n }", "public function destroy(Request $request, User $user)\n {\n $this->authorize('delete', $user);\n Auth::guard('web')->logout();\n $request->session()->invalidate();\n $request->session()->regenerateToken();\n $user->comments()->each(function($comment) {\n $comment->delete(); // <-- direct deletion\n });\n $user->posts()->each(function($post) {\n if(!is_null($post->file)) $post->file->delete();\n $post->delete(); // <-- direct deletion\n });\n $user->delete();\n\n return redirect(route('login'))->with('message', 'User Deleted Successfully!');\n }", "public function delete_user($user);", "public function deleted(User $user)\n {\n debug('User deleted');\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function deleting(User $user)\n {\n //\n }", "public function delete_delete()\n {\n $response = $this->UserM->delete_user(\n $this->delete('id')\n );\n $this->response($response);\n }", "public function delete()\n { if (is_null($this->id))\n trigger_error(\"User::delete(): Attempt to delete a User object that does not have its ID property set.\", E_USER_ERROR);\n\n // Delete the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $st = $conn->prepare(\"DELETE FROM users WHERE id = :id LIMIT 1\");\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT); \n $st->execute();\n \n $conn = null;\n }", "public function deleteUser($userId)\n {\n // remove the user\n $this->db->delete('user', array('ID' => $userId));\n\n //set their comments to anonymous?\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "public function deleted(User $user)\n {\n //\n }", "protected function deleteUser()\n {\n $userId = $this->request->variable('user_id',0);\n\n if($userId === 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => ['User ID was not supplied']\n ]);\n }\n\n // Determine if this user is an administrator\n $arrUserData = $this->auth->obtain_user_data($userId);\n $this->auth->acl($arrUserData);\n $isAdmin = $this->auth->acl_get('a_');\n\n if($isAdmin)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'User was not deleted because they are an admin',\n 'error' => ['phpBB admin accounts cannot be automatically deleted. Please delete via ACP.']\n ]);\n }\n\n user_delete('remove', $userId);\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user was deleted',\n 'data' => [\n 'user_id' => $userId\n ]\n ]);\n }", "public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }", "public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }", "public function deleteUser(User $user): void\n {\n $em = $this->getDoctrine()->getManager();\n $em->remove($user);\n $em->flush();\n }", "public function deletComment($user, $timestamp) {\r\n \r\n $sql = \"DELETE FROM RecipeComments\r\n WHERE username = '$user' AND timestamp = '$timestamp' AND page = '$this->page'\";\r\n \r\n mysqli_query($this->conn, $sql);\r\n \r\n }", "public function userDeleted()\n\t{\n\t\tself::authenticate();\n\n\t\t$userId = FormUtil::getPassedValue('user', null, 'GETPOST');\n\t\tif(!is_string($userId)) {\n\t\t\treturn self::ret(false);\n\t\t}\n\n\t\t$user = $this->entityManager->getRepository('Owncloud_Entity_DeleteUser')->findOneBy(array('uname' => $userId));\n\t\tif(!($user instanceof Owncloud_Entity_DeleteUser)) {\n\t\t\treturn self::ret(false);\n\t\t}\n\t\t$this->entityManager->remove($user);\n\t\t$this->entityManager->flush();\n\n\t\treturn self::ret(true);\n\t}", "public function delete(User $user)\n {\n //\n }", "public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }", "public function deleteUser(request $request){\n \n $afi = User::find($request->id);\n $afi->delete();\n \n }", "public function deleteUser($userId);", "public function userDeleted();", "public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }", "public function delete() {\n try {\n $db = Database::getInstance();\n $sql = \"DELETE FROM `User` WHERE username = :username\";\n $stmt = $db->prepare($sql);\n $stmt->execute([\"username\" => $this->username]);\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }", "public function deleting(User $user)\n {\n if($user->isForceDeleting()) \n {\n $this->forceDeleting($user);\n }\n }", "public function delete() {\n\t\tif(isset($this->args[1]) && $this->user()) {\n\t\t\ttry {\n\t\t\t\t$this->commentsModel->delete($this->args[1], $this->user->model->userID);\n\t\t\t\t$this->view->setVar('message', 'Deleted comment');\n\t\t\t} catch(exception $excpt) {\n\t\t\t\t$this->view->setError($excpt);\n\t\t\t}\n\t\t}\n\t}", "public function destroy($id)\n {\n $user=User::find($id);\n $comments=Comment::where('user_id',$user->id)->delete();\n $orders=Order::where('user_id',$user->id)->delete();\n $user->notifications()->detach();\n $user->delete();\n flash('User Deleted....');\n return redirect()->back();\n }", "public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $model->content = true;\n $model->feedback = true;\n $model->wall = true;\n $model->make();\n }\n\n // delete avatars\n File::remove('/upload/user/avatar/big/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/small/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/original/' . $uid . '.jpg');\n // delete user profile and auth data\n $user->profile()->delete();\n // delete user provider data\n $user->provider()->delete();\n // delete user object\n $user->delete();\n }\n }", "function deleteUser()\n {\n $validateF = new ValidateFunctions();\n if ($_SESSION['id'] == $_GET['']) {\n logUserOut();\n }\n $id = $validateF->sanitize($_GET['id']);\n $userRp = new UserRepository();;\n $hasUser = $userRp->getOneFromDB($id);\n if ($hasUser != 0) {\n $this->deleteUserImage($id);\n $this->removeUser($id);\n $_SESSION['success'] = ['User deleted successfully'];\n } else {\n $_SESSION['error'] = ['No user found.'];\n }\n header('Location:index.php?action=adminUsers');\n }", "public function deleteUser()\n {\n \n $headers = getallheaders();\n $token = $headers['Authorization'];\n $key = $this->key;\n $userData = JWT::decode($token, $key, array('HS256'));\n $id_user = Users::where('email', $userData->email)->first()->id;\n $id_users = $_POST['idUser'];\n $id = $id_users;\n\n $user = Users::find($id);\n\n $rolUser = Users::where('email', $userData->email)->first();\n \n\n if ($rolUser->rol_id == 1){\n\n $user_name = Users::where('id', $id_users)->first()->name;\n Users::destroy($id);\n\n return $this->success('Acabas de borrar a', $user_name);\n\n }else{\n return $this->error(403, 'No tienes permisos');\n }\n \n\n if (is_null($user)) \n {\n return $this->error(400, 'El lugar no existe');\n }\n // }else{\n\n // $user_name = Users::where('id', $id_users)->first()->name;\n // Users::destroy($id);\n\n // return $this->success('Carlos he borrado el usuario', $user_name);\n // }\n }", "public function eraseUserAndComments($user_id){\n // Below deletes user when they have posts and comments \n $this->db->query('DELETE users, comments\n FROM users \n INNER JOIN comments \n ON comments.user_id = users.user_id \n WHERE users.user_id = :user_id');\n \n $this->db->bind(':user_id', $user_id); \n\n if($this->db->execute()){\n return true;\n } else {\n return false;\n } \n }", "public function delUser($user_id)\n {\n $user = User::findOrFail($user_id);\n if ($user) {\n $user->delete();\n return redirect()->back();\n }else{\n\n return redirect()->back();\n }\n }", "public function destroy(User $user)\n {\n User::find($user->id)->delete();\n }", "public function destroy(User $user)\n {\n User::find($user->id)->delete();\n }", "public function delete($user_id) {\n $this->cancel_subscription($user_id);\n\n /* Send webhook notification if needed */\n if(settings()->webhooks->user_delete) {\n\n $user = db()->where('user_id', $user_id)->getOne('users', ['user_id', 'email', 'name']);\n\n \\Unirest\\Request::post(settings()->webhooks->user_delete, [], [\n 'user_id' => $user->user_id,\n 'email' => $user->email,\n 'name' => $user->name\n ]);\n\n }\n\n /* Delete everything related to the domain that the user owns */\n $result = database()->query(\"SELECT `link_id` FROM `links` WHERE `user_id` = {$user_id}\");\n while($link = $result->fetch_object()) {\n (new \\Altum\\Models\\Link())->delete($link->link_id);\n }\n\n /* Delete the record from the database */\n db()->where('user_id', $user_id)->delete('users');\n\n /* Clear the cache */\n \\Altum\\Cache::$adapter->deleteItemsByTag('biolinks_links_user_' . $user_id);\n \\Altum\\Cache::$adapter->deleteItemsByTag('user_id=' . $user_id);\n\n }", "public function delUser($user_id) {\n $db = $this->dbConnect();\n $req = $db->prepare('DELETE FROM `p5_users` WHERE USER_ID = ?');\n $req->execute(array($user_id));\n $req->closeCursor();\n }", "public function deleting(User $user)\n {\n\n $user->user_eraser_id = \\Auth::id();\n $user->timestamps = false;\n $user->save();\n }", "public function deleteUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$userModel->destroy();\n\t\t\t$this->expireToken($userModel);\n\t\t\treturn $this->sendResponse('Your account has been deleted');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to delete this account');\n }", "public function destroy(User $user)\n {\n $currentUser = Auth::user();\n \n if ($user->id !== $currentUser->id) {\n \n $user->save();\n $user->delete();\n\n Alert::success('Success', 'User deleted successfully');\n return redirect('users');\n }\n Alert::error('Error', 'User not deleted');\n return back()->with('error');\n }", "public function destroy($id)\n {\n $com = Comments::where('user',$id);\n $com->delete();\n $user = User::find($id);\n $user->delete();\n return redirect()->back();\n }", "public static function delete(Users $user)\n {\n $email=$user->Email;\n DB::delete(\"user\",\"Email='$email' AND IsDeleted=0\");\n \n //$conn->close();\n header('location: DeleteUser.php');\n\n }", "public function deleteUser()\n {\n $user = User::find(Auth::id());\n $user->delete();\n return redirect('/');\n }", "private function user_deleted($event) {\n global $DB;\n $userid = $event->relateduserid;\n $token = $DB->get_record('repository_gdrive_tokens', array('userid' => $userid), 'refreshtokenid');\n $this->client->revokeToken($token->refreshtokenid);\n $DB->delete_records('repository_gdrive_tokens', array ('userid' => $userid));\n }", "public function deleted(Model $comment)\n {\n $user = $comment->post->owner;\n\n $user->notify(new Notification($comment, 'comment_delete_author'));\n }", "private function deleteUser()\n {\n try \n {\n $request = $_REQUEST;\n\n if(!isset($request['userid']) || $request['userid']==\"\")\n throw_error_msg(\"user id not provided\");\n else if(!is_numeric($request['userid']))\n throw_error_msg(\"invalid user id\");\n else\n $userid = (int)$request['userid'];\n\n global $userquery;\n $user = $userquery->delete_user($userid);\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\" => 'user deleted successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n } \n }", "public function destroy(User $user)\n {\n \n }", "public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}", "public function removeUser(UserInterface $user);", "public function delete_user($user_id) {\r\n $this->conn->connect();\r\n if ($user_id != null) {\r\n $res = $this->conn->execute_query(\"\r\n UPDATE Shifts\r\n SET UserID=NULL\r\n WHERE UserID=?;\",\"d\",$user_id);\r\n $res = $this->conn->execute_query(\"\r\n DELETE FROM Requests\r\n WHERE UserID=?;\",\"d\",$user_id);\r\n $res = $this->conn->execute_query(\"\r\n DELETE FROM Users\r\n WHERE UserId=?;\",\"d\",$user_id);\r\n }\r\n }", "public function destroy()\n {\n $userId = Helper::getIdFromUrl('user');\n \n if ((Helper::checkUrlIdAgainstLoginId($userId)) !== 'super-admin') {\n Usermodel::load()->destroy($userId);\n } else { \n View::render('errors/403.view', [\n 'message' => 'You cannot delete yourself!',\n ]);\n }\n }", "public function deleteUser($id)\n\t{\n\n\t\t$this->collection->remove(['_id'=> new MongoId($id)]);\n\t}", "public function deleteFromDb($user) {\n $sql = \"DELETE FROM users WHERE username = ?\";\n $stmt = $this->dbh->prepare($sql);\n $succ = $stmt->execute(array($user->getUsername()));\n }", "public function deleteUser($id)\n {\n $user = User::find($id);\n $user->delete();\n }", "public function delete($user)\n {\n\n }", "public function delete()\n {\n // deleting all related comments\n $this->comments()->delete();\n // deleting all related posts\n $this->posts()->delete();\n\n // deleting user\n return parent::delete();\n }", "public function destroy(User $user)\n {\n $user->delete();\n }", "public function destroy(User $user)\n {\n $user->delete();\n }", "public function delete($user){\n }", "public function delete_user($user){\n if(empty($user->email))\n {\n $this->res->SetObject(RCD::EC_EMPTY, RCD::ED_EMPTY, FALSE, NULL);\n }\n $where = array('id'=>$id);\n $this->db->where(array('id' => $user['id']));\n if($this->db->delete(self::user))\n {\n $this->res->SetObject(RCD::SC, RCD::SD, FALSE, NULL);\n }\n else\n {\n $this->res->SetObject(RCD::EC_DELETE, RCD::ED_DELETE, TRUE, NULL);\n }\n }", "public function destroy(User $user)\n {\t\t\n\t\tif (Auth::id() != $user->id)\n\t\t{\n\t\t\t$user->delete();\n\t\t\treturn redirect()->route(\"user.list\")->with('success', \"El usuario \".$user->name.\" se eliminó correctamente\");\n\t\t} \n\t\telse \n\t\t{\n\t\t\treturn redirect()->back()->withErrors(['No se pudo eliminar el usuario']);\n\t\t}\n }", "public function destroy(User $user) {\n //\n }", "function wp_delete_signup_on_user_delete($id, $reassign, $user)\n {\n }", "public function remove($id) {\n $this->db->where('id_user', $id);\n $this->db->delete('user');\n }", "function delete_user($user_id = 0)\n\t{\n\t\t//delete user\n\t\t$this->db->where('user_id', $user_id);\n\t\t$this->db->delete('ci_users');\n\t}", "public function destroy($id)\n {\n // delete user\n }", "public function destroy(Request $request, User $user)\n\t{\n\n \t$user->where('id', $request->user)->delete();\n\n \treturn redirect('/users');\n\t}", "public function remove()\n {\n $model = $this->getModel('comments');\n $count = $model->delete();\n if($count === false){\n $msg = JText::_('COM_JOOMGALLERY_COMMAN_MSG_ERROR_DELETING_COMMENT');\n } else {\n if($count == 1){\n $msg = JText::_('COM_JOOMGALLERY_COMMAN_MSG_COMMENT_DELETED');\n } else {\n $msg = JText::sprintf('COM_JOOMGALLERY_COMMAN_MSG_COMMENTS_DELETED', $count);\n }\n }\n\n $this->setRedirect($this->_ambit->getRedirectUrl(), $msg);\n }", "public function destroy(Requests\\DeleteUserRequest $request, $user)\n {\n $user = \\App\\User::findOrFail($user);\n $deleteOption = $request->delete_option;\n $selectedUser = $request->selected_user;\n\n if($deleteOption == 'delete') {\n // delete user posts \n $user->posts()->withTrashed()->forceDelete();\n } elseif($deleteOption == 'attribute') {\n $user->posts()->update(['author_id' => $selectedUser]);\n }\n $user->delete();\n \n return redirect()->route('users.index')->with('success', 'User deleted successfully.');\n }", "public function delete($id) {\n\t\t// Delete the user\n\t\t$this->getDb()->delete('t_user', array('idUser' => $id));\n\t}", "public function destroy(User $user)\n {\n //TODO: montar excluir usuário\n }", "function deleteUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"DELETE\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['_id'])){\n\t\t\t\t\t$where = \"_id='\".$_POST['_id'].\"'\";\n\t\t\t\t\t$delete = $this->model->getUser('*',$where);\n\t\t\t\t\t$result = $this->model->deleteUser($where);\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record deleted.';\n\t\t\t\t\t\t$response_array['data']=$delete;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='The record does not exist';\n\t\t\t\t\t\t$data['user_id'] = $_POST['_id'];\n\t\t\t\t\t\t$response_array['data']=$data;\n\t\t\t\t\t\t$this->rest->response($response_array, 404);\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\t\t\t\n\t\t}", "public function delete(){\n\t\t$user_id = $this->input->post(\"user_id\");\n\t\t$username = $this->input->post(\"username\");\n\n\t\t$condition = array(\n\t\t\t\"user_id\" => $user_id\n\t\t);\n\n\t\t$this->load->model(\"User_model\", \"users\", true);\n\n\t\t$this->users->delete($condition);\n\n\t\t$toast = array('state' => true, 'msg' => $username.' is Deleted Successfully!');\n\t\t$this->session->set_flashdata('toast', $toast);\n\n\t\techo \"success\";\n\t}", "public function deleteUser(){\n\t\t$sql = \"SELECT COUNT(aid) AS theCount FROM administrator where uid=:uid\";\n\n\t\tif($stmt = $this->_db->prepare($sql)){\n\t\t\t$stmt->bindParam(\":uid\", $_SESSION['UID'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch();\n\t\t\tif($row['theCount']==0){\n\t\t\t\treturn \"<h2> Error </h2>\" . \n\t\t\t\t\t\"<p> Only administrators can do this. </p>\";\n\t\t\t}\n\t\t\t$stmt ->closeCursor();\n\t\t}\n\t\telse{\n\t\t\treturn \"Something went wrong checking the admin table.\";\n\t\t}\n\t\t\n\t\t//TODO: send the deleted user an email telling them they have been deleted\n\t\t\n\t\t$sql = \"DELETE FROM user WHERE uid=:uid\";\n\t\tif($stmt = $this->_db->prepare($sql)){\n\t\t\t$stmt->bindParam(\":uid\", $_GET['u'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t}\n\t\telse{\n\t\t\treturn \"Something went wrong deleting the user.\";\n\t\t}\n\n\t\treturn \"done\";\n\t}", "public static function delete($conn, User $user) {\n\t\t$query = $conn->prepare('DELETE FROM users WHERE id = ?;');\n\t\t$query->bind_param(\"i\", $user->id);\n\t\treturn $query->execute();\n\t}", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }", "public function destroy(User $user)\n {\n //\n }" ]
[ "0.77865046", "0.74046165", "0.7338357", "0.7260892", "0.72133267", "0.7169138", "0.71560746", "0.71560746", "0.71560746", "0.71455485", "0.7118569", "0.7052689", "0.70478714", "0.70478714", "0.70478714", "0.70478714", "0.70478714", "0.70478714", "0.70478714", "0.70478714", "0.70478714", "0.70478714", "0.70478714", "0.70478714", "0.70478714", "0.7040826", "0.7004042", "0.6932525", "0.6917483", "0.689426", "0.68916863", "0.68717664", "0.6859343", "0.68539697", "0.68206125", "0.68121153", "0.679974", "0.67965305", "0.67964023", "0.6790695", "0.6784862", "0.67719066", "0.6769723", "0.67577136", "0.67530143", "0.67491674", "0.6744582", "0.6744582", "0.6734006", "0.6727566", "0.67160624", "0.6699369", "0.6692157", "0.66845405", "0.66789067", "0.66674036", "0.66639787", "0.66309696", "0.66260576", "0.6620604", "0.66193455", "0.6618306", "0.6607364", "0.65991235", "0.659632", "0.6594415", "0.6579413", "0.65683526", "0.6563352", "0.65622705", "0.65622705", "0.6560366", "0.655876", "0.6558543", "0.65584034", "0.6556883", "0.65531594", "0.6546465", "0.65380305", "0.6537956", "0.652561", "0.6519437", "0.65152425", "0.651168", "0.6511509", "0.650859", "0.6507199", "0.6506435", "0.650498", "0.650498", "0.650498", "0.650498", "0.650498", "0.650498", "0.650498", "0.650498", "0.650498", "0.650498", "0.650498", "0.650498" ]
0.6740312
48
FUNCION PARA OBTENER TODOS LOS REGISTROS
public function getAll() { $sql="CALL SP_APODERADOS_SELECT_ALL()"; return $this->mysqli->findAll($sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _reglas()\n\t{\n\t\t$reglas[] = array('field' => 'titulo', 'label' => 'lang:field_titulo', 'rules' => 'trim|required|max_length[100]');\n\t\t\n\t\t\t$reglas[] = array('field' => 'has_category', 'label' => 'lang:field_has_category', 'rules' => 'callback_has_categorys');\n\t\t\n\t\t\n\t\treturn $reglas;\n\t}", "function palabraDescubierta($coleccionLetras){\n \n /*>>> Completar el cuerpo de la función, respetando lo indicado en la documentacion <<<*/\n}", "public function registros() {\r\n\r\n $data['info'] = $this->general_model->get_tutorias_inscritos();\r\n\r\n\r\n\r\n $data[\"view\"] = 'listado_tutorias_inscrito';\r\n\r\n $this->load->view(\"layout\", $data);\r\n\r\n }", "function opcion__regenerar()\n\t{\n\t\t$this->get_proyecto()->regenerar();\n\t}", "function _Registros($Regs=0){\n\t\t// Creo grid\n\t\t$Grid = new nyiGridDB('NOTICIAS', $Regs, 'base_grid.htm');\n\t\t\n\t\t// Configuro\n\t\t$Grid->setParametros(isset($_GET['PVEZ']), 'titulo');\n\t\t$Grid->setPaginador('base_navegador.htm');\n\t\t$arrCriterios = array(\n\t\t\t'id'=>'Identificador',\n\t\t\t'titulo'=>'T&iacute;tulo', \n\t\t\t\"IF(p.visible, 'Si', 'No')\"=>\"Visible\"\n\t\t);\n\t\t$Grid->setFrmCriterio('base_criterios_buscador.htm', $arrCriterios);\n\t\n\t\t// Si viene con post\n\t\tif ($_SERVER[\"REQUEST_METHOD\"] == \"POST\"){\n\t\t\t$Grid->setCriterio($_POST['ORDEN_CAMPO'], $_POST['ORDEN_TXT'], $_POST['CBPAGINA']);\n\t\t\tunset($_GET['NROPAG']);\n\t\t}\n\t\telse if(isset($_GET['NROPAG'])){\n\t\t\t// Numero de Pagina\n\t\t\t$Grid->setPaginaAct($_GET['NROPAG']);\n\t\t}\n\t\n\t\t$Campos = \"p.id_noticia AS id, p.titulo, pf.nombre_imagen, pf.extension, IF(p.visible, 'Si', 'No') AS visible, p.copete\";\n\t\t$From = \"noticia p LEFT OUTER JOIN noticia_foto pf ON pf.id_noticia = p.id_noticia AND pf.orden = 1\";\n\t\t\n\t\t$Grid->getDatos($this->DB, $Campos, $From);\n\t\t\n\t\t// Devuelvo\n\t\treturn($Grid);\n\t}", "function geraClasseValidadorFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.ValidadorFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoValidaFormularioCadastro.tpl');\n\n # abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n $aModeloFinal = array();\n \n # varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode((string)$aTabela['NOME']));\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n $objetoClasse = \"\\$o$nomeClasse\";\n\n # ==== varre a estrutura dos campos da tabela em questao ====\n $camposForm = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n # processa nome original da tabela estrangeira\n $nomeFKClasse = (string)$oCampo->FKTABELA;\n $objetoFKClasse = \"\\$o$nomeFKClasse\";\n\n $nomeCampo = $nomeCampoOriginal;\n //$nomeCampo = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n $label = ($nomeFKClasse != '') ? ucfirst(strtolower($nomeFKClasse)) : ucfirst(str_replace($nomeClasse,\"\",$nomeCampoOriginal));;\t\t\t\t\t\n $camposForm[] = ((int)$oCampo->CHAVE == 1) ? \"if(\\$acao == 2){\\n\\t\\t\\tif(\\$$nomeCampoOriginal == ''){\\n\\t\\t\\t\\t\\$this->msg = \\\"$label invalido!\\\";\\n\\t\\t\\t\\treturn false;\\n\\t\\t\\t}\\n\\t\\t}\" : \"if(\\$$nomeCampoOriginal == ''){\\n\\t\\t\\t\\$this->msg = \\\"$label invalido!\\\";\\n\\t\\t\\treturn false;\\n\\t\\t}\\t\";\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis já processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) mkdir($dir);\n\n $fp = fopen(\"$dir/class.ValidadorFormulario.php\",\"w\"); fputs($fp, $modeloFinal); fclose($fp);\n\n return true;\t\n }", "function retorno($nombre,$apellido)\n {\n if( is_string($nombre) && is_string($apellido) )\n {\n //filter_vars()\n $dame = $nombre. \"<br>\". $apellido;\n return $dame;\n }\n else\n {\n return \"Ingresaste mal los datos. tienen que ser caractéres alfabéticos\";\n }\n\n }", "function evt__efs_lista__modificacion($registros)\n\t{\n\t\t/*\n\t\t\tComo en el mismo request es posible dar una efs de alta y seleccionarla,\n\t\t\ttengo que guardar el ID intermedio que el ML asigna en las efss NUEVAS,\n\t\t\tporque ese es el que se pasa como parametro en la seleccion\n\t\t\t*/\n\t\t$orden = 1;\n\t\tforeach(array_keys($registros) as $id)\n\t\t{\n\t\t\t//Creo el campo orden basado en el orden real de las filas\n\t\t\t$registros[$id]['orden'] = $orden;\n\t\t\t$orden++;\n\t\t\t$accion = $registros[$id][apex_ei_analisis_fila];\n\t\t\tunset($registros[$id][apex_ei_analisis_fila]);\n\t\t\tswitch($accion){\n\t\t\t\tcase 'A':\n\t\t\t\t\t//Por defecto el campo 'columnas' es igual a $this->campo_clave\n\t\t\t\t\t$registros[$id]['columnas'] = $registros[$id][$this->campo_clave];\n\t\t\t\t\t$this->id_intermedio_efs[$id] = $this->get_tabla()->nueva_fila($registros[$id]);\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'B':\n\t\t\t\t\t$this->get_tabla()->eliminar_fila($id);\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'M':\n\t\t\t\t\t//---Si se cambia un identificador que estaba ligado con us columna se cambia tambien el valor de la columna\n\t\t\t\t\t$anterior_id = $this->get_tabla()->get_fila_columna($id, $this->campo_clave);\n\t\t\t\t\t$anterior_col = $this->get_tabla()->get_fila_columna($id, 'columnas');\n\t\t\t\t\tif ($anterior_id != $registros[$id][$this->campo_clave]) {\n\t\t\t\t\t\tif ($anterior_id == $anterior_col) {\n\t\t\t\t\t\t\t$registros[$id]['columnas'] = $registros[$id][$this->campo_clave];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->get_tabla()->modificar_fila($id, $registros[$id]);\n\t\t\t\t\tbreak;\t\n\t\t\t}\n\t\t}\n\t}", "function rec_empresa_list(){\n\t\t}", "function validar_Nombre_buscar()\n {\n $this->resource = 'Actividades';\n\n if ($this->es_alfabetico_espacios($this->nombre) === false) {\n $this->code = '70023';\n $this->ok = false;\n $this->construct_response();\n return $this->feedback;\n } else if ($this->longitud_maxima($this->nombre, 20) === false) {\n $this->code = '70024';\n $this->ok = false;\n $this->construct_response();\n return $this->feedback;\n }\n }", "public function armado() {\n $validacion = new Seguridad_UsuarioValidacion();\n $validacion = $validacion->consultaElemento();\n\n // creo una matriz con los campos de los componentes de la pagina\n $componentes = Consultas_MatrizObtenerDeComponenteTablaYParametros::armado('todos');\n\n $datos_tabla = Consultas_ObtenerTablaNombreTipo::armado($_GET['id_tabla']);\n $tabla_tipo = $datos_tabla['tipo'];\n \n // borro del los atributos del usuario si tiene oculto algun componente de la tabla\n Armado_DesplegableOcultos::eliminarComponenteOcultoTodos($_GET['id_tabla']);\n\n // elimino los componentes con sus propias herramientas\n if (is_array($componentes)) {\n foreach ($componentes as $id => $dcp) {\n\n // llama al componente para eliminarlo\n $llamado_componente = Generales_LlamadoAComponentesYTraduccion::armar('ComponenteBaja', '', '', $dcp, $dcp['cp_nombre'], $dcp['cp_id']);\n\n // si el objeto anterior devuelve true\n if ($llamado_componente == true) {\n\n // elimina la columna si la tabla es tipo 'registro' o crea el registro para\n // cargar el valor de la variable\n if ($tabla_tipo == 'registros') {\n\n // elimino el campo de la tabla\n Consultas_CampoEliminar::armado(__FILE__, __LINE__, $dcp['tb_prefijo'] . '_' . $dcp['tb_nombre'], $dcp['tb_campo']);\n } elseif ($tabla_tipo == 'variables') {\n\n // elimino el campo de la tabla\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, $dcp['tb_nombre'], 'variables', $dcp['tb_campo']);\n }\n }\n\n // condiciones para eliminar los registros que definen al componente\n // elimino el componente de 'kirke_componente'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente', 'id_componente', $dcp['cp_id']);\n\n // elimino el componente de 'kirke_componente_parametro'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente_parametro', 'id_componente', $dcp['cp_id']);\n }\n }\n\n // Consulta nombre de tabla y nombre de campo\n $datos_tabla = Consultas_ObtenerTablaNombreTipo::armado();\n $tabla_nombre = $datos_tabla['prefijo'] . '_' . $datos_tabla['nombre'];\n\n // elimino el campo de la tabla\n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre);\n\n if (($tabla_tipo == 'menu') || $tabla_tipo == 'tabuladores') {\n\n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre . '_trd');\n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre . '_rel');\n\n $consulta = new Bases_RegistroEliminar(__FILE__, __LINE__);\n $consulta->tabla('kirke_tabla');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', '', '', $datos_tabla['id_prefijo']);\n $consulta->condiciones('y', 'kirke_tabla', 'tabla_nombre', 'iguales', '', '', $datos_tabla['nombre'] . '_trd');\n $consulta->condiciones('y', 'kirke_tabla', 'tipo', 'iguales', '', '', $tabla_tipo . '_trd');\n //$consulta->verConsulta();\n $consulta->realizarConsulta();\n\n $consulta = new Bases_RegistroEliminar(__FILE__, __LINE__);\n $consulta->tabla('kirke_tabla');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', '', '', $datos_tabla['id_prefijo']);\n $consulta->condiciones('y', 'kirke_tabla', 'tabla_nombre', 'iguales', '', '', $datos_tabla['nombre'] . '_rel');\n $consulta->condiciones('y', 'kirke_tabla', 'tipo', 'iguales', '', '', $tabla_tipo . '_rel');\n //$consulta->verConsulta();\n $consulta->realizarConsulta();\n\n if ($tabla_tipo == 'tabuladores') {\n \n Consultas_TablaEliminar::armado(__FILE__, __LINE__, $tabla_nombre . '_prd');\n\n $consulta = new Bases_RegistroEliminar(__FILE__, __LINE__);\n $consulta->tabla('kirke_tabla');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', '', '', $datos_tabla['id_prefijo']);\n $consulta->condiciones('y', 'kirke_tabla', 'tabla_nombre', 'iguales', '', '', $datos_tabla['nombre'] . '_prd');\n $consulta->condiciones('y', 'kirke_tabla', 'tipo', 'iguales', '', '', $tabla_tipo . '_prd');\n //$consulta->verConsulta();\n $consulta->realizarConsulta();\n \n $consulta = new Bases_RegistroConsulta(__FILE__, __LINE__);\n $consulta->tablas('kirke_tabla_parametro');\n $consulta->campos('kirke_tabla_parametro', 'valor');\n $consulta->condiciones('', 'kirke_tabla_parametro', 'parametro', 'iguales', '', '', 'cp_id');\n $consulta->condiciones('y', 'kirke_tabla_parametro', 'id_tabla', 'iguales', '', '', $_GET['id_tabla']);\n //$consulta->verConsulta();\n $parametros_tabla = $consulta->realizarConsulta();\n\n // condiciones para eliminar los registros que definen al componente necesario para que se puedan cargar los tabuladores\n // elimino el componente de 'kirke_componente'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente', 'id_componente', $parametros_tabla[0]['valor']);\n\n // elimino el componente de 'kirke_componente_parametro'\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_componente_parametro', 'id_componente', $parametros_tabla[0]['valor']);\n }\n }\n\n // eliminacion de los roles relacionados con la pagina\n Consultas_RollDetalle::RegistroEliminar(__FILE__, __LINE__, $_GET['id_tabla']);\n\n // condiciones para la eliminacion de los nombres de los links del menu\n $matriz_link_nombre = Consultas_MenuLink::RegistroConsultaIdTabla(__FILE__, __LINE__, $_GET['id_tabla']);\n\n // elimino los nombres de los links\n if (is_array($matriz_link_nombre)) {\n foreach ($matriz_link_nombre as $id => $value) {\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_menu_link_nombre', 'id_menu_link', $value['id_menu_link']);\n }\n }\n\n // condiciones para la eliminacion\n // elimino los links de la pagina\n Consultas_MenuLink::RegistroEliminar(__FILE__, __LINE__, $_GET['id_tabla']);\n\n // elimino los nombres de la pagina\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_tabla_nombre_idioma', 'id_tabla', $_GET['id_tabla']);\n\n // elimino los parametros de la pagina\n Consultas_RegistroEliminar::armado(__FILE__, __LINE__, 'kirke_tabla_parametro', 'id_tabla', $_GET['id_tabla']);\n\n // elimino la pagina\n Consultas_Tabla::RegistroEliminar(__FILE__, __LINE__, $_GET['id_tabla']);\n \n if (Inicio::confVars('generar_log') == 's') {\n $this->_cargaLog();\n }\n\n // la redireccion va al final\n $armado_botonera = new Armado_Botonera();\n\n $parametros = array('kk_generar' => '0', 'accion' => '30', 'id_tabla' => $_GET['id_tabla']);\n $armado_botonera->armar('redirigir', $parametros);\n }", "function stringLetrasDescubiertas($coleccionLetras){\n $pal = \"\";\n \n /*>>> Completar el cuerpo de la función, respetando lo indicado en la documentacion <<<*/\n \n return $pal;\n}", "function mostrarRegistro($infoProyecto=\"\") {\r\n if($infoProyecto!=\"\")\r\n {\r\n $planEstudio=$infoProyecto[0]['PLAN'];\r\n $codProyecto=$infoProyecto[0]['PROYECTO'];\r\n $nombreProyecto=$infoProyecto[0]['NOMBRE'];\r\n\r\n $variable=array($codProyecto,$nombreProyecto,$planEstudio);\r\n }else if($_REQUEST['codProyecto'] && $_REQUEST['planEstudio'])\r\n {\r\n $codProyecto=$_REQUEST['codProyecto'];\r\n $planEstudio=$_REQUEST['planEstudio'];\r\n $nombreProyecto=isset($_REQUEST['nombreProyecto']);\r\n $variable=array($codProyecto,$nombreProyecto,$planEstudio);\r\n }else\r\n {\r\n $cadena_sql=$this->sql->cadena_sql(\"proyectos_curriculares\",$this->usuario);//echo $cadena_sql;exit;\r\n $resultado_datosCoordinador=$this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql,\"busqueda\" );\r\n\r\n $planEstudio=$resultado_datosCoordinador[0]['PLAN'];\r\n $codProyecto=$resultado_datosCoordinador[0]['PROYECTO'];\r\n $nombreProyecto=$resultado_datosCoordinador[0]['NOMBRE'];\r\n\r\n $variable=array($codProyecto,$nombreProyecto,$planEstudio);\r\n }\r\n\r\n $this->menuCoordinador($variable);\r\n \r\n }", "function geraClasseDadosFormulario(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo1 = Util::getConteudoTemplate('class.Modelo.DadosFormulario.tpl');\n $modelo2 = Util::getConteudoTemplate('metodoDadosFormularioCadastro.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n\n $copiaModelo1 = $modelo1;\n $copiaModelo2 = $modelo2;\n\n # varre a estrutura dos campos da tabela em questao\n $camposForm = $aModeloFinal = array();\n foreach($aTabela as $oCampo){\n # recupera campo e tabela e campos (chave estrangeira)\n $nomeCampoOriginal = (string)$oCampo->NOME;\n $nomeCampo \t = $nomeCampoOriginal;\n //$nomeCampo \t = $nomeCampoOriginal;\n\n # monta parametros a serem substituidos posteriormente\n switch ((string)$oCampo->TIPO) {\n case 'date':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n case 'datetime':\n case 'timestamp':\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = Util::formataDataHoraFormBanco(strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"]))));\";\n break;\n\n default:\n if((int)$oCampo->CHAVE == 1)\n if((string)$aTabela['TIPO_TABELA'] != 'NORMAL')\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n else\n $camposForm[] = \"if(\\$acao == 2){\\n\\t\\t\\t\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\\n\\t\\t}\";\n else\n $camposForm[] = \"\\$post[\\\"$nomeCampoOriginal\\\"] = strip_tags(addslashes(trim(\\$_REQUEST[\\\"$nomeCampoOriginal\\\"])));\";\n break;\n }\n }\n # monta demais valores a serem substituidos\n $camposForm = join($camposForm,\"\\n\\t\\t\");\n\n # substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo2 = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo2);\n $copiaModelo2 = str_replace('%%ATRIBUICAO%%', $camposForm, $copiaModelo2);\n\n $aModeloFinal[] = $copiaModelo2;\n }\n\n $modeloFinal = str_replace('%%FUNCOES%%', join(\"\\n\\n\", $aModeloFinal), $copiaModelo1);\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.DadosFormulario.php\",\"w\");\n fputs($fp, $modeloFinal);\n fclose($fp);\n return true;\t\n }", "public function validar()\n {\n foreach ($this->reglas as $campo => $listadoReglas) {\n foreach ($listadoReglas as $regla) {\n $this->aplicarValidacion($campo, $regla);\n }\n }\n }", "function listar($camposMostrar,$campo,$operador,$valor,$separador,$inicio,$fin)\n\t\t{\n\t\t\t$tablas=\"menciones*\".$this->tabla;\n\t\t\t$campos=\"en.mencion*en.apellidos*en.mencion\".$campo;\n\t\t\t$operadores=\"=*=*=\".$operador;\n\t\t\t$valores=\"me.id*\".$valor;\n\t\t\t$config=new config($tablas,$this->id,\"en.codigo*en.apellidos*en.nombres*en.maestria*me.nombre*en.anoEgreso*en.ofEnlace\",$campos,$operadores,$valores,\"AND*AND\",\"\",\"\",\"me*en\",$inicio,$fin);\n\t\t\t$config->enlazar();\n\t\t\t$a=$config->conn->crearConsultaMultiple();\n\t\t\treturn $a;\n\t\t}", "function cargar_formulario($datos_necesarios){\n if(isset($datos_necesarios['acta'])){\n $ar = array();\n \n $ar[0]['votos'] = $datos_necesarios['acta']['total_votos_blancos'];\n $ar[0]['id_nro_lista'] = -1;\n $ar[0]['nombre'] = \"VOTOS EN BLANCO\";\n \n $ar[1]['votos'] = $datos_necesarios['acta']['total_votos_nulos'];\n $ar[1]['id_nro_lista'] = -2;\n $ar[1]['nombre'] = \"VOTOS NULOS\";\n \n $ar[2]['votos'] = $datos_necesarios['acta']['total_votos_recurridos'];\n $ar[2]['id_nro_lista'] = -3;\n $ar[2]['nombre'] = \"VOTOS RECURRIDOS\";\n\n //obtener los votos cargados, asociados a este acta\n $votos = $this->dep('datos')->tabla($datos_necesarios['tabla_voto'])->get_listado_votos($datos_necesarios['acta']['id_acta']);\n \n if(sizeof($votos) > 0){//existen votos cargados\n $ar = array_merge($votos, $ar);\n \n }\n else{//no existen votos cargados\n $listas = $this->dep('datos')->tabla($datos_necesarios['tabla_listas'])->get_listas_a_votar($datos_necesarios['acta']['id_acta']);\n \n if(sizeof($listas)>0)//Existen listas\n $ar = array_merge($listas, $ar); \n \n }\n \n return $ar;\n }\n }", "function crear_carpeta($ruta,$nombre_carpeta)\r\n\t{\r\n\t}", "public function gerarRequisicaoAction() {\n\n $aDados = $this->getRequest()->getParams();\n $oForm = new Contribuinte_Form_RequisicaoRps();\n\n // Busca Tipos de Nota do Grupo RPS\n $aTiposNota = Contribuinte_Model_Nota::getTiposNota(Contribuinte_Model_Nota::GRUPO_NOTA_RPS);\n\n // Popula o select com os tipos de nota para poder validar\n if (is_object($oForm->tipo_documento) && is_array($aTiposNota)) {\n $oForm->tipo_documento->addMultiOptions($aTiposNota);\n }\n\n // Valida o formulario e gera a requisicao\n if ($oForm->isValid($aDados)) {\n\n $iInscricaoMunicipal = $this->_session->contribuinte->getInscricaoMunicipal();\n $iCgmGrafica = $this->_getParam('cgm_grafica');\n $iTipoDocumento = $this->_getParam('tipo_documento');\n $iQuantidade = $this->_getParam('quantidade');\n\n // Verifica se possui requisicoes pendentes\n $iQuantidadeRequisicaoPendente = Administrativo_Model_RequisicaoAidof::verificarRequisicaoPendente(\n $iInscricaoMunicipal,\n $iTipoDocumento,\n Contribuinte_Model_Nota::GRUPO_NOTA_RPS);\n\n if ($iQuantidadeRequisicaoPendente > 0) {\n\n $aRetornoJson['status'] = FALSE;\n $aRetornoJson['error'][] = $this->translate->_('Existem requisições pendentes para este tipo de documento.');\n } else {\n\n Administrativo_Model_RequisicaoAidof::gerar(\n $iTipoDocumento,\n $iInscricaoMunicipal,\n $iCgmGrafica,\n $iQuantidade);\n\n $aRetornoJson['status'] = TRUE;\n $aRetornoJson['success'] = $this->translate->_('Requisição de emissão de RPS enviada.');\n $aRetornoJson['reload'] = TRUE;\n }\n } else {\n\n $aRetornoJson['status'] = FALSE;\n $aRetornoJson['fields'] = array_keys($oForm->getMessages());\n $aRetornoJson['error'][] = $this->translate->_('Preencha os dados corretamente.');\n }\n\n echo $this->getHelper('json')->sendJson($aRetornoJson);\n }", "public function buscarUsuarios(){\n\t\t}", "public function run()\n {\n $rueda = [\n ['nombre' => 'ENMC','descripcion'=>'Personas cálidas, entusiastas y creativas que ven la vida como un lugar con una gran cantidad de posibilidades para hacer o conseguir cosas. Rápida e intuitivamente suelen hacer conexiones entre las diferentes situaciones que viven y suelen actuar en base a las conexiones que hicieron. Tienen una fuerte necesidad de afirmación y aprecio por parte de los otros. Por ello, se interesan mucho por cómo se sienten las otras personas. Asimismo, son claros para expresar sus sentimientos cuando están conversando con alguien. Suelen acompañar a los otros e identificar lo que está sintiendo la otra persona. Sin embargo, debido a su gran energía no son de las personas que se enfocan en escuchar, sino más bien de los que quieren hablar, dar consejos y hacer que la gente se sienta mejor. Estas personas pueden ser espontáneas y flexibles y no se preocupan mucho cuando algo no sale como lo planearon. Para solucionar las dificultades suelen apoyarse en su habilidad para conversar, improvisar y ser creativo.'],\n ['nombre' => 'ENMO','descripcion'=>'Personas cálidas, empáticas y responsables que suelen estar atentas a las emociones, necesidades y deseos de los otros. Ellas, se interesan mucho por los demás e intuyen que todas las personas tienen la posibilidad de crecer e incluso pueden ser los que motivan a que los demás crezcan. Son sociables y en grupo facilitan la comunicación entre los miembros de éste. Suelen ser las personas líderes que ayudan a dirigir los grupos. Son comprometidos con el grupo ya que les interesa la interacción con los demás, pero debido a que también son personas emotivas, les importa cómo se siente el resto de personas. Además, muchas veces se guían de su propia intuición para encontrar soluciones para sus propios proyectos, así como para los compartidos con otras personas. Sus habilidades para organizarse les permiten no sólo orientar sus propias tareas, sino también dirigir a su grupo de amistades o grupo de trabajo.'],\n ['nombre' => 'ENRC','descripcion'=>'Personas ingeniosas y muy alertas que suelen tener facilidad para comunicarse con los demás. Además, utilizan sus propias experiencias y son objetivos para analizar las situaciones alrededor de ellas. Debido a su gran flexibilidad y capacidad para adaptarse ante situaciones inesperadas, cuentan con varias alternativas para solucionar situaciones nuevas y que muchas veces pueden ser bastante retadoras. Son hábiles para generar posibilidades nuevas utilizando los conceptos que conocen para luego analizarlos de manera ordenada y estratégica. Son personas que tienen facilidad para identificar las necesidades de los otros y encuentran que éstas tienen una lógica en común y se pueden ver objetivamente. Además, suelen aburrirse ante la rutina o situaciones repetitivas y prefieren guiarse de lo que su intuición les dice. Están abiertos a las diversas posibilidades, por lo que rara vez enfrentan situaciones de la misma manera y siempre buscan encontrar nuevos temas y nuevas vías para abordar diferentes situaciones.'],\n ['nombre' => 'ENRO','descripcion'=>'Personas sumamente sinceras y directas que por su habilidad expresiva asumen rápidamente el liderazgo. Suelen tener una gran facilidad para identificar errores y por ello pueden rápidamente sugerir alternativas para solucionar las equivocaciones que encontraron. Muchas veces sus propuestas de solución son primordialmente objetivas, pero también se guían de intuición y lo que creen que es lo mejor. Son personas que tienen facilidad para expresar lo que piensan, pero estas ideas son objetivas y cuando hablan, suelen decir las cosas de manera directa. Estas personas se sienten muy cómodas cuando pueden planear, y mejor aún si es posible realizar planes de largo plazo. Por ello, se sienten cómodos planificando y son metódicos al ejecutar el plan que se trazan. Además, presentan sus ideas con gran energía y las exponen como una idea objetiva, sintiendo que posiblemente esa es la verdad sobre ese hecho, por lo que pueden llegar a ser convincentes.'],\n ['nombre' => 'ESMC','descripcion'=>'Personas llevaderas y amigables. Son individuos que aman su modo de vivir intensamente y las relaciones sociales. Esto muchas veces puede llevarlos a ser muy flexibles y no tan disciplinados como podrían ser otras personas. En otras palabras, ven el mundo con mayor tranquilidad y calma que de manera sistemática y organizada. Disfrutan de trabajar en equipo como método para terminar las labores. Tienden a tener una mirada realista hacia el trabajo y suelen intentar hacer que éste sea lo más dinámico posible. Son personas flexibles y espontáneas con gran facilidad para adaptarse a la manera de ser de gente que recién conocen y a nuevos entornos. Además, no se fían tanto de ideas abstractas, sino que necesitan probarlas de tal manera que puedan verificar que éstas son claras y factibles. Finalmente, su lado emotivo les permite ser personas prudentes, comprensivas y preocupadas por quienes tienen alguna preocupación o malestar.'],\n ['nombre' => 'ESMO','descripcion'=>'Personas cálidas y cooperativas que desean que el entorno en el que están sea armonioso y se esfuerzan para conseguir ese tipo de ambientes. Les gusta trabajar en equipo con otras personas con el objetivo de terminar las tareas a tiempo. Siguen sus valores incluso en actividades cotidianas. Están muy atentos a las necesidades de los demás y suelen intentar satisfacer éstas. Estas personas tienen el importante deseo de ser aceptadas por quienes son y lo que pueden dar. Además, prefieren las actividades que implican interactuar con la gente y se sienten cómodos dando un trato cálido a los demás. Sin embargo, en la interacción con las personas y su manera de ver el mundo, prima la necesidad de trabajar con ideas concretas y que son posibles observar y verificar con la realidad. Asimismo, su carácter emotivo muchas veces puede dificultarles la posibilidad de tomar decisiones sobre los demás y sobre sí mismos, ya que se centran en los sentimientos que hay de por medio a la hora de decidir.'],\n ['nombre' => 'ESRC','descripcion'=>'Personas tolerantes y flexibles que tienen una visión pragmática del mundo y se centran en conseguir resultados inmediatos. No suelen tener mucho interés en las teorías y las explicaciones conceptuales. Suelen ser personas espontáneas que disfrutan pasar el tiempo con gente y le dan gran importancia a lo que ocurre en el presente (“aquí y ahora”). Además, tienen una mayor facilidad para aprender haciendo y no tanto leyendo, ya que necesitan la interacción con otros. Además, se caracterizan por ser personas sumamente realistas. En ese caso, cuando no entienden algo, intentan buscar el sentido lógico y cuál es la premisa que está detrás de la idea. Les cuesta comprender ideas que no tienen una explicación lógica y que es difícil ponerlas en práctica. Por ello, suelen tomar sus decisiones enfocándose en la lógica y en ciertas ocasiones, pueden dejar de lado los aspectos de carácter más emocional'],\n ['nombre' => 'ESRO','descripcion'=>'Personas prácticas y realistas que intentan implementar las decisiones que toman lo más rápido que puedan y no suelen utilizar mucho tiempo para evaluar dichas decisiones. Intentan ser lo más organizadas posible y se enfocan en terminar los proyectos que emprenden lo más pronto y de la manera más eficiente que puedan. Se muestran como personas objetivas e interactúan con los demás utilizando la lógica, porque suelen ver el mundo de una manera práctica y racional. Además, en situaciones emocionalmente intensas, se mantienen ecuánimes y no se quiebran con facilidad. Esto no significa que no les interesen las emociones de los demás, al contrario, estas personas tienen la intención de interactuar con ellos, pero analizan de manera objetiva cómo se sienten las otras personas. Estas personas tienen una guía propia de cómo se debe realizar una labor, las cuales siguen sistemáticamente y buscan que los demás hagan lo mismo. Muchas veces sienten la necesidad de implementar sus planes a toda costa a pesar de que pueda existir la posibilidad de incomodar a otras personas en el proceso.'],\n ['nombre' => 'INMC','descripcion'=>'Personas idealistas y seguidoras de sus propios valores y la gente que sienten importante para ellas. Son curiosas y rápidas en encontrar alternativas que pueden ser implementadas en alguna situación. Por ello, suelen ser las personas que motivan a los otros a implementar ideas nuevas. A pesar de ello, también pueden ser personas reservadas, haciendo que su recopilación y análisis de información nueva, no sea comunicada necesariamente. Luego que han logrado concluir la búsqueda de nuevas ideas es que las comparten con los otros (esperan a estar seguros antes de comentar sus ideas). Muchas veces se guían de su propia inspiración y de su intuición y ésta la emplean tomando en cuenta su interés por las emociones de las personas. Intentan comprender a los otros y apoyarlos ya que tienen gran interés en los sentimientos de los demás. Acostumbran adaptarse a las situaciones y son flexibles a menos que sientan que uno de sus valores está siendo criticado.'],\n ['nombre' => 'INMO','descripcion'=>'Personas que buscan conectar y relacionar ideas para encontrarles un sentido. Este sentido no necesariamente está ligado a lo que es tangible y real. Estas personas pueden encontrar un sentido lógico mediante la utilización de su propia experiencia e instinto y no específicamente utilizando hechos comprobados. Tienen una fuerte curiosidad por entender qué motiva a la gente a hacer cosas y se interesan por los otros. Estas personas suelen desarrollar la habilidad para identificar cuál es la mejor manera de encontrar el bien común entre todo el grupo y se sienten cómodos cuando el grupo está en armonía. Son personas organizadas y muy decididas a implementar su manera de pensar. Sin embargo, a pesar de su interés por el bienestar de los demás, por momentos pueden ser reservados con sus propios sentimientos. Estas personas suelen escoger a quien compartirle sus sentimientos y pueden ser emotivos en esos momentos.'],\n ['nombre' => 'INRC','descripcion'=>'Personas que buscan encontrarle un sentido lógico a todas las cosas que aprenden. Gustan de los conceptos y lo abstracto y están más interesados en pensar en sus ideas, que en hablar con otras personas. Tienen una gran habilidad para enfocarse en solucionar problemas que son de su interés. Estas personas suelen ser muy reflexivas y analíticas, por lo que en ciertas situaciones pueden ser muy críticas y con dificultad para aceptar rápidamente ideas con una baja explicación lógica. Además, no tienden a ser muy comunicativas, sino más reservadas y críticas cuando es necesario hacerlo. Lo más frecuente que ocurre con ellas, es que analizan en silencio las situaciones de manera lógica y piensan en varias alternativas de solución, las mismas que se les ocurren utilizando sus experiencias pasadas. En ese caso también pueden ser personas flexibles que ante dificultades utilizan la lógica para adaptarse y encontrar soluciones.'],\n ['nombre' => 'INRO','descripcion'=>'Personas que suelen ser muy creativas, y tienen un gran deseo de implementar ideas nuevas para conseguir sus metas. Ellas pueden encontrar patrones comunes en las situaciones del ambiente y suelen desarrollar explicaciones del por qué se han dado las diferentes situaciones. Si bien suelen adquirir sus ideas utilizando su intuición, son personas lógicas y objetivas. En ese caso, es importante que las ideas que encontraron mediante su experiencia sean lógicas, racionales y muchas veces que las puedan ver como objetivas. Cuando se comprometen con alguna tarea, suelen organizarse para terminar la labor que tienen pendiente. En este caso, utilizan la planificación y la suelen ejecutar de manera ordenada y metódica. Son personas que suelen cuestionar las situaciones en búsqueda de la razón y lo que consideran que puede ser la verdad objetiva. Estas personas son independientes y pueden ser muy exigentes no sólo con ellos mismos, sino también con los demás. Sin embargo, su cuestionamiento y búsqueda de la razón lógica no necesariamente es abierta, ya que son personas que son más reservadas y piensan primero sus ideas antes de realizar algún tipo de cuestionamiento.'],\n ['nombre' => 'ISMC','descripcion'=>'Personas calladas, amigables y sensibles que valoran mucho el presente y lo que está pasando alrededor de ellas. Gustan de tener sus propios horarios y poder trabajar manejando sus tiempos. En ese caso, son sumamente comprometidos con los trabajos que realmente les importa, siempre y cuando les den la posibilidad de realizarlo en sus propios tiempos. No suelen agradarles los desacuerdos y evitan el conflicto a todo costo, por lo que frente a un desacuerdo pueden preferir respetar la opinión del otro a pesar de que ésta no sea del todo consecuente con sus principios. Son leales y suelen recordar características específicas de las personas que son significativas para ellas. Se preocupan por los sentimientos de los demás y tratan de generar ambientes armoniosos en la casa y en el trabajo. En general, pueden ser vistos como personas emotivas, con la habilidad para acompañar emocionalmente a otros, ya que comprenden muy bien cómo se sienten los demás.'],\n ['nombre' => 'ISMO','descripcion'=>'Personas calladas, responsables y que hacen las actividades con mucho cuidado y atención. Son perseverantes, cuidadosas y enfocadas en sus obligaciones. Son leales y suelen recordar características específicas de las personas que son significativas para ellas. Se preocupan por los sentimientos de los demás y tratan de generar ambientes armoniosos en la casa y en el trabajo. En general, pueden ser vistos como personas emotivas, con la habilidad para acompañar emocionalmente a otros, ya que se identifican con los sentimientos de ellos. Sin embargo, estas personas acostumbran acompañar a los demás pero no interactúan tanto con ellos. En ese caso, prefieren escuchar y filtrar la información a través de lo que ven y escuchan. Asimismo, al realizar una evaluación de la información, comprenden lo que le va ocurriendo al otro. Son personas que se les puede ver como amables, comprensivas y diplomáticas.'],\n ['nombre' => 'ISRC','descripcion'=>'Personas tolerantes y flexibles, suelen ser calladas y observadoras, hasta que una dificultad aparece. Ante esta situación acostumbran actuar de manera calmada hasta que solucionan el problema. Habitualmente analizan las situaciones que funcionan, manejan una gran cantidad de información y prefieren enfocarse en situaciones más conceptuales que prácticas. Estas personas creen que la información se obtiene mediante la causa y el efecto utilizando la lógica para conocer los hechos. Valoran la eficiencia y la entienden como la ejecución de tareas de manera sumamente metódica y organizada. Utilizan reglas y la deducción para llegar a crear ideas y argumentos y se sienten buenos empleando este método. Asimismo, tienen dificultad para aceptar y comprender explicaciones que carecen de un sentido lógico. Por ello, en ciertas ocasiones pueden dejar de lado los aspectos de carácter más emocional para tomar una decisión. Esto podría llevarlos a no sentirse tan afectados con las emociones ajenas. Valoran la eficiencia y la entienden como la ejecución de tareas de manera sumamente organizada.'],\n ['nombre' => 'ISRO','descripcion'=>'Personas calladas, detallistas y minuciosas, lo que puede permitirles ser cuidadosas a la hora de trabajar, siempre tomando en cuenta los detalles y la prolijidad de los mismos. Son personas organizadas en diferentes aspectos de sus vidas y ello les permite tener recursos variados para enfrentar las tareas que se les presenten. Además, son sumamente trabajadoras y cuidadosas con los procedimientos y el orden de cómo hacer las cosas. Eligen los temas de conversación en los que desean participar y no suelen interactuar mucho en conversaciones banales con gente que recién conocen. Estas personas acostumbran mostrarse calmadas y ecuánimes la mayor parte del tiempo. Al ser personas realistas y prácticas, suelen decidir utilizando la lógica, y ello hace que intenten expresar lo que dicen de manera clara. Cuando trabajan, se orientan a conseguir la meta que se proponen y a encontrar información que sea objetiva o que pueda ser catalogada como verdadera. En sí, su búsqueda de la verdad podría hacer que incurran en debates ya que le dan suma importancia a la información objetiva. Se sienten cómodos de tener los diversos aspectos de su vida ordenados y organizados.'],\n ];\n\n Rueda::insert($rueda);\n }", "public function listarPreg(){\n $consulta = $this->ejecutar(\"SELECT * FROM cappiutep.t_usuario_pregunta WHERE id_usuario = '$this->IdUser'\");\n while($data = $this->getArreglo($consulta))$datos[] = $data;\n return $datos;\n }", "function modificarJuegoDesdeLista($id, $datos = array()) {\n global $textos, $sql, $configuracion, $archivo_imagen;\n\n $juego = new Juego($id);\n $destino = \"/ajax\".$juego->urlBase.\"/editRegister\";\n\n if (empty($datos)) {\n \n $codigo = HTML::campoOculto(\"procesar\", \"true\");\n $codigo .= HTML::campoOculto(\"id\", $id);\n $codigo .= HTML::campoOculto(\"datos[id_imagen]\", $juego->idImagen);\n $codigo .= HTML::parrafo($textos->id(\"NOMBRE\"), \"negrilla margenSuperior\");\n $codigo .= HTML::campoTexto(\"datos[nombre]\", 50, 255, $juego->nombre);\n $codigo .= HTML::parrafo($textos->id(\"DESCRIPCION\"), \"negrilla margenSuperior\");\n $codigo .= HTML::areaTexto(\"datos[descripcion]\", 10, 60, $juego->descripcion, \"editor\");\n $codigo .= HTML::parrafo($textos->id(\"SCRIPT\"), \"negrilla margenSuperior\");\n $codigo .= HTML::areaTexto(\"datos[script]\", 5, 60, $juego->script);\n $codigo .= HTML::parrafo($textos->id(\"IMAGEN\"), \"negrilla margenSuperior\");\n $codigo .= HTML::campoArchivo(\"imagen\", 50, 255);\n $codigo .= HTML::parrafo(HTML::campoChequeo(\"datos[activo]\", $juego->activo).$textos->id(\"ACTIVO\"), \"margenSuperior\"); \n $codigo .= HTML::parrafo(HTML::boton(\"chequeo\", $textos->id(\"ACEPTAR\"), \"botonOk\", \"botonOk\", \"botonOk\").HTML::frase(\" \".$textos->id(\"REGISTRO_MODIFICADO\"), \"textoExitoso\", \"textoExitoso\"), \"margenSuperior\");\n \n $codigo = HTML::forma($destino, $codigo, \"P\", true);\n\n $respuesta[\"generar\"] = true;\n $respuesta[\"codigo\"] = $codigo;\n $respuesta[\"titulo\"] = HTML::contenedor(HTML::frase(HTML::parrafo($textos->id(\"MODIFICAR_JUEGO\"), \"letraNegra negrilla\"), \"bloqueTitulo-IS\"), \"encabezadoBloque-IS\");\n $respuesta[\"destino\"] = \"#cuadroDialogo\";\n $respuesta[\"ancho\"] = 500;\n $respuesta[\"alto\"] = 570; \n\n } else {\n $respuesta[\"error\"] = true;\n\n if(!empty($archivo_imagen[\"tmp_name\"])){\n $validarFormato = Archivo::validarArchivo($archivo_imagen, array(\"jpg\",\"png\",\"gif\", \"jpeg\"));\n $area = getimagesize($archivo_imagen[\"tmp_name\"]);\n }\n\n if (empty($datos[\"nombre\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_NOMBRE\");\n\n } elseif (empty($datos[\"descripcion\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_DESCRIPCION\");\n\n } elseif (empty($datos[\"script\"])) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_FALTA_SCRIPT\");\n\n } elseif ($area[0] != $configuracion[\"DIMENSIONES\"][\"JUEGOS\"][0] || $area[1] != $configuracion[\"DIMENSIONES\"][\"JUEGOS\"][1]) {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_AREA_IMAGEN_JUEGO\");\n\n } else { \n \n if ($juego->modificar($datos)) {\n /********************** En este Bloque se Arma el Contenido del nuevo Juego que se acaba de Registrar **********************/\n $juego = new Juego($id); \n $botonEliminar = HTML::nuevoBotonEliminarItem($juego->id, $juego->urlBase);\n $botonModificar = HTML::nuevoBotonModificarItem($juego->id, $juego->urlBase);\n $item .= HTML::contenedor($botonEliminar.$botonModificar, \"botonesLista\", \"botonesLista\");\n $item .= HTML::enlace(HTML::imagen($juego->imagen, \"flotanteIzquierda margenDerecha miniaturaListaUltimos5\"), $juego->url);\n $item .= HTML::enlace(HTML::parrafo($juego->nombre, \"negrilla\"), $juego->url);\n $item .= HTML::parrafo($juego->descripcion, \"margenInferior\");\n $item = HTML::contenedor($item, \"tablaJuegosAjax\");\n $contenidoJuego = $item;/*HTML::contenedor($item, \"contenedorListaJuegos\", \"contenedorListaJuegos\".$juego->id);*/\n /*******************************************************************************************************************************/\n\n $respuesta[\"error\"] = false;\n $respuesta[\"accion\"] = \"insertar\";\n $respuesta[\"contenido\"] = $contenidoJuego;\n $respuesta[\"idContenedor\"] = \"#contenedorListaJuegos\".$id;\n $respuesta[\"modificarAjaxLista\"] = true;\n //$respuesta[\"destino\"] = \"#nuevosRegistros\";\n\n } else {\n $respuesta[\"mensaje\"] = $textos->id(\"ERROR_DESCONOCIDO\");\n }\n\n\n }\n \n }\n Servidor::enviarJSON($respuesta);\n \n }", "public function __construct($usuario = array()) {\n if(!class_exists(\"Registro\")){\n require_once 'registro.class.php'; \n }\n $this->reg = new Registro($this->tabela);\n \n /*----------------CONFIG USUARIO------------------*/\n // INICIA A CONFIGURAÇÃO BADICA\n $info = array(\n 'FUN_nome' => 'Seu Nome',\n 'FUN_email' => '[email protected]'\n );\n $this->reg->_load($info);\n\n /*------------------------------------------------*/\n \n // se for array contiver mais registros do que 0\n if(is_array($usuario) && count($usuario) > 0){\n //carrega os dados no objeto registro\n $this->reg->_load($usuario);\n //grava na tabela\n $this->reg->_grava();\n \n }else{\n // se não, pega os argumentos passados pela função\n $args = func_get_args();\n if(count($args)>0){\n // se maior que zero carrega a função select do objeto Registro e \n call_user_func_array(array($this->reg,'_select'), func_get_args());\n }\n $this->erro .= $this->reg->_getErro();\n }\n }", "public function registrarCarro($productos = array(), $direccion_id = null, $peso = 0, $reserva = false, $lista = false, $retiro_tienda = false, $tienda_retiro = false, $observacion = '')\n\t{\n\t\tif ( empty($productos) )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Informacion de la direccion\n\t\t */\n\t\t$direccion\t\t= null;\n\t\tif ( ! empty($direccion_id) )\n\t\t{\n\t\t\t$direccion\t\t\t\t= $this->Direccion->find('first', array(\n\t\t\t\t'conditions'\t\t\t=> array('Direccion.id' => $direccion_id),\n\t\t\t\t'callbacks'\t\t\t\t=> false\n\t\t\t));\n\t\t\tif ( ! $direccion )\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Calcula el subtotal y formatea el detalle de la compra\n\t\t */\n\t\t$subtotal\t\t\t\t= 0;\n\t\t$valor_despacho\t\t\t= 0;\n\t\t$detalles\t\t\t\t= array();\n\t\tforeach ( $productos as $catalogo => $data )\n\t\t{\n\t\t\t/**\n\t\t\t * Detecta multi catalogos\n\t\t\t */\n\t\t\t$productos_carro\t\t= array();\n\t\t\tif ( empty($data['Productos']) )\n\t\t\t{\n\t\t\t\tforeach ( $data as $subcatalogo => $subdata )\n\t\t\t\t{\n\t\t\t\t\tforeach ( $subdata['Productos'] as $subid => $subproducto )\n\t\t\t\t\t{\n\t\t\t\t\t\t$productos_carro[]\t= $subproducto;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$productos_carro\t\t= $data['Productos'];\n\t\t\t}\n\n\t\t\tforeach ( $productos_carro as $producto )\n\t\t\t{\n\t\t\t\t$subtotal\t\t\t\t+= ($producto['Meta']['Precio'] * $producto['Meta']['Cantidad']);\n\t\t\t\t$detalle\t\t\t\t= array(\n\t\t\t\t\t'producto_id'\t\t\t\t=> $producto['Data']['Producto']['id'],\n\t\t\t\t\t'cantidad'\t\t\t\t\t=> $producto['Meta']['Cantidad'],\n\t\t\t\t\t'precio_unitario'\t\t\t=> $producto['Data']['Producto']['preciofinal_publico'],\n\t\t\t\t\t'total'\t\t\t\t\t\t=> ($producto['Data']['Producto']['preciofinal_publico'] * $producto['Meta']['Cantidad']),\n\t\t\t\t\t'peso'\t\t\t\t\t\t=> (empty($producto['Data']['Producto']['peso']) ? 0 : $producto['Data']['Producto']['peso'])\n\t\t\t\t);\n\n\t\t\t\t/**\n\t\t\t\t * Determina el origen del producto\n\t\t\t\t */\n\t\t\t\tswitch ( $catalogo )\n\t\t\t\t{\n\t\t\t\t\tcase 'lista':\n\t\t\t\t\t{\n\t\t\t\t\t\t$detalle\t\t= array_merge($detalle, array(\n\t\t\t\t\t\t\t'via_lista'\t\t\t=> true,\n\t\t\t\t\t\t\t'lista_id'\t\t\t=> $producto['Meta']['lista_id']\n\t\t\t\t\t\t));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'reserva':\n\t\t\t\t\t{\n\t\t\t\t\t\t$detalle\t\t= array_merge($detalle, array(\n\t\t\t\t\t\t\t'via_reserva'\t\t=> true,\n\t\t\t\t\t\t\t'reserva_id'\t\t=> $producto['Meta']['reserva_id']\n\t\t\t\t\t\t));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'catalogo':\n\t\t\t\t\t{\n\t\t\t\t\t\t$detalle\t\t= array_merge($detalle, array(\n\t\t\t\t\t\t\t'via_catalogo'\t\t=> true,\n\t\t\t\t\t\t\t'lista_precio'\t\t=> 'catalogo'\n\t\t\t\t\t\t));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'deportes':\n\t\t\t\t\t{\n\t\t\t\t\t\t$detalle\t\t= array_merge($detalle, array(\n\t\t\t\t\t\t\t'via_catalogo'\t\t=> true,\n\t\t\t\t\t\t\t'lista_precio'\t\t=> 'deportes'\n\t\t\t\t\t\t));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'bits':\n\t\t\t\t\t{\n\t\t\t\t\t\t$detalle\t\t= array_merge($detalle, array(\n\t\t\t\t\t\t\t'via_catalogo'\t\t=> true,\n\t\t\t\t\t\t\t'lista_precio'\t\t=> 'bits'\n\t\t\t\t\t\t));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tarray_push($detalles, $detalle);\n\t\t\t}\n\t\t}\n\t\t$data\t\t\t\t\t= array(\n\t\t\t'Compra'\t\t\t\t=> array(\n\t\t\t\t'usuario_id'\t\t\t\t=> AuthComponent::user('id'),\n\t\t\t\t'estado_compra_id'\t\t\t=> 1,\n\t\t\t\t'direccion_id'\t\t\t\t=> $direccion_id,\n\t\t\t\t'sucursal_id'\t\t\t\t=> $tienda_retiro,\n\t\t\t\t'despacho_gratis'\t\t\t=> 0, \n\t\t\t\t'subtotal'\t\t\t\t\t=> $subtotal,\n\t\t\t\t'valor_despacho'\t\t\t=> $valor_despacho,\n\t\t\t\t'total_descuentos'\t\t\t=> 0,\n\t\t\t\t'total'\t\t\t\t\t\t=> ($subtotal + $valor_despacho),\n\t\t\t\t'pagado'\t\t\t\t\t=> false,\n\t\t\t\t'aceptado'\t\t\t\t\t=> false,\n\t\t\t\t'reversado'\t\t\t\t\t=> false,\n\t\t\t\t'modified'\t\t\t\t\t=> date('Y-m-d H:i:s'),\n\t\t\t\t'created'\t\t\t\t\t=> date('Y-m-d H:i:s'),\n\t\t\t),\n\t\t\t'DetalleCompra'\t\t\t=> $detalles\n\t\t);\n\n\t\t/**\n\t\t * Si la compra ya existe, actualiza sus datos y borra el detalle para reescribirlo\n\t\t */\n\t\tif ( $this->id )\n\t\t{\n\t\t\t$data['Compra']['id']\t\t= $this->id;\n\t\t\t$this->DetalleCompra->deleteAll(\n\t\t\t\tarray('DetalleCompra.compra_id' => $this->id),\n\t\t\t\tfalse, false\n\t\t\t);\n\t\t}\n\n\t\t// prx($data);\n\n\t\t/**\n\t\t * Guarda la compra\n\t\t */\n\t\tif ( $this->saveAll($data) )\n\t\t{\n\t\t\treturn $this->find('first', array(\n\t\t\t\t'conditions'\t\t=> array('Compra.id' => $this->id),\n\t\t\t\t'contain'\t\t\t=> array(\n\t\t\t\t\t'Usuario',\n\t\t\t\t\t'DetalleCompra'\t\t=> array('Producto'),\n\t\t\t\t\t'EstadoCompra',\n\t\t\t\t\t'Direccion'\t\t\t=> array('Comuna' => array('Region')),\n\t\t\t\t)\n\t\t\t));\n\t\t}else{\n\t\t\tprx($this->validationErrors );\n\t\t}\n\n\t\treturn false;\n\t}", "function listar_originales_idioma($registrado,$id_tipo,$letra,$filtrado,$orden,$id_subtema,$id_idioma,$tipo_pictograma,$txt_locate,$sql) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_registradas=\"AND imagenes.registrado=0\";\n\t\t}\n\t\t\n\t\tif ($id_tipo==99) { $sql_tipo=''; } \n\t\telse { $sql_tipo='AND palabras.id_tipo_palabra='.$id_tipo.''; }\n\t\t\t\n\t\tif (isset($sql) && $sql !='') { \n\t\t\t\t$sql_subtema='AND palabra_subtema.id_palabra=palabras.id_palabra\n\t\t\t\t'.$sql; \n\t\t\t\t$subtema_tabla=',palabra_subtema.*';\n\t\t\t\t$subtema_tabla_from=', palabra_subtema';\n\t\t} else {\n\t\t\t\n\t\t\tif ($id_subtema==99999) { \n\t\t\t\t$sql_subtema=''; \n\t\t\t\t$subtema_tabla='';\n\t\t\t\t$subtema_tabla_from='';\n\t\t\t} \n\t\t\telse { \n\t\t\t\t$sql_subtema='AND palabra_subtema.id_palabra=palabras.id_palabra\n\t\t\tAND palabra_subtema.id_subtema='.$id_subtema.''; \n\t\t\t\t$subtema_tabla=',palabra_subtema.*';\n\t\t\t\t$subtema_tabla_from=', palabra_subtema';\n\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($letra==\"\") { $sql_letra=''; } \n\t\telse { \n\t\t\n\t\t\tswitch ($txt_locate) { \n\t\t\t\n\t\t\t\tcase 1:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '$letra%%'\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 2:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '%%$letra%%'\";\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 3:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '%%$letra'\"; \n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase 4:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion='$letra'\"; \n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t$sql_letra=\"AND traducciones_\".$id_idioma.\".traduccion LIKE '$letra%%'\";\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t}\n\t\t\t\n\n\t\t}\t\n\t\t\n\t\tif ($filtrado==1) { $sql_filtrado='imagenes.ultima_modificacion'; } \n\t\telseif ($filtrado==2) { $sql_filtrado='palabras.palabra'; }\n\t\t\n\t\t$query = \"SELECT COUNT(*)\n\t\tFROM palabra_imagen, imagenes, palabras, traducciones_\".$id_idioma.\" $subtema_tabla_from\n\t\tWHERE imagenes.estado=1\n\t\tAND traducciones_\".$id_idioma.\".id_palabra=palabra_imagen.id_palabra\n\t\tAND traducciones_\".$id_idioma.\".id_palabra=palabras.id_palabra\n\t\tAND traducciones_\".$id_idioma.\".traduccion IS NOT NULL\n\t\t$sql_letra\n\t\t$sql_tipo\n\t\t$sql_subtema\t\n\t\tAND imagenes.id_tipo_imagen=$tipo_pictograma\n\t\tAND palabra_imagen.id_imagen=imagenes.id_imagen\n\t\t$mostrar_registradas\n\t\tORDER BY $sql_filtrado $orden\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t$row=mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\treturn $row[0];\n\t\t\n\t}", "function getTituloCombo($tabelaProcura){\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n $retorno = $pk = '';\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n # Recupera o nome da tabela e gera o nome da classe\n if($tabelaProcura != $aTabela['NOME']) \n continue;\n\n # Varre a estrutura dos campos da tabela em questao\n foreach($aTabela as $oCampo){ \n //print \"@@{$oCampo->NOME}\\n\";\n //print_r($aTabela); exit;\n # Se o campo for chave, nao sera usado\n if($oCampo->CHAVE == 1){\n $pk = $oCampo->NOME;\n \n if((String)$oCampo->FKTABELA == ''){\n continue;\n }\n }\n\n # Se o campo for do tipo numerico, nao sera usado, nao sera usado\n if(!preg_match(\"#varchar#is\", (String)$oCampo->TIPO)) continue;\n \n # Se o campo tiver nomenclatura que nao remeta a nome/descricao sera eliminado \n if(preg_match(\"#(?:nome|descricao)#is\", (String)$oCampo->NOME)){\n $retorno = (String)$oCampo->NOME;\n break;\n }\n \n # Se o campo tiver nomenclatura que nao remeta a nome/descricao sera eliminado \n if(preg_match(\"#(?:usuario|login|nome_?(?:pessoa|cliente|servidor)|descricao|titulo|nm_(?:pessoa|cliente|servidor|estado_?civil|lotacao|credenciado)|desc_)#is\", (String)$oCampo->NOME)){\n $retorno = (String)$oCampo->NOME;\n break;\n }\n \n # Recupera valores a serem substituidos no modelo\n \n }\n break;\n }\n if($retorno == '')\n $retorno = $pk;\n return (string)$retorno;\n }", "function obtener_registro_todos_los_registros(){\n $this->sentencia_sql=\"CALL pa_consultar_todos_los_\".$this->TABLA.\"()\"; \n \n if($this->ejecutar_consulta_sql()){\n //return array(\"codigo\"=>\"00\",\"mensaje\"=>\"Estos son los resultados de la consulta a la tabla $this->TABLA\",\"respuesta\"=>TRUE);\n return array(\"codigo\"=>\"00\",\"mensaje\"=>\"Estos son los resultados de la consulta a la tabla $this->TABLA\",\"respuesta\"=>TRUE,\"valores_consultados\"=>$this->filas_json);\n }else{\n return array(\"codigo\"=>\"01\",\"mensaje\"=> $this->mensajeDepuracion,\"respuesta\"=>TRUE);\n }\n \n }", "function crearPreguntas($numpreguntas,$idtemaasignado,$estu){\n\t$contador=0;\n\t$filas=$numpreguntas;\n\tforeach($this->model->SeleccionarTemasPreguntas($estu,$idtemaasignado) as $r): //tomo todas las preguntas de acuerdo al examen\n\t\t$estudiante = new estudiante();\n\t\t$estudiante->est_id =$estu;\n\t $auxiliar[$contador]=$r->PRE_ID; //asigno cada pregunta en una posicion de un array\n\t\t $temaid=$r->TA_ID; //id de la tabla de temas asignados\n\t\t$contador++;\n\t\tendforeach;\n\t\n$num = Array();\n reset($num);\n for($i=1;$i<=$filas;$i++)\n {\n $num[$i]=$auxiliar[rand(0,($contador-1))];\n if($i>1)\n {\n for($x=1; $x<$i; $x++)\n {\n if($num[$i]==$num[$x])\n {\n $i--;\n break;\n }\n }\n }\n }\n foreach($num as $valor){ //recorro todos mis preguntas aleatorias y asigno la pregunta\n\t$estudiante = new estudiante();\n\t\t\t$estudiante->est_id =$estu;\n\t\t\t $estudiante->pre_id =$valor;\n \t$estudiante->ta_id =$temaid;\n\t\t\t$this->model->AsignarPregunta($estudiante); //asigno la pregunta al estudiante\n }\n\n\t\t\n\t\t//METODO PARA ASIGNAR PREGUNTAS\n\t\n}", "function altaGrupo($nombre,$descripcion)\n\t\t{\t\n\t\t\t$mysqli=$this->conexionBD();\n\t\t\t$query=\"INSERT INTO `grupo`(`NOMBRE_GRUPO`, `DESCRIPCION`) VALUES ('$nombre','$descripcion')\";\n\t\t\t$mysqli->query($query);\n\t\t\t$mysqli->close();\n\t\t\t\t\n\t\t}", "function getRegistros() {\n\t\tif (isset($this->extra[\"monitor_id\"]) and isset($this->extra[\"pagina\"])) {\n\t\t\t$this->resultado = $this->getDetalleRegistros($this->extra[\"monitor_id\"], $this->extra[\"pagina\"]);\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\n\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t$sql = \"SELECT unnest(_nodos_id) AS nodo_id FROM _nodos_id(\".\n\t\t\t pg_escape_string($current_usuario_id).\", \".\n\t\t\t pg_escape_string($this->objetivo_id).\", '\".\n\t\t\t pg_escape_string($this->timestamp->getInicioPeriodo()).\"','\".\n\t\t\t pg_escape_string($this->timestamp->getTerminoPeriodo()).\"')\";\n\t\t//print($sql);\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\t\t$monitor_ids = array();\n\t\twhile($row = $res->fetchRow()) {\n\t\t\t$monitor_ids[] = $row[\"nodo_id\"];\n\t\t}\n\n\t\t/* SI NO HAY DATOS MOSTRAR MENSAJE */\n\t\tif (count($monitor_ids) == 0) {\n\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\treturn;\n\t\t}\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'contenedor_tabla.tpl');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_CONTENEDORES', 'lista_contenedores');\n\n\t\t/* LISTA DE MONITORES */\n\t\t$orden = 1;\n\t\tforeach ($monitor_ids as $monitor_id) {\n\t\t\t$T->setVar('__contenido_id', 'reg_'.$monitor_id);\n\t\t\t$T->setVar('__contenido_tabla', $this->getDetalleRegistros($monitor_id, 1, $orden));\n\t\t\t$T->parse('lista_contenedores', 'LISTA_CONTENEDORES', true);\n\t\t\t$orden++;\n\t\t}\n\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\t}", "public function cargarPreguntas(){\n\t$this->load->view('../views/complementos/header');// se carga el encabezado\n\t$datos['preguntas'] = $this->mlPreguntas->getPreguntas();// se enlistan todas las preguntas y elmacena en este arreglo \n\t//$datos['datos2'] = $this->mlPreguntas->getDatosMicriosip();\n\t$this->load->view('encuesta', $datos);//Se carga la vista de encuesta y se le pasan los datos\n\t$this->load->view('../views/complementos/footer');// Se carga el pie de pagina\n\t}", "private function resaltar($buscar, $texto, $clase='')\n {\n $class = ($clase) ? \"class=\\\"$clase\\\"\" : \"style=\\\"background-color: yellow; color: red;\\\"\";\n $clave = explode(\" \", $buscar);\n $num = count($clave);\n for($i=0; $i < $num; $i++)\n { \n $clave[$i] = preg_replace('/(a|A|á|Á|à|À|ä|Ä)/', '(a|A|á|Á|à|À|ä|Ä)', $clave[$i]);\n $clave[$i] = preg_replace('/(e|E|é|É|è|È|ë|Ë)/', '(e|E|é|É|è|È|ë|Ë)', $clave[$i]);\n $clave[$i] = preg_replace('/(i|I|í|Í|ì|Ì|ï|Ï)/', '(i|I|í|Í|ì|Ì|ï|Ï)', $clave[$i]);\n $clave[$i] = preg_replace('/(o|O|ó|Ó|ò|Ò|ö|Ö)/', '(o|O|ó|Ó|ò|Ò|ö|Ö)', $clave[$i]);\n $clave[$i] = preg_replace('/(u|U|ú|Ú|ù|Ù|ü|Ü)/', '(u|U|ú|Ú|ù|Ù|ü|Ü)', $clave[$i]);\n $clave[$i] = preg_replace('/(ñ|Ñ)/', '(ñ|Ñ)', $clave[$i]);\n $texto = preg_replace(\"/(\".trim($clave[$i]).\")/Ui\", \"<span $class>\\\\1</span>\" , $texto);\n }\n return $texto;\n }", "public function crear_campos_dinamicos($modulo,$id_registro=null,$col_lab=4,$col_cam=10){\n if(!class_exists('Template')){\n import(\"clases.interfaz.Template\");\n }\n \n $ut_tool = new ut_Tool();\n $html = '';\n \n $columnas_fam=$this->cargar_parametros_familias();//cargar datos de familias\n \n $desc_valores_params = $valores_params = array();\n if ($id_registro!= null){\n //echo \"id registro: \".$id_registro;\n $sql = \"SELECT item_f.id id_item,item_f.descripcion descripcion_item FROM mos_requisitos_item as item INNER JOIN mos_requisitos_items_familias as item_f ON item.id_item=item_f.id WHERE id_requisitos = $id_registro\";\n //echo $sql;\n $data_params = $this->dbl->query($sql, array());\n foreach ($data_params as $value_data_params) {\n $valores_params[$value_data_params[id_item]] = $value_data_params[id_item];\n $desc_valores_params[$value_data_params[id_item]] = $value_data_params[descripcion_item];\n } \n }\n \n $js = $html = $nombre_campos = \"\";\n $html .= '<div class=\"form-group\">'\n . '<label class=\"col-md-4 control-label\" control-label\">FAMILIAS:</label></div>';\n $cont=0;\n foreach ($columnas_fam as $value) {\n $condicion=\"\";\n $primera_opc=' <option selected=\"\" value=\"\">-- Seleccione --</option>';\n if($id_registro!= null && isset($data_params[$cont][id_item])){//para editar\n $primera_opc= '<option selected=\"\" value=\"'.$data_params[$cont][id_item].'\">'.$data_params[$cont][descripcion_item].'</option>';\n $condicion=\"and id<>\".$data_params[$cont][id_item];\n }\n if($id_registro== null){// un nuevo*/\n $primera_opc=' <option selected=\"\" value=\"\">-- Seleccione --</option>';\n $condicion=\"\";\n }\n $nombre_campos .= \"campo_\".$value[id].\",\";\n//construir los select dinamicos para el formulario de requisitos\n $html .= '<div class=\"form-group\">'\n . '<label for=\"campo-'.$value[id].'\" class=\"col-md-4 control-label\">' . ucwords(strtolower($value[descripcion] )). '</label>'; \n $html .= '<div class=\"col-md-10\"> \n <select class=\"form-control\" name=\"campo_' . $value[id] . '\" id=\"campo_' . $value[id] . '\" data-validation=\"required\">';\n $html.=$primera_opc;// si es editar muestra de primera opcion el que tiene y si es nuevo. muestra opcion seleccione\n //echo \"SELECT id, descripcion from mos_requisitos_items_familias where id_familia=\".$value[id].\" \".$condicion.\"\";\n $html .= $ut_tool->OptionsCombo(\"SELECT id, descripcion from mos_requisitos_items_familias where id_familia=\".$value[id].\" \".$condicion.\"\"\n , 'id'\n , 'descripcion', $valores_params[$value[id]]);\n $cont++;\n $html .= '</select></div>';\n $html .= '</div>';\n\n \n \n }\n $array[nombre_campos] = $nombre_campos;\n $array[html] = $html;\n return $array;\n }", "public function formulario()\n {\n //\n }", "public static function metodo_estatico () {\n }", "public function run()\n {\n /**\n * Permissões para o CRUD da lista\n */\n $regra1 = new Regras();\n $regra1->nome = \"lista.view\";\n $regra1->descricao = \"Visualização da lista\";\n $regra1->save();\n\n $regra2 = new Regras();\n $regra2->nome = \"lista.create\";\n $regra2->descricao = \"Inserção na lista\";\n $regra2->save();\n\n $regra3 = new Regras();\n $regra3->nome = \"lista.update\";\n $regra3->descricao = \"Atualização da lista\";\n $regra3->save();\n\n $regra4 = new Regras();\n $regra4->nome = \"lista.delete\";\n $regra4->descricao = \"Apagar da lista\";\n $regra4->save();\n\n\n /**\n * Permissões para o CRUD dos usuários\n */\n $regra5 = new Regras();\n $regra5->nome = \"user.view\";\n $regra5->descricao = \"Visualização do usuário\";\n $regra5->save();\n\n $regra6 = new Regras();\n $regra6->nome = \"user.create\";\n $regra6->descricao = \"Inserção do usuário\";\n $regra6->save();\n\n $regra7 = new Regras();\n $regra7->nome = \"user.update\";\n $regra7->descricao = \"Atualização do usário\";\n $regra7->save();\n\n $regra8 = new Regras();\n $regra8->nome = \"user.delete\";\n $regra8->descricao = \"Apagar usuário\";\n $regra8->save();\n\n /**\n * Permissão do master\n */\n $regra8 = new Regras();\n $regra8->nome = \"master\";\n $regra8->descricao = \"Master\";\n $regra8->save();\n\n }", "function validar_Nombre()\n {\n $this->resource = 'Actividades';\n\n if ($this->no_vacio($this->nombre) === false) {\n $this->code = '70022';\n $this->ok = false;\n $this->construct_response();\n return $this->feedback;\n } else if ($this->es_alfabetico_espacios($this->nombre) === false) {\n $this->code = '70023';\n $this->ok = false;\n $this->construct_response();\n return $this->feedback;\n } else if ($this->longitud_maxima($this->nombre, 20) === false) {\n $this->code = '70024';\n $this->ok = false;\n $this->construct_response();\n return $this->feedback;\n } else if ($this->longitud_minima($this->nombre, 2) === false) {\n $this->code = '70025';\n $this->ok = false;\n $this->construct_response();\n return $this->feedback;\n }\n }", "private function processarParametros() {\n\n /**\n * Busca os usuarios definidos para notificar quando acordo ira vencer, ordenando pelo dia\n */\n $oDaoMensageriaUsuario = db_utils::getDao('mensagerialicenca_db_usuarios');\n $sSqlUsuarios = $oDaoMensageriaUsuario->sql_query_usuariosNotificar('am16_sequencial', 'am16_dias');\n $rsUsuarios = db_query($sSqlUsuarios);\n $iTotalUsuarios = pg_num_rows($rsUsuarios);\n\n if ($iTotalUsuarios == 0) {\n throw new Exception(\"Nenhum usuário para notificar.\");\n }\n\n /**\n * Percorre os usuarios e define propriedades necessarias para buscar acordos\n */\n for ($iIndiceUsuario = 0; $iIndiceUsuario < $iTotalUsuarios; $iIndiceUsuario++) {\n\n /**\n * Codigo do usuario para notificar: mensageriaacordodb_usuario.ac52_sequencial\n */\n $iCodigoMensageriaLicencaUsuario = db_utils::fieldsMemory($rsUsuarios, $iIndiceUsuario)->am16_sequencial;\n\n /**\n * Codigo dos usuarios que serao notificados\n * - usado para verificar os usuarios que ja foram notificados\n * - mensageriaacordodb_usuario.ac52_sequencial\n */\n $this->aCodigoMensageriaLicencaUsuario[] = $iCodigoMensageriaLicencaUsuario;\n\n /**\n * Usuario para notificar\n * - mensageriaacordodb_usuario\n */\n $oMensageriaLicencaUsuario = MensageriaLicencaUsuarioRepository::getPorCodigo($iCodigoMensageriaLicencaUsuario);\n\n /**\n * Codigo do usuario do sistema\n * - db_usuarios.id_usuario\n */\n $iCodigoUsuario = $oMensageriaLicencaUsuario->getUsuario()->getCodigo();\n\n /**\n * Data de vencimento:\n * - Soma data atual com dias definidos na rotina de parametros de mensageria\n */\n $iDias = $oMensageriaLicencaUsuario->getDias();\n $this->aDataVencimento[] = date('Y-m-d', strtotime('+ ' . $iDias . ' days'));\n }\n\n return true;\n }", "public function run()\n {\n //\n $elementosListas = [\n [\n 'nombre' => \"Cedula Ciudadania\",\n 'elemento_lista_id' => \"CC\",\n 'tipo_lista_id' => \"TI\"\n ],\n [\n 'nombre' => \"Tarjeta Identidad\",\n 'elemento_lista_id' => \"TID\",\n 'tipo_lista_id' => \"TI\"\n ],\n [\n 'nombre' => \"NIT\",\n 'elemento_lista_id' => \"NIT\",\n 'tipo_lista_id' => \"TI\"\n ],\n [\n 'nombre' => \"Empleado\",\n 'elemento_lista_id' => \"EM\",\n 'tipo_lista_id' => \"TT\"\n ],\n [\n 'nombre' => \"Contratista\",\n 'elemento_lista_id' => \"CO\",\n 'tipo_lista_id' => \"TT\"\n ],\n [\n 'nombre' => \"Paciente\",\n 'elemento_lista_id' => \"PA\",\n 'tipo_lista_id' => \"TT\"\n ],\n [\n 'nombre' => \"Huila\",\n 'elemento_lista_id' => \"HUI\",\n 'tipo_lista_id' => \"DEP\"\n ],\n [\n 'nombre' => \"Tolima\",\n 'elemento_lista_id' => \"TOL\",\n 'tipo_lista_id' => \"DEP\"\n ],\n [\n 'nombre' => \"Ibague\",\n 'elemento_lista_id' => \"IBA\",\n 'tipo_lista_id' => \"CI\"\n ],\n [\n 'nombre' => \"Neiva\",\n 'elemento_lista_id' => \"NEV\",\n 'tipo_lista_id' => \"CI\"\n ],\n [\n 'nombre' => \"Gran contribuyent\",\n 'elemento_lista_id' => \"GC\",\n 'tipo_lista_id' => \"TC\"\n ],\n [\n 'nombre' => \"Responsable de iva\",\n 'elemento_lista_id' => \"RI\",\n 'tipo_lista_id' => \"TC\"\n ],\n [\n 'nombre' => \"Régimen especial\",\n 'elemento_lista_id' => \"RE\",\n 'tipo_lista_id' => \"TC\"\n ]\n ];\n\n ElementosListas::insert($elementosListas);\n }", "public function geraClasseControle(){\n # Abre o template da classe Controle e armazena conteudo do modelo\t\t\n $modelo = Util::getConteudoTemplate('class.Modelo.Controle.tpl');\n\n # Abre o template dos metodos de cadastros e armazena conteudo do modelo\n $modeloCAD = Util::getConteudoTemplate('metodoCadastra.tpl');\n $modeloExclui = Util::getConteudoTemplate('metodoExclui.tpl');\n $modeloSelecionar = Util::getConteudoTemplate('metodoSeleciona.tpl');\n $modeloGetAll = Util::getConteudoTemplate('metodoGetAll.tpl'); \n $modeloConsultar = Util::getConteudoTemplate('metodoConsulta.tpl');\n $modeloAlterar = Util::getConteudoTemplate('metodoAltera.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n $aRequire = $aCadastro = $aExclui = $aSelecionar = $aGetAll = $aAlterar = $aConsultar = array();\n $copiaModelo = $modelo;\n //print_r($aBanco);exit;\n foreach($aBanco as $aTabela){\n $aPKDoc = $aPK = array(); \n foreach($aTabela as $oCampo){\n if((string)$oCampo->CHAVE == '1'){\n $aPKDoc[] = \"\\t * @param integer \\$\".(string)$oCampo->NOME;\n $aPK[] = \"\\$\".(string)$oCampo->NOME;\n }\n }\n\n # Montar a Lista de DOC do metodo selecionar\n $listaPKDoc = join(\"\\n\", $aPKDoc);\n $listaPK = join(\",\", $aPK);\n\n # Recupera o nome da tabela e gera os valores a serem gerados\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n $copiaModeloCAD = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloCAD);\n $copiaModeloExclui = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloExclui);\n $copiaModeloSelecionar = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloSelecionar);\n $copiaModeloGetAll = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloGetAll);\n $copiaModeloAlterar = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloAlterar);\n $copiaModeloConsultar = str_replace('%%NOME_CLASS%%', $nomeClasse, $modeloConsultar);\n\n $montaObjeto = $this->retornaObjetosMontados($aTabela['NOME']);\n $montaObjetoBD = $this->retornaObjetosBDMontados($aTabela['NOME']);\n\n $copiaModeloCAD = str_replace('%%MONTA_OBJETO%%', $montaObjeto, $copiaModeloCAD);\n $copiaModeloCAD = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloCAD);\n $copiaModeloExclui = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloExclui);\n $copiaModeloSelecionar = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloSelecionar);\n $copiaModeloSelecionar = str_replace('%%DOC_LISTA_PK%%', $listaPKDoc, $copiaModeloSelecionar);\n $copiaModeloSelecionar = str_replace('%%LISTA_PK%%', \t$listaPK, $copiaModeloSelecionar);\n $copiaModeloGetAll = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloGetAll);\n $copiaModeloAlterar = str_replace('%%MONTA_OBJETO%%', $montaObjeto, $copiaModeloAlterar);\n $copiaModeloAlterar = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloAlterar);\n $copiaModeloConsultar = str_replace('%%MONTA_OBJETOBD%%', $montaObjetoBD, $copiaModeloConsultar);\n\n $aRequire[] = \"require_once(dirname(__FILE__).'/bd/class.$nomeClasse\".\"BD.php');\";\n $aCadastro[] = $copiaModeloCAD;\n $aExclui[] = $copiaModeloExclui;\n $aSelecionar[] = $copiaModeloSelecionar;\n $aGetAll[] = $copiaModeloGetAll;\n $aAlterar[] = $copiaModeloAlterar;\n $aConsultar[] = $copiaModeloConsultar;\n }\n\n # Monta demais valores a serem substituidos\n $listaRequire = join(\"\\n\", $aRequire);\n $listaCadastro = join(\"\\n\\n\", $aCadastro);\n $listaExclui = join(\"\\n\\n\", $aExclui);\n $listaSelecionar = join(\"\\n\\n\", $aSelecionar);\n $listaGetAll = join(\"\\n\\n\", $aGetAll);\n $listaAlterar = join(\"\\n\\n\", $aAlterar);\n //print \"<pre>\"; print_r($aAlterar); print \"</pre>\"; \n //print \"<pre>\"; print_r($aConsultar); print \"</pre>\"; \n $listaConsultar = join(\"\\n\\n\", $aConsultar);\n\n # Substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo = str_replace('%%LISTA_REQUIRE%%',\t\t $listaRequire, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_CADASTRA%%',\t $listaCadastro, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_EXCLUI%%',\t $listaExclui, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_SELECIONAR%%',\t $listaSelecionar, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_CARREGAR_COLECAO%%', $listaGetAll, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_ALTERA%%',\t $listaAlterar, $copiaModelo);\n $copiaModelo = str_replace('%%METODOS_CONSULTA%%',\t $listaConsultar, $copiaModelo);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes\";\n if(!file_exists($dir)) mkdir($dir);\n\n $fp = fopen(\"$dir/class.Controle.php\",\"w\");\n fputs($fp,$copiaModelo);\n\n # ============ Adicionando Classes de core/Config =========\n $modeloConfig = Util::getConteudoTemplate(\"Modelo.Config.\".$aBanco['SGBD'].\".tpl\");\n $modeloConfig = str_replace('%%DATABASE%%', $this->projeto, $modeloConfig);\n \n $fpConfig = fopen(\"$dir/core/config.ini\",\"w\"); \t\n fputs($fpConfig, $modeloConfig); \n fclose($fpConfig);\n\n copy(dirname(__FILE__).\"/core/class.Seguranca.php\", \"$dir/class.Seguranca.php\");\n copy(dirname(__FILE__).\"/class.Util.php\",\t \"$dir/core/class.Util.php\");\n copy(dirname(__FILE__).\"/class.Conexao.php\", \"$dir/core/class.Conexao.php\");\n \n return true;\n }", "function agregarJuego($coleccionJuegos,$puntos,$indicePalabra){\n $coleccionJuegos[] = array(\"puntos\"=> $puntos, \"indicePalabra\" => $indicePalabra); \n return $coleccionJuegos;\n}", "public function run()\n {\n $register = [\n ['nome'=>'Barcelos','uf'=>'AM'],\n ['nome'=>'São Gabriel da Cachoeira','uf'=>'AM'],\n ['nome'=>'Tapauá','uf'=>'AM'],\n ['nome'=>'Atalaia do Norte','uf'=>'AM'],\n ['nome'=>'Jutaí','uf'=>'AM'],\n ['nome'=>'Lábrea','uf'=>'AM'],\n ['nome'=>'Santa Isabel do Rio Negro','uf'=>'AM'],\n ['nome'=>'Coari','uf'=>'AM'],\n ['nome'=>'Japurá','uf'=>'AM'],\n ['nome'=>'Apuí','uf'=>'AM'],\n ['nome'=>'Manicoré','uf'=>'AM'],\n ['nome'=>'Borba','uf'=>'AM'],\n ['nome'=>'Pauini','uf'=>'AM'],\n ['nome'=>'Novo Aripuanã','uf'=>'AM'],\n ['nome'=>'Maués','uf'=>'AM'],\n ['nome'=>'Novo Airão','uf'=>'AM'],\n ['nome'=>'Humaitá','uf'=>'AM'],\n ['nome'=>'Canutama','uf'=>'AM'],\n ['nome'=>'Urucará','uf'=>'AM'],\n ['nome'=>'Carauari','uf'=>'AM'],\n ['nome'=>'Presidente Figueiredo','uf'=>'AM'],\n ['nome'=>'Itamarati','uf'=>'AM'],\n ['nome'=>'Tefé','uf'=>'AM'],\n ['nome'=>'BocadoAcre','uf'=>'AM'],\n ['nome'=>'São Paulo de Olivença','uf'=>'AM'],\n ['nome'=>'Juruá','uf'=>'AM'],\n ['nome'=>'Codajás','uf'=>'AM'],\n ['nome'=>'Beruri','uf'=>'AM'],\n ['nome'=>'Maraã','uf'=>'AM'],\n ['nome'=>'Eirunepé','uf'=>'AM'],\n ['nome'=>'Nhamundá','uf'=>'AM'],\n ['nome'=>'Ipixuna','uf'=>'AM'],\n ['nome'=>'Envira','uf'=>'AM'],\n ['nome'=>'Santo Antônio do Içá','uf'=>'AM'],\n ['nome'=>'FonteBoa','uf'=>'AM'],\n ['nome'=>'Manaus','uf'=>'AM'],\n ['nome'=>'São Sebastião do Uatumã','uf'=>'AM'],\n ['nome'=>'Uarini','uf'=>'AM'],\n ['nome'=>'Caapiranga','uf'=>'AM'],\n ['nome'=>'Guajará','uf'=>'AM'],\n ['nome'=>'Itacoatiara','uf'=>'AM'],\n ['nome'=>'Benjamin Constant','uf'=>'AM'],\n ['nome'=>'Autazes','uf'=>'AM'],\n ['nome'=>'Manacapuru','uf'=>'AM'],\n ['nome'=>'Tonantins','uf'=>'AM'],\n ['nome'=>'Careiro','uf'=>'AM'],\n ['nome'=>'Parintins','uf'=>'AM'],\n ['nome'=>'Alvarães','uf'=>'AM'],\n ['nome'=>'Rio Preto da Eva','uf'=>'AM'],\n ['nome'=>'Anori','uf'=>'AM'],\n ['nome'=>'Barreirinha','uf'=>'AM'],\n ['nome'=>'Nova Olinda do Norte','uf'=>'AM'],\n ['nome'=>'Amaturá','uf'=>'AM'],\n ['nome'=>'Itapiranga','uf'=>'AM'],\n ['nome'=>'Manaquiri','uf'=>'AM'],\n ['nome'=>'Silves','uf'=>'AM'],\n ['nome'=>'Tabatinga','uf'=>'AM'],\n ['nome'=>'Urucurituba','uf'=>'AM'],\n ['nome'=>'Careiro da Várzea','uf'=>'AM'],\n ['nome'=>'Boa Vista do Ramos','uf'=>'AM'],\n ['nome'=>'Anamã','uf'=>'AM'],\n ['nome'=>'Iranduba','uf'=>'AM'],\n ];\n \n DB::table('ufs')->insert($register);\n }", "function constroe_campo_administrar(){\n\n// globals\nglobal $idioma;\nglobal $pagina_href;\n\n// valida usuario administrador\nif(retorne_usuario_administrador() == false){\n\n// retorno nulo\nreturn null;\n\t\n};\n\n// titulo\n$titulo = $idioma[18];\n\n// links de administrador\n$links[] = \"<a href='$pagina_href[3]'>$idioma[19]</a>\";\n$links[] = \"<a href='$pagina_href[4]'>$idioma[47]</a>\";\n$links[] = \"<a href='$pagina_href[6]'>$idioma[22]</a>\";\n$links[] = \"<a href='$pagina_href[7]'>$idioma[23]</a>\";\n$links[] = \"<a href='$pagina_href[9]'>$idioma[25]</a>\";\n$links[] = \"<a href='$pagina_href[10]'>$idioma[26]</a>\";\n$links[] = \"<a href='$pagina_href[11]'>$idioma[27]</a>\";\n$links[] = \"<a href='$pagina_href[12]'>$idioma[28]</a>\";\n$links[] = \"<a href='$pagina_href[14]'>$idioma[30]</a>\";\n\n// conteudo\n$conteudo = constroe_links_menu_vertical($links);\n\n// codigo html\n$codigo_html = constroe_menu_navegacao_vertical($titulo, $conteudo);\n\n// retorno\nreturn $codigo_html;\n\n}", "function buscar_nombre($nombre_libro){\n\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"SELECT\n\t\t\t\t\t*\n\t\t\t\t\tFROM\n\t\t\t\t\tlibro\n\t\t\t\t\tWHERE nombre_libro='$nombre_libro'\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$conexion -> cerrar();\n\t\t//Proceso el arreglo para convertirlo\n\t\t//en una colección de objetos de tipo\n\t\t//producto.\n\t\tif($resultado == TRUE)\n\t\t{\n\t\t\trequire('libroClass.php');\n\t\t\t//Por cada producto\n\t\t\tforeach($resultado as $libro){\n\t\t\t\t$libros = new Libro($libro['id_libro'], $libro['nombre_libro'], $libro['paginas_libro'], $libro['codigo_libro'], $libro['version_libro'], $libro['id_editorial'], $libro['id_estado_libro']);\n\t\t\t\t$lista_libros[] = $libros;\n\t\t\t}\n\t\t\t//Regreso los productos\n\t\t\treturn $lista_libros;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function _comprobarEstructuraContenido(){\n\n\t$campos_requeridos = array(\n\t\t'body',\n\t\t'og_group_ref',\n\t\t'field_download',\n\t\t'field_servicio_categoria',\n\t\t'field_acciones',\n\t\t'field_costo',\n\t\t'field_dirigido',\n\t\t'field_modalidad_digital',\n\t\t'field_modalidad_otro',\n\t\t'field_modalidad_otro_especificar',\n\t\t'field_modalidad_presencial',\n\t\t'field_modalidad_telefonico',\n\t\t'field_pasos',\n\t\t'field_requisitos_collection',\n\t\t'field_vigencia',\n\t\t'field_id_migracion',\n\t\t'field_es_migrado',\n\t\t//Relevamiento\n\t\t'field_transaccion_tipo',\n\t\t'field_digitalizacion_medir',\n\t\t'field_digitalizacion_observacion',\n\t\t'field_descargas_obligatorias',\n\t\t'field_formulario_digital',\n\t\t'field_turno_requerido',\n\t\t'field_turno_digital',\n\t\t'field_identificacion_digital',\n\t\t'field_posee_notificaciones',\n\t\t'field_notificaciones',\n\t\t'field_pago_requerido_list',\n\t\t'field_pago_electronico_list',\n\t\t'field_resumen_nivel',\n\t\t'field_relevamiento_observaciones'\n\t);\n\n\t$fields = field_info_instances('node', 'tramite');\n\n\tforeach($fields as $key => $value){\n\t\t$campos_servicio[] = $key;\n\t}\n\t\n\tforeach ($campos_requeridos as $key => $value) {\n\t\tif(!in_array($value, $campos_servicio)){\n\t\t\tdie('El campo '.$value.' no esta presente verificar la feature de servicios');\n\t\t}\n\t}\n\n}", "function comprobar_atributos(){\n\t$errores=array();\n\t$errores[]=$this->comprobar_CODESPACIO();\n\t$errores[]=$this->comprobar_CODCENTRO();\n\t$errores[]=$this->comprobar_CODEDIFICIO();\n\t$errores[]=$this->comprobar_TIPO();\n\t$errores[]=$this->comprobar_SUPERFICIEESPACIO();\n\t$errores[]=$this->comprobar_NUMINVENTARIOESPACIO();\n\tfor($i=0;$i<count($errores,0);$i++){\n if(is_array($errores[$i])){\n return $errores;\n }\n }\nreturn TRUE;\n\n}", "function agregar($nombre,$correo,$usuario,$rol,$zonah,$estado,$psw)\n {\n $Valores = \"'\".$usuario.\"','\".$psw.\"','\".$nombre.\"','\".$correo.\"',\".$estado.\",\".$zonah.\",\".$rol;\n $this->Insertar(\"usuarios\",\"usuario,password,nombre,correo,activo,zonashorarias_id,roles_id\",$Valores);\n }", "function validarCampos()\r\n\t{\r\n\t\t$retorno = array('bool' => true, 'msg' => null);\r\n\r\n\t\tforeach($_POST as $nombre_campo => $valor){\r\n\r\n\t\t\t/*\r\n\t\t\t\tVALIDACIONES\r\n\t\t\t*/\r\n\r\n\t\t\t//bool = true: caso que no exite error alguno en los campos\r\n\t\t\t//bool = false: caso que exista error...(tamano, caracteres especiales)\r\n\r\n\t\t\tif(strlen($valor) >= 1){ //no esta vacio\r\n\r\n\t\t\t\tswitch($nombre_campo){\r\n\r\n\t\t\t\t\tcase 'nombre':\r\n\r\n\t\t\t\t\t\tif(!preg_match(\"/^[a-zA-Z0-9\\_\\-]{0,40}\\s?[a-zA-Z0-9\\_\\-]{0,40}?$/\", $valor)){\r\n\r\n\t\t\t\t\t\t\t$retorno['msg'] = 'Verifica los caracteres del nombre';\r\n\t\t\t\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'email':\r\n\r\n\t\t\t\t\t\tif(!preg_match(\"/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9]+\\.[a-zA-Z0-9-.]+$/\", $valor)){\r\n\r\n\t\t\t\t\t\t\t$retorno['msg'] = 'Tu correo no es valido';\r\n\t\t\t\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'password':\r\n\r\n\t\t\t\t\t\tif(!preg_match(\"/^.{0,12}$/\", $valor)){\r\n\r\n\t\t\t\t\t\t\t$retorno['msg'] = 'Comprueba el limite de caracteres de tu contraseña';\r\n\t\t\t\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t//validaciones de datos de contras\r\n\r\n\t\t\t\t\tcase 'nombreContra':\r\n\r\n\t\t\t\t\t\tif(!preg_match(\"/^.{0,20}$/\", $valor)){\r\n\r\n\t\t\t\t\t\t\t$retorno['msg'] = 'Comprueba el limite de caracteres del nombre de la contraseña';\r\n\t\t\t\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\tcase 'contenidoContra':\r\n\r\n\t\t\t\t\t\tif(!preg_match(\"/^.{0,30}$/\", $valor)){\r\n\r\n\t\t\t\t\t\t\t$retorno['msg'] = 'Comprueba el limite de caracteres de tu contraseña';\r\n\t\t\t\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t} else{\r\n\r\n\t\t\t\t$retorno['msg'] = 'Por favor rellena todos los campos';\r\n\t\t\t\t$retorno['bool'] = false;\r\n\t\t\t}\r\n\t\t} \r\n\r\n\t\treturn $retorno;\r\n\t}", "static public function ctrCrearRecursos(){\n if (isset($_POST[\"nuevorubro\"])) {\n if (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevorubro\"]) &&\n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoconcepto\"]) &&\n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevovalor_rubro\"]) &&\n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevovalor_proyecto\"]) &&\n preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoid_proyecto\"])){\n\n $recursos = \"recursos\"; \n \n $datos = array(\"rubro\" => $_POST[\"nuevorubro\"],\n \"concepto\" => $_POST[\"nuevoconcepto\"],\n \"valor_rubro\" => $_POST[\"nuevovalor_rubro\"],\n \"valor_proyecto\" => $_POST[\"nuevovalor_proyecto\"],\n \"id_proyecto\" => $_POST[\"nuevoid_proyecto\"]);\n $respuesta = ModeloRecurso::mdlIngresarRecursos($recursos, $datos);\n\n if ($respuesta == \"ok\") {\n echo '<script>\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\ttitle: \"¡El recurso ha sido guardado correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"recurso\";\n\n\t\t\t\t\t\t}\n\n });\n \n\t\t\t\t\t</script>';\n }\n }else{\n echo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡El recurso no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"recurso\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t</script>';\n }\n }\n }", "public function armado() {\n $validacion = new Seguridad_UsuarioValidacion();\n $validacion = $validacion->consultaElemento();\n\n $parametros_tabla = Consultas_TablaParametros::RegistroConsultaTodos(__FILE__, __LINE__, $_GET['id_tabla']);\n\n if (!is_array($parametros_tabla)) {\n\n if (isset($_POST['id_cp_rel']) && ($_POST['id_cp_rel'] != '')) {\n $tabla_tabuladores = Consultas_Tabla::RegistroConsultaTablaNombre(__FILE__, __LINE__, $_GET['id_tabla']);\n $consulta = new Bases_RegistroConsulta(__FILE__, __LINE__);\n $consulta->tablas('kirke_tabla');\n $consulta->tablas('kirke_tabla_prefijo');\n $consulta->tablas('kirke_componente');\n $consulta->campos('kirke_tabla', 'tabla_nombre');\n $consulta->campos('kirke_tabla_prefijo', 'prefijo');\n $consulta->condiciones('', 'kirke_tabla', 'id_tabla_prefijo', 'iguales', 'kirke_tabla_prefijo', 'id_tabla_prefijo');\n $consulta->condiciones('y', 'kirke_tabla', 'id_tabla', 'iguales', 'kirke_componente', 'id_tabla');\n $consulta->condiciones('y', 'kirke_componente', 'id_componente', 'iguales', '', '', $_POST['id_cp_rel']);\n $id_tabla_cp_rel = $consulta->realizarConsulta();\n Consultas_CampoCrear::armado(__FILE__, __LINE__, $tabla_tabuladores, 'id_' . $id_tabla_cp_rel[0]['prefijo'] . '_' . $id_tabla_cp_rel[0]['tabla_nombre'], 'numero', '12', false);\n }\n\n $tabla_rel_datos = Consultas_Tabla::RegistroConsultaTablaNombre(__FILE__, __LINE__, $_POST['id_tb_rel']);\n $tabla_int_datos = Consultas_Tabla::RegistroConsultaTablaNombre(__FILE__, __LINE__, $_GET['intermedia_tb_id']);\n Consultas_CampoCrear::armado(__FILE__, __LINE__, $tabla_int_datos, 'id_' . $tabla_rel_datos, 'numero', '12', false);\n\n $this->_agregarComponenteTabuladores();\n $this->_pasarNombresComponente();\n\n if (isset($_POST['id_cp_rel']) && ($_POST['id_cp_rel'] != '')) {\n Consultas_TablaParametros::RegistroCrearCompleto(__FILE__, __LINE__, $_GET['id_tabla'], 'tabuladores', 'id_cp_rel', $_POST['id_cp_rel']);\n }\n\n Consultas_TablaParametros::RegistroCrearCompleto(__FILE__, __LINE__, $_GET['id_tabla'], 'tabuladores', 'tabla_relacionada', $_POST['id_tb_rel']);\n Consultas_TablaParametros::RegistroCrearCompleto(__FILE__, __LINE__, $_GET['id_tabla'], 'tabuladores', 'cp_id', $this->_id_componente);\n }\n\n // la redireccion va al final\n $armado_botonera = new Armado_Botonera();\n $parametros = array('kk_generar' => '0', 'accion' => '30');\n $armado_botonera->armar('redirigir', $parametros);\n }", "function cl_issarqsimplesreg() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"issarqsimplesreg\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function registrarGrupo($nombre, $descripcion, $codgru, $materia, $auxiliar, $fecha_inicio, $fecha_fin, $conn, $docente, $codoc, $codaux,$aula){\n\t\t$sql = \"INSERT INTO grupo (COD_GRUPO, ID_MATERIA, ID_USUARIO, COD_AUXILIAR, DOC_ID_USUARIO, COD_DOCENTE, NOMBRE_GRUPO, FECHA_INI, FECHA_FIN, ID_LABORATORIO) \n\t\tVALUES('$codgru', $materia, $auxiliar, '$codaux', '$docente', '$codoc','$nombre', '$fecha_inicio', '$fecha_fin',$aula)\";\n\t\tmysqli_query($conn, $sql);\n\n\t\t\n\t\t//mysqli_query($conn, $sql);\n\t}", "public function registrar(){\n\n /*parametros del metodo input:\n *nomnbre del campo,\n *si es requerido o no (true,false)\n *tipo del campo -actualmente valida (string,int,date,email)*/\n\n $nombre=$this->input('nombre',true,'string');\n\n $descripcion=$this->input('descripcion',true,'string');\n\n\n\n //si la validacion falla lo redirecciona a la vista donde esta los mensaje de error\n if($this->validateFails()){\n //este metodo REDIRECCIONA osea cambia de pagina, se le pasa a que controlador y que accion\n\n $this->redirect('Example','index');\n }else{\n\n $example=new Example();//no hace falta incluir el modelo ya esta incluido\n $example->setExampleParameters1($nombre);\n $example->setExampleParameters2($descripcion);\n $example->save();\n $this->redirect('Example','index');\n }\n }", "function recuperar_datos() {\n\t\tglobal $nombre, $tipo ;\n\t\t\n\t\t\t$pers_id =(isset($_POST['id_marcas']) && !empty($_POST['id_marcas']))? $_POST['id_marcas']:\"\";\n\t\t\t$tipo =(isset($_POST['tipo']) && !empty($_POST['tipo']))? $_POST['tipo']:\"A\"; \t\n\n\t\t\t$nombre=(isset($_POST[\"nombre\"]) && !empty($_POST[\"nombre\"]))? $_POST[\"nombre\"]:\"\";\t\t\t\n\t\n\t\t}", "function listar_simbolos_especiales($id_tipo_palabra,$letra,$id_tipo_simbolo,$idioma,$registrado) {\n\t\n\t\tif ($registrado==false) {\n\t\t\t$mostrar_registradas=\"AND simbolos_especiales.registrado=0\";\n\t\t}\n\t\t\n\t\tif ($id_tipo_palabra==99) { $sql_tipo_palabra=''; } \n\t\telse { $sql_tipo_palabra='AND palabras.id_tipo_palabra='.$id_tipo_palabra.''; }\n\t\t\n\t\tif ($idioma==99) { $sql_idioma=''; } \n\t\telseif ($idioma==98) { $sql_idioma='AND simbolos_especiales.castellano=1'; }\n\t\telseif ($idioma==97) { $sql_idioma='AND simbolos_especiales.castellano=0 AND simbolos_especiales.id_idioma=0'; } \n\t\telse { $sql_idioma='AND simbolos_especiales.id_idioma='.$idioma.''; }\n\t\t\n\t\tif ($id_tipo_simbolo==99) { $sql_tipo_simbolo='AND simbolos_especiales.id_tipo_simbolo=tipos_simbolos.id_tipo'; } \n\t\telse { $sql_tipo_simbolo='AND simbolos_especiales.id_tipo_simbolo='.$id_tipo_simbolo.' AND tipos_simbolos.id_tipo='.$id_tipo_simbolo.''; }\n\t\t\n\t\tif ($letra=='todas') { $sql_letra=''; } else { $sql_letra=$letra; }\n\t\t\n\t\t$query = \"SELECT simbolos_especiales.*, palabras.*, tipos_simbolos.*\n\t\tFROM simbolos_especiales, palabras, tipos_simbolos\n\t\tWHERE simbolos_especiales.id_palabra=palabras.id_palabra\n\t\t$sql_tipo_simbolo\n\t\t$sql_tipo_palabra\n\t\t$sql_idioma\n\t\t$mostrar_registradas\n\t\tAND palabras.palabra LIKE '$sql_letra%%'\n\t\tORDER BY palabras.palabra asc\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function consultarGrupo()\n\t\t{\n\t\t\t\t $file = fopen(\"../Archivos/ArrayConsultarGrupo.php\", \"w\");\n\t\t\t\t fwrite($file,\"<?php class consult { function array_consultar(){\". PHP_EOL);\n\t\t\t\t fwrite($file,\"\\$form=array(\" . PHP_EOL);\n\n\t\t\t$mysqli=$this->conexionBD();\n\t\t\t$query=\"SELECT * FROM grupo \";\n\t\t\t$resultado=$mysqli->query($query);\n\t\t\tif(mysqli_num_rows($resultado)){\n\t\t\t\twhile($fila = $resultado->fetch_array())\n\t\t\t{\n\t\t\t\t$filas[] = $fila;\n\t\t\t}\n\t\t\tforeach($filas as $fila)\n\t\t\t{ \n\t\t\t\t$nombre=$fila['NOMBRE_GRUPO'];\n\t\t\t\t$descripcion=$fila['DESCRIPCION'];\n\t\t\t\tfwrite($file,\"array(\\\"nombre\\\"=>'$nombre',\\\"descripcion\\\"=>'$descripcion'),\" . PHP_EOL);\n\t\t\t}\n\t\t\t}\n\t\t\t fwrite($file,\");return \\$form;}}?>\". PHP_EOL);\n\t\t\t\t fclose($file);\n\t\t\t\t $resultado->free();\n\t\t\t\t $mysqli->close();\n\t\t}", "function sevenconcepts_formulaire_charger($flux){\n $form=$flux['args']['form'];\n if($form=='inscription'){\n include_spip('cextras_pipelines');\n $champs_extras=champs_extras_objet(table_objet_sql('auteur'));\n foreach($champs_extras as $value){\n $flux['data'][$value['options']['nom']]=''; \n if(isset($value['options']['obligatoire']))$flux['data']['obligatoire'][$value['options']['nom']]='on';\n }\n $flux['data']['nom_inscription']='';\n $flux['data']['mail_inscription']='';\n }\n \n return $flux;\n}", "function geraClassesMapeamento(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo = Util::getConteudoTemplate('class.ModeloMAP.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $copiaModelo = $modelo;\n # Recupera o nome da tabela e gera o nome da classe\n $nomeTabela = ucfirst((string)$aTabela['NOME']);\n $nomeTabelaOriginal = (string)$aTabela['NOME'];\n\n $nomeClasse = ucfirst($this->getCamelMode($nomeTabela));\n $objetoClasse = \"\\$o$nomeClasse\";\n # Varre a estrutura dos campos da tabela em questao\n $objToReg = $regToObj = $objToRegInsert = array();\n\n foreach($aTabela as $oCampo){\n # Processa nome original da tabela estrangeira\n $nomeFKClasse\t= ucfirst($this->getCamelMode((string)$oCampo->FKTABELA));\n $objetoFKClasse = $nomeFKClasse;\n\n # Testando nova implementacao - Tirar caso ocorrer erro\n if($nomeFKClasse == $nomeClasse)\n $objetoFKClasse = ucfirst(preg_replace(\"#^(?:id_?|cd_?)(.*?)#is\", \"$1\", (string)$oCampo->NOME));\n\n //$nomeCampo = $this->getCamelMode((string)$oCampo->NOME); Alteracao SUDAM\n $nomeCampo = (string)$oCampo->NOME;\n\n # Monta parametros a serem substituidos posteriormente\n if($oCampo->FKTABELA == ''){\n $objToReg[] = \"\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = $objetoClasse\".\"->$nomeCampo;\";\n if($oCampo->CHAVE == \"0\"){\n $objToRegInsert[] = \"\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = $objetoClasse\".\"->$nomeCampo;\";\n }\n $regToObj[] = \"\\t\\t$objetoClasse\".\"->$nomeCampo = \\$reg['$nomeTabelaOriginal\".\"_\".(string)$oCampo->NOME.\"'];\";\n \n }\n else{\n $objToReg[] = \"\\t\\t\\$o$objetoFKClasse = $objetoClasse\".\"->o$objetoFKClasse;\\n\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = \\$o$objetoFKClasse\".\"->\".(string)$oCampo->FKCAMPO.\";\";\n if($oCampo->CHAVE == \"0\"){\n $objToRegInsert[] = \"\\t\\t\\$o$objetoFKClasse = $objetoClasse\".\"->o$objetoFKClasse;\\n\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = \\$o$objetoFKClasse\".\"->\".(string)$oCampo->FKCAMPO.\";\";\n }\n $x \t\t= $this->retornaArvore((string)$oCampo->FKTABELA);\n $regToObj[] = \"\\n$x\\t\\t$objetoClasse\".\"->o$objetoFKClasse = \\$o$objetoFKClasse;\";\n }\n }\n\n # Monta demais valores a serem substituidos\n $objToReg = join($objToReg,\"\\n\");\n $objToRegInsert = join($objToRegInsert,\"\\n\");\n $regToObj = join($regToObj,\"\\n\");\n\n # Substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo);\n $copiaModelo = str_replace('%%OBJETO_CLASSE%%', $objetoClasse, $copiaModelo);\n $copiaModelo = str_replace('%%OBJ_TO_REG%%', $objToReg, $copiaModelo);\n $copiaModelo = str_replace('%%OBJ_TO_REG_INSERT%%', $objToRegInsert,$copiaModelo);\n $copiaModelo = str_replace('%%REG_TO_OBJ%%', $regToObj, $copiaModelo);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes/core/map\";\n\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.$nomeClasse\".\"MAP.php\",\"w\");\n fputs($fp,$copiaModelo);\n fclose($fp);\n }\n return true;\t\n }", "static function crear( toba_modelo_instancia $instancia, $nombre, $usuarios_a_vincular , $dir_inst_proyecto=null)\n\t{\n\t\t//- 1 - Controles\n\t\t$dir_template = toba_dir() . self::template_proyecto;\n\t\tif ( $nombre == 'toba' ) {\n\t\t\tthrow new toba_error(\"INSTALACIÓN: No es posible crear un proyecto con el nombre 'toba'\");\n\t\t}\n\t\tif ( self::existe( $nombre ) ) {\n\t\t\ttoba_logger::instancia()->error(\"INSTALACIÓN: Ya existe una carpeta con el nombre '$nombre' en la carpeta 'proyectos'\");\n\t\t\tthrow new toba_error(\"INSTALACIÓN: Ya existe una carpeta con el nombre especificado en la carpeta 'proyectos'\");\n\t\t}\n\t\ttry {\n\n\t\t\t//- 2 - Modificaciones en el sistema de archivos\n\t\t\t$dir_proyecto = (is_null($dir_inst_proyecto)) ? $instancia->get_path_proyecto($nombre): $dir_inst_proyecto;\n\t\t\t$url_proyecto = $instancia->get_url_proyecto($nombre);\n\n\t\t\t// Creo la CARPETA del PROYECTO\n\t\t\t$excepciones = array();\n\t\t\t$excepciones[] = $dir_template.'/www/aplicacion.produccion.php';\n\t\t\ttoba_manejador_archivos::copiar_directorio( $dir_template, $dir_proyecto, $excepciones);\n\n\t\t\t// Modifico los archivos\n\t\t\t$editor = new toba_editor_archivos();\n\t\t\t$editor->agregar_sustitucion( '|__proyecto__|', $nombre );\n\t\t\t$editor->agregar_sustitucion( '|__instancia__|', $instancia->get_id() );\n\t\t\t$editor->agregar_sustitucion( '|__toba_dir__|', toba_manejador_archivos::path_a_unix( toba_dir() ) );\n\t\t\t$editor->agregar_sustitucion( '|__version__|', '1.0.0');\n\t\t\t$editor->procesar_archivo( $dir_proyecto . '/www/aplicacion.php' );\n\n\t\t\t$modelo = $dir_proyecto . '/php/extension_toba/modelo.php';\n\t\t\t$comando = $dir_proyecto . '/php/extension_toba/comando.php';\n\t\t\t$editor->procesar_archivo($comando);\n\t\t\t$editor->procesar_archivo($modelo);\n\t\t\t$editor->procesar_archivo($dir_proyecto.'/www/rest.php');\n\t\t\t$editor->procesar_archivo($dir_proyecto.'/www/servicios.php');\n\n\t\t\trename($modelo, str_replace('modelo.php', $nombre.'_modelo.php', $modelo));\n\t\t\trename($comando, str_replace('comando.php', $nombre.'_comando.php', $comando));\n\t\t\t$ini = $dir_proyecto.'/proyecto.ini';\n\t\t\t$editor->procesar_archivo($ini);\n\n\t\t\t// Asocio el proyecto a la instancia\n\t\t\t$instancia->vincular_proyecto( $nombre, $dir_inst_proyecto, $url_proyecto);\n\n\t\t\t//- 3 - Modificaciones en la BASE de datos\n\t\t\t$db = $instancia->get_db();\n\t\t\ttry {\n\t\t\t\t$db->abrir_transaccion();\n\t\t\t\t$db->retrasar_constraints();\n\t\t\t\t$db->ejecutar( self::get_sql_metadatos_basicos( $nombre ) );\n\t\t\t\t$sql_version = self::get_sql_actualizar_version( toba_modelo_instalacion::get_version_actual(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$nombre);\n\t\t\t\t$db->ejecutar($sql_version);\n\t\t\t\tforeach( $usuarios_a_vincular as $usuario ) {\n\t\t\t\t\tself::do_vincular_usuario($db, $nombre, $usuario, array('admin'));\n\t\t\t\t}\n\t\t\t\t$db->cerrar_transaccion();\n\t\t\t} catch ( toba_error $e ) {\n\t\t\t\t$db->abortar_transaccion();\n\t\t\t\t$txt = 'PROYECTO : Ha ocurrido un error durante la carga de METADATOS del PROYECTO. DETALLE: ';\n\t\t\t\ttoba_logger::instancia()->error($txt . $e->getMessage());\n\t\t\t\tthrow new toba_error( $txt );\n\t\t\t}\n\t\t} catch ( toba_error $e ) {\n\t\t\t// Borro la carpeta creada\n\t\t\tif ( is_dir( $dir_proyecto ) ) {\n\t\t\t\t$instancia->desvincular_proyecto( $nombre );\n\t\t\t\ttoba_manejador_archivos::eliminar_directorio( $dir_proyecto );\n\t\t\t}\n\t\t\tthrow $e;\n\t\t}\n\t}", "function listaRuta()\r\n\t{\t\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::listaRegistros( $query );\r\n\t}", "function add($nombre, $apellidopaterno = \"\", $apellidomaterno = \"\",\n\t\t\t$rfc = \"\", $curp = \"\", $cajalocal = DEFAULT_CAJA_LOCAL,\n\t\t\t$fecha_de_nacimiento = false, $lugar_de_nacimiento = \"\",\n\t\t\t$tipo_de_ingreso = FALLBACK_PERSONAS_TIPO_ING, $estado_civil = DEFAULT_ESTADO_CIVIL,\n\t\t\t$genero = DEFAULT_GENERO, $dependencia = FALLBACK_CLAVE_EMPRESA, $regimen_conyugal = DEFAULT_REGIMEN_CONYUGAL,\n\t\t\t$personalidad_juridica = PERSONAS_FIGURA_FISICA, $grupo_solidario = DEFAULT_GRUPO, $observaciones = \"\",\n\t\t\t$identificado_con = 1, $documento_de_identificacion = \"0\", $codigo = false, $sucursal = false,\n\t\t\t$movil\t= \"\", $correo = \"\", $dependientes = 0, $fecha = false, $riesgo = AML_PERSONA_BAJO_RIESGO, $clave_fiel = \"\", \n\t\t\t$pais = EACP_CLAVE_DE_PAIS, $regimen_fiscal = DEFAULT_REGIMEN_FISCAL){\n\t\t$sucess\t\t\t\t\t= false;\n\t\t$xF\t\t\t\t\t\t= new cFecha();\n\t\t$xLoc\t\t\t\t\t= new cLocal();\n\t\t//$ql\t\t\t\t\t\t= new MQL();\n\t\t//Reparando\n\t\t$fecha_de_entrevista \t= $xF->getFechaISO($fecha);\n\t\t$fecha_de_alta\t\t\t= $xF->getFechaISO($fecha);\n\t\t$fecha_de_revision\t\t= $xF->getFechaISO($fecha);\n\t\t$estatus\t\t\t\t= FALLBACK_PERSONAS_ESTADO;\n\t\t$region\t\t\t\t\t= FALLBACK_PERSONAS_REGION;\n\t\t\n\t\t$nombre\t\t\t\t\t= addslashes($nombre);\n\t\t$apellidomaterno\t\t= addslashes($apellidomaterno);\n\t\t$apellidopaterno\t\t= addslashes($apellidopaterno);\n\t\t\n\t\t$nombre\t\t\t\t\t= utf8_decode( strtoupper($nombre) );\n\t\t$apellidopaterno\t\t= utf8_decode( strtoupper($apellidopaterno) );\n\t\t$apellidomaterno\t\t= utf8_decode( strtoupper($apellidomaterno) );\n\t\t$dependientes\t\t\t= setNoMenorQueCero($dependientes);\n\t\t$eacp\t\t\t\t\t= EACP_CLAVE;\n\t\t$sucursal\t\t\t\t= ($sucursal == false) ? getSucursal() : $sucursal;\n\t\t$usuario\t\t\t\t= getUsuarioActual();\n\t\t$codigo\t\t\t\t\t= ($codigo == false) ? $this->mCodigo : $codigo;\n\t\t$fecha_de_nacimiento\t= $xF->getFechaISO($fecha_de_nacimiento);\n\t\t$cajalocal\t\t\t\t= setNoMenorQueCero($cajalocal);\n\t\t$cajalocal\t\t\t\t= ($cajalocal == 0) ? $xLoc->getCajaLocal() : $cajalocal;\n\t\tif($codigo == false){\n\t\t\t$xCL\t\t\t\t= new cCajaLocal($cajalocal); $xCL->init();\n\t\t\t$codigo\t\t\t\t= $xCL->getUltimoSocioRegistrado(true)+1;\n\t\t\t$this->mCodigo\t\t= $codigo;\n\t\t}\n\t\t//purgar RFC\n\t\tif($pais == \"MX\"){\n\t\t\t$xMex\t= new cReglasDePais();\n\t\t\t$rfc\t= $xMex->getValidIDFiscal($rfc);\n\t\t\t\n\t\t}\n\t\t$rfc\t\t= ($rfc == \"\") ? DEFAULT_PERSONAS_RFC_GENERICO : $rfc;\n\t\t$sql = \"INSERT INTO socios_general(codigo, nombrecompleto, apellidopaterno, apellidomaterno, rfc, curp, \n\t\t\t\t\tfechaentrevista, fechaalta, estatusactual, region, cajalocal,\n\t\t\t\t\tfechanacimiento, lugarnacimiento, tipoingreso,\n\t\t\t\t\testadocivil, genero, eacp, observaciones, idusuario,\n\t\t\t\t\tgrupo_solidario, personalidad_juridica, dependencia,\n\t\t\t\t\tregimen_conyugal, sucursal, fecha_de_revision, tipo_de_identificacion, documento_de_identificacion,\n\t\t\t\t\tcorreo_electronico, telefono_principal, dependientes_economicos, pais_de_origen, nivel_de_riesgo_aml, clave_de_firma_electronica,\n\t\t\tregimen_fiscal)\n \t\t\tVALUES\n\t\t\t\t\t($codigo, '$nombre', '$apellidopaterno', '$apellidomaterno', '$rfc', '$curp',\n\t\t\t\t\t'$fecha_de_entrevista', '$fecha_de_alta', $estatus, $region, $cajalocal,\n\t\t\t\t\t'$fecha_de_nacimiento', '$lugar_de_nacimiento', $tipo_de_ingreso,\n\t\t\t\t\t$estado_civil, $genero, '$eacp', '$observaciones', $usuario,\n\t\t\t\t\t$grupo_solidario, $personalidad_juridica, $dependencia,\n\t\t\t\t\t'$regimen_conyugal', '$sucursal', '$fecha_de_revision', $identificado_con, '$documento_de_identificacion',\n\t\t\t\t\t'$correo', '$movil', $dependientes, '$pais', $riesgo, '$clave_fiel', $regimen_fiscal)\";\n\t\t\n\t\t$x\t\t\t= my_query($sql);\n\t\t$this->mCodigo\t= $codigo;\n\t\tif ($x[\"stat\"] == false){\n\t\t\t$this->mMessages .= \"ERROR\\tSe fallo al agregar la persona $codigo\\r\\n\";\n\t\t\t$sucess\t\t\t= false;\n\t\t} else {\n\t\t\t$this->mMessages .= \"OK\\tSe agrego el Socio $codigo con Nombre $nombre $apellidopaterno $apellidomaterno \\r\\n\";\n\t\t\t$this->init();\t\t//Iniciar\n\t\t\t//Agregar en la Tabla de Grupos Solidarios si aplica\n\t\t\t//2012-06-20 si es grupo y es persojna moral\n\t\t\tif ( $tipo_de_ingreso == TIPO_INGRESO_GRUPO AND $personalidad_juridica == PERSONAS_FIGURA_MORAL ){\n\t\t\t\t$xGrup\t\t= new cGrupo($codigo);\n\t\t\t\t$this->addToGrupos(DEFAULT_SOCIO, DEFAULT_SOCIO, $sucursal, $fecha);\n\t\t\t\t//$xGrup->add($nombre, \"\", DEFAULT_SOCIO, DEFAULT_SOCIO, 10, 1, $codigo, $sucursal, $fecha_de_alta, $codigo);\n\t\t\t\t//$this->mMessages .= \"OK\\tSe Agrega Nuevo Grupo con clave $codigo\\r\\n\";\n\t\t\t}\n\t\t\tif(MODULO_AML_ACTIVADO == true){\n\t\t\t\tif( $this->mNoAML == false ){\n\t\t\t\t\t\n\t\t\t\t\t//checar lista negra\n\t\t\t\t\t$xAml\t= new cAMLPersonas($codigo);\n\t\t\t\t\t$xAml->init($codigo);\n\t\t\t\t\t$ln\t\t= $xAml->getBuscarEnListaNegra($nombre, $apellidopaterno, $apellidomaterno);\n\t\t\t\t\tif($ln == true){\n\t\t\t\t\t\t$xCM\t= new cAML();\n\t\t\t\t\t\t$xCM->sendAlerts($codigo, AML_OFICIAL_DE_CUMPLIMIENTO, 901001, $xAml->getMessages());\n\t\t\t\t\t}\n\t\t\t\t\tif($pais != EACP_CLAVE_DE_PAIS){\n\t\t\t\t\t\t//verificar persona extranjera\n\t\t\t\t\t\t$xCM\t= new cAML();\n\t\t\t\t\t\t$xCM->sendAlerts($codigo, AML_OFICIAL_DE_CUMPLIMIENTO, 801009, \"PERSONA EXTRANJERA REGISTRADA\");\n\t\t\t\t\t}\n\t\t\t\t\tif($riesgo == AML_PERSONA_ALTO_RIESGO){\n\t\t\t\t\t\t//verificar persona extranjera\n\t\t\t\t\t\t$xCM\t= new cAML();\n\t\t\t\t\t\t$xCM->sendAlerts($codigo, AML_OFICIAL_DE_CUMPLIMIENTO, 901001, \"PERSONA ALTAMENTE RIESGOSA REGISTRADA\");\n\t\t\t\t\t}\n\t\t\t\t\t//buscar persona SDN\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sucess\t= true;\n\t\t}\n\t\treturn $sucess;\n\t}", "function existeLetra(/*>>> Completar parámetros <<<*/ ){\n \n /*>>> Completar cuerpo de la función <<<*/\n\n}", "public function acessarRelatorios(){\n\n }", "function validar() {\n leerClase('Formulario');\n Formulario::validar('login' , $this->login , 'texto', 'El Nombre de Usuario');\n Formulario::validar('clave', $this->clave, 'texto', 'Contraseña');\n \n }", "function ComandoConsultarPreguntasFrecuentes()\n\t{\n\t\t$lineaComando = $this->ConstruirComando(SP_PreguntasFrecuentes);\n\t\t$lineaComando = $lineaComando . $this->_cierre;\n\t\t//echo \"Comando: \".$lineaComando;\n\t\treturn $lineaComando;\n\t}", "public function listar(){\r\n }", "function geraClassesBasicas(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo = Util::getConteudoTemplate('class.Modelo.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n //print_r($aBanco);\n # varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $copiaModelo = $modelo;\n $nomeClasse = ucfirst($this->getCamelMode($aTabela['NOME']));\n # Varre a estrutura dos campos da tabela em questao\n $aAtributo = $aListaAtributo = $aAtribuicao = $aFuncaoGet = $aFuncaoSet = array();\n foreach($aTabela as $oCampo){\n $nomeCampo \t = (string)$oCampo->NOME;\n if((string)$oCampo->FKTABELA != ''){\n # Processa nome original da tabela estrangeira\n $nomeFKClasse = ucfirst($this->getCamelMode((string)$oCampo->FKTABELA));\n if($nomeFKClasse == $nomeClasse){\n $nomeCampo = \"o\".ucfirst(preg_replace(\"#^(?:id_?|cd_?)(.*?)#is\", \"$1\", $nomeCampo));\n } else {\n $nomeCampo = \"o$nomeFKClasse\";\n }\n }\n\n # Atribui resultados\n $aAtributo[] \t = \"\\tpublic \\$$nomeCampo;\";\n $aListaAtributo[] = ((string)$oCampo->FKTABELA != '') ? \"$nomeFKClasse \\$$nomeCampo = NULL\" : \"\\$$nomeCampo = NULL\";\n $aAtribuicao[] \t = \"\\t\\t\\$this->$nomeCampo = \\$$nomeCampo;\";\n }\n\n # Monta demais valores a serem substituidos\n $atributos = join($aAtributo,\"\\n\");\n $listaAtributos = join(\", \", $aListaAtributo);\n $atribuicao = join(\"\\n\", $aAtribuicao);\n\n # Substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo);\n $copiaModelo = str_replace('%%ATRIBUTOS%%', $atributos, $copiaModelo);\n $copiaModelo = str_replace('%%LISTA_ATRIBUTOS%%', $listaAtributos, $copiaModelo);\n $copiaModelo = str_replace('%%ATRIBUICAO%%', $atribuicao, $copiaModelo);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes/core/basicas\";\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.$nomeClasse.php\",\"w\");\n fputs($fp, $copiaModelo);\n fclose($fp);\n }\n return true;\t\n }", "public function RegistreComision($fecha,$ValorComision, $TipoVenta,$comisionista,$idVenta,$Paga)\r\n{\r\n\r\n\t\t\t\t\t\r\n\t\t$tabla=\"comisionesporventas\";\r\n\t\t$NumRegistros=8;\r\n\t\r\n\t\t$this->NombresColumnas(\"colaboradores\");\r\n\t\t\r\n\t\t$DatosColaborador=$this->DevuelveValores($comisionista);\r\n\t\t\t\t\t\t\t\r\n\t\t$CuentaPUC=\"233520$comisionista\";\r\n\t\t$NombreCuenta=\"Comision por pagar del colaborador $DatosColaborador[Nombre] CC $DatosColaborador[Identificacion]\";\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$Columnas[0]=\"Fecha\";\t\t\t\t\t\t\t$Valores[0]=$fecha;\r\n\t\t$Columnas[1]=\"CuentaPUC\";\t\t\t\t\t\t$Valores[1]=$CuentaPUC;\r\n\t\t$Columnas[2]=\"NombreCuenta\";\t\t\t\t\t$Valores[2]=$NombreCuenta;\r\n\t\t$Columnas[3]=\"Valor\";\t\t\t\t\t\t\t$Valores[3]=$ValorComision;\r\n\t\t$Columnas[4]=\"TipoVenta\";\t\t\t\t\t\t$Valores[4]=$TipoVenta;\r\n\t\t$Columnas[5]=\"Colaboradores_idColaboradores\";\t$Valores[5]=$comisionista;\r\n\t\t$Columnas[6]=\"Ventas_NumVenta\";\t\t\t\t\t$Valores[6]=$idVenta;\r\n\t\t$Columnas[7]=\"Paga\";\t\t\t\t\t\t\t$Valores[7]=$Paga;\r\n\t\t\t\t\t\t\t\r\n\t\t$this->InsertarRegistro($tabla,$NumRegistros,$Columnas,$Valores);\r\n\r\n\r\n}", "static public function ctrRegistrarReceta(){\n\n if(isset($_POST[\"productoReceta\"])){\n\n if (preg_match('/^[0-9]+$/', $_POST[\"productoReceta\"])){\n\n $tabla = \"Receta\";\n $idProducto = $_POST[\"productoReceta\"];\n $listaInsumos = json_decode($_POST[\"listadoInsumos\"], true);\n\n $idReceta = ModeloRecetas::mdlRegistrarReceta($tabla, $idProducto);\n\n if ($idReceta != \"error\") {\n \n $tablaRecetaDetalle = \"RecetaDetalle\";\n\n foreach ($listaInsumos as $key => $value) {\n \n $idInsumo = $value[\"idInsumo\"]; \n $Cantidad = $value[\"cantidadInsumo\"];\n \n $respuesta = ModeloRecetas::mdlRegistrarDetalleReceta($tablaRecetaDetalle, $idReceta, $idInsumo, $Cantidad);\n\n }\n\n if($respuesta = \"ok\"){\n\n echo'<script>\n swal({\n title:\"¡Registro Exitoso!\",\n text:\"¡La receta se registró correctamente!\",\n type:\"success\",\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n },\n function(isConfirm){\n if(isConfirm){\n window.location=\"recetas\";\n }\n });\n </script>';\n\n }else{\n\n echo'<script>\n swal({\n title:\"¡Registro Fallido!\",\n text:\"¡Ocurrio un error, revise los datos!'.$respuesta.'\",\n type:\"error\",\n confirmButtonText:\"Cerrar\",\n closeOnConfirm: false\n });\n </script>';\n\n }\n\n }// fin if receta error\n\n\n } else {\n\n echo '<script>\n swal({\n title:\"¡Error!\",\n text:\"¡No ingrese caracteres especiales!\",\n type:\"warning\",\n confirmButtonText:\"Cerrar\",\n closeOnConfirm:false\n },\n function(isConfirm){\n if(isConfirm){\n window.location=\"recetas\";\n }\n });\n </script>';\n\n }\n\n } //if isset\n \n }", "public function gestioneUtenti(){\n\t\t// Istanzio Grocery Crud\n\t\t$crud = new grocery_CRUD();\n\t\t$crud->set_model('Mod_GCR');\n\t\t$crud->set_theme('bootstrap');\n\t\t$crud->set_language('italian');\n\t\t// Determino la tabella di riferimento\n\t\t//$crud->set_table('utenti');\n\t\t$crud->set_table('users');\n\t\t// Imposto la relazione n-n\n\t\t$crud->set_relation_n_n('elenco_categorie', 'utenti_categorie', 'tasks_categorie', 'id', 'id_categoria', 'categoria');\n\t\t$crud->unset_columns(array('ip', 'password','salt'));\n\t\t//$crud->unset_fields(array('id_cliente','username','last_login','ip_address', 'password','salt','activation_code','forgotten_password_code','forgotten_password_time','remember_code','created_on','phone'));\n\t\t$crud->fields(array('last_name','first_name','email','active','elenco_categorie'));\n\t\t$crud->columns(array('last_name','first_name','email','active','elenco_categorie'));\n\t\t$crud->display_as('first_name', 'Nome');\n\t\t$crud->display_as('last_name', 'Cognome');\n\t\t$crud->display_as('active', 'Abilitato');\n\n\t\t$crud->unset_delete();\n\t\t$crud->unset_bootstrap();\n\t\t$output = $crud->render();\n\t\t// Definisco le opzioni\n\t\t$opzioni=array();\n\t\t// Carico la vista\n\t\t$this->opzioni=array();\n\t\t$this->codemakers->genera_vista_aqp('crud',$output,$this->opzioni);\n\t}", "public function registrar_registro()\n \n {\n /** \n * @brief : Metodos para ingresar registro en la base de datos.\n * @return :Vista donde nos mostrara todos lo registro.\n */\n \n $data =Request()->all();\n registro::create($data);\n\n }", "public static function generarRepresentanteLegal(Empresa $empresa,$nombres,$apellidop,$apellidom,$tipodocumento,$documento,$direccion,$numerocontacto2,$idpais,$genero,$email,$id_persona,$cargo,$expedido)\n {\n $logs = new Logs();\n $sqlLogs = new SQLLogs();\n \n $persona = new Persona();\n $sqlPersona = new SQLPersona();\n $hoy = date(\"Y-m-d h:m:s\");\n $usuario = new Usuario();\n $sqlUsuario = new SQLUsuario();\n \n if($id_persona=='0')\n {\n //es nuevo\n $persona->setNombres(mb_strtoupper($nombres));\n $persona->setPaterno(mb_strtoupper($apellidop));\n $persona->setMaterno(mb_strtoupper($apellidom));\n $persona->setId_tipo_documento($tipodocumento);\n $persona->setNumero_documento($documento);//este es el documento\n $persona->setDireccion($direccion);\n // if($numerocontacto!=''){$persona->setNumero_contacto($numerocontacto);}\n // if($numerocontacto2!=''){$persona->setNumero_contacto2($numerocontacto2);}\n $persona->setExpedido($expedido);\n $persona->setEmail($email);\n $persona->setId_pais_origen($idpais);\n $persona->setFecha_creacion($hoy);\n $persona->setEstado(1);//para el estado activo\n $persona->setId_usuario_creacion($_SESSION['id_usuario']);\n if($genero==1) $persona->setGenero(true);\n else $persona->setGenero(false);\n try{\n $sqlPersona->setGuardarPersona($persona);\n } catch (Exception $ex) {\n $logs->setDescripcion('ERROR: generarRepresentanteLegal: creacion de la PERSONA');\n $logs->setId_servicio(0);\n $logs->setMensaje($ex->getMessage());\n $logs->setObjeto(print_r($persona,true));\n $logs->setDate(Date('Y-m-d H:i:s'));\n $sqlLogs->Save($logs);\n return null;\n }\n \n \n //esto es para crear el nombre del usuario\n $campousuario=trim($persona->getNombres());\n $campousuario=$campousuario[0].$persona->getNumero_documento();\n //-guardamos el usuario\n \n $usuario->setUsuario($campousuario);\n $usuario->setClave(substr(str_shuffle(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, 8));\n //$usuario->setClave('123456');\n $usuario->setFecha_creacion($hoy);\n $usuario->setId_persona($persona->getId_persona());\n $usuario->setActivo(1);\n $usuario->setId_tipo_usuario(2);\n try{\n $sqlUsuario->setGuardarUsuario($usuario);\n } catch (Exception $ex) {\n $logs->setDescripcion('ERROR: generarRepresentanteLegal: creacion del USUARIO');\n $logs->setId_servicio(0);\n $logs->setMensaje($ex->getMessage());\n $logs->setObjeto(print_r($usuario,true));\n $logs->setDate(Date('Y-m-d H:i:s'));\n $sqlLogs->Save($logs);\n $sqlPersona->delete($persona);\n return null;\n }\n }\n else\n {\n //es antiguo\n $persona->setId_persona($id_persona);\n $persona = $sqlPersona->getDatosPersonaPorId($persona);\n $usuario->setId_persona($id_persona);\n $usuario=$sqlUsuario->getDatosUsuarioPorIdPersona($usuario);\n }\n \n $perfil = new Perfil();\n $sqlPerfil = new SQLPerfil();\n $perfil->setId_perfil(3);//es pa el RL\n $perfil=$sqlPerfil->getBuscarDescripcionPorId($perfil);\n $perfil->getOpciones();\n\n $empresa_persona = new EmpresaPersona();\n $sqlEmpresaPersona = new SQLEmpresaPersona();\n $empresa_persona->setId_Persona($persona->getId_persona());\n $empresa_persona->setId_Empresa($empresa->getId_empresa());\n $empresa_persona->setId_Perfil(3);\n $empresa_persona->setFecha_Vinculacion($hoy);\n $empresa_persona->setOpciones_persona($perfil->getOpciones());\n $empresa_persona->setActivo(1);\n $empresa_persona->setCargo($cargo);\n try{\n $sqlEmpresaPersona->setGuardarEmpresaPersona($empresa_persona);\n return $persona->getId_persona().','.$usuario->getClave().','.$campousuario.','.$persona->getEmail();\n } catch (Exception $ex) {\n $logs->setDescripcion('ERROR: generarRepresentanteLegal: registo EMPRESA - PERSONA');\n $logs->setId_servicio(0);\n $logs->setMensaje($ex->getMessage());\n $logs->setObjeto(print_r($empresa_persona,true));\n $logs->setDate(Date('Y-m-d H:i:s'));\n $sqlLogs->Save($logs);\n $sqlPersona->delete($persona);\n $sqlUsuario->delete($usuario);\n }\n return null;\n /*if($sqlEmpresaPersona->setGuardarEmpresaPersona($empresa_persona)){\n return $persona->getId_persona().','.$usuario->getClave().','.$campousuario.','.$persona->getEmail();\n }else return null;*/\n }", "public function validarCargo() {\n if (!$this->getTexto('cargo')) {\n $this->_view->assign('_error', 'Debe introducir la descripcion del cargo');\n $this->_view->renderizar('nuevo_cargo', 'acl');\n exit;\n }\n }", "function listarRegistrosGruposAtivos() {\n\t\treturn $this->listarRegistrosGrupos(array(\"gu_status_registro = 'A' \"));\n\t}", "function maquetador_genera($plantilla, $controladorDefecto=false, $accionDefecto=false) {\n global $aEstado ;\n \n $pendientes = false;\n\n\t // precarga de modulos\n\t if ( !is_array($aEstado) ){ \n\t maquetador_evaluar_estado($controladorDefecto, $accionDefecto);\t \n\t }\n\t \n\t if ( !isset($aEstado[\"modulos\"]) ){\n\t maquetador_precarga_modulos();\n\t }\n\n // leer la plantilla\n if ( !file_exists($plantilla) ) {\n echo t(\"No exista la plantilla: [$plantilla]\");\n return false; \n }\n $html = maquetador_insertar_include ( $plantilla ); \n $aGenerar = maquetador_extraer_marcas ( $html );\n\n foreach ( $aGenerar as $marca=>$contenido ) {\n $aDatos = maquetador_extrae_modulo ( $marca );\n\n // averiguar el modulo\n if ( $aDatos[\"modulo\"] == \"contenido\") {\n $modulo = $aEstado[\"controlador\"];\n $aDatos[\"accion\"]= ( $aDatos[\"accion\"]=='' ? $aEstado[\"accion\"] : $aDatos['accion']);\n $aDatos[\"id\"] = ( $aDatos[\"id\"] =='' ? $aEstado[\"id\"] : $aDatos['id']);\n } elseif ($aDatos[\"modulo\"]==\"maquetador\") {\n $pendientes[$marca] = $aDatos[\"accion\"];\n continue;\n } else {\n $modulo = $aDatos[\"modulo\"];\n }\n\n // comprobamos que el modulo es correcto\n if ( $modulo == \"t\") {\n $aGenerar[$marca] = t($aDatos[\"accion\"]);\n } else {\n // ver si es un modulo\n if ( $modulo!=\"PUT\" and $modulo!=\"PHP\" and !isset( $aEstado[\"modulos\"][$modulo]) ) {\n $aGenerar[$marca] = \"controlador desconocido: $modulo\";\n } else {\n // si inserta el modulo si cumple la condición\n if ( $aDatos['condicional']==\"\" or maquetador_evalua ( $aDatos['condicional'])) {\n // hay que mostrar el modulo\n switch ( $modulo ) {\n case \"PUT\":\n $aGenerar[$marca] = $aDatos[\"accion\"];\n break;\n case \"PHP\":\n $aGenerar[$marca] = eval(\"return \" . $aDatos[\"accion\"]. \";\" ) ;\n break;\n\n default:\n if ( $aEstado[\"modulos\"][$modulo]) {\n include_once $aEstado[\"modulos\"][$modulo];\n $aEstado[\"modulos\"][$modulo]= false;\n }\n $aGenerar[$marca] = $modulo( $aDatos[\"accion\"], $aDatos[\"id\"] ) ;\n }\n }\n }\n } // else T\n } // for\n\n if ( $pendientes ) {\n foreach ( $pendientes as $k=>$accion) {\n $aGenerar[$k] = maquetador_script(\"genera\", $accion );\n }\n }\n \n // ahorita solo queda calcular e imprimir el resultado \n echo strtr ( $html, $aGenerar );\n\n}", "function desplegarCampo(Detallesmantenimientosdetablas $detalle,$numeroGrid,$sinValorPorDefecto=false){\n $size=$detalle->getTamanoCampo();\n $max=$detalle->getTamanoMaximoCampo();\n $javascript=$detalle->getJavascriptDesdeCampo();\n $valorPorDefecto=trim(obtenerValorPorDefecto($detalle));\n if($sinValorPorDefecto!=false){\n $valorPorDefecto=$ValorPorDefecto;\n }\n $id=$detalle->getIdCampo();\n $tipo=$detalle->getIdTipoCampo();\n $requerido=$detalle->getNulidadCampo();\n $accion=strtoupper($detalle->getAccionCampo());\n\n $ayuda=$detalle->getDescripcionCampo();\n\n if ($tipo == 14) { //Si es tipo Separador de Campos\n Campos::columnaGrid($numeroGrid);\n echo \"<center><strong>\" . $detalle->getNombreCampo() . \"</strong></center>\";\n Campos::finColumnaGrid();\n return;\n } else {\n Campos::columnaGrid($numeroGrid);\n echo $detalle->getNombreCampo();\n C::finColumnaGrid();\n }\n\n Campos::columnaGrid($numeroGrid);\n\n/*\n 1\tFecha\n 2\tFecha Hora\n 3\tHora\n 4\tArchivo\n 5\tNumerico\n 6\tMoneda\n 7\tCaracteres\n 8\tTexto\n 9\tTabla Extranjera\n 10\tBoton de Cheque\n 11\tBotones de Opcion Múltiple PENDIENTE\n 12\tFALSO\n 13\tLista Desplegable\n 14\tAgrupador de Campos\n 15\tSeparador De Campos Oculto PENDIENTE\n 16\tFinalizacion del Separador PENDIENTE\n 17\tTabla PENDIENTE\n 18\tBoton PENDIENTE\n 19\tRuta de archivo PENDIENTE\n 20 Editor HTML PopUp\n */\n\n\n //Aqui empieza la captura...\n if($tipo==1){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n if(trim($valorPorDefecto)==\"\"){\n $valorPorDefecto=null;\n }\n C::texto($id,$valorPorDefecto,10,10,\" READONLY \");\n }else if($tipo==2){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n C::texto($id,$valorPorDefecto,15,15,\" READONLY \");\n }else if($tipo==3){\n C::texto($id,$valorPorDefecto,10,10,\" READONLY \");\n }else if($tipo==5){\n C::entero($id,$valorPorDefecto,$size,$max,$javascript.\" READONLY \");\n }else if($tipo==6){\n C::flotante($id,$valorPorDefecto,$size,$max,$javascript.\" READONLY \");\n }else if($tipo==7){\n C::texto($id,$valorPorDefecto,$size,$max,$javascript.\" READONLY \");\n }else if($tipo==8){\n $filas=$detalle->getAltoCampo();\n C::textArea($id,$valorPorDefecto,$filas,$size,$javascript.\" READONLY \");\n }else if($tipo==9){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id.\"selectDisabled\", $rsT, $valorPorDefecto,\" DISABLED \");\n C::oculto($id,$valorPorDefecto);\n }else if($tipo==10){\n $chequeado=false;\n if($valorPorDefecto==1){\n $chequeado=true;\n }\n C::chequeSiNo($id,'',$chequeado,1,\" DISABLED \");\n } else if($tipo==12){\n C::texto($id, $valorPorDefecto, $size, $max, $javascript.\" READONLY\");\n }else if($tipo==13){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id.\"selectDisabled\", $rsT, $valorPorDefecto,\" DISABLED \");\n C::oculto($id,$valorPorDefecto);\n }else if($tipo==20){\n C::editorHTMLPopUp($id, $valorPorDefecto, $detalle->getNombreCampo());\n }else if($tipo==26){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSetConBusqueda($id, $rsT, $valorPorDefecto);\n }else if($tipo==27){\n $chequeado=false;\n if($valorPorDefecto=='A'){\n $chequeado=true;\n }\n C::chequeActivo($id,'',$chequeado);\n }else if($tipo==28){\n C::textoConMascara($id,$detalle->getQueryFiltro());\n }else if($tipo==29){\n C::selectCatalogoId($id,$detalle->getCatalogoId(), $valorPorDefecto);\n }\n\n C::finColumnaGrid();\n}", "function comprobar_nombre()\n\t{\n\t$correcto = true; //variable booleana que comprueba si el atributo cuumple o no lo especificado\n\n\t//si los atributos estan vacios\n\tif (strlen($this->nombre) == 0)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"nombre\", \"codigoincidencia\" => \"00001\" ,\"mensajeerror\" => \"nombre vacio\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\tif (strlen($this->nombre) < 3)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"nombre\", \"codigoincidencia\" => \"00003\" ,\"mensajeerror\" => \"Valor de atributo no numérico demasiado corto\"]);\n\n\t\t$correcto = false;\n\t}\n\n\t//si los atributos estan vacios\n\tif (strlen($this->nombre) > 31)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"nombre\", \"codigoincidencia\" => \"00002\" ,\"mensajeerror\" => \"nombre demasiado largo, maximo 10 caracteres\"]);\n\n\t\t$correcto = false;\t\t}\n\n\t//si los atributos son alfabeticos\n\tif (ctype_alpha($this->nombre))\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"nombre\", \"codigoincidencia\" => \"00003\" ,\"mensajeerror\" => \"nombre no valido, solo se admiten caracteres\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\treturn $correcto;\n}", "public function __construct($nombre,$apellido,$tipo,$nombreUsuario,$contrasena)\r\n {\r\n $this->nombre = $nombre;\r\n $this->apellido = $apellido;\r\n $this->tipo = $tipo;\r\n $this->nombreUsuario = $nombreUsuario;\r\n $this->contrasena = $contrasena;\r\n }", "function formulaires_recommander_charger_dist(){\n\t$valeurs = array('destinataire'=>'','destinataires'=>'','texte'=>'');\n\n\treturn $valeurs;\n}", "function index() {\n global $autorias;\n global $autores;\n global $livros;\n $autorias = buscarRegistros('tab_autorias');\n $autores = buscarRegistros('tab_autor');\n $livros = buscarRegistros('tab_livro');\n }", "function generarOrden($arreglo){\n $nomEstadoItemOK = $this->datos->traerIdEstadoItemOK();\n $idEstadoEnUso = $this->datos->traerIdEstadoUso();\n $idEstadoOfertado = $this->datos->traerIdEstadoOferProd();\n $idEstadoOfertaEco = $this->datos->traerIdEstadoOferOK();\n \n //ACTUALIZO ESTADO ITEM OFERTA OK\n $this->datos->actualizaEstadoItemOK($arreglo[\"idOfe\"],$nomEstadoItemOK->nomEstado);\n \n //ACTUALIZO ESTADO OFERTA\n $this->datos->actualizaEstadoOfertaCom($arreglo[\"idOfe\"],$idEstadoOfertaEco->idEstadoOfOk);\n $ofertaEconomica = $this->datos->datosOfertaEconomica($arreglo[\"idOfe\"]);\n \n $idDetProductoOfertado = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoOfertado->idEstadoOferProd);\n \n \n /* \n $idDetProductoEnUso = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoOfertado->idEstadoOferProd);\n \n \n //ACTUALIZO ESTADO PRODUCTO\n foreach ($idDetProductoEnUso as $key => $valueProdOrden) {\n \n $this->datos->actualizaCantidadDetProd($valueProdOrden[\"idDetalle\"],$idEstadoEnUso->idEnUso);\n }\n \n $idDetProducto = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoEnUso->idEnUso);*/\n \n //INSERTO ENCABEZADO \n $idOrdenCompra = $this->datos->insertarOrdenCompra($ofertaEconomica,$arreglo[\"idOfe\"]);\n \n //INSERTO DETALLE\n foreach ($idDetProductoOfertado as $key => $valueDetOfe) {\n \n $this->datos->insertarOrdenDes($valueDetOfe[\"idDetalle\"],$idOrdenCompra);\n \n }\n \n $this->mostrarOfertaEconomica($arreglo);\n \n }", "function validar_atributos_edit()\n {\n $nomberExito = $this->validar_Nombre();\n $fechaExito = $this->validar_Fecha();\n $validadoExito = $this->validar_Validado();\n\n if (is_array($nomberExito)) {\n return $this->feedback;\n }\n if (is_array($fechaExito)) {\n return $this->feedback;\n }\n if (is_array($validadoExito)) {\n return $this->feedback;\n }\n\n return true;\n }", "function guardar_receta($objeto){\n\t// Anti hack\n\t\tforeach ($objeto as $key => $value) {\n\t\t\t$datos[$key]=$this->escapalog($value);\n\t\t}\n\n\t// Guarda la receta y regresa el ID\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tcom_recetas\n\t\t\t\t\t\t(id, nombre, precio, ganancia, ids_insumos, ids_insumos_preparados, preparacion)\n\t\t\t\tVALUES\n\t\t\t\t\t(\".$datos['id_receta'].\", '\".$datos['nombre'].\"',\".$datos['precio_venta'].\",\n\t\t\t\t\t\t\".$datos['margen_ganancia'].\",\n\t\t\t\t\t\t'\".$datos['ids'].\"','\".$datos['ids_preparados'].\"','\".$datos['preparacion'].\"'\n\t\t\t\t\t)\";\n\t\t// return $sql;\n\t\t$result =$this->insert_id($sql);\n\n\t// Guarda la actividad\n\t\t$fecha=date('Y-m-d H:i:s');\n\n\t\t$texto = ($datos['tipo']==1) ? 'receta' : 'insumo preparado' ;\n\t// Valida que exista el empleado si no agrega un cero como id\n\t\t$usuario = (!empty($_SESSION['accelog_idempleado'])) ?$_SESSION['accelog_idempleado'] : 0 ;\n\t\t$sql=\"\tINSERT INTO\n\t\t\t\t\tcom_actividades\n\t\t\t\t\t\t(id, empleado, accion, fecha)\n\t\t\t\tVALUES\n\t\t\t\t\t('',\".$usuario.\",'Agrega \".$texto.\"', '\".$fecha.\"')\";\n\t\t$actividad=$this->query($sql);\n\n\t\treturn $result;\n\t}", "function recuperarDatos(){\r\n\t\t\t\t$this->objFunc=$this->create('MODEmpresa');\r\n\t\t\t\t$objetoFuncion = $this->create('MODEmpresa');\r\n\t\t\t\t$this->res=$this->objFunc->insertarEmpresa($this->objParam);\t//esta bien\t\t\t\r\n\t\t\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\t\t}", "private function f_ListarValidado(){\n $lobj_AccesoZona = new cls_AccesoZona;\n //creo la peticion\n $pet = array(\n 'operacion' => 'buscarZonas',\n 'codigo_usuario' => $_SESSION['Con']['Nombre']\n );\n //guardo los datos en el objeto y gestiono para obtener una respuesta\n $lobj_AccesoZona->setPeticion($pet);\n $zona = $lobj_AccesoZona->gestionar();\n $cadenaBusqueda = ' where codigo_zona in(';\n if($zona['success'] == 1){\n for($x = 0;$x < count($zona['registros']) - 1; $x++){\n $cadenaBusqueda .= $zona['registros'][$x].',';\n }\n $cadenaBusqueda .= $zona['registros'][count($zona['registros']) - 1].' ';\n }\n $cadenaBusqueda .= \") \";\n $cadenaBusqueda .= ($this->aa_Atributos['valor']=='')?'':\"and nombre_finca like '%\".$this->aa_Atributos['valor'].\"%'\";\n $ls_SqlBase=\"SELECT * FROM agronomia.vfinca $cadenaBusqueda\";\n $orden = ' order by codigo_productor,letra';\n $ls_Sql = $this->f_ArmarPaginacion($ls_SqlBase,$orden);\n $x=0;\n $la_respuesta=array();\n $this->f_Con();\n $lr_tabla=$this->f_Filtro($ls_Sql);\n while($la_registros=$this->f_Arreglo($lr_tabla)){\n $la_respuesta[$x]['codigo']=$la_registros['codigo_productor'];\n $la_respuesta[$x]['nombre']=$la_registros['codigo_productor'].'-'.$la_registros['letra'];\n $la_respuesta[$x]['id_finca']=$la_registros['id_finca'];\n $x++;\n }\n $this->f_Cierra($lr_tabla);\n $this->f_Des();\n $this->aa_Atributos['registros'] = $la_respuesta;\n $lb_Enc=($x == 0)?false:true;\n return $lb_Enc;\n }", "function fct_titre_page ($mescriteres) {\n\t$titre_page = \"\";\n\tforeach ($mescriteres as $ref => $infoscritere) {\n\t\tif (($infoscritere['code'] >= 0) && ($infoscritere['libelle'] != \"\")) {\n\t\t\tif ($titre_page != \"\") $titre_page .= \", \";\n\t\t\t$titre_page .= $infoscritere['libelle'];\n\t\t}\n\t}\n\tif ($titre_page == \"\") $titre_page = \"Un expert vous aide Ó identifier un arbre\";\n\telse $titre_page = \"Fleurs correspondant Ó : \".$titre_page;\n\treturn $titre_page;\n}", "function cl_aguacoletorexporta() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacoletorexporta\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function RegistrarNotasAnticipo($tipoCambioFac = 0,$montoAnticipo=0,$tagref, $monedaFactura, $fechaemision, $DebtorNo, $DebtorTransIDFactura, $tieneIVA,$idAnticipo,$ivaFactura, $db, $puntoVenta = 0, $nocuentaPuntoVenta = '', $nomClientePuntoVenta = ''){\n // *********************************************** //\n // ********************************************** //\n // ******** No dejar echo en la funcion *********//\n // ******** Declarar Variables a usar ******** //\n // ******** Afecta al punto de venta ********* //\n // ****************************************** //\n // ***************************************** //\n \n //global $db;\n $systype_doc = 13;\n /*$tipocambio = $_SESSION['Items' . $identifier]->CurrencyRate;\n $montoAnticipo = $LineAnticipo->Monto;\n $moneda = $_SESSION['Items' . $identifier]->CurrAbrev;\n $fecha = split(\"-\", $fechaemision) ;\n $DebtorNo = $_SESSION['Items' . $identifier]->DebtorNo;\n $tagref = $_SESSION['Items' . $identifier]->Tagref;\n $tieneIVA = $tieneIVA;\n $idAnticipo = $LineAnticipo->TransID;*/\n\n //echo \"<br> AnticipoIVA: \".$tieneIVA;\n $tipocambio = $tipoCambioFac;\n $montoAnticipo = $montoAnticipo;\n $monto = $montoAnticipo;\n $moneda = $monedaFactura;\n $fecha = explode(\"-\", $fechaemision) ;\n $DebtorNo = $DebtorNo;\n $tagref = $tagref;\n $tieneIVA = $tieneIVA;\n $idAnticipo = $idAnticipo;\n $ErrMsg = '';\n $DbgMsg = '';\n\n $InputError = 0;\n\n $FromDia = $fecha [2];\n $FromMes = $fecha [1];\n $FromYear = $fecha [0];\n $_POST['aplparcial'] = 2; // PARA TIMBRAR\n $_POST['cmbUsoCfdi'] = 'G02'; \n $_POST['cmbTipoComprobante'] = 'E';\n $_POST['cmbMetodoPago'] = 'PUE';\n $_POST['cmbTipoRelacion'] = '07';\n $_POST['paymentname'] = 'Aplicacion de anticipos';\n $vrcodepay = utf8_decode('Aplicacion de anticipos');\n $concepto = utf8_decode('Aplicacion de anticipos'); \n $vrcodeasat = '30';\n //$idSaldoAnticipo = $LineAnticipo->TransID;\n $DebtorTransID = $DebtorTransIDFactura ;\n\n $SQLDatosFactura= \"SELECT debtortrans.*, name FROM debtortrans\n INNER JOIN debtorsmaster ON debtortrans.debtorno = debtorsmaster.debtorno\n WHERE id =\" .$DebtorTransIDFactura;\n $resultFactura = DB_query($SQLDatosFactura, $db);\n $myrowFactura = DB_fetch_array($resultFactura);\n $TotalFactura = $myrowFactura['ovamount'] + $myrowFactura['ovgst'];\n $typeFactura = $myrowFactura['type'];\n $nombrecliente= $myrowFactura['name'];\n \n\n //echo \"<br> Tipo cambio BIEN\".$tipoCambioFacBIEN;\n\n $_POST ['TaxCat'] = 2;\n if($tieneIVA == '1'){\n $_POST ['TaxCat'] = 4;\n }\n\n $nocuenta = '';\n if ($puntoVenta == 1) {\n $nocuenta = $nocuentaPuntoVenta;\n } else {\n if (isset($_POST ['nocuenta'])) {\n $nocuenta = $_POST ['nocuenta'];\n }\n }\n\n $nomCliente = '';\n if ($puntoVenta == 1) {\n $nomCliente = $nomClientePuntoVenta;\n } else {\n if (isset($nombrecliente)) {\n $nomCliente = $nombrecliente;\n }\n }\n\n $_POST ['nocuenta'] = $nocuenta;\n\n $nombrecliente = $nomCliente;\n\n $SQLSaldoANT = \"SELECT debtortrans.*, bien.rate as cambiobien FROM debtortrans \n INNER JOIN debtortrans bien ON bien.id = debtortrans.ref1\n WHERE debtortrans.id ='\".$idAnticipo.\"'\"; \n\n //echo \"<br> saldo\".$SQLSaldoANT;\n $resultSaldoANT = DB_query($SQLSaldoANT, $db);\n $rowSaldoANT = DB_fetch_array($resultSaldoANT);\n $monedaSaldoANT = $rowSaldoANT['currcode'];\n $rateSaldoANT = $rowSaldoANT['rate'];\n $ivaSaldoANT = $rowSaldoANT['ovgst'];\n $tipoCambioFacBIEN= $rowSaldoANT['cambiobien'];\n \n\n //echo \"<br> Pruebas: \".$rowSaldoANT;\n //echo \"<br> saldo ANt: \".$rateSaldoANT;\n if ($InputError != 1) {\n $Result = DB_Txn_Begin($db);\n \n // Obtiene el trans no que le corsesponde en base al tagref y al $systype_doc\n $transno = GetNextTransNo($systype_doc, $db);\n \n $taxrate = 0;\n $montoiva = 0;\n $rate = ( $tipocambio);\n $DefaultDispatchDate = $FromDia . '/' . $FromMes . '/' . $FromYear;\n $fechaini = rtrim($FromYear) . '-' . rtrim($FromMes) . '-' . rtrim($FromDia);\n $diae = rtrim($FromDia);\n $mese = rtrim($FromMes);\n $anioe = rtrim($FromYear);\n $horax = date('H:i:s');\n $horax = strtotime($horax);\n $hora = date('H');\n $minuto = date('i');\n $segundo = date('s');\n $fechainic = mktime($hora, $minuto, $segundo, rtrim($mese), rtrim($diae), rtrim($anioe));\n $fechaemision = date(\"Y-m-d H:i:s\", $fechainic);\n $PeriodNo = GetPeriod($DefaultDispatchDate, $db, $tagref);\n $DefaultDispatchDate = FormatDateForSQL($DefaultDispatchDate);\n \n if (isset($_POST ['TaxCat']) and $_POST ['TaxCat'] != \"\") {\n $sqliva = \"SELECT taxrate,taxglcode,taxglcodepaid\n FROM taxauthrates, taxauthorities\n WHERE taxauthrates.taxauthority=taxauthorities.taxid\n AND taxauthrates.taxcatid =\" . $_POST ['TaxCat'];\n\n //echo \"<br> SQL IVA\".$sqliva;\n\n $result = DB_query($sqliva, $db);\n $myrow = DB_fetch_row($result);\n $taxrate = $myrow [0];\n $taxglcode = $myrow [1];\n $taxglcodepaid = $myrow [2];\n }\n\n // calcula iva y desglosa de iva\n // $montosiniva = $monto / (1 + $taxrate);\n // $montoiva = $monto - $montosiniva;\n\n $mntIVA = 0;\n if (isset($_POST['mntIVA'])) {\n $mntIVA = $_POST['mntIVA'];\n }\n\n // calcula iva y desglosa de iva\n if (($mntIVA == 0 || empty($mntIVA))) {\n //Iva del categoria impuestos\n $montosiniva = $monto / (1 + $taxrate);\n $montoiva = $monto - $montosiniva;\n }else{\n //Iva agregado manual\n $_SESSION['IvaManualAbonoDirectoClientes'] = 1;\n //\n $montosiniva = $monto - $mntIVA;\n //$montosiniva = $monto;\n $montoiva = $mntIVA;\n } \n // se valida ya que debe de acuerdo al iva de l factura\n //echo \"<br> ivaFactura2: \".$ivaFactura;\n if( (Round($TotalFactura,2) - Round($monto,2) < -.01) AND $tieneIVA ==1 AND $ivaFactura == 0){\n $monto = $montosiniva;\n $montoiva = $montosiniva - ($montosiniva/1.16);\n $montosiniva = ($montosiniva/1.16);\n $montoAnticipo = $monto;\n }\n \n // Datos del Periodo y fecha ***\n // $DefaultDispatchDate=Date($_SESSION['DefaultDateFormat'],CalcEarliestDispatchDate());\n // $PeriodNo = GetPeriod($DefaultDispatchDate, $db);\n \n // $DefaultDispatchDate = FormatDateForSQL($DefaultDispatchDate);\n // *****************************\n if ($_SESSION['MostrarCuentaNC']=='1') {\n $SQL=\"SELECT accountcode,\n concept AS accountname\n FROM chartbridge\n WHERE accountcode='\".$_POST['GLCode'].\"'\n ORDER BY accountcode\";\n $ResultR=DB_query($SQL, $db);\n $rowR=DB_fetch_array($ResultR);\n $concepto.=' '.$rowR['accountname'];\n }\n // Realiza el insert en la tabla de debtortrans\n $SQL = \"INSERT INTO debtortrans (`tagref`,\n `transno`,`type`,\n `debtorno`,`branchcode`,\n `origtrandate`,`trandate`,`prd`,\n `settled`,`reference`,`tpe`,`order_`,\n `rate`,`ovamount`,`ovgst`,`ovfreight`,\n `ovdiscount`,`diffonexch`,`alloc`,`invtext`,\n `shipvia`,`edisent`,`consignment`,`folio`,`ref1`,`ref2`,`currcode`,paymentname,nocuenta,userid)\";\n $SQL .= \" VALUES (\" . $tagref . \",\n \" . $transno . \",\" . $systype_doc . \",\n '\" . $DebtorNo . \"', '\" . $DebtorNo . \"','\" . $fechaemision . \"','\" . $fechaini . \"',\" . $PeriodNo . \",'0','\" . $concepto . \"', '','0','\" . $rate . \"',\" . ($montosiniva * - 1) . \",\" . ($montoiva * - 1) . \",'0','0','0','0','','1','0','', 'FANT','NCR','NCR','\" . $moneda . \"','\" . $_POST ['paymentname'] . \"','\" . $_POST ['nocuenta'] . \"','\".$_SESSION['UserID'].\"')\";\n // echo '<pre>sql NC:'.$SQL;\n $result = DB_query($SQL, $db);\n \n $DebtorTransIDND = DB_Last_Insert_ID($db, 'debtortrans', 'id');\n\n // ***************************************************************************************************\n // **** CFDI Relacionados ****\n // ***************************************************************************************************\n // \n //******************GENERAR NOTA DE CARGO Y SE HACE LA APLICACION YA QUE ES SIN CONTABILIDAD****************** \n $systype_docN = 21;\n $transnoN = GetNextTransNo($systype_docN, $db); \n $SQLN = \"INSERT INTO debtortrans (`tagref`,\n `transno`,`type`,\n `debtorno`,`branchcode`,\n `origtrandate`,`trandate`,`prd`,\n `settled`,`reference`,`tpe`,`order_`,\n `rate`,`ovamount`,`ovgst`,`ovfreight`,\n `ovdiscount`,`diffonexch`,`alloc`,`invtext`,\n `shipvia`,`edisent`,`consignment`,`folio`,`ref1`,`ref2`,`currcode`,paymentname,nocuenta,userid)\";\n $SQLN .= \" VALUES (\" . $tagref . \",\n \" . $transnoN . \",\" . $systype_docN . \",\n '\" . $DebtorNo . \"', '\" . $DebtorNo . \"','\" . $fechaemision . \"','\" . $fechaini . \"',\" . $PeriodNo . \",'0','\" . $concepto . \"', '','0','\" . $rateSaldoANT . \"',\" . ($montosiniva) . \",\" . ($montoiva) . \",'0','0','0','0','','1','0','', 'FANT','NCR','NCR','\" . $moneda . \"','\" . $_POST['paymentname'] . \"','\" . $_POST ['nocuenta'] . \"','\".$_SESSION['UserID'].\"')\";\n //echo '<pre>sql NC:'.$SQLN;\n $result = DB_query($SQLN, $db);\n $DebtorTransIDCargo = DB_Last_Insert_ID($db, 'debtortrans', 'id');\n\n $ISQL = \"INSERT INTO custallocns (datealloc,transid_allocfrom,amt,transid_allocto, rate_to,currcode_to, rate_from, currcode_from)\n VALUES ( NOW(),\" . $idAnticipo . ',' . abs($montoAnticipo) . ',' . $DebtorTransIDCargo . ',\"'.$tipocambio.'\", \"'.$moneda.'\", \"'.$rate.'\", \"'.$moneda.'\" )';\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n\n $ISQL = \"UPDATE debtortrans SET alloc = alloc + \".($montoAnticipo * -1 ).\" WHERE id = '\".$idAnticipo.\"' \" ;\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n\n\n $ISQL = \"UPDATE debtortrans SET alloc = alloc + \".abs($montoAnticipo).\", settled=1 WHERE id = '\".$DebtorTransIDCargo.\"' \" ;\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n\n //********************GENERAR NOTA DE CARGO Y SE HACE LA APLICACION YA QUE ES SIN CONTABILIDAD********************\n $percentDescription=\"\";\n if ($_SESSION['FacturaVersion']==\"3.3\") {\n\n $queryInsert=\"INSERT INTO notesorders_invoice(transid,transid_relacion,monto, tiporelacion_relacion, trandate)\";\n $queryInsert.=\" VALUES ('\".$DebtorTransIDND.\"','\".$DebtorTransID.\"',\".str_replace(\",\", \"\", $monto ).\", '\".$_POST['cmbTipoRelacion'].\"', NOW())\";\n\n\n // echo \" Consulta: <br> notesordes: \".$queryInsert;\n $result = DB_query($queryInsert, $db);\n\n // SE HACE LA RELACION DE FACTURA CON NOTA DE CREDITO\n $ISQL = \"INSERT INTO custallocns (datealloc,transid_allocfrom,amt,transid_allocto, rate_to,currcode_to, rate_from, currcode_from )\n VALUES (NOW(),\" . $DebtorTransIDND . ',' . abs($monto ) . ',' . $DebtorTransID . ', \"'.$tipocambio.'\", \"'.$moneda.'\", \"'.$rate.'\", \"'.$moneda.'\")';\n //echo \"<br> PRUEBAS: \".$ISQL;\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n\n $ISQL = \"UPDATE debtortrans SET alloc = alloc + \". (abs($monto ) * -1 ).\", settled=1 WHERE id = '\".$DebtorTransIDND.\"' \" ;\n //echo \"<br> PRUEBAS: \".$ISQL;\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n $ISQL = \"UPDATE debtortrans SET alloc = alloc + \".abs($monto).\" WHERE id = '\".$DebtorTransID.\"' \" ;\n //echo \"<br> PRUEBAS: \".$ISQL;\n $Result = DB_query($ISQL, $db, $ErrMsg, $DbgMsg, true);\n // SE HACE LA RELACION DE FACTURA CON NOTA DE CREDITO\n \n \n if ($result && 1 == 2) {\n $banderaEx = 0;\n if ($banderaEx > 0) {\n while ($rse = DB_fetch_array($rrr)) {\n $queryFolio=\"SELECT REPLACE(folio,'|','') as folio FROM debtortrans WHERE id = '\".$rse['transid_relacion'].\"'\";\n $resultFolio = DB_query($queryFolio, $db);\n $myrowFolio = DB_fetch_array($resultFolio);\n $percentDescription .= \", aplicado al folio: \" .$myrowFolio['folio'] ;// \", \" . number_format((($rse['monto']/$monto) * 100), '0', '.', '') .\" % al saldo del folio: \" .$myrowFolio['folio'] ;\n }\n } else {\n $queryFolio=\"SELECT REPLACE(folio,'|','') as folio FROM debtortrans WHERE id = '\".$_POST['InvoiceTransId_'.$index].\"'\";\n $resultFolio = DB_query($queryFolio, $db);\n $myrowFolio = DB_fetch_array($resultFolio);\n $percentDescription .= \", aplicado al folio: \" .$myrowFolio['folio'] ;//$percentDescription .= \", \" . number_format((( str_replace(\",\", \"\", $_POST['InvoiceAmount_'.$index])/$monto) * 100), '0', '.', '') .\" % al saldo del folio: \" .$myrowFolio['folio'] ;\n }\n }\n //SE CREA INSERT PARA REGISTRAR LA RELACION DE LA FACTURA CON EL ANTICIPO\n $SQLAnt = \"UPDATE salesinvoiceadvance SET transidncredito = '\".$DebtorTransIDND.\"' , montoncredito = '\".str_replace(\",\", \"\", $monto).\"', transidncargo = '\".$DebtorTransIDCargo.\"' WHERE transidinvoice = '\".$DebtorTransID.\"' AND transidanticipo = '\".$idAnticipo.\"';\";\n $resultado = DB_query($SQLAnt, $db);\n\n //SE CREA INSERT PARA REGISTRAR LA RELACION DE LA FACTURA CON EL ANTICIPO\n\n $querySelect=\"select notesorders_invoice.transid_relacion,(abs(notesorders_invoice.monto)) AS ovamount ,codesat,c_paymentid,paymentname\n from notesorders_invoice\n left join debtortrans on notesorders_invoice.transid_relacion = debtortrans.id\n where notesorders_invoice.transid='\".$DebtorTransIDND.\"'\n order by notesorders_invoice.monto desc limit 1;\";\n $resultSelect = DB_query($querySelect, $db);\n\n if (DB_num_rows($resultSelect)) {\n $myrowResult=DB_fetch_array($resultSelect);\n\n if ($myrowResult['codesat']==null or $myrowResult['codesat']=='') {\n $queryGetCod=\"SELECT debtortrans.paymentname, paymentmethods.codesat\n FROM debtortrans \n INNER JOIN paymentmethods ON paymentmethods.paymentname= debtortrans.paymentname\n WHERE id='\".$myrowResult['transid_relacion'].\"'\n LIMIT 1\";\n $resultGetc = DB_query($queryGetCod, $db);\n if (DB_num_rows($resultGetc)) {\n $myrowGet=DB_fetch_array($resultGetc);\n\n //$vrcodeasat=$myrowGet['codesat'];\n //$vrcodepay=$myrowGet['paymentname'];\n }\n if ($_SESSION['UserID'] == 'desarrollo') {\n //echo '<pre> paymentname:'.$queryGetCod;\n //echo htmlentities($arrayGeneracion['xml']);\n }\n } else {\n //$vrcodeasat=$myrowResult['codesat'];\n //$vrcodepay=$myrowResult['paymentname'];\n }\n\n $vrcodepayid= $_POST['cmbMetodoPago'];\n \n \n $percentDescription = \"\"; // se deja vacio ya que la descripción solo permite 1000 caracteres, si no se timbra, se agrega solo en PDF\n\n $queryUpdate=\"UPDATE debtortrans SET paymentname='\".$vrcodepay.\"',codesat='\".$vrcodeasat.\"',c_TipoDeComprobante='E',c_paymentid='\".$vrcodepayid.\"',c_UsoCFDI='\".$_POST['cmbUsoCfdi'] .\"',invtext=concat(invtext,' ', '\".$percentDescription.\"') WHERE id='\".$DebtorTransIDND.\"'\";\n //echo \"<br>sqlUpdate:<pre>\".$queryUpdate;\n\n $result = DB_query($queryUpdate, $db);\n } else {\n $percentDescription = \"\"; // se deja vacio ya que la descripción solo permite 1000 caracteres, si no se timbra, se agrega solo en PDF\n\n $queryUpdate=\"UPDATE debtortrans SET paymentname='\".$_POST['paymentname'].\"',codesat='\".$vrcodeasat.\"',c_TipoDeComprobante='E',c_paymentid='\".$_POST['cmbMetodoPago'].\"',c_UsoCFDI='\".$_POST['cmbUsoCfdi'] .\"',invtext=concat(invtext,' ', '\".$percentDescription.\"') WHERE id='\".$DebtorTransIDND.\"'\";\n //echo \"<br>sqlUpdate:<pre>\".$queryUpdate;\n\n $result = DB_query($queryUpdate, $db);\n }\n }\n \n \n // ***************************************************************************************************\n // **** AFECTACIONES CONTABLES ****\n // ***************************************************************************************************\n $rmontosiniva = ($montosiniva / $rate);\n $rmontosinivaANT = ($montosiniva / $tipoCambioFacBIEN);\n $rmontoiva = ($montoiva / $rate);\n $rmontoivaP = ($montoiva / $rateSaldoANT);\n $rmonto = ($monto / $rate);\n\n /*echo \"<br> MONTO; TOTAL total: \".$monto.\" \".$rate.\" \".($monto/$rate);\n echo \"<br> MONTO; TOTAL montoiva : \".$montoiva.\" \".$rateSaldoANT.\" \".($montoiva/$rateSaldoANT);\n echo \"<br> MONTO; TOTAL MONTO SIN IVA : \".$montosiniva.\" \".$rate.\" \".($montosiniva/$rate);\n echo \"<br> MONTO; TOTAL MONTO SIN IVA tipoCambioFacBIEN : \".$montosiniva.\" \".$tipoCambioFacBIEN.\" \".($montosiniva/$tipoCambioFacBIEN);*/\n //$montoiva = $ivaNotaCredito/$rate;\n //$rmonto = $montoNotaCredito/$rate;\n \n // Obtiene la cuentas contables que se afectaran\n // *****************************************\n // Se afecta la cuenta de CxC\n // *****************************************\n // $cuenta_cxc=$_SESSION['CompanyRecord']['debtorsact'];\n $SQLClient = \"SELECT typeid FROM debtorsmaster WHERE debtorno='\" . $DebtorNo . \"'\";\n $result_typeclient = DB_query($SQLClient, $db, $ErrMsg, $DbgMsg, true);\n \n if (DB_num_rows($result_typeclient) == 1) {\n $myrowtype = DB_fetch_array($result_typeclient);\n $tipocliente = $myrowtype ['typeid'];\n }\n \n if ($typeFactura == 110 ) {\n \n $cuenta_cxc = ClientAccount($tipocliente, 'gl_accountcontado', $db);\n }else{\n $cuenta_cxc = ClientAccount($tipocliente, 'gl_accountsreceivable', $db);\n }\n\n \n\n $diferenciCambiariaTotal = 0;\n $diferenciCambiariaIVA = 0;\n if($monedaSaldoANT== $moneda aND $moneda!=$_SESSION ['CountryOfOperation'] ){\n\n $diferenciCambiaria=Round( abs((str_replace(\",\", \"\", $montosiniva)/$tipoCambioFacBIEN)) - (str_replace(\",\", \"\", $montosiniva)/$rate),8) ;\n\n $diferenciCambiariaIVA =Round( abs($montosiniva) /$rateSaldoANT - (str_replace(\",\", \"\", $montosiniva)/$rate),8) ;\n }elseif($monedaSaldoANT!=$_SESSION ['CountryOfOperation'] AND $moneda!=$_SESSION ['CountryOfOperation']){\n\n $diferenciCambiaria=Round(abs((str_replace(\",\", \"\", $montosiniva)/$tipoCambioFacBIEN)) - (str_replace(\",\", \"\", $montosiniva)/$rate),8) ;\n $diferenciCambiariaIVA =Round( abs($montoiva) /$rateSaldoANT - (str_replace(\",\", \"\", $montoiva)/$rate),8) ;\n }elseif($monedaSaldoANT!=$_SESSION ['CountryOfOperation'] AND $moneda==$_SESSION ['CountryOfOperation']){\n\n $diferenciCambiaria=Round(abs((str_replace(\",\", \"\", $montosiniva)/$tipoCambioFacBIEN)) - (str_replace(\",\", \"\", $montosiniva)/$rate),8) ;\n $diferenciCambiariaIVA =Round( abs($montoiva) /$rateSaldoANT - (str_replace(\",\", \"\", $montoiva)/$rate),8) ;\n }\n \n \n if ($montoiva != 0) {\n\n $SQL = \"INSERT INTO gltrans (\n type,\n typeno,\n trandate,\n periodno,\n account,\n narrative,\n amount,\n tag\n )\n VALUES (\n '\" . $systype_doc . \"',\n '\" . $transno . \"',\n '\" . $DefaultDispatchDate . \"',\n '\" . $PeriodNo . \"',\n '\" . $taxglcode . \"',\n '\" . $DebtorNo . \" No. de Nota de Credito: \" . $transno . \" @\" . $nombrecliente . \" ',\n '\" . ($rmontoiva) . \"',\n '\" . $tagref . \"'\n )\";\n \n $result = DB_query($SQL, $db);\n\n if( abs($ivaSaldoANT) ==0 ){\n $SQL = \"INSERT INTO gltrans (\n type,\n typeno,\n trandate,\n periodno,\n account,\n narrative,\n amount,\n tag\n )\n VALUES (\n '\" . $systype_doc . \"',\n '\" . $transno . \"',\n '\" . $DefaultDispatchDate . \"',\n '\" . $PeriodNo . \"',\n '\" . $taxglcodepaid . \"',\n '\" . $DebtorNo . \" No. de Nota de Credito: \" . $transno .' @TC:' . (1 / $rateSaldoANT). \" @\" . $nombrecliente . \" ',\n '\" . ($rmontoivaP *-1) . \"',\n '\" . $tagref . \"'\n )\";\n if ($_SESSION ['UserID'] == \"admin\") {\n // echo '<pre>'.$SQL;\n }\n $result = DB_query($SQL, $db);\n\n }else{\n //$diferenciCambiaria = $diferenciCambiaria + $diferenciCambiariaIVA;\n }\n\n\n \n }\n \n // Obtiene la cuentas contables que se afectar�n\n // $cuenta_notacredito=$_SESSION['CompanyRecord']['creditnote'];\n\n $cuenta_notacredito= ClientAccount($tipocliente, 'gl_debtoradvances', $db);\n\n // *****************************************\n // Se afecta la cuenta de CxC\n // *****************************************\n \n $SQL = \"INSERT INTO gltrans (\n type,\n typeno,\n trandate,\n periodno,\n account,\n narrative,\n amount,\n tag\n )\n VALUES (\n '\" . $systype_doc . \"',\n '\" . $transno . \"',\n '\" . $DefaultDispatchDate . \"',\n '\" . $PeriodNo . \"',\n '\" . $cuenta_cxc . \"',\n '\" . $DebtorNo . \" No. de Nota de Credito: \" . $transno .' @TC:' . (1 / $tipoCambioFacBIEN). \" @\" . $nombrecliente . \" ',\n '\" . ($rmonto * - 1) . \"',\n '\" . $tagref . \"'\n )\";\n // echo $SQL;\n if ($_SESSION ['UserID'] == \"admin\") {\n // echo '<pre>'.$SQL;\n }\n $result = DB_query($SQL, $db);\n\n\n\n if(abs($diferenciCambiaria)>0){\n if (($diferenciCambiaria) >= 0) {\n $ctautilidadperdida = $_SESSION ['CompanyRecord'] ['exchangediffact'];\n } else {\n $ctautilidadperdida = $_SESSION ['CompanyRecord'] ['gllink_exchangediffactutil'];\n }\n \n // $PeriodNo = GetPeriod($_SESSION['AllocCustomer']->TransDate, $db, $_SESSION['AllocCustomer']->tagref);\n \n $reference = $DebtorNo . \"@UTIL/PERD CAMBIARIA@\" . $diferenciCambiaria . ' @TC:' . (1 / $rateSaldoANT).' cliente:'.($nombrecliente);\n // extrae porcentaje de iva\n \n //echo \"<br> diferencia cambiaria \".$diferenciCambiaria;\n \n $SQL = \"INSERT INTO gltrans (type,\n typeno,\n trandate,\n periodno,\n account,\n narrative,\n amount,\n tag\n )\n VALUES ('\" . $systype_doc . \"',\n '\" . $transno. \"',\n '\" . $DefaultDispatchDate . \"',\n '\" . $PeriodNo . \"',\n '\" . $ctautilidadperdida . \"',\n '\" . $reference . \"',\n '\" . ($diferenciCambiaria)*(-1) . \"',\n '\" . $tagref . \"')\";\n //echo \"<br>gltrans 510: \".$SQL;\n $ErrMsg = _ ( 'CRITICAL ERROR' ) . '! ' . _ ( 'NOTE DOWN THIS ERROR AND SEEK ASSISTANCE' ) . ': ' . _ ( 'The GL entry for the difference on exchange arising out of this allocation could not be inserted because' );\n $DbgMsg = _ ( 'The following SQL to insert the GLTrans record was used' );\n $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, True);\n\n }\n \n \n // *****************************************\n // Se afecta la cuenta de Notas de Credito\n // *****************************************\n \n $DebtorTransIDGL = DB_Last_Insert_ID($db, 'gltrans', 'counterindex');\n \n $SQL = \"INSERT INTO debtortransmovs (`tagref`,`transno`,`type`,`debtorno`,`branchcode`,`origtrandate`,`trandate`,`prd`,`settled`,`reference`,`tpe`,`order_`,`rate`,`ovamount`,`ovgst`,`ovfreight`,`ovdiscount`,`diffonexch`,`alloc`,`invtext`,`shipvia`,`edisent`,`consignment`,`folio`,`ref1`,`ref2`,`currcode`,`idgltrans`,`userid`)\";\n $SQL .= \" VALUES (\" . $tagref . \", \" . $transno . \",\" . $systype_doc . \", '\" . $DebtorNo . \"', '\" . $DebtorNo . \"', now(), '\" . $fechaini . \"',\" . $PeriodNo . \",'0','\" . $concepto . \"', '','0','\" . $rate . \"',\" . ($montosiniva * - 1) . \",\" . ($montoiva * - 1) . \",'0','0','0','0','','1','0','', 'NCR','NCR','NCR','\" . $moneda . \"',\" . $DebtorTransIDGL . \",'\" . $_SESSION ['UserID'] . \"')\";\n $result = DB_query($SQL, $db);\n \n // afecta cuentas de notas de credito\n $SQL = \"INSERT INTO gltrans (\n type,\n typeno,\n trandate,\n periodno,\n account,\n narrative,\n amount,\n tag\n )\n VALUES (\n '\" . $systype_doc . \"',\n '\" . $transno . \"',\n '\" . $DefaultDispatchDate . \"',\n '\" . $PeriodNo . \"',\n '\" . $cuenta_notacredito . \"',\n '\" . $DebtorNo . \" No. de Nota de Credito: \" . $transno . \" @\" . $nombrecliente . \" ',\n '\" . $rmontosinivaANT . \"',\n '\" . $tagref . \"'\n )\";\n if ($_SESSION ['UserID'] == \"admin\") {\n // echo '<pre>'.$SQL;\n }\n $msgexito = '<b>LA NOTA DE CREDITO SE HA GENERADO EXITOSAMENTE...';\n $result = DB_query($SQL, $db, $msgexito);\n \n if ($puntoVenta != 1) {\n prnMsg(_($msgexito), 'success');\n }\n $_SESSION['IvaManualAbonoDirectoClientes'] = 0;\n \n // imprimir datos de la nota de credito\n if (! isset($legaid) or $legaid == '' or ! isset($area) or $area == '') {\n $sql = \"Select legalid,areacode from tags where tagref=\" . $tagref;\n $result = DB_query($sql, $db);\n while ($myrow = DB_fetch_array($result, $db)) {\n $legaid = $myrow ['legalid'];\n $area = $myrow ['areacode'];\n }\n }\n \n // Consulta el rfc y clave de facturacion electronica\n $SQL = \" SELECT l.taxid,l.address5,t.tagname,t.typeinvoice, l.legalname\n FROM legalbusinessunit l, tags t\n WHERE l.legalid=t.legalid AND tagref='\" . $tagref . \"'\";\n \n if ($_SESSION['UserID'] == 'desarrollo')\n echo \"<pre> SQL -> $SQL </pre>\";\n\n $Result = DB_query($SQL, $db);\n if (DB_num_rows($Result) == 1) {\n $myrowtags = DB_fetch_array($Result);\n $rfc = trim($myrowtags ['taxid']);\n $keyfact = trim($myrowtags ['address5']);\n $nombre = trim($myrowtags ['tagname']);\n $tipofacturacionxtag = $myrowtags ['typeinvoice'];\n $legalname = $myrowtags ['legalname'];\n // $nombre=\"SERVILLANTAS DE QUERETARO S.A. DE C.V.\";\n }\n\n if ($_SESSION['UserID'] == 'desarrollo')\n echo \"<pre> tipofacturacionxtag -> $tipofacturacionxtag </pre>\";\n\n if ($tipofacturacionxtag == 0) {\n $InvoiceNoTAG = DocumentNext($systype_doc, $tagref, $area, $legaid, $db);\n } else {\n $InvoiceNoTAG = DocumentNext(11, $tagref, $area, $legaid, $db);\n }\n\n if ($_SESSION['UserID'] == 'desarrollo')\n echo \"<pre> InvoiceNoTAG ->\". print_r($InvoiceNoTAG) .\"</pre>\";\n \n \n $separa = explode('|', $InvoiceNoTAG);\n $serie = $separa [1];\n $folio = $separa [0];\n // echo 'folio:'.$InvoiceNoTAG;\n \n $OrderNo = 0;\n $factelectronica = XSAInvoicingCreditdirect($transno, $OrderNo, $DebtorNo, $systype_doc, $tagref, $serie, $folio, $db);\n // Envia los datos al archivooooo\n $factelectronica = utf8_encode($factelectronica);\n \n if ($_SESSION['UserID'] == 'desarrollo') {\n echo '<pre> cadena de XSAInvoicingCreditdirect:'.$factelectronica;\n //echo htmlentities($arrayGeneracion['xml']);\n }\n \n $empresa = $keyfact . '-' . $rfc;\n $nombre = $nombre;\n $tipo = 'Notas de Credito';\n // if ($ambiente == \"desarrollo\") {\n // $tipo = 'NOTA DE CREDITO';\n // }\n \n // $tipo='NOTA DE CREDITO';\n $myfile = '';\n $factelectronica = $factelectronica;\n // echo '<pre><br>'.$factelectronica;\n $param = array (\n 'in0' => $empresa,\n 'in1' => $nombre,\n 'in2' => $tipo,\n 'in3' => $myfile,\n 'in4' => $factelectronica\n );\n \n // Seccion para validar si selecciono la opcion de timbrar o no\n if ($typeFactura == 119 ) {\n $flagsendfiscal = 0;\n }else{\n $flagsendfiscal = 1;\n }\n \n $ligaN = '';\n\n // Si se va a timbrar el documento entra a esta condicion\n //echo \"<br>tipofacturacionxtag:\". $tipofacturacionxtag;\n if ($flagsendfiscal == 1) {\n if ($tipofacturacionxtag == 1) {\n //echo \"entra1\";\n try {\n $client = new SoapClient($_SESSION ['XSA'] . \"xsamanager/services/FileReceiverService?wsdl\");\n $codigo = $client->guardarDocumento($param);\n } catch (SoapFault $exception) {\n $errorMessage = $exception->getMessage();\n }\n $liga = $_SESSION ['XSA'] . \"xsamanager/downloadCfdWebView?serie=\" . $serie . \"&folio=\" . $folio . \"&tipo=PDF&rfc=\" . $rfc . \"&key=\" . $keyfact;\n $liga = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $liga . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n } elseif ($tipofacturacionxtag == 2) {\n echo \"entra2\";\n $arrayGeneracion = generaXML($factelectronica, 'egreso', $tagref, $serie, $folio, $DebtorTransIDND, 'NCreditoDirect', $OrderNo, $db);\n $XMLElectronico = $arrayGeneracion [\"xml\"];\n // Se agrega la generacion de xml_intermedio\n\n $array = generaXMLIntermedio($factelectronica, $XMLElectronico, ($arrayGeneracion [\"cadenaOriginal\"]), utf8_encode($arrayGeneracion [\"cantidadLetra\"]), $DebtorTransIDND, $db, 13, $tagref, $systype_doc, $transno);\n $xmlImpresion = ( $array [\"xmlImpresion\"] );\n $rfcEmisor = $array [\"rfcEmisor\"];\n $fechaEmision = $array [\"fechaEmision\"];\n\n $XMLElectronico = caracteresEspecialesFactura($XMLElectronico);\n $xmlImpresion = caracteresEspecialesFactura($xmlImpresion);\n $xmlImpresion =str_replace(\"&\", \"&amp;\", $xmlImpresion);\n \n // Almacenar XML\n $XMLElectronico = str_replace(\"<?xml version='1.0' encoding='UTF-8'?>\", '<?xml version=\"1.0\" encoding=\"UTF-8\"?>', $XMLElectronico);\n $query = \"INSERT INTO Xmls(transNo,type,rfcEmisor,fechaEmision,xmlSat,xmlImpresion,fiscal)\n VALUES(\" . $transno . \",\" . $systype_doc . \",'\" . $rfcEmisor . \"','\" . $fechaemision . \"','\" . utf8_decode(addslashes($XMLElectronico)) . \"','\" . utf8_decode(addslashes($xmlImpresion)) . \"',\" . $flagsendfiscal . \");\";\n $Result = DB_query($query, $db, $ErrMsg, $DbgMsg, true);\n \n if ($_SESSION ['Template_V6'] != '1') {\n $ligaN = \"PDFCreditDirect.php\";\n } else {\n $ligaN = \"PDFInvoice.php\";\n }\n // $liga = \"PDFCreditDirect.php\";\n $ligaN = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $rootpath . '/' . $ligaN . SID . '?tipo=' . $systype_doc . '&area=' . $area . '&legal=' . $legaid . '&TransNo=' . $transno . '&Type=13&Tagref=' . $tagref . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n } elseif ($tipofacturacionxtag == 3) {\n // $XMLElectronico=generaXML($factelectronica,'egreso',$tagref,$serie,$folio,$DebtorTransIDND,'NCreditoDirect',$OrderNo,$db);\n \n $ligaN = \"PDFNoteCreditDirectTemplate.php\";\n $ligaN = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $rootpath . '/' . $ligaN . SID . '&tipo=' . $systype_doc . '&area=' . $area . '&legal=' . $legaid . '&TransNo=' . $transno . '&Tagref=' . $tagref . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n } elseif ($tipofacturacionxtag == 4) {\n $success = false;\n $config = $_SESSION;\n //echo \"<br>---\".$_SESSION['FacturaVersion'];\n if ($_SESSION['FacturaVersion'] == \"3.3\") {\n //echo \"<br>generaXMLCFDI3_3:\";\n $arrayGeneracion = generaXMLCFDI3_3($factelectronica, 'egreso', $tagref, $serie, $folio, $DebtorTransIDND, 'NCreditoDirect', $OrderNo, $db);\n } else {\n $arrayGeneracion = generaXMLCFDI($factelectronica, 'egreso', $tagref, $serie, $folio, $DebtorTransIDND, 'NCreditoDirect', $OrderNo, $db);\n }\n \n $XMLElectronico = $arrayGeneracion [\"xml\"];\n $XMLElectronico = str_replace('<?xml version=\"1.0\" encoding=\"UTF-8\"?>', '', $XMLElectronico);\n\n if ($_SESSION['UserID'] == 'aenriquez' or $_SESSION['UserID'] == 'desarrollo') {\n //echo '<pre>'.$factelectronica;\n //echo '<br>XMLElectronico: <br><pre>'.htmlentities($XMLElectronico);\n }\n \n //require_once '../../.././' .'timbradores/TimbradorFactory.php';\n //include_once 'timbradores/TimbradorFactory.php';\n $timbrador = TimbradorFactory::getTimbrador($config);\n if ($timbrador != null) {\n $timbrador->setRfcEmisor($rfc);\n $timbrador->setDb($db);\n $cfdi = $timbrador->timbrarDocumento($XMLElectronico);\n $success = ($timbrador->tieneErrores() == false);\n foreach ($timbrador->getErrores() as $error) {\n if ($puntoVenta != 1) {\n prnMsg($error, 'error');\n }\n }\n } else {\n if ($puntoVenta != 1) {\n prnMsg(_('No hay un timbrador configurado en el sistema'), 'error');\n }\n }\n \n if ($success) {\n if ($_SESSION['UserID'] == \"desarrollo\") {\n echo '<br>success';\n }\n // leemos la informacion del cfdi en un arreglo\n $DatosCFDI = TraeTimbreCFDI($cfdi);\n if (strlen($DatosCFDI ['FechaTimbrado']) > 0) {\n //$cadenatimbre = '||1.1|' . $DatosCFDI ['UUID'] . '|' . $DatosCFDI ['FechaTimbrado'] . '|' . $DatosCFDI ['selloCFD'] . '|' . $DatosCFDI ['noCertificadoSAT'] . '||';\n $cadenatimbre = '||1.1|' . $DatosCFDI ['UUID'] . '|' . $DatosCFDI ['FechaTimbrado'] .'|' . $DatosCFDI ['RfcProvCertif']. '||' . $DatosCFDI ['SelloCFD'] . '|' . $DatosCFDI ['NoCertificadoSAT'] . '||';\n \n // guardamos el timbre fiscal en la base de datos para efectos de impresion de datos\n $sql = \"UPDATE debtortrans\n SET fechatimbrado='\" . $DatosCFDI ['FechaTimbrado'] . \"',\n uuid='\" . $DatosCFDI ['UUID'] . \"',\n timbre='\" . $DatosCFDI ['SelloSAT'] . \"',\n cadenatimbre='\" . $cadenatimbre . \"'\n where id=\" . $DebtorTransIDND;\n \n $ErrMsg = _('El Sql que fallo fue');\n $DbgMsg = _('No se pudo actualizar el sello y cadena del documento');\n $Result = DB_query($sql, $db, $ErrMsg, $DbgMsg, true);\n $XMLElectronico = $cfdi;\n // Guardamos el XML una vez que se agrego el timbre fiscal\n \n $legalname= caracteresEspecialesFactura($legalname);\n \n $carpeta = 'NCreditoDirect';\n\n $dir = \"/var/www/html\" . dirname($_SERVER ['PHP_SELF']) . \"/companies/\" . $_SESSION ['DatabaseName'] . \"/SAT/\" . utf8_decode(addslashes((str_replace('.', '', str_replace(' ', '', $legalname))))) . \"/XML/\" . $carpeta . \"/\";\n\n //$dir=\"/var/www/html/erpdistribucion/companies/\".$_SESSION ['DatabaseName'].\"/SAT/\".utf8_decode(addslashes((str_replace ( '.', '', str_replace ( ' ', '', $legalname ) )))).\"/XML/NCreditoDirect/\";\n \n if ($puntoVenta == 1) {\n // Si es punto de venta quitar carpetas\n $dir = str_replace('mvc/api/v1/', '', $dir);\n }\n\n \n $nufa = $serie . $folio;\n $mitxt = $dir . $nufa . \".xml\";\n if ($puntoVenta != 1) {\n unlink($mitxt);\n }\n \n //echo \"<br>\".$mitxt;\n // Se modifico la fucion\n $fp = fopen($mitxt, \"w\");\n fwrite($fp, $XMLElectronico);\n fclose($fp);\n\n \n $fp = fopen($mitxt . '.COPIA', \"w\");\n fwrite($fp, $XMLElectronico);\n fclose($fp);\n //Se agrega la generacion de xml_intermedio\n \n $XMLElectronico_Impresion=\"\";\n if ($_SESSION['FacturaVersion'] == \"3.3\") {\n $XMLElectronico_Impresion = generaXMLCFDI_Impresion($factelectronica, $XMLElectronico, $tagref, $db);\n }\n \n\n if (!empty($XMLElectronico_Impresion)) {\n $array = generaXMLIntermedio($factelectronica, $XMLElectronico_Impresion, $cadenatimbre, utf8_encode($arrayGeneracion [\"cantidadLetra\"]), $OrderNo, $db, 13, $tagref, $systype_doc, $transno);\n } else {\n $array = generaXMLIntermedio($factelectronica, $XMLElectronico, $cadenatimbre, utf8_encode($arrayGeneracion [\"cantidadLetra\"]), $DebtorTransIDND, $db, 13, $tagref, $systype_doc, $transno);\n }\n \n\n //$array = generaXMLIntermedio ( $factelectronica, $XMLElectronico, $cadenatimbre, utf8_encode ( $arrayGeneracion [\"cantidadLetra\"] ), $DebtorTransIDND, $db, 13, $tagref, $systype_doc, $transno );\n\n $xmlImpresion = ( $array [\"xmlImpresion\"] );\n $rfcEmisor = $array [\"rfcEmisor\"];\n $fechaEmision = $array [\"fechaEmision\"];\n $XMLElectronico = caracteresEspecialesFactura($XMLElectronico);\n $xmlImpresion = caracteresEspecialesFactura($xmlImpresion);\n $xmlImpresion =str_replace(\"&\", \"&amp;\", $xmlImpresion);\n\n if ($_SESSION['UserID']=='desarrollo') {\n echo '<br>XMLElectronico: <br><pre>'.htmlentities($XMLElectronico);\n echo '<br>xmlImpresion: <br><pre>'.htmlentities($xmlImpresion);\n }\n\n // Almacenar XML//\n $XMLElectronico = str_replace(\"<?xml version='1.0' encoding='UTF-8'?>\", '<?xml version=\"1.0\" encoding=\"UTF-8\"?>', $XMLElectronico);\n $query = \"INSERT INTO Xmls(transNo,type,rfcEmisor,fechaEmision,xmlSat,xmlImpresion,fiscal)\n VALUES(\" . $transno . \",\" . $systype_doc . \",'\" . $rfcEmisor . \"','\" . $fechaemision . \"','\" . utf8_decode(addslashes($XMLElectronico)) . \"','\" . utf8_decode(addslashes($xmlImpresion)) . \"',\" . $flagsendfiscal . \");\";\n $Result = DB_query($query, $db, $ErrMsg, $DbgMsg, true);\n \n if ($_SESSION ['Template_V6'] != '1') {\n $ligaN = \"PDFCreditDirect.php\";\n } else {\n $ligaN = \"PDFInvoice.php\";\n }\n \n if ($puntoVenta != 1) {\n $ligaN = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $rootpath . '/' . $ligaN . SID . '?Type=' . $systype_doc . '&area=' . $area . '&legal=' . $legaid . '&TransNo=' . $transno . '&Tagref=' . $tagref . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n }\n } else {\n prnMsg(_('No fue posible realizar el timbrado del documento, verifique con el administrador; el numero de error es:') . $cfdi, 'error');\n // exit;\n }\n }\n } else {\n $ligaN = GetUrlToPrintNu($tagref, $area, $legaid, $systype_doc, $db);\n $ligaN = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $rootpath . '/' . $ligaN . SID . '&tipo=' . $systype_doc . '&area=' . $area . '&legal=' . $legaid . '&TransNo=' . $transno . '&Tagref=' . $tagref . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n }\n } else {\n //echo \"<br> flagsendfiscal\";\n // Documento No Fiscal\n $arrayGeneracion = generaXMLCFDI($factelectronica, 'egreso', $tagref, $serie, $folio, $DebtorTransIDND, 'NCreditoDirect', $OrderNo, $db);\n $XMLElectronico = $arrayGeneracion [\"xml\"];\n \n // Se agrega la generacion de xml_intermedio\n $array = generaXMLIntermedio($factelectronica, $XMLElectronico, $arrayGeneracion [\"cadenaOriginal\"], utf8_encode($arrayGeneracion [\"cantidadLetra\"]), $DebtorTransIDND, $db, 13, $tagref, $systype_doc, $transno);\n $xmlImpresion = utf8_decode($array [\"xmlImpresion\"]);\n $rfcEmisor = $array [\"rfcEmisor\"];\n $fechaEmision = $array [\"fechaEmision\"];\n $XMLElectronico = caracteresEspecialesFactura($XMLElectronico);\n $xmlImpresion = caracteresEspecialesFactura($xmlImpresion);\n $xmlImpresion =str_replace(\"&\", \"&amp;\", $xmlImpresion);\n\n \n // Insertar el registro en la tabla de XMLS\n $query = \"INSERT INTO Xmls(transNo,type,rfcEmisor,fechaEmision,xmlSat,xmlImpresion,fiscal)\n VALUES(\" . $transno . \",\" . $systype_doc . \",'\" . $rfcEmisor . \"','\" . $fechaemision . \"','\" . utf8_decode(addslashes($XMLElectronico)) . \"','\" . utf8_decode(addslashes($xmlImpresion)) . \"',\" . $flagsendfiscal . \");\";\n \n $Result = DB_query($query, $db, $ErrMsg, $DbgMsg, true);\n \n if ($_SESSION ['Template_V6'] != '1') {\n $ligaN = \"PDFCreditDirect.php\";\n } else {\n $ligaN = \"PDFInvoice.php\";\n }\n \n $ligaN = '<p><img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _('Imprimir') . '\" alt=\"\">' . ' ' . '<a target=\"_blank\" href=\"' . $rootpath . '/' . $ligaN . SID . '?Type=' . $systype_doc . '&area=' . $area . '&legal=' . $legaid . '&TransNo=' . $transno . '&Tagref=' . $tagref . '\">' . _('Imprimir Nota de Credito') . ' (' . _('Laser') . ')' . '</a>';\n \n /*$PrintDispatchNote = $rootpath . '/' . $liga . '?OrderNo=' . $OrderNo . '&TransNo=' . $BatchNo . '&Type=' . $tipodefacturacion;\n \n echo '<p class=\"page_title_text\">';\n echo '<img src=\"' . $rootpath . '/css/' . $theme . '/images/printer.png\" title=\"' . _ ( 'Imprimir Recibo ' ) . '\" alt=\"\">' . ' ';\n echo '<a href=\"' . $PrintDispatchNote . '\" target=\"_blank\">';\n echo _ ( 'Imprimir Recibo PDF ' ) . '</a></p>';*/\n } // Fin de condicion para timbrar el documento o no\n \n // Actualizar el documento para folio\n $SQL = \"UPDATE debtortrans\n SET folio='\" . $serie . '|' . $folio . \"',\n flagfiscal= '\" . $flagsendfiscal . \"' \n WHERE transno=\" . $transno . \" and type=\" . $systype_doc;\n \n $ErrMsg = _('ERROR CRITICO') . '! ' . _('ANOTE EL ERROR') . ': ' . _('La Actualizacion para saldar la factura, no se pudo realizar');\n $DbgMsg = _('El SQL utilizado para el registro de la fatura es:');\n $Result = DB_query($SQL, $db, $ErrMsg, $DbgMsg, true);\n $Result = DB_Txn_Commit($db);\n\n if ($puntoVenta != 1) {\n echo '<p><div align=\"center\">';\n echo $ligaN;\n echo '</div>';\n }\n\n if (function_exists(\"updateGlTransAccountingInfo\")) {\n $valued = updateGlTransAccountingInfo($systype_doc, $transno, $db);\n }\n \n if ($puntoVenta != 1) {\n echo '<p><div align=\"center\">';\n echo '<a href=\"ReportCustomerInqueryV3.php?CustomerID=' . $DebtorNo . '\">';\n echo '<font size=2 face=\"arial\"><b>';\n echo _('IR AL ESTADO DE CUENTA DEL CLIENTE');\n echo '</b></font>';\n echo '</a>';\n echo '</div>';\n }\n }\n \n // ***************************************************************************************************\n // ***************************************************************************************************\n // ***************************************************************************************************\n}", "function obtenerRegistros($datos = []) {\n\t\t$this->openConnection();\n\t\t$sentencia = $this->conn->prepare($this->consulta);\n\t\tif(!empty($datos)){\n\t\t\tforeach ($datos as $key => $value) {\n\t\t\t\t$sentencia->bind_param($key, $value);\n\t\t\t}\n\t\t}\n\t\t$sentencia->execute();\n\t\t$reg = $sentencia->get_result();\n\t\t$rows = $reg->num_rows;\n\t\t$i = 0;\n\t\tdo {\n\t\t\t$this->registros[] = $reg->fetch_assoc();\n\t\t\t$i++;\n\t\t} while ($i < $rows);\n\t\t$this->closeConnection();\n\t}", "function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Scheda argomento\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}", "public function getUtilisateurs();", "function guardarUsuario($nombre, $tel) {\n global $agenda;\n $agenda[] = array($nombre, $tel);\n }", "public function comerPersona($nombre){\n\t\techo \"Soy el tiburon peligroso $this->nombre y me voy a comer a la persona $nombre\";\n\t}", "public function getElementos();", "function pre_descuento_familia_articulos(&$Sesion) {\n\t$id_cliente=$Sesion->fetchVar('id_cliente','GET');\n\t$descuentos_familia_borrar=$Sesion->fetchVar('descuentos_familia_borrar','POST');\n\t$descuentos_familia_modificar=$Sesion->fetchVar('descuentos_familia_modificar','POST');\n\t$accion_ejecutar=$Sesion->fetchVar('accion_ejecutar','POST');\n\n\t$id_cliente_sesion = $Sesion->get_var(\"id_cliente_promocion\");\n\t$oDb = $Sesion->get_db('data');\n\n\t//debug(\"glob $id_cliente\");\n\t//debug(\"ses $id_cliente_sesion\");\n\n\tif(isset($id_cliente) AND $id_cliente_sesion != $id_cliente)\n\t\t$Sesion->set_var(\"id_cliente_promocion\",$id_cliente);\n\telse {\n\t\t$id_cliente = $Sesion->get_var(\"id_cliente_promocion\");\n\t\tif(!isset($id_cliente)){\n\t\t\t// debug(\"no hay cliente\");\n\t\t\treturn;\n\t\t}\n\t}\n\n\t//$id_cliente = $Sesion->get_var(\"id_cliente_promocion\");\n\t$usuario = identifica_usuarios($Sesion);\n\t//debug($id_cliente);\n\n\tswitch($accion_ejecutar){\n\t\tcase \"Modificar\" :\n\t\t\tif ($Sesion->verifyVar('descuentos_familia_modificar',IKRN_VAR_CRC_CHANGE) AND $Sesion->verifyVar('descuentos_familia_modificar',IKRN_VAR_CRC_AUTHED)) {\n\t\t\t\tif(isset($descuentos_familia_modificar)) {\n\t\t\t\t\tforeach($descuentos_familia_modificar as $clave => $valor){\n\t\t\t\t\t\t$aTmp = array();\n\t\t\t\t\t\t$aTmp['descuento'] = $descuentos_familia_modificar[$clave];\n\t\t\t\t\t\t$aTmp['id_familia'] = $clave;\n\t\t\t\t\t\t$aTmp['id_cliente'] = $id_cliente;\n\t\t\t\t\t\t$aTmp['id_empresa'] = $usuario['id'];\n\t\t\t\t\t\t$oDb->tb_update('Cliente_familia_articulos',$aTmp);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\n\t\tcase \"Borrar\" :\n\t\t\tif(isset($descuentos_familia_borrar)){\n\t\t\t\tforeach($descuentos_familia_borrar as $clave => $valor)\n\t\t\t\t\tif($valor == 1 ){\n\t\t\t\t\t\t$aTmp = array();\n\t\t\t\t\t\t$aTmp['id_familia'] = $clave;\n\t\t\t\t\t\t$aTmp['id_cliente'] = $id_cliente;\n\t\t\t\t\t\t$aTmp['id_empresa'] = $usuario['id'];\n\t\t\t\t\t\t$oDb->tb_delete('Cliente_familia_articulos',$aTmp);\n\t\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\n\t\tcase \"Anyadir\" :\n\t\t\tif ($Sesion->verifyVar('descuentos_familia_modificar',IKRN_VAR_CRC_CHANGE) AND $Sesion->verifyVar('descuentos_familia_modificar',IKRN_VAR_CRC_AUTHED)) {\n\t\t\t\tif(isset($descuentos_familia_modificar)){\n\t\t\t\t\tforeach($descuentos_familia_modificar as $clave => $valor){\n\t\t\t\t\t\tif($descuentos_familia_modificar[$clave] != 0){\n\t\t\t\t\t\t\t$aTmp['id_empresa'] = $usuario['id'];\n\t\t\t\t\t\t\t$aTmp['id_cliente'] = $id_cliente;\n\t\t\t\t\t\t\t$aTmp['id_familia'] = $clave;\n\t\t\t\t\t\t\t$aTmp['descuento'] = $descuentos_familia_modificar[$clave];\n\t\t\t\t\t\t\t$oDb->tb_replace('Cliente_familia_articulos',$aTmp);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\n\t}//fin de acciones\n}", "function maquetacioItemsAgendaHoudini($model, $columna, $nomCaixa, $tipusCaixa, $ordre, $estilCaixa, $estilLlistat, $estilElement, $id_registre, $id_newsletter, $registre, $pathEditora)\n{\n global $CONFIG_URLBASE , $CONFIG_URLUPLOADIM; \n $parametres = '<input type=\"hidden\" name=\"newsletter['.htmlspecialchars($model).']['.htmlspecialchars($columna).']['.htmlspecialchars($nomCaixa).']['.htmlspecialchars($tipusCaixa).'][]['.htmlspecialchars($estilCaixa).']['.htmlspecialchars($estilLlistat).']['.htmlspecialchars($estilElement).']\" value=\"'.htmlspecialchars($id_registre).'\" />';\n \n $registre['ORIGEN'] = '<h4><a href=\"'.$CONFIG_URLBASE . $pathEditora . $registre['ID'] . '/' . $registre['URL_TITOL'] . '\" rel=\"external\" style=\"text-decoration:none;\">'.$registre['TITOL'].'</a></h4>';\n $imatge = $registre['IMATGE1'] != '' ? '<img src=\"' . $CONFIG_URLUPLOADIM . $registre['IMATGE1'] . '\" style=\"width: 159px;\" class=\"left\"/>' : '';\n \n return '<li id=\"ageh_reg' . $id_registre . '\" class=\"box removable stylable '.$estilElement.'\">\n\t\t\t'.$parametres.'\n\t\t\t<div class=\"spacer clearfix\">\n\t\t\t ' . $imatge . '\n\t\t\t\t'.$registre['ORIGEN'].'\n\t\t\t\t'.$registre['RESUM'].'\n\t\t\t</div>\n\t\t</li>';\n}", "function RellenarTitulo()\r\n {\r\n $this->Imprimir('ANÁLSIS DE FALLAS DE DISTRIBUCIÓN');\r\n\r\n $this->Imprimir($this->convocatoria->getLugar(), 93, 10);\r\n\r\n $this->Imprimir(strftime(\"%A %d de %B de %Y\", strtotime($this->convocatoria->getFecha())) .\r\n ' - Hora: ' . $this->convocatoria->getHoraIni() . ' a ' .\r\n $this->convocatoria->getHoraFin(), 95, 10, 16);\r\n }", "public function RegistrarProductos()\n\t{\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codproducto\"]) or empty($_POST[\"producto\"]) or empty($_POST[\"codcategoria\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\n\t\t$ingrediente = $_POST['codingrediente'];\n\t\t$repeated = array_filter(array_count_values($ingrediente), function($count) {\n\t\t\treturn $count > 1;\n\t\t});\n\t\tforeach ($repeated as $key => $value) {\n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\n\t\t$sql = \" select codproducto from productos where codproducto = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codproducto\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n##################### REGISTRAMOS LOS NUEVOS PRODUCTOS ####################################\n\t\t\t$query = \" insert into productos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codproducto);\n\t\t\t$stmt->bindParam(2, $producto);\n\t\t\t$stmt->bindParam(3, $codcategoria);\n\t\t\t$stmt->bindParam(4, $preciocompra);\n\t\t\t$stmt->bindParam(5, $precioventa);\n\t\t\t$stmt->bindParam(6, $existencia);\n\t\t\t$stmt->bindParam(7, $stockminimo);\n\t\t\t$stmt->bindParam(8, $ivaproducto);\n\t\t\t$stmt->bindParam(9, $descproducto);\n\t\t\t$stmt->bindParam(10, $codproveedor);\n\t\t\t$stmt->bindParam(11, $codigobarra);\n\t\t\t$stmt->bindParam(12, $favorito);\n\t\t\t$stmt->bindParam(13, $statusproducto);\n\n\t\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t\t$producto = strip_tags($_POST[\"producto\"]);\n\t\t\t$codcategoria = strip_tags($_POST[\"codcategoria\"]);\n\t\t\t$preciocompra = strip_tags($_POST[\"preciocompra\"]);\n\t\t\t$precioventa = strip_tags($_POST[\"precioventa\"]);\n\t\t\t$existencia = strip_tags($_POST[\"existencia\"]);\n\t\t\t$stockminimo = strip_tags($_POST[\"stockminimo\"]);\n\t\t\t$ivaproducto = strip_tags($_POST[\"ivaproducto\"]);\n\t\t\t$descproducto = strip_tags($_POST[\"descproducto\"]);\n\t\t\t$codproveedor = strip_tags($_POST[\"codproveedor\"]);\n\t\t\tif (strip_tags($_POST['codigobarra']!=\"\")) { $codigobarra = strip_tags($_POST['codigobarra']); } else { $codigobarra ='00000000000'; }\n\t\t\t$favorito = strip_tags($_POST[\"favorito\"]);\n\t\t\t$statusproducto = strip_tags($_POST[\"statusproducto\"]);\n\t\t\t$stmt->execute();\n\n\t\t\t$query = \" insert into kardexproductos values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t\t$stmt = $this->dbh->prepare($query);\n\t\t\t$stmt->bindParam(1, $codproceso);\n\t\t\t$stmt->bindParam(2, $codresponsable);\n\t\t\t$stmt->bindParam(3, $codproducto);\n\t\t\t$stmt->bindParam(4, $movimiento);\n\t\t\t$stmt->bindParam(5, $entradas);\n\t\t\t$stmt->bindParam(6, $salidas);\n\t\t\t$stmt->bindParam(7, $devolucion);\n\t\t\t$stmt->bindParam(8, $stockactual);\n\t\t\t$stmt->bindParam(9, $preciom);\n\t\t\t$stmt->bindParam(10, $costototal);\n\t\t\t$stmt->bindParam(11, $documento);\n\t\t\t$stmt->bindParam(12, $fechakardex);\n\n\t\t\t$codproceso = strip_tags($_POST['codproceso']);\n\t\t\t$codresponsable = strip_tags(\"0\");\n\t\t\t$codproducto = strip_tags($_POST['codproducto']);\n\t\t\t$movimiento = strip_tags(\"ENTRADAS\");\n\t\t\t$entradas = strip_tags($_POST['existencia']);\n\t\t\t$salidas = strip_tags(\"0\");\n\t\t\t$devolucion = strip_tags(\"0\");\n\t\t\t$stockactual = strip_tags($_POST['existencia']);\n\t\t\t$preciom = strip_tags($_POST['precioventa']);\n\t\t\t$costototal = strip_tags($_POST['precioventa'] * $_POST['existencia']);\n\t\t\t$documento = strip_tags(\"INVENTARIO INICIAL\");\n\t\t\t$fechakardex = strip_tags(date(\"Y-m-d\"));\n\t\t\t$stmt->execute();\n\n################## SUBIR FOTO DE PRODUCTO ######################################\n//datos del arhivo \n\t\t\tif (isset($_FILES['imagen']['name'])) { $nombre_archivo = $_FILES['imagen']['name']; } else { $nombre_archivo =''; }\n\t\t\tif (isset($_FILES['imagen']['type'])) { $tipo_archivo = $_FILES['imagen']['type']; } else { $tipo_archivo =''; }\n\t\t\tif (isset($_FILES['imagen']['size'])) { $tamano_archivo = $_FILES['imagen']['size']; } else { $tamano_archivo =''; } \n//compruebo si las características del archivo son las que deseo \n\t\t\tif ((strpos($tipo_archivo,'image/jpeg')!==false)&&$tamano_archivo<200000) \n\t\t\t{ \n\t\t\t\tif (move_uploaded_file($_FILES['imagen']['tmp_name'], \"fotos/\".$nombre_archivo) && rename(\"fotos/\".$nombre_archivo,\"fotos/\".$codproducto.\".jpg\"))\n\t\t\t\t{ \n## se puede dar un aviso\n\t\t\t\t} \n## se puede dar otro aviso \n\t\t\t}\n################## FINALIZA SUBIR FOTO DE PRODUCTO ######################################\n\n\n###################### PROCESO DE REGISTRO DE INSCREDIENTES A PRODUCTOS ###########################\nfor($i=0;$i<count($_POST['codingrediente']);$i++){ //recorro el array\n\tif (!empty($_POST['codingrediente'][$i])) {\n\n\t\t$query = \" insert into productosvsingredientes values (null, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codproducto);\n\t\t$stmt->bindParam(2, $codingrediente);\n\t\t$stmt->bindParam(3, $cantidad);\n\n\t\t$codproducto = strip_tags($_POST[\"codproducto\"]);\n\t\t$codingrediente = strip_tags($_POST['codingrediente'][$i]);\n\t\t$cantidad = strip_tags($_POST['cantidad'][$i]);\n\t\t$stmt->execute();\n\t}\n}\n################### PROCESO DE REGISTRO DE INSCREDIENTES A PRODUCTOS ##################\n\n\necho \"<div class='alert alert-success'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\necho \"<span class='fa fa-check-square-o'></span> EL PRODUCTO FUE REGISTRADO EXITOSAMENTE\";\necho \"</div>\";\t\t\nexit;\n}\nelse\n{\n\techo \"3\";\n\texit;\n}\n}", "public function __construct($nombre,$arreglo,$codigo)\n {\n $this->nombre = $nombre;\n $this->arreglo = $arreglo;\n $this->codigo = $codigo;\n }", "public function run()\n {\n //\n $tipos = [\n '0' => [\n 'nombre' => 'CONTROL DE PLAGAS BASICO SIN ROEDORES'\n ],\n '1' => [\n 'nombre' => 'CONTROL DE PLAGAS BASICO Y ROEDORES'\n ],\n '2' => [\n 'nombre' => 'CONTROL SOLO ROEDORES' \n ],\n '3' => [\n 'nombre' => 'CONTROL INSECTOS RASTREROS'\n ],\n '4' => [\n 'nombre' => 'CONTROL INSECTOS VOLADORES'\n ],\n '5' => [\n 'nombre' => 'CONTROL CHINCHES'\n ],\n '6' => [\n 'nombre' => 'CONTROL GARRAPATAS'\n ],\n '7' => [\n 'nombre' => 'CONTROL PULGAS'\n ],\n '8' => [\n 'nombre' => 'CONTROL TERMITAS'\n ],\n '9' => [\n 'nombre' => 'CONTROL ABEJAS'\n ],\n '10' => [\n 'nombre' => 'CONTROL AVISPAS'\n ],\n '11' => [\n 'nombre' => 'DESINFECCION'\n ],\n '12' => [\n 'nombre' => 'ESPOLVOREO ELECTRICO'\n ],\n '13' => [\n 'nombre' => 'NEBULIZACION'\n ],\n '14' => [\n 'nombre' => 'TERMONEBULIZACION'\n ],\n '15' => [\n 'nombre' => 'GASIFICACION'\n ],\n '16' => [\n 'nombre' => 'RETIRO DE RESIDUOS / DESCARPADO'\n ],\n '17' => [\n 'nombre' => 'INSTALACION ESTACIONES ROEDOR'\n ],\n '18' => [\n 'nombre' => 'CONTROL DE PLAGAS EN ZONAS COMUNES'\n ],\n '19' => [\n 'nombre' => 'CONTROL EN CASAS Y/O APARTAMENTOS'\n ],\n '20' => [\n 'nombre' => 'CONTROL EN CAJAS DE ALCANTARILLA'\n ],\n '21' => [\n 'nombre' => 'RUTA LAMPARAS CONTROL INSECTOS VOLADORES'\n ],\n '22' => [\n 'nombre' => 'RUTA ESTACIONES CONTROL ROEDORES'\n ],\n '22' => [\n 'nombre' => 'CONTROL CARACOLES'\n ],\n '23' => [\n 'nombre' => 'CONTROL DE PLAGAS BASICO RESIDENCIAL'\n ]\n ];\n\n DB::table('tipo_servicios')->insert($tipos);\n }" ]
[ "0.6780367", "0.6612574", "0.61810625", "0.61094296", "0.60722345", "0.60569257", "0.60493064", "0.602756", "0.601529", "0.59810215", "0.59739685", "0.59667754", "0.59449035", "0.59412515", "0.5934055", "0.5932063", "0.59281844", "0.59187376", "0.59174913", "0.59036463", "0.5903575", "0.5901222", "0.5899649", "0.5889056", "0.58843124", "0.5877945", "0.5876543", "0.5863168", "0.58531266", "0.5837513", "0.5835284", "0.5823647", "0.5823111", "0.58208287", "0.58143246", "0.58059675", "0.5792152", "0.5790915", "0.5778403", "0.5768465", "0.5763175", "0.57595277", "0.5757367", "0.57523036", "0.57494307", "0.5743229", "0.5742113", "0.5740484", "0.5740246", "0.5733296", "0.57315093", "0.573031", "0.572675", "0.57264996", "0.57238466", "0.57157886", "0.5707825", "0.57063735", "0.5696226", "0.5691334", "0.56912494", "0.5688479", "0.5673527", "0.5671573", "0.56690305", "0.566725", "0.5658983", "0.565027", "0.56465983", "0.564394", "0.5640891", "0.5634061", "0.56295425", "0.5628266", "0.5627517", "0.5627314", "0.56265473", "0.5620946", "0.56194586", "0.5615273", "0.5608861", "0.56032634", "0.56014234", "0.56006604", "0.5599766", "0.5598845", "0.55973", "0.55949336", "0.5589962", "0.5587188", "0.55869794", "0.55839396", "0.55803674", "0.5578058", "0.55772096", "0.55751157", "0.5570216", "0.55684257", "0.5567574", "0.556685", "0.5565097" ]
0.0
-1
FUNCION PARA OBTENER APODERADO CON ID
public function getByID($id) { $sql="CALL SP_APODERADOS_SELECT_BY_ID(?)"; return $this->mysqli->find($sql, $id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buscarPorId($id) {\r\n \r\n }", "abstract public function get_id();", "abstract function getId();", "abstract public function getId();", "public function getID();", "public function getID();", "public function getID();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function getIdfa();", "function getId();", "public function get_id();", "public function get_id();", "public function id_tarjeta();", "public function buscarID()\n {\n $sentencia = \"SELECT id, cl FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n foreach ($registros as $r) {\n $id = $r->id;\n }\n return $id;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "public function getId() ;", "public static function ObtenerPorID($id) {\n }", "protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }", "function servicioID($id){\n\t\t\n\t\t$query = $this->db->from('servicio')->where('id',$id)->get();\n\t\tif($query-> num_rows() > 0)\n\t\t\t{\n\t\t\treturn $query;\n\t\t\t// SI SE MANDA A RETORNAR SOLO $QUERY , SE PUEDE UTILIZAR LOS ELEMENTOS DEL QUERY \n\t\t\t// COMO usuarioID($data['sesion']->result()[0]->id_usuario POR EJEMPLO. \n\t\t\t}\n\t\n\t}", "function get_id($id){\n\t\t$this->id = $id;\n\t}", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "function get_id(){\n return $this -> id;\n }", "function get_id(){\n return $this -> id;\n }", "public function ArqueoCajaPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * FROM arqueocaja INNER JOIN cajas ON arqueocaja.codcaja = cajas.codcaja LEFT JOIN usuarios ON cajas.codigo = usuarios.codigo where arqueocaja.codarqueo = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codarqueo\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function _set_id( $idGrupo ){\n \t\t$this->idGrupo = $idGrupo;\n }", "function id():string {return $this->_p['_id'];}", "public function setId()\n\t{\n\t}", "public function get_id()\n {\n }", "function ler_id($id) {\n $x = (int)$id;\n if($x >= $this->bd[0][0] || $x <= 0) {return false;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\n return true;\n }", "function buscar_id($id_autor){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"SELECT\n\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\tautor\n\t\t\t\tWHERE id_autor='$id_autor'\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$conexion -> cerrar();\n\t\tif($resultado == TRUE)\n\t\t{\n\t\t\trequire('autorClass.php');\n\t\t\t$autor = new Autor($resultado[0]['id_autor'], $resultado[0]['nombre_autor']);\n\t\t\t//Regreso los productos\n\t\t\treturn $autor;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();", "public function getId();" ]
[ "0.76026964", "0.7062267", "0.7030332", "0.7028262", "0.70141155", "0.70141155", "0.70141155", "0.70048654", "0.70048654", "0.70048654", "0.70048654", "0.70048654", "0.70048654", "0.70048654", "0.70048654", "0.70048654", "0.7000209", "0.6968232", "0.6960433", "0.6960433", "0.6951815", "0.6927221", "0.69210833", "0.690329", "0.68844026", "0.6883983", "0.6872771", "0.6872692", "0.6872692", "0.6872692", "0.6863307", "0.6863307", "0.68500584", "0.68442464", "0.68404126", "0.68389577", "0.680091", "0.6790719", "0.6786087", "0.67680496", "0.67680496", "0.67680496", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694", "0.67554694" ]
0.0
-1
FUNCION PARA OBTENER ALUMNOS POR ID APODERADO
public function getAllAlumnoByIDApoderado($id) { $sql="CALL SP_APODERADOS_SELECT_ALUMNOS_BY_IDAPODERADO(?)"; return $this->mysqli->find($sql, $id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buscarPorId($id) {\r\n \r\n }", "public function getIdfa();", "public function SalasPorId()\n{\n\tself::SetNames();\n\t$sql = \" select salas.codsala, salas.nombresala, salas.salacreada, mesas.codmesa, mesas.nombremesa, mesas.mesacreada, mesas.statusmesa FROM salas LEFT JOIN mesas ON salas.codsala = mesas.codsala where salas.codsala = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codsala\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function id_articulo($id){\n return (int)limpiarDatos($id);\n}", "public function buscarID()\n {\n $sentencia = \"SELECT id, cl FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n foreach ($registros as $r) {\n $id = $r->id;\n }\n return $id;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "public function ArqueoCajaPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * FROM arqueocaja INNER JOIN cajas ON arqueocaja.codcaja = cajas.codcaja LEFT JOIN usuarios ON cajas.codigo = usuarios.codigo where arqueocaja.codarqueo = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codarqueo\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function ComprasPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN mediospagos ON compras.formacompra = mediospagos.codmediopago WHERE compras.codcompra = ?\";\t\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function MesasPorId()\n{\n\tself::SetNames();\n\t$sql = \" select salas.codsala, salas.nombresala, salas.salacreada, mesas.codmesa, mesas.nombremesa, mesas.mesacreada, mesas.statusmesa FROM mesas INNER JOIN salas ON salas.codsala = mesas.codsala where mesas.codmesa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codmesa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function CreditosPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, clientes.tlfcliente, clientes.direccliente, clientes.emailcliente, ventas.idventa, ventas.codventa, ventas.codcaja, ventas.codcliente, ventas.subtotalivasive, ventas.subtotalivanove, ventas.ivave, ventas.totalivave, ventas.descuentove, ventas.totaldescuentove, ventas.totalpago, ventas.totalpago2, ventas.tipopagove, ventas.formapagove, ventas.fechaventa, ventas.fechavencecredito, ventas.statusventa, usuarios.nombres, cajas.nrocaja, abonoscreditos.codventa as cod, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (ventas LEFT JOIN clientes ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa LEFT JOIN cajas ON ventas.codcaja = cajas.codcaja LEFT JOIN usuarios ON ventas.codigo = usuarios.codigo WHERE ventas.codventa =? GROUP BY cod\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codventa\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function idDefinitivo($tipo,$id){\n $iddef=0;\n $objA=new admonDAO(); //direcionador =1 mandar a admon\n $objM=new medicoDAO(); //direcionar=2 mandar a medico\n $objP=new pacienteDAO(); //direccionar=3 mandar a paciente\n $resul1=$objA->readOneById($id); //error en datos\n $resul2=$objM->readOneById($id);\n $resul3=$objP->readOneById($id);\n \n if($tipo==1){\n for($i=0;$i<count($resul1);$i++){\n $iddef=$resul1[$i]['id_admon'];\n }\n }\n if($tipo==2){\n for($i=0;$i<count($resul2);$i++){\n $iddef=$resul2[$i]['id_medico'];\n }\n }\n if($tipo==3){\n for($i=0;$i<count($resul3);$i++){\n $iddef=$resul3[$i]['id_paciente'];\n }\n }\n \n return $iddef;\n }", "public function AbonosCreditosId() \n{\n\tself::SetNames();\n\t$sql = \" SELECT clientes.codcliente, clientes.cedcliente, clientes.nomcliente, ventas.idventa, ventas.codventa, ventas.totalpago, ventas.statusventa, abonoscreditos.codventa as codigo, abonoscreditos.fechaabono, SUM(montoabono) AS abonototal FROM (clientes INNER JOIN ventas ON clientes.codcliente = ventas.codcliente) LEFT JOIN abonoscreditos ON ventas.codventa = abonoscreditos.codventa WHERE abonoscreditos.codabono = ? AND clientes.cedcliente = ? AND ventas.codventa = ? AND ventas.tipopagove ='CREDITO'\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindValue(1, trim(base64_decode($_GET['codabono'])));\n\t$stmt->bindValue(2, trim(base64_decode($_GET['cedcliente'])));\n\t$stmt->bindValue(3, trim(base64_decode($_GET['codventa'])));\n\t$stmt->execute();\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t\texit;\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function id_tarjeta();", "public function ProductosPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria LEFT JOIN proveedores ON productos.codproveedor=proveedores.codproveedor WHERE productos.codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function ler_id($id) {\n $x = (int)$id;\n if($x >= $this->bd[0][0] || $x <= 0) {return false;}\n //comecando a setar tudo\n $this->id = $this->bd[$x][0];\n $this->maximo = $this->bd[$x][1];\n $this->nome = $this->bd[$x][2];\n $this->categoria = $this->bd[$x][3];\n $this->tipo = $this->bd[$x][4];\n $this->atributo = $this->bd[$x][5];\n $this->specie = $this->bd[$x][6];\n $this->lv = $this->bd[$x][7];\n $this->atk = $this->bd[$x][8];\n $this->def = $this->bd[$x][9];\n $this->preco = $this->bd[$x][10];\n $this->descricao = $this->bd[$x][11];\n $this->img = '../imgs/cards/'.$this->id.'.png';\n return true;\n }", "public function conseguirId (){\n $query = $this->db->query (\"SELECT * FROM acceso WHERE id_acceso = '{$this->id_acceso}'\");\n if ($query->num_rows === 1)\n {\n $this->datos= $query->fetch_assoc();\n \n }\n return $this->datos;\n }", "public function getIdAluno()\n {\n return $this->id_aluno;\n }", "function servicioID($id){\n\t\t\n\t\t$query = $this->db->from('servicio')->where('id',$id)->get();\n\t\tif($query-> num_rows() > 0)\n\t\t\t{\n\t\t\treturn $query;\n\t\t\t// SI SE MANDA A RETORNAR SOLO $QUERY , SE PUEDE UTILIZAR LOS ELEMENTOS DEL QUERY \n\t\t\t// COMO usuarioID($data['sesion']->result()[0]->id_usuario POR EJEMPLO. \n\t\t\t}\n\t\n\t}", "function _set_id( $idGrupo ){\n \t\t$this->idGrupo = $idGrupo;\n }", "protected function cargaIdUbicacion() {\n $dao = new PGDAO();\n $strSql = $this->COLECCIONMAPEOUBICA . $this->propiedad->getId_ubica();\n $arrayDatos = $this->leeDBArray($dao->execSql($strSql));\n $id = $arrayDatos[0]['zpubica'];\n return $id;\n }", "function ColsultarTodosLosID(){///funciona\n try {\n $FKAREA=$this->objRequerimiento->getFKAREA();\n $objControlConexion = new ControlConexion();\n $objControlConexion->abrirBd();\n //$comandoSql = \"select * from Requerimiento where FKAREA = '\".$FKAREA.\"' \";\n $comandoSql = \"SELECT IDREQ ,TITULO,FKEMPLE,FKAREA,FKESTADO,OBSERVACION,FKEMPLEASIGNADO FROM Requerimiento INNER JOIN detallereq ON Requerimiento.IDREQ=detallereq.FKREQ where FKAREA = '\".$FKAREA.\"'\";\n $rs = $objControlConexion->ejecutarSelect($comandoSql);\n return $rs;\n $objControlConexion->cerrarBd();\n } catch(Exception $e) {\n echo \"Error: \" . $e->getMessage();\n }\n}", "function buscar_id($id_autor){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"SELECT\n\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\tautor\n\t\t\t\tWHERE id_autor='$id_autor'\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$conexion -> cerrar();\n\t\tif($resultado == TRUE)\n\t\t{\n\t\t\trequire('autorClass.php');\n\t\t\t$autor = new Autor($resultado[0]['id_autor'], $resultado[0]['nombre_autor']);\n\t\t\t//Regreso los productos\n\t\t\treturn $autor;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "public function CajaPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from cajas LEFT JOIN usuarios ON cajas.codigo = usuarios.codigo WHERE cajas.codcaja = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codcaja\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function getIdproducto()\n {\n return $this->idproducto;\n }", "abstract public function getId();", "abstract function getId();", "public function personaYCargo($id)\n {\n\n }", "public function GetIdObsAluno()\n\t{\n\t\treturn $this->_phreezer->GetManyToOne($this, \"observacoes_ibfk_1\");\n\t}", "public function IngredientesPorId()\n{\n\tself::SetNames();\n\t$sql = \" SELECT * FROM ingredientes LEFT JOIN proveedores ON ingredientes.codproveedor = proveedores.codproveedor WHERE ingredientes.codingrediente = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codingrediente\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function getIdproducto()\n {\n return $this->idproducto;\n }", "function ConsultarId($id){\n $conn = Conexao::getconexao();\n $docente = new Docente();\n $lista;\n $i=0;\n \n try {\n \n \n \n $sql = \"SELECT * from users u, docentes d where u.id = d.users_id and u.id = :id\";\n \n $conn->query('SET NAMES utf8');\n $stmt = $conn->prepare($sql);\n $stmt->bindValue(':id', $id , PDO::PARAM_INT);\n \n if($stmt->execute()){\n \n $linha = $stmt->fetch(PDO::FETCH_ASSOC);\n //var_dump($linha);\n $docente->setId($linha['id']); \n $docente->setEmail($linha['email']);\n $docente->setNome($linha['nome']);\n $docente->setSenha($linha['senha']);\n $docente->setNivel($linha['nivel']);\n $docente->setCurso($linha['cursos_id']);\n $docente->setEspecialidade($linha['especialidade']);\n $docente->setImg($linha['img']);\n \n\n $sql = \"select * from formacoes where users_id = :id\";\n $stmt = $conn->prepare($sql);\n $stmt->bindValue(':id', $id , PDO::PARAM_INT);\n $stmt->execute();\n\n $lista = array();\n foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $linha){\n $formacao = new Formacao();\n $formacao->setId($linha['id']);\n $formacao->setNome($linha['nome']);\n $formacao->setInstituicao($linha['instituicao']);\n $formacao->setTipo($linha['tipo']);\n $formacao->setAno($linha['ano']);\n $lista[$i++] = $formacao; \n } \n\n $docente->setFormacao($lista);\n\n $sql = \"select * from pesquisa where users_id = :id\";\n $stmt = $conn->prepare($sql);\n $stmt->bindValue(':id', $id, PDO::PARAM_INT);\n $stmt->execute();\n\n $lista = array();\n $i = 1;\n foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $linha){\n $pesquisa = new Pesquisa();\n $pesquisa->setId($linha['idpesquisa']);\n $pesquisa->setNome($linha['nome']);\n\n $lista[$i++] = $pesquisa; \n }\n\n\n $docente->setPesquisa($lista);\n\n return $docente;\n } else {\n \n return false;\n }\n \n } catch( Exception $e ){\n echo $e->getMessage(); \n return false;\n }\n }", "public function traerPorVehiculo($id)\n {\n }", "public function DetalleProductosPorId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" SELECT * FROM productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria LEFT JOIN proveedores ON productos.codproveedor=proveedores.codproveedor WHERE productos.codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "function getAbogadoID($id){\n $query = \"SELECT\n nombre,\n apellidoP,\n apellidoM,\n email,\n fechaNac, \n valuePermission,\n cuentaBanco,\n costoBase,\n descripcion,\n cedulaPro\n FROM\n usuario\n LEFT JOIN(rol) ON usuario.rol_id = rol.id_rol \n LEFT JOIN(abogado) ON usuario.id_usuario = abogado.usuario_id\n WHERE\n usuario.id_usuario = \".$this->db->escape($id).\" AND\n rol.valuePermission = 1\n \";\n return $this->db->query($query);\n }", "public function setId()\n\t{\n\t}", "public function ProveedoresPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from proveedores where codproveedor = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codproveedor\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function id();", "public function ClientesPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from clientes where codcliente = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codcliente\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function getId();", "abstract public function get_id();", "public function carregarPorID($id) {\n $sid = \"\\\"$id\\\"\";\n $query = \"SELECT * FROM \" . get_class($this) . \" WHERE id=$sid\";\n $this->ATRIBUTO= bd::executeSqlParaArrayTitulada($query);\n if (is_null($this->ATRIBUTO['id'])) {\n throw new Exception(\"Erro ao carregar item \".get_class($this). \", id $id : Não encontrado.\");\n }\n else {\n $this->id=$this->ATRIBUTO['id'];\n }\n $this->carregarRelacionamentos();\n }", "public function MediosPagosId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * from mediospagos where codmediopago = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"formapagove\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function ProveedorPorId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * from proveedores where codproveedor = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codproveedor\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "function get_entrada_pr_pedido_id($id){\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, prf.monto_total as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and prf.pr_pedido_id='$id'\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function Ativar(){\n \n $idFrota = $_GET['id'];\n \n $frota = new Frota();\n \n $frota->id = $idFrota ;\n \n $frota::Ativando($frota);\n \n }", "function getId_carrera(){\n\t\treturn $this->id_carrera;\n\t}", "public function getId() ;", "function initialiserId()\n {\n if(empty($this->m_idOption))\n {\n $requete = 'SELECT idOption FROM optionHotel WHERE libelleOption=? AND prixOption=?';\n $tabParametres = array($this->m_libelleOption, $this->m_prixOption);\n $tabResultat = $this->m_bdd->selection($requete, $tabParametres);\n $this->m_idOption = $tabResultat[0]['idOption']; \n }\n }", "function idperfil($nombre){\n //busca en la tabla usuarios los campos donde el alias sea igual a lo que recibe del controlaor si no encuentra nada devuelve null\n $usuario = R::findOne('usuarios', 'alias=?', [\n $nombre\n ]);\n //guardo en una sesion la variable usuario y se retorna esa variable al controlador Usuarios.php linea 169 dentro de la carpeta usuario\n $_SESSION['idusuario']=$usuario->id;\n return $usuario;\n }", "public function listarPorId(){\n $query = \"select * from usuario where idusuario=?\";\n\n //preparando a consulta para a execução\n $stmt=$this->conn->prepare($query);\n\n //vamos fazer um blind(ligação) do id pesquisado\n //com o paramêtro da consulta, neste caso é o \n //ponto de interrogação\n $stmt ->bindParam(1,$this->idusuario);\n\n //executar efetivamente a consulta \n $stmt ->execute();\n\n //Organizar os dados retornados da consulta para \n // a exibição em formato de json\n // Vamos usar uma variavel e um array para associar \n // os campos da tabela\n $linha = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //organizar no objeto usuario(aqrquivo usuario.php)\n //os dados retornados\n //da tabela usuario que está no banco de dados\n \n $this->email = $linha['email'];\n $this->senha = $linha['senha'];\n $this->nome = $linha['nome'];\n $this->cpf = $linha['cpf'];\n $this->telefone = $linha['telefone'];\n $this->foto = $linha['foto'];\n\n }", "abstract public function getId();", "abstract public function getId();", "abstract public function getId();", "public function CajerosPorId()\n\t{\n\t\tself::SetNames();\n\t\t$sql = \" select * from cajas INNER JOIN usuarios ON cajas.codigo = usuarios.codigo WHERE cajas.codcaja = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_GET[\"codcaja\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[] = $row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function setId($valor){\n\t\t\t$this->id = $valor;\n\t\t}", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "public function traerPorId($id)\n {\n }", "public function getId_producto()\n {\n return $this->id_producto;\n }", "function getDatosId_item()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_item'));\n $oDatosCampo->setEtiqueta(_(\"id_item\"));\n return $oDatosCampo;\n }", "public function por_id($id){\n $this->db->select('a.id, b.nombre as Empresa, c.nombre as Servicio, d.nombre as Linea, a.nombre, a.fecha_inicio, a.fecha_fin, a.habilitado, a.tiene_ticket, a.horas_disponibles, a.facturable');\n $this->db->from('proyectos a');\n $this->db->join('empresas b', 'a.id_empresa = b.id');\n $this->db->join('vmca_tipo_servicio c', 'a.id_tipo_servicio = c.id');\n $this->db->join('vmca_lineas_servicio d', 'a.id_linea_servicio = d.id');\n $this->db->where(array('a.id' => $id));\n $query = $this->db->get();\n $resultado = array(\n 'err' => FALSE,\n 'mensaje' => 'Proyecto cargado exitosamente',\n 'proyecto' => $query->result()\n );\n\n return $resultado;\n }", "public function idAluno()\n {\n $result = $this->aluno->id_aluno;\n\n return $this->view->escapeHtml($result);\n }", "public function getID();", "public function getID();", "public function getID();", "public function MediosPagosPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from mediospagos where codmediopago = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codmediopago\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "function buscar_id($id_libro){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"SELECT\n\t\t\t\t*\n\t\t\t\tFROM\n\t\t\t\tlibro\n\t\t\t\tWHERE id_libro='$id_libro'\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$conexion -> cerrar();\n\t\tif($resultado == TRUE)\n\t\t{\n\t\t\trequire('libroClass.php');\n\t\t\t$libro = new Libro($resultado[0]['id_libro'], $resultado[0]['nombre_libro'], $resultado[0]['paginas_libro'], $resultado[0]['codigo_libro'], $resultado[0]['version_libro'], $resultado[0]['id_editorial'], $resultado[0]['id_estado_libro']);\n\t\t\t//Regreso los productos\n\t\t\treturn $libro;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "protected function IdUserListReproduction ()\n {\n $lista = Model_listas::find('all', array\n (\n 'where' => array\n (\n array('id_usuario'=>$this->userID()),\n array('titulo'=>'reproducidas')\n )\n ));\n if(!empty($lista))\n {\n $id=0;\n foreach ($lista as $key => $value)\n {\n $id = $lista[$key]->id;\n } \n return $id; \n }\n }", "function seleccionInicio($idP){\r\n }", "function obtenerUsuario_EspecialistaID($id){\n\t\n\t//$query = $this->db->from('sesion')->where('id',$id)->get();\n\t\n\t\t$user = 'user';\n\t $query = $this->db->from('usuario')->where('perfil',$user)->get();\n\t if($query-> num_rows() > 0){\n\t \t\n\t \t$row = $query->row($id);\n\t \t\n\t if (isset($row))\n\t\t\t{\n\t\t\t\t//echo ('ESTE ES EL ID'.' '.$row->id.'- ');\n \treturn $row->id; }\n\t\t}\n\t else return false ;\n\t \n\t}", "public function testid() {\n $tiempo = new TiempoFalso();\n $tarjeta = new Tarjeta( $tiempo );\n $colectivo = new Colectivo(NULL, NULL, NULL);\n\t$id=$tarjeta->obtenerID();\n $boleto = new Boleto(NULL, NULL, $tarjeta, $tarjeta->obtenerID(),NULL, NULL, NULL, NULL, $tiempo);\n\n $this->assertEquals($boleto->obteneriID(), $id);\n }", "function buscarPorID(Visita $obj)\r\n {\r\n $this->sql = sprintf(\"SELECT * FROM tipovisita WHERE id = %d\",\r\n mysqli_real_escape_string($this->con, $obj->getId()));\r\n $result = mysqli_query($this->con, $this->sql);\r\n\r\n $this->superdao->resetResponse();\r\n\r\n if(!$result) {\r\n $this->superdao->setMsg( resolve( mysqli_errno( $this->con ), mysqli_error( $this->con ), get_class( $obj ), 'BuscarPorId' ) );\r\n }else{\r\n while($row = mysqli_fetch_object($result)) {\r\n //classe pessoa\r\n // $controlPessoa = new PessoaControl(new Pessoa($row->idpessoa));\r\n // $objPessoa = $controlPessoa->buscarPorId();\r\n $this->obj = $row;\r\n }\r\n $this->superdao->setSuccess( true );\r\n $this->superdao->setData( $this->obj );\r\n }\r\n return $this->superdao->getResponse();\r\n }", "public function publicaciones() //Lleva ID del proveedor para hacer carga de BD\r\n\t{\r\n\t\t//Paso a ser totalmente otro modulo para generar mejor el proceso de visualizacion y carga de datos en la vistas\r\n\r\n\t}", "function consec_productobyID($id) {\n $sql = \"\n SELECT\n COUNT(idusuario)\n FROM vendedor\n WHERE idusuario=?;\";\n //$sql = $this->db->query($sql, array($id));\n \n //return $sql->simple_query(); //->total_cortes;\n }", "public function getIdentificacao();", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "public function getIdProducto()\n {\n return $this->id_producto;\n }", "function getDatosId_asignatura()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_asignatura'));\n $oDatosCampo->setEtiqueta(_(\"id_asignatura\"));\n return $oDatosCampo;\n }", "public function getId()\n {\n \treturn $this->id_actadocumentacion;\n }", "public function get_id();", "public function get_id();", "public function suprimerId($id)\n {\n }", "public function getId(): int;", "public function IdByMass(){\n }", "public function IdPropiedad($id) {\n $sql = \"SELECT * FROM addpropiedad WHERE id= \".$id;\n try {\n $mysql= mysqli_query($GLOBALS[\"db_link\"],$sql);\n if($mysql->num_rows == 1){\n\t\t\t $usuario = $mysql->fetch_assoc();\n $resultado = array($usuario);\n }\n return $resultado;\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":'. $e->getMessage() .'}}';\n }\n }", "public function ultimoID()\n {\n $sentencia = \"SELECT id, clNumReporte FROM tsreportebocadetubo ORDER BY id DESC LIMIT 1\";\n try {\n $stm = $this->db->prepare($sentencia);\n $stm->execute();\n $registros = $stm->fetchAll(PDO::FETCH_OBJ);\n\n return $registros;\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }", "function pegaId($id){\n $pdo=conecta();\n try{\n $pegaid = $pdo->prepare(\"SELECT * FROM tbclientes WHERE CLI_ID = ?\");\n $pegaid->bindValue(1, $id, PDO::PARAM_INT);\n $pegaid->execute();\n \n if ($pegaid->rowCount() > 0) {\n return $pegaid->fetch(PDO::FETCH_OBJ);\n return TRUE;\n } else {\n return FALSE;\n }\n }catch(PDOException $e){\n echo $e->getMessage();\n }\n}", "public function ID();", "public function findById(){\n\t\t$parametro = func_get_args();\n\t\t$resultado=$this->execSql($this->FINDBYID,$parametro);\n\t\tif (!$resultado){\n\t\t\t$this->onError(\"COD_FIND\",\"x ID NOTICIAS\");\n\t\t}\n\t\treturn $resultado;\n\t}", "public function getIdadeFilho1() {\n return $this->iIdadeFilho1;\n }", "public function getId ();", "function Consulta_id(){\r\n $query = \"SELECT\r\n o.ID_Eventos, o.EVE_Nombres, o.EVE_Descripcion, o.ID_Distrito, t.DIS_Nombre as Distrito, o.EVE_Detalles, o.EVE_Fotografia, o.EVE_Fecha_Hora, o.EVE_Longitud, o.EVE_Latitud\r\n FROM\r\n \" . $this->table_name . \" o\r\n LEFT JOIN\r\n Tbl_Distrito t\r\n ON o.ID_Distrito = t.ID_Distrito\r\n WHERE\r\n o.ID_Eventos = ?\r\n LIMIT\r\n 0,1\";\r\n // prepare query statement\r\n $stmt = $this->conn->prepare( $query );\r\n \r\n // bind id of product to be updated\r\n $stmt->bindParam(1, $this->ID_Eventos);\r\n \r\n // execute query\r\n $stmt->execute();\r\n \r\n // get retrieved row\r\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\r\n \r\n // set values to object properties\r\n $this->ID_Eventos = $row['ID_Eventos'];\r\n $this->EVE_Nombres = $row['EVE_Nombres'];\r\n $this->EVE_Descripcion = $row['EVE_Descripcion'];\r\n $this->ID_Distrito = $row['ID_Distrito'];\r\n $this->Distrito = $row['Distrito'];\r\n $this->EVE_Detalles = $row['EVE_Detalles'];\r\n $this->EVE_Fotografia = $row['EVE_Fotografia'];\r\n $this->EVE_Fecha_Hora = $row['EVE_Fecha_Hora'];\r\n $this->EVE_Longitud = $row['EVE_Longitud'];\r\n $this->EVE_Latitud = $row['EVE_Latitud'];\r\n }", "public function mostrar($id)\n {\n //\n }", "public function mostrar($id)\n {\n //\n }" ]
[ "0.736666", "0.7058507", "0.6928126", "0.68775266", "0.6846759", "0.68421143", "0.6837424", "0.6823921", "0.68156093", "0.68072265", "0.6801877", "0.67782944", "0.6738109", "0.6716963", "0.67115736", "0.6708167", "0.67046213", "0.6672978", "0.6659489", "0.6652308", "0.6623716", "0.6610762", "0.65885586", "0.6579547", "0.657759", "0.65740633", "0.65708345", "0.6562043", "0.6556259", "0.65204465", "0.6517321", "0.64896595", "0.64866686", "0.64631444", "0.64601874", "0.645019", "0.645019", "0.645019", "0.645019", "0.645019", "0.645019", "0.645019", "0.645019", "0.645019", "0.64455205", "0.6432286", "0.6430888", "0.64268935", "0.64225876", "0.64198875", "0.6412802", "0.6410124", "0.63998467", "0.6391384", "0.63904077", "0.63820595", "0.63817865", "0.638052", "0.638052", "0.638052", "0.6379909", "0.63785386", "0.6375822", "0.6375822", "0.6375822", "0.6369885", "0.6369733", "0.63596654", "0.63589674", "0.6348203", "0.6348203", "0.6348203", "0.63474303", "0.6339295", "0.63373995", "0.6334636", "0.6317328", "0.6309452", "0.6307392", "0.63007337", "0.6279416", "0.62623274", "0.62573385", "0.62573385", "0.6251096", "0.6247424", "0.6244548", "0.6244548", "0.6242166", "0.62393713", "0.6236841", "0.62309027", "0.62306035", "0.6228464", "0.622522", "0.6219047", "0.62188303", "0.62083924", "0.620703", "0.6206761", "0.6206761" ]
0.0
-1
FUNCION PARA AGREGAR UN NUEVO APODERADO
public function insert($apPaternoApoderado, $apMaternoApoderado, $nombresApoderado, $dniApoderado, $fechaNacApoderado, $direccionApoderado) { $sql="CALL SP_APODERADOS_INSERT(?,?,?,?,?,?)"; $conn = $this->mysqli->open(); $stmt = $conn->prepare($sql); $stmt -> bind_param('ssssss', $apPaternoApoderado, $apMaternoApoderado, $nombresApoderado, $dniApoderado, $fechaNacApoderado, $direccionApoderado); $result=$this->mysqli->executeIUD($stmt); $conn -> close(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function alta_compra(){\n\t\t$u= new Pr_pedido();\n\t\t$u->get_by_id($_POST['id']);\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->empresas_id=$GLOBALS['empresa_id'];\n\t\t$usuario=$this->usuario->get_usuario($GLOBALS['usuarioid']);\n\t\t//Encargada de Tienda\n\t\tif ($usuario->puesto_id==6 or $usuario->puesto_id==7) {\n\t\t\t$u->corigen_pedido_id=3;\n\t\t\t$u->usuario_validador_id=$u->usuario_id;\n\t\t} else {\n\t\t\t$u->corigen_pedido_id=2;\n\t\t}\n\t\t$u->fecha_alta=date(\"Y-m-d H:i:s\");\n\t\t$related = $u->from_array($_POST);\n\t\t//Adecuar las Fechas al formato YYYY/MM/DD\n\t\t$fecha_pago=explode(\" \", $_POST['fecha_pago']);\n\t\t$fecha_entrega=explode(\" \", $_POST['fecha_entrega']);\n\t\t$u->fecha_pago=\"\".$fecha_pago[2].\"-\".$fecha_pago[1].\"-\".$fecha_pago[0];\n\t\t$u->fecha_entrega=\"\".$fecha_entrega[2].\"-\".$fecha_entrega[1].\"-\".$fecha_entrega[0] ;\n\t\t// save with the related objects\n\t\tif($u->save($related)) {\n\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\techo '<button type=\"submit\" id=\"boton1\" style=\"display:none;\">Actualizar Registro</button>';\n\t\t\techo \"<p id=\\\"response\\\">Datos Generales Guardados<br/><b>Capturar los detalles del pedido</b></p>\";\n\t\t} else\n\t\t\tshow_error(\"\".$u->error->string);\n\t}", "public function pasaje_abonado();", "function aggiungiAllegato($pratica,$documento){\n \n}", "public function acessarRelatorios(){\n\n }", "function asignacion_anp_objetivos($id_objetivo_estrategico){\r\n\t\t//OBJETIVO ESTRATEGICO\t\t\t\t\r\n\t\t$sql_aae = \" SELECT * FROM anp_objetivo_estrategico \r\n\t\t\t\tWHERE id_objetivo_estrategico='\".$id_objetivo_estrategico.\"' \";\r\n\t\t$query_aae = new Consulta($sql_aae);\r\n\t\t$in_aae = \"\";\r\n\t\twhile($row_aae = $query_aae->ConsultaVerRegistro()){\r\n\t\t\t$in_aae .=$in_aae == \"\" ? $row_aae['id_anp_objetivo_estrategico'] : \",\".$row_aae['id_anp_objetivo_estrategico'];\t\r\n\t\t}\t\r\n\t\t\t\t\t\r\n\t\t//asignaciopn anp objetivos\r\n\t\t$sql_aao = \"SELECT * FROM asignacion_anp_objetivos \r\n\t\t\t\t\tWHERE id_anp_objetivo_estrategico in(\".$in_aae.\") \r\n\t\t\t\t\tAND id_axo_poa='\".$_SESSION[inrena_4][2].\"' \";\r\n\t\t\t\t\t\t\r\n\t\t$query_aao = new Consulta($sql_aao);\r\n\t\t$in_aao=\"\";\r\n\t\twhile($row_aao = $query_aao->ConsultaVerRegistro()){\r\n\t\t\t$in_aao .=$in_aao == \"\" ? $row_aao['id_asignacion_anp_objetivos'] : \",\".$row_aao['id_asignacion_anp_objetivos'];\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $in_aao;\r\n\t\r\n\t}", "function agregar($nombre_libro, $paginas_libro, $codigo_libro, $version_libro, $id_editorial, $id_estado_libro){\n\t\tinclude 'data_bd.inc';\n\t\tinclude 'databaseClass.php';\n\t\t//creo mi cadena de conexion\n\t\t$conexion = new DB($host, $user, $pass, $bd);\n\t\t//Creo mi conexión\n\t\t$status = $conexion->conectar();\n\t\t//En caso de que devuelva una falla\n\t\tif($status === FALSE){\n\t\t\tdie('No se pudo conectar');\n\t\t}\n\t\t//Creo mi query\n\t\t$consulta = \"INSERT INTO\n\t\t\t\t\t\t\t\tlibro(nombre_libro, paginas_libro, codigo_libro, version_libro, id_editorial, id_estado_libro)\n\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t'$nombre_libro',\n\t\t\t\t\t\t\t\t'$paginas_libro',\n\t\t\t\t\t\t\t\t'$codigo_libro',\n\t\t\t\t\t\t\t\t'$version_libro',\n\t\t\t\t\t\t\t\t$id_editorial,\n\t\t\t\t\t\t\t\t$id_estado_libro\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\";\n\t\t//Ejecuto la consulta\n\t\t$resultado = $conexion -> ejecutarConsulta($consulta);\n\t\t//Si fue una falla\n\t\tif($conexion === FALSE){\n\t\t\t$conexion -> cerrar();\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t//Cierro la conexion\n\t\t$id = $resultado;\n\t\t$conexion -> cerrar();\n\t\trequire('libroClass.php');\n\t\t$libro = new Libro($id, $nombre_libro, $paginas_libro, $codigo_libro, $version_libro, $id_editorial, $id_estado_libro);\n\t\t//Regreso los productos\n\t\treturn $libro;\n\t}", "function archobjet_autoriser() {\n}", "function InscricaoAvaliacao($codAtividade, $codAluno){\n\n }", "function agregar_nueva_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion){\n\t\n\t//VEO SI SE HA HECHO CLICK EN EL BOTON GUARDAR\n\tif(isset($_POST['btnGuardar'])) {\n\t\t\n\t\t\t$id_ef_cia = base64_decode($_GET['id_ef_cia']);\t\n\t\t \n\t\t\t//SEGURIDAD\n\t\t\t$num_poliza = $conexion->real_escape_string($_POST['txtPoliza']);\n\t\t\t$fecha_ini = $conexion->real_escape_string($_POST['txtFechaini']);\n\t\t\t$fecha_fin = $conexion->real_escape_string($_POST['txtFechafin']);\n\t\t\t$producto = $conexion->real_escape_string($_POST['txtProducto']);\n\t\t\t//GENERAMOS EL ID CODIFICADO UNICO\n\t\t\t$id_new_poliza = generar_id_codificado('@S#1$2013');\t\t\t\t\t\n\t\t\t//METEMOS LOS DATOS A LA BASE DE DATOS\n\t\t\t$insert =\"INSERT INTO s_poliza(id_poliza, no_poliza, fecha_ini, fecha_fin, producto, id_ef_cia) \"\n\t\t\t\t .\"VALUES('\".$id_new_poliza.\"', '\".$num_poliza.\"', '\".$fecha_ini.\"', '\".$fecha_fin.\"', '\".$producto.\"', '\".$id_ef_cia.\"')\";\n\t\t\t\n\t\t\t\n\t\t\t//VERIFICAMOS SI HUBO ERROR EN EL INGRESO DEL REGISTRO\n\t\t\tif($conexion->query($insert)===TRUE){\n\t\t\t\t\t\t\t\t\n\t\t\t\t$mensaje=\"Se registro correctamente los datos del formulario\";\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=1&msg='.base64_encode($mensaje));\n\t\t\t exit;\n\t\t\t} else {\n\t\t\t\t$mensaje=\"Hubo un error al ingresar los datos, consulte con su administrador \".$conexion->errno.\": \".$conexion->error;\n\t\t\t header('Location: index.php?l=des_poliza&var='.$_GET['var'].'&listarpolizas=v&id_ef_cia='.$_GET['id_ef_cia'].'&entidad='.$_GET['entidad'].'&compania='.$_GET['compania'].'&id_ef='.base64_encode($_GET['id_ef']).'&producto_nombre='.$_GET['producto_nombre'].'&producto_code='.$_GET['producto_code'].'&op=2&msg='.base64_encode($mensaje));\n\t\t\t\texit;\n\t\t\t}\n\t\t\n\t}else {\n\t\t//MUESTRO EL FORM PARA CREAR UNA CATEGORIA\n\t\tmostrar_crear_poliza($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion);\n\t}\n}", "public static function Nueva_Orden($fecha_ingreso, $id_cotizacion, $id_cliente, $id_locacion, $id_actividad, $num_muestras, $id_usuario, $estado, $version, $num_orden, $prioridad)\n {\n // Sentencia INSERT\n $comando = \"INSERT INTO ordenes (fecha_ingreso, id_cotizacion, id_cliente, id_locacion, id_actividad, num_muestras, id_usuario, estado, impreso, version, num_orden, razon_jt, razon_dt, razon_dc, recibido, enviado, prioridad) VALUES( ?,?,?,?,?,?,?,?,0,?,?,'','','',0,0,? )\";\n\n // Preparar la sentencia\n $sentencia = Database::getInstance()->getDb()->prepare($comando);\n\n return $sentencia->execute(\n array(\n $fecha_ingreso,\n $id_cotizacion,\n $id_cliente, \n $id_locacion,\n $id_actividad,\n $num_muestras,\n $id_usuario,\n $estado,\n $version,\n $num_orden,\n $prioridad\n )\n );\n\n }", "function cl_aguacoletorexporta() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacoletorexporta\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function Nuevo(){\n $pvd = new alumno();\n\n //Llamado de las vistas.\n require_once '../Vista/Alumno/agregar-alumnos.php';\n\n }", "public function mostraAggiornaP($pagina) {\r\n $idUpdate = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;\r\n $idPratica = isset($_REQUEST[\"idPratica\"]) ? $_REQUEST[\"idPratica\"] : null;\r\n\r\n $operatore = $_SESSION[\"op\"];\r\n $pagina->setHeaderFile(\"./view/header.php\");\r\n $pagina->setContentFile(\"./view/operatore/aggiornaP.php\");\r\n $ruolo = $operatore->getFunzione();\r\n OperatoreController::setruolo($pagina);\r\n $operatori = OperatoreFactory::getListaOp();\r\n $rows = count($operatori);\r\n\r\n if ($ruolo >= 2) {\r\n $pagina->setJsFile(\"./js/contentPratica.js\");\r\n } else {\r\n $pagina->setJsFile(\"./js/operatore.js\");\r\n }\r\n\r\n if ($_REQUEST[\"cmd\"] === \"aggiornaP\" && isset($_REQUEST[\"numeroP\"])) {\r\n\r\n $numeroP = $_REQUEST[\"numeroP\"];\r\n\r\n $idUpdate = PraticaFactory::ricercaPerNumeroPratica($numeroP);\r\n if ($numeroP == \"\") {\r\n $pagina->setMsg(\"Errore, inserisci il numero di una pratica esistente <br/>oppure utilizza la voce di menu [Elenco].\");\r\n } elseif (!isset($idUpdate)) {\r\n $pagina->setMsg(\"Errore, pratica N. \" . $numeroP . \" non presente! <br/>Inserisci il numero di una pratica esistente <br/>oppure utilizza la voce di menu [Elenco].\");\r\n } elseif ($ruolo < 2) {\r\n $pratica = PraticaFactory::getPraticaById($idUpdate);\r\n if ($pratica->getIncaricato() != $operatore->getId()) {\r\n unset($pratica);\r\n unset($idUpdate);\r\n }\r\n }\r\n }\r\n\r\n if (!isset($idUpdate)) {\r\n $pratica = new Pratica();\r\n } else {\r\n $pratica = PraticaFactory::getPraticaById($idUpdate);\r\n $pagina->setContentFile(\"./view/contentPratica.php\");\r\n $pagina->setTitle(\"Aggiorna pratica\");\r\n\r\n if (!isset($pratica)) {\r\n $pratica = new Pratica();\r\n }\r\n }\r\n\r\n if ($_REQUEST[\"cmd\"] == \"salvaP\") {\r\n $pagina->setJsFile(\"./js/contentPratica.js\");\r\n\r\n $contatto = isset($_REQUEST[\"contatto\"]) ? ($_REQUEST[\"contatto\"]) : null;\r\n $dataAvvioProcedimento = isset($_REQUEST[\"dataAvvioProcedimento\"]) ? ($_REQUEST[\"dataAvvioProcedimento\"]) : null;\r\n $dataCaricamento = isset($_REQUEST[\"dataCaricamento\"]) ? ($_REQUEST[\"dataCaricamento\"]) : null;\r\n $dataConferenzaServizi = isset($_REQUEST[\"dataConferenzaServizi\"]) ? ($_REQUEST[\"dataConferenzaServizi\"]) : null;\r\n $dataInvioRicevuta = isset($_REQUEST[\"dataInvioRicevuta\"]) ? ($_REQUEST[\"dataInvioRicevuta\"]) : null;\r\n $dataInvioVerifiche = isset($_REQUEST[\"dataInvioVerifiche\"]) ? ($_REQUEST[\"dataInvioVerifiche\"]) : null;\r\n $dataProtocollo = isset($_REQUEST[\"dataProtocollo\"]) ? ($_REQUEST[\"dataProtocollo\"]) : null;\r\n $dataProvvedimento = isset($_REQUEST[\"dataProvvedimento\"]) ? ($_REQUEST[\"dataProvvedimento\"]) : null;\r\n $flagAllaFirma = isset($_REQUEST[\"flagAllaFirma\"]) ? ($_REQUEST[\"flagAllaFirma\"]) : null;\r\n $flagFirmata = isset($_REQUEST[\"flagFirmata\"]) ? ($_REQUEST[\"flagFirmata\"]) : null;\r\n $flagInAttesa = isset($_REQUEST[\"flagInAttesa\"]) ? ($_REQUEST[\"flagInAttesa\"]) : null;\r\n $flagSoprintendenza = isset($_REQUEST[\"flagSoprintendenza\"]) ? ($_REQUEST[\"flagSoprintendenza\"]) : null;\r\n $importoDiritti = isset($_REQUEST[\"importoDiritti\"]) ? ($_REQUEST[\"importoDiritti\"]) : null;\r\n $incaricato = isset($_REQUEST[\"incaricato\"]) ? ($_REQUEST[\"incaricato\"]) : null;\r\n $motivoAttesa = isset($_REQUEST[\"motivoAttesa\"]) ? ($_REQUEST[\"motivoAttesa\"]) : null;\r\n $numeroPratica = isset($_REQUEST[\"numeroPratica\"]) ? ($_REQUEST[\"numeroPratica\"]) : null;\r\n $numeroProtocollo = isset($_REQUEST[\"numeroProtocollo\"]) ? ($_REQUEST[\"numeroProtocollo\"]) : null;\r\n $numeroProtocolloProvvedimento = isset($_REQUEST[\"numeroProtocolloProvvedimento\"]) ? ($_REQUEST[\"numeroProtocolloProvvedimento\"]) : null;\r\n $oggetto = isset($_REQUEST[\"oggetto\"]) ? ($_REQUEST[\"oggetto\"]) : null;\r\n $procuratore = isset($_REQUEST[\"procuratore\"]) ? ($_REQUEST[\"procuratore\"]) : null;\r\n $procuratoreId = isset($_REQUEST[\"procuratoreId\"]) ? ($_REQUEST[\"procuratoreId\"]) : null;\r\n $richiedente = isset($_REQUEST[\"richiedente\"]) ? ($_REQUEST[\"richiedente\"]) : null;\r\n $richiedenteId = isset($_REQUEST[\"richiedenteId\"]) ? ($_REQUEST[\"richiedenteId\"]) : null;\r\n $statoPratica = isset($_REQUEST[\"statoPratica\"]) ? ($_REQUEST[\"statoPratica\"]) : null;\r\n $suap = isset($_REQUEST[\"suap\"]) ? ($_REQUEST[\"suap\"]) : null;\r\n $tipoPratica = isset($_REQUEST[\"tipoPratica\"]) ? ($_REQUEST[\"tipoPratica\"]) : null;\r\n $ubicazione = isset($_REQUEST[\"ubicazione\"]) ? ($_REQUEST[\"ubicazione\"]) : null;\r\n\r\n $err = 0;\r\n $pratica->setContatto($contatto);\r\n $pratica->setDataAvvioProcedimento($dataAvvioProcedimento);\r\n $pratica->setDataCaricamento($dataCaricamento);\r\n $pratica->setDataConferenzaServizi($dataConferenzaServizi);\r\n $pratica->setDataInvioRicevuta($dataInvioRicevuta);\r\n $pratica->setDataInvioVerifiche($dataInvioVerifiche);\r\n if ($ruolo > 1) {\r\n $pratica->setDataProtocollo($dataProtocollo);\r\n $pratica->setFlagFirmata($flagFirmata);\r\n $pratica->setProcuratore($procuratore);\r\n if (!$pratica->setProcuratoreId($procuratoreId)) {\r\n $err++;\r\n }\r\n $pratica->setRichiedente($richiedente);\r\n if (!$pratica->setRichiedenteId($richiedenteId)) {\r\n $err++;\r\n }\r\n if (!$pratica->setIncaricato($incaricato)) {\r\n $err++;\r\n }\r\n if (!$pratica->setNumeroPratica($numeroPratica)) {\r\n $err++;\r\n }\r\n if (!$pratica->setNumeroProtocollo($numeroProtocollo)) {\r\n $err++;\r\n }\r\n if (!$pratica->setStatoPratica($statoPratica)) {\r\n $err++;\r\n }\r\n if (!$pratica->setTipoPratica($tipoPratica)) {\r\n $err++;\r\n }\r\n if (!$pratica->setSuap($suap)) {\r\n $err++;\r\n }\r\n }\r\n\r\n $pratica->setDataProvvedimento($dataProvvedimento);\r\n $pratica->setFlagAllaFirma($flagAllaFirma);\r\n $pratica->setFlagInAttesa($flagInAttesa);\r\n $pratica->setFlagSoprintendenza($flagSoprintendenza);\r\n $pratica->setImportoDiritti($importoDiritti);\r\n $pratica->setMotivoAttesa($motivoAttesa);\r\n $pratica->setNumeroProtocolloProvvedimento($numeroProtocolloProvvedimento);\r\n $pratica->setOggetto($oggetto);\r\n $pratica->setUbicazione($ubicazione);\r\n\r\n if ($idPratica == \"\" && $err === 0) {\r\n $pagina->setTitle(\"Salvataggio pratica\");\r\n $errore = PraticaFactory::salvaP($pratica);\r\n } elseif ($err === 0) {\r\n $pagina->setTitle(\"Aggiorna pratica\");\r\n $errore = PraticaFactory::aggiornaP($pratica);\r\n } else {\r\n $pagina->setTitle(\"Errore\");\r\n }\r\n if ($errore == 0 && $err == 0) {\r\n $pagina->setContentFile(\"./view/operatore/okNuovaP.php\");\r\n } elseif ($errore == 1062) {\r\n $pagina->setContentFile(\"./view/contentPratica.php\");\r\n $pagina->setMsg(\"Errore, pratica N. \" . $pratica->getNumeroPratica() . \" già presente!\");\r\n } else {\r\n $pagina->setContentFile(\"./view/contentPratica.php\");\r\n }\r\n }\r\n\r\n include \"./view/masterPage.php\";\r\n }", "function motivoDeAnulacionDesin(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNDS' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "function adjudicarTodo(){\n $this->procedimiento='adq.f_cotizacion_ime';\n $this->transaccion='ADQ_ADJTODO_IME';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_cotizacion','id_cotizacion','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function generarAtencion()\r\n{ \r\n\tglobal $use;\r\n\tglobal $priv;\r\n\r\n\t\t//DISTINGUE ENTRE ATENCION A DOMICILIO O ATENCION EN CONSULTORIO\r\n\t\tif(isset($_POST['atencion_domicilio'])){\r\n\t\t\t$dom=$_POST['dom'];\r\n\t\t\t$nrocasa=$_POST['nrocasa'];\r\n\t\t\t$barrio=$_POST['barrio'];\r\n\t\t\t$localidad=$_POST['localidad'];\r\n\t\t\t$cod_postal=$_POST['codpostal'];\r\n\t\t\t$dpto=$_POST['dpto'];\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$dom='EN CONSULTORIO';\r\n\t\t\t$nrocasa='';\r\n\t\t\t$barrio='';\r\n\t\t\t$localidad='';\r\n\t\t\t$cod_postal='';\r\n\t\t\t$dpto='';\r\n\t\t}\r\n\r\n\tif(isset($_POST['doctit']) && isset($_POST['nro'])){\r\n\t\t\r\n\t\t$cod_ser=$_POST['cod_serv'];\r\n\t\t$doctitu=$_POST['doctit'];\r\n\t\t$numdoc=$_POST['doc'];\r\n\t\t$nombre=$_POST['nombre'];\r\n\t\t$fec_pedido=$_POST['fecha'];\r\n\t\t$hora_pedido=$_POST['hora'];\r\n\t\t$dessit=$_POST['desc'];\r\n\t\t$profesional=$_POST['prof'];\r\n\t\t$sexo=$_POST['sexo'];\r\n\t\t$tel=$_POST['tel'];\r\n\t\t$id_persona= $_POST['id_persona'];\r\n\t\t$nro=$_POST['nro'];\t\t//nro es el numero de asociado\r\n\r\n\t\t$profesional_explode = explode('|',$profesional); //$profesional_explode[0] es nombre y $profesional_explode[1] es id_profesional\r\n\t\t\r\n\t\t$resultado=$GLOBALS['db']->query(\"INSERT INTO fme_asistencia (cod_ser,doctitu,numdoc,nombre,fec_pedido,hora_pedido,dessit,profesional,domicilio,casa_nro,barrio,localidad,codpostal,dpmto,id_persona, id_profesional)\r\n\t\t\t\tVALUES ('$cod_ser','$doctitu','$numdoc','$nombre','$fec_pedido','$hora_pedido','$dessit','$profesional_explode[0]','$dom','$nrocasa','$barrio','$localidad','$cod_postal','$dpto','$id_persona','$profesional_explode[1]')\");\r\n\t\t\r\n\t\t$res2=$GLOBALS['db']->select(\"SELECT idnum FROM fme_asistencia WHERE idnum=LAST_INSERT_ID()\");//obtentemos el id_atencion del ultimo insert realizado\r\n\t\t\r\n\t\t$id_atencion=$res2[0]['idnum']; \r\n\r\n\t\tif(!$resultado)\r\n\t\t{\r\n\t\t\t$error=[\r\n\t\t\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t\t\t'funcion'\t\t=>\"generarAtencion\",\r\n\t\t\t\t\t'descripcion'\t=>\"No se pudo realizar la consulta: INSERT INTO fme_asistencia (doctitu,numdoc,nombre,fec_pedido,hora_pedido,dessit,profesional)\r\n\t\t\t\tVALUES ('$doctitu','$numdoc','$nombre','$fec_pedido','$hora_pedido','$dessit','$profesional')\"\r\n\t\t\t\t\t];\r\n\t\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use','priv'));\t\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\theader('Location: ./nueva_atencion_finalizar.php?id_atencion='.$id_atencion);\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t\r\n\t//SI NO SE SETEA DOCTIT, ES PORQUE ES UN PARTICULAR ENTONCES:\r\n\telse{\r\n\t\t\t\t\r\n\t\t$cod_ser=$_POST['cod_serv'];\r\n\t\t$doctitu='';\r\n\t\t$numdoc=$_POST['doc'];\r\n\t\t$nombre=$_POST['nombre'];\r\n\t\t$fec_pedido=$_POST['fecha'];\r\n\t\t$hora_pedido=$_POST['hora'];\r\n\t\t$dessit=$_POST['desc'];\r\n\t\t$profesional=$_POST['prof'];\r\n\t\t$sexo=$_POST['sexo'];\r\n\t\t$tel=$_POST['tel'];\r\n\t\t$id_persona= $_POST['id_persona'];\r\n\t\t$nro='';\t\t//nro es el numero de asociado\r\n\r\n\t\t$profesional_explode = explode('|',$profesional); //$profesional_explode[0] es nombre y $profesional_explode[1] es id_profesional\r\n\t\t\r\n\t\t$resultado=$GLOBALS['db']->query(\"INSERT INTO fme_asistencia (cod_ser,doctitu,numdoc,nombre,fec_pedido,hora_pedido,dessit,profesional,domicilio,casa_nro,barrio,localidad,codpostal,dpmto,id_persona, id_profesional)\r\n\t\t\t\tVALUES ('$cod_ser','$doctitu','$numdoc','$nombre','$fec_pedido','$hora_pedido','$dessit','$profesional_explode[0]','$dom','$nrocasa','$barrio','$localidad','$cod_postal','$dpto','$id_persona','$profesional_explode[1]')\");\r\n\t\t\r\n\t\t$res2=$GLOBALS['db']->select(\"SELECT idnum FROM fme_asistencia WHERE idnum=LAST_INSERT_ID()\");//obtentemos el id_atencion del ultimo insert realizado\r\n\t\t\t\t\r\n\t\t$id_atencion=$res2[0]['idnum']; \r\n\r\n\t\tif(!$resultado)\r\n\t\t{\r\n\t\t\t$error=[\r\n\t\t\t\t\t'menu'\t\t\t=>\"Atenciones\",\r\n\t\t\t\t\t'funcion'\t\t=>\"generarAtencion\",\r\n\t\t\t\t\t'descripcion'\t=>\"No se pudo realizar la consulta: INSERT INTO fme_asistencia (doctitu,numdoc,nombre,fec_pedido,hora_pedido,dessit,profesional)\r\n\t\t\t\tVALUES ('$doctitu','$numdoc','$nombre','$fec_pedido','$hora_pedido','$dessit','$profesional')\"\r\n\t\t\t\t\t];\r\n\t\t\techo $GLOBALS['twig']->render('/Atenciones/error.html', compact('error','use','priv'));\t\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$persona=[\r\n\t\t\t'cod_serv'\t=>\t$cod_ser,\r\n\t\t\t'fecha'\t\t=>\t$fec_pedido,\r\n\t\t\t'hora'\t\t=>\t$hora_pedido,\r\n\t\t\t'nro'\t\t=>\t$nro,\r\n\t\t\t'nombre'\t=>\t$nombre,\r\n\t\t\t'sexo'\t\t=>\t$sexo,\r\n\t\t\t'tel'\t\t=>\t$tel,\r\n\t\t\t'doc'\t\t=>\t$numdoc,\r\n\t\t\t'doctit'\t=>\t$doctitu,\r\n\t\t\t'dom'\t\t=>\t$dom,\r\n\t\t\t'nro_casa'\t\t=>\t$nrocasa,\r\n\t\t\t'barrio'\t\t=>\t$barrio,\r\n\t\t\t'localidad'\t\t=>\t$localidad,\r\n\t\t\t'cod_postal'\t=>\t$cod_postal,\r\n\t\t\t'dpmto'\t\t\t=>\t$dpto,\r\n\t\t\t'prof'\t\t=>\t$profesional,\r\n\t\t\t'desc'\t\t=>\t$dessit\r\n\t\t];\r\n\t\t\r\n\t\theader('Location: ./nueva_atencion_finalizar.php?id_atencion='.$id_atencion);\r\n\t\treturn;\r\n\t}\r\n\r\n\t\r\n}", "public function AggiornaPrezzi(){\n\t}", "function insertarRelacionProceso(){\n\n $this->objFunc=$this->create('MODObligacionPago');\n if($this->objParam->insertar('id_relacion_proceso_pago')){\n $this->res=$this->objFunc->insertarRelacionProceso($this->objParam);\n } else{\n $this->res=$this->objFunc->modificarRelacionProceso($this->objParam);\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "function insertarObligacionCompleta()\n {\n $this->objFunc = $this->create('MODObligacionPago');\n if ($this->objParam->insertar('id_obligacion_pago')) {\n $this->res = $this->objFunc->insertarObligacionCompleta($this->objParam);\n } else {\n //TODO .. trabajar en la edicion\n }\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "function asignar_pago_adelantado($acceso,$id_contrato){\n\t$cable=conexion();\n\t$acceso1=conexion();\n\t$cable->objeto->ejecutarSql(\"select id_pago,costo_cobro,id_cont_serv from vista_pago_ser where id_contrato='$id_contrato' and id_serv='ZZZ00001'\");\n\twhile($row=row($cable)){\n\t\n\t\t$id_pago=trim($row['id_pago']);\n\t\t$id_cont_serv_deuda=trim($row['id_cont_serv']);\n\t\t$monto_pago=trim($row['costo_cobro'])+0;\n\t\t\n\t\t//echo \"<br>:$id_pago:$monto_pago:$id_cont_serv_deuda\";\n\t\t//echo \"<br>:select tipo_costo,id_cont_serv,(((cant_serv * costo_cobro)-descu) - pagado ) as costo from vista_contratodeu where id_contrato='$id_contrato' and status_con_ser='DEUDA' and costo_cobro>0 order by tipo_serv ,fecha_inst:<br>\";\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$acceso1->objeto->ejecutarSql(\"select tipo_costo,id_cont_serv,(((cant_serv * costo_cobro)-descu) - pagado ) as costo from vista_contratodeu where id_contrato='$id_contrato' and status_con_ser='DEUDA' and (((cant_serv * costo_cobro)-descu) - pagado )>0 order by tipo_serv ,fecha_inst\");\n\t\twhile($row=row($acceso1)){\n\t\t\t$id_cont_serv=trim($row['id_cont_serv']);\n\t\t\t$tipo_costo=trim($row['tipo_costo']);\n\t\t\t$costo=trim($row['costo'])+0;\n\t\t\t//echo \"<br>id_cont_serv:$id_cont_serv:costo:$costo<br>\";\n\t\t\tif($monto_pago>=$costo){\n\t\t\t\t$id_select=$id_select.\"=@$id_cont_serv\";\n\t\t\t\t$acceso->objeto->ejecutarSql(\"Update contrato_servicio_deuda Set apagar=0, pagado=pagado+'$costo' where id_cont_serv='$id_cont_serv'\");\n\t\t\t\t$acceso->objeto->ejecutarSql(\"insert into pago_factura(id_pago,id_cont_serv,costo_cobro_serv) values ('$id_pago','$id_cont_serv','$costo')\");\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update contrato_servicio_deuda set status_con_ser='PAGADO' where id_cont_serv='$id_cont_serv' and ((cant_serv * costo_cobro)-descu)=pagado\");\n\t\t\t\t$monto_pago=$monto_pago-$costo;\n\t\t\t}\n\t\t\telse if($monto_pago>0){\n\t\t\t\t$id_select=$id_select.\"=@$id_cont_serv\";\n\t\t\t\t$acceso->objeto->ejecutarSql(\"Update contrato_servicio_deuda Set apagar=0, pagado=pagado+'$monto_pago' where id_cont_serv='$id_cont_serv'\");\n\t\t\t\t\n\t\t\t\t$cable->objeto->ejecutarSql(\"select costo_cobro_serv from pago_factura where id_pago='$id_pago' and id_cont_serv='$id_cont_serv'\");\n\t\t\t\tif($row=row($cable)){\n\t\t\t\t\t$costo_cobro_serv1=trim($row['costo_cobro_serv'])+0;\n\t\t\t\t\t//echo \"<BR>ENTRO ACT<BR>update pago_factura set costo_cobro_serv=costo_cobro_serv+$costo_cobro_serv1 where id_pago='$id_pago' and id_cont_serv='$id_cont_serv';\";\n\t\t\t\t\t$acceso->objeto->ejecutarSql(\"update pago_factura set costo_cobro_serv=costo_cobro_serv+$costo_cobro_serv1 where id_pago='$id_pago' and id_cont_serv='$id_cont_serv'\");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$acceso->objeto->ejecutarSql(\"insert into pago_factura(id_pago,id_cont_serv,costo_cobro_serv) values ('$id_pago','$id_cont_serv','$monto_pago')\");\n\t\t\t\t}\n\t\t\t\t$acceso->objeto->ejecutarSql(\"update contrato_servicio_deuda set status_con_ser='PAGADO' where id_cont_serv='$id_cont_serv' and ((cant_serv * costo_cobro)-descu)=pagado\");\n\t\t\t\t$monto_pago=0;\n\t\t\t}\n\t\t}\n\t\t$acceso->objeto->ejecutarSql(\"select id_pago from contrato_servicio_deuda where id_cont_serv='$id_cont_serv_deuda'\");\n\t\t$row=row($acceso);\n\t\t$id_pago_ade=trim($row['id_pago']);\n\t\t\t//echo \"<br>:$monto_pago:<br>\";\n\t\tif($monto_pago>0){\n\t\t\t$acceso->objeto->ejecutarSql(\"update pago_factura set costo_cobro_serv=$monto_pago where id_cont_serv='$id_cont_serv_deuda' \");\n\t\t\t$acceso->objeto->ejecutarSql(\"update contrato_servicio_deuda set costo_cobro=$monto_pago, pagado=$monto_pago where id_cont_serv='$id_cont_serv_deuda'\");\n\t\t\t\n\t\t\tactualizar_monto_pago($acceso,$id_pago_ade);\n\t\t}else{\n\t\t\t\n\t\t\t$acceso->objeto->ejecutarSql(\"delete from pago_factura where id_cont_serv='$id_cont_serv_deuda'\");\n\t\t\t$acceso->objeto->ejecutarSql(\"delete from contrato_servicio_deuda where id_cont_serv='$id_cont_serv_deuda'\");\n\t\t\t//echo \"delete from pagos where id_pago='$id_pago_ade'<br><br>\";\n\t\t\t$acceso->objeto->ejecutarSql(\"delete from pagos where id_pago='$id_pago_ade'\");\n\t\t}\n\n\t}//while inicial\n}", "function generarPreingreso(){\n $this->procedimiento='adq.f_cotizacion_ime';\n $this->transaccion='ADQ_PREING_GEN';\n $this->tipo_procedimiento='IME';\n \n //Define los parametros para la funcion\n $this->setParametro('id_cotizacion','id_cotizacion','int4');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n\t\t//echo $this->consulta;exit;\n\t\t\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "function Nuevo() {\n /**\n * Crear instancia de EstacionHidrometrica\n */\n $EstacionHidrometrica = new EstacionHidrometrica();\n /**\n * Colocar los datos del POST por medio de los metodos SET\n */\n $EstacionHidrometrica->setIdEstacion(filter_input(INPUT_GET, 'clave'));\n $EstacionHidrometrica->setNombre(filter_input(INPUT_GET, 'nombre'));\n $EstacionHidrometrica->setCuenca_id(filter_input(INPUT_GET, 'cuenca_id'));\n $EstacionHidrometrica->setCorriente(filter_input(INPUT_GET, 'corriente'));\n $EstacionHidrometrica->setRegion_id(filter_input(INPUT_GET, 'id_reg_hidrologica'));\n $EstacionHidrometrica->setEstado_id(filter_input(INPUT_GET, 'estado_id'));\n $EstacionHidrometrica->setLatitud(filter_input(INPUT_GET, 'latitud'));\n $EstacionHidrometrica->setLongitud(filter_input(INPUT_GET, 'longitud'));\n if ($EstacionHidrometrica->Insert() != null) {\n echo 'OK';\n } else {\n echo 'Algo salío mal :(';\n }\n}", "function insertarProcesoCompra(){\n\t\t$this->procedimiento='adq.f_proceso_compra_ime';\n\t\t$this->transaccion='ADQ_PROC_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_depto','id_depto','int4');\n\t\t$this->setParametro('num_convocatoria','num_convocatoria','varchar');\n\t\t$this->setParametro('id_solicitud','id_solicitud','int4');\n\t\t$this->setParametro('id_estado_wf','id_estado_wf','int4');\n\t\t$this->setParametro('fecha_ini_proc','fecha_ini_proc','date');\n\t\t$this->setParametro('obs_proceso','obs_proceso','varchar');\n\t\t$this->setParametro('id_proceso_wf','id_proceso_wf','int4');\n\t\t$this->setParametro('num_tramite','num_tramite','varchar');\n\t\t$this->setParametro('codigo_proceso','codigo_proceso','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('estado','estado','varchar');\n\t\t$this->setParametro('num_cotizacion','num_cotizacion','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function valorpasaje();", "function generarOrden($arreglo){\n $nomEstadoItemOK = $this->datos->traerIdEstadoItemOK();\n $idEstadoEnUso = $this->datos->traerIdEstadoUso();\n $idEstadoOfertado = $this->datos->traerIdEstadoOferProd();\n $idEstadoOfertaEco = $this->datos->traerIdEstadoOferOK();\n \n //ACTUALIZO ESTADO ITEM OFERTA OK\n $this->datos->actualizaEstadoItemOK($arreglo[\"idOfe\"],$nomEstadoItemOK->nomEstado);\n \n //ACTUALIZO ESTADO OFERTA\n $this->datos->actualizaEstadoOfertaCom($arreglo[\"idOfe\"],$idEstadoOfertaEco->idEstadoOfOk);\n $ofertaEconomica = $this->datos->datosOfertaEconomica($arreglo[\"idOfe\"]);\n \n $idDetProductoOfertado = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoOfertado->idEstadoOferProd);\n \n \n /* \n $idDetProductoEnUso = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoOfertado->idEstadoOferProd);\n \n \n //ACTUALIZO ESTADO PRODUCTO\n foreach ($idDetProductoEnUso as $key => $valueProdOrden) {\n \n $this->datos->actualizaCantidadDetProd($valueProdOrden[\"idDetalle\"],$idEstadoEnUso->idEnUso);\n }\n \n $idDetProducto = $this->datos->traerIdDetProUso($arreglo[\"idOfe\"],$idEstadoEnUso->idEnUso);*/\n \n //INSERTO ENCABEZADO \n $idOrdenCompra = $this->datos->insertarOrdenCompra($ofertaEconomica,$arreglo[\"idOfe\"]);\n \n //INSERTO DETALLE\n foreach ($idDetProductoOfertado as $key => $valueDetOfe) {\n \n $this->datos->insertarOrdenDes($valueDetOfe[\"idDetalle\"],$idOrdenCompra);\n \n }\n \n $this->mostrarOfertaEconomica($arreglo);\n \n }", "public function nuovoProvvedimento($pagina) {\r\n \r\n $nuovoProvvedimento = new Provvedimento();\r\n \r\n $pagina->setJsFile(\"\");\r\n $operatore = $_SESSION[\"op\"];\r\n $ruolo = $operatore->getFunzione();\r\n $pagina->setHeaderFile(\"./view/header.php\");\r\n $pagina->setTitle(\"Nuovo provvedimento\");\r\n OperatoreController::setruolo($pagina);\r\n $pagina->setMsg('');\r\n $pagina->setContentFile(\"./view/operatore/nuovoProvvedimento.php\");\r\n $operatori = OperatoreFactory::getListaOp();\r\n $rows = count($operatori);\r\n \r\n if ($_REQUEST[\"cmd\"] == \"salvaProvvedimento\") {\r\n $pagina->setTitle(\"Salvataggio Provvedimento\");\r\n $numeroProvvedimento = isset($_REQUEST[\"numeroProvvedimento\"]) ? $_REQUEST[\"numeroProvvedimento\"] : null;\r\n $dataProvvedimento = isset($_REQUEST[\"dataProvvedimento\"]) ? $_REQUEST[\"dataProvvedimento\"] : null;\r\n $numeroProtocollo = isset($_REQUEST[\"numeroProtocollo\"]) ? $_REQUEST[\"numeroProtocollo\"] : null;\r\n $dataProtocollo = isset($_REQUEST[\"dataProtocollo\"]) ? $_REQUEST[\"dataProtocollo\"] : null;\r\n $praticaCollegata = isset($_REQUEST[\"praticaCollegata\"]) ? $_REQUEST[\"praticaCollegata\"] : null;\r\n $update = isset($_REQUEST[\"update\"]) && $_REQUEST[\"update\"] == true ? true : false;\r\n $id = isset($_REQUEST[\"id\"]) ? $_REQUEST[\"id\"] : null;\r\n \r\n $messaggio = '<div class=\"erroreInput\"><p>Errore, per proseguire occorre: </p><ul>';\r\n $errori = 0;\r\n \r\n if (!($nuovoProvvedimento->setNumeroProvvedimento($numeroProvvedimento))) {\r\n $messaggio .= '<li>Specificare il numero del provvedimento</li>';\r\n $errori++;\r\n }\r\n if (!($nuovoProvvedimento->setDataProvvedimento($dataProvvedimento))) {\r\n $messaggio .= '<li>Specificare la data del provvedimento</li>';\r\n $errori++;\r\n }\r\n if (!($nuovoProvvedimento->setNumeroProtocollo($numeroProtocollo))) {\r\n $messaggio .= '<li>Specificare il protocollo</li>';\r\n \r\n }\r\n if (!($nuovoProvvedimento->setDataProtocollo($dataProtocollo))) {\r\n $messaggio .= '<li>Specificare la data del protocollo</li>';\r\n \r\n }\r\n if (!($nuovoProvvedimento->setPraticaCollegata($praticaCollegata))) {\r\n $messaggio .= '<li>Specificare la pratica collegata/li>';\r\n $errori++;\r\n }\r\n\r\n $messaggio .='</ul></div>';\r\n \r\n if ($errori > 0) {\r\n $pagina->setMsg($messaggio);\r\n } else if (!$update) {\r\n $setNewProvvedimento = ProvvedimentoFactory::salvaProvvedimento($nuovoProvvedimento);\r\n\r\n if ($setNewProvvedimento === 0) {\r\n $pagina->setContentFile(\"./view/operatore/okNuovoProvvedimento.php\");\r\n $pagina->setTitle(\"Inserimento nuovo Provvedimento Unico\");\r\n } elseif ($setNewProvvedimento === 1062) {\r\n $pagina->setMsg('<div class=\"erroreInput\"><p>Errore, dati ripetuti</p></div>');\r\n }\r\n } else {\r\n $nuovoProvvedimento->setId($id);\r\n echo $id;\r\n $updateProvvedimento = ProvvedimentoFactory::updateProvvedimento($nuovoProvvedimento);\r\n\r\n if ($updateProvvedimento === 0) {\r\n $pagina->setContentFile(\"./view/operatore/okNuovoProvvedimento.php\");\r\n $pagina->setTitle(\"Modifica operatore\");\r\n } elseif ($updateProvvedimento === 1062) {\r\n $pagina->setMsg('<div class=\"erroreInput\"><p>Errore, dati ripetuti</p></div>');\r\n } else {\r\n $pagina->setMsg('<div class=\"erroreInput\"><p>Errore, non è possibile aggiornare</p></div>');\r\n }\r\n }\r\n }\r\n\r\n include \"./view/masterPage.php\";\r\n }", "function descontar_insumo($objeto) {\n\t\tsession_start();\n\t// Obtiene el almacen\n\t\t$almacen = \"SELECT\n\t\t\t\t\t\ta.id\n\t\t\t\t\tFROM\n\t\t\t\t\t\tadministracion_usuarios au\n\t\t\t\t\tLEFT JOIN\n\t\t\t\t\t\t\tapp_almacenes a\n\t\t\t\t\t\tON\n\t\t\t\t\t\t\ta.id_sucursal = au.idSuc\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tau.idempleado = \" . $_SESSION['accelog_idempleado'] . \"\n\t\t\t\t\tLIMIT 1\";\n\t\t$almacen = $this -> queryArray($almacen);\n\t\t$almacen = $almacen['rows'][0]['id'];\n\n\t// Valida que exista el almacen\n\t\t$almacen = (empty($almacen)) ? 1 : $almacen;\n\n\t\t$sql = \"INSERT INTO\n\t\t\t\t\tapp_inventario_movimientos\n\t\t\t\t\t\t(id_producto, cantidad, importe, id_almacen_origen, fecha, id_empleado,\n\t\t\t\t\t\ttipo_traspaso, costo, referencia)\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t('\" . $objeto['idProducto'] . \"', '\" . $objeto['cantidad'] . \"', '\" . $objeto['importe'] . \"',\n\t\t\t\t\t\t'\" . $almacen . \"', '\" . $objeto['fecha'] . \"', '\" . $_SESSION['accelog_idempleado'] . \"', 0,\n\t\t\t\t\t\t'\" . $objeto['costo'] . \"', 'Preparacion \" . $objeto['id_preparacion'] . \"')\";\n\t\t$result = $this -> query($sql);\n\n\t\treturn $result;\n\t}", "function ResumenEstadoCC(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_RESESTCC_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n\n $this->setCount(false);\n\n\n $this->setParametro('id_agencia','id_agencia','int4');\n\n\n\n //Definicion de la lista del resultado del query\n $this->captura('id_agencia','int4');\n $this->captura('tipo','varchar');\n $this->captura('moneda','varchar');\n $this->captura('monto','numeric');\n $this->captura('monto_mb','numeric');\n\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n\n\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function opcion__regenerar()\n\t{\n\t\t$this->get_proyecto()->regenerar();\n\t}", "function insertarSolicitudObligacionPago()\r\n {\r\n $this->procedimiento = 'tes.ft_solicitud_obligacion_pago_ime';\r\n $this->transaccion = 'TES_SOOBPG_INS';\r\n $this->tipo_procedimiento = 'IME';\r\n\r\n //Define los parametros para la funcion\r\n $this->setParametro('id_proveedor', 'id_proveedor', 'int4');\r\n $this->setParametro('tipo_obligacion', 'tipo_obligacion', 'varchar');\r\n $this->setParametro('id_moneda', 'id_moneda', 'int4');\r\n $this->setParametro('obs', 'obs', 'varchar');\r\n $this->setParametro('porc_retgar', 'porc_retgar', 'numeric');\r\n $this->setParametro('id_funcionario', 'id_funcionario', 'int4');\r\n $this->setParametro('porc_anticipo', 'porc_anticipo', 'numeric');\r\n $this->setParametro('id_depto', 'id_depto', 'int4');\r\n $this->setParametro('fecha', 'fecha', 'date');\r\n $this->setParametro('tipo_cambio_conv', 'tipo_cambio_conv', 'numeric');\r\n $this->setParametro('pago_variable', 'pago_variable', 'varchar');\r\n $this->setParametro('total_nro_cuota', 'total_nro_cuota', 'int4');\r\n $this->setParametro('fecha_pp_ini', 'fecha_pp_ini', 'date');\r\n $this->setParametro('rotacion', 'rotacion', 'int4');\r\n $this->setParametro('id_plantilla', 'id_plantilla', 'int4');\r\n $this->setParametro('tipo_anticipo', 'tipo_anticipo', 'varchar');\r\n $this->setParametro('id_contrato', 'id_contrato', 'int4');\r\n\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }", "function generar_estado_codigo()\n\t{\n\t\t$this->manejador_interface->mensaje(\"Calculando revisiones {$this->identificador} \" , false);\n\t\t$this->generar_checksum();\n\n\t\t//Esto simplemente se calcula para darle una idea al pobre chango de cual\n\t\t//fue la ultima revision que cargo en la base,util para el revert\n\t\t$svn = new toba_svn();\n\t\tif ($svn->hay_cliente_svn()) {\n\t\t\t$max_rev = 0;\n\t\t\t$revisiones = $svn->get_revisiones_dir_recursivos($this->get_dir_dump());\n\t\t\t$max_rev = 0;\n\t\t\tif (! empty($revisiones)) {\n\t\t\t\tforeach($revisiones as $revision) {\n\t\t\t\t\tif (isset($revision['error'])) {\n\t\t\t\t\t\tthrow new toba_error_def($revision['error']);\n\t\t\t\t\t}\n\t\t\t\t\tif ($max_rev < intval($revision['revision'])) {\n\t\t\t\t\t\t$max_rev = intval($revision['revision']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->manejador_interface->progreso_avanzar();\n\t\t\t$this->instancia->set_revision_proyecto($this->identificador, $max_rev);\n\t\t}\n\t\t$this->manejador_interface->progreso_fin();\n\t}", "public function buscar($objeto){\r\n\t}", "abstract function ActualizarDatos();", "function cl_evolucaodividaativa() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"evolucaodividaativa\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "static public function agregarViajeControlador()\n {\n\n if (isset($_POST[\"nuevoCamionViaje\"])) {\n\n $tabla = \"VIAJE\";\n\n $datos = array(\n \"ID_CAMIONES\" => strtoupper($_POST[\"nuevoCamionViaje\"]),\n \"TIPO_VIAJE\" => strtoupper($_POST[\"nuevoTipoViaje\"]),\n \"CANTIDAD_PEDIDOS\" => strtoupper($_POST[\"nuevoCantidadPedidos\"]),\n \"MONTO_TOTAL\" => strtoupper($_POST[\"nuevoTotalPagos\"]),\n \"DESCRIPCION\" => strtoupper($_POST[\"nuevoRutaViaje\"]),\n \"FECHA_SALIDA\" => strtoupper($_POST[\"nuevoFechaViaje\"]),\n \"ESTATUS\" => strtoupper(\"1\"),\n );\n\n date_default_timezone_set('America/Mexico_City');\n\n $fecha = date('Y-m-d');\n\n $fechaActual = $_POST[\"nuevoFechaViaje\"];\n\n if ($fecha == $fechaActual) {\n ModeloCamiones::actualizarCamionesModelo(\"Repartiendo\", $datos[\"ID_CAMIONES\"]);\n } else {\n ModeloCamiones::actualizarCamionesModelo(\"Cargado\", $datos[\"ID_CAMIONES\"]);\n }\n\n $respuesta = ModeloViaje::agregarViajeModelo($tabla, $datos);\n // var_dump($fecha);\n // var_dump($fechaActual);\n\n\n\n if ($respuesta == \"ok\") {\n\n echo '<script>\n\n swal({\n\n type: \"success\",\n title: \"¡Registro guardado correctamente!\",\n showConfirmButton: true,\n confirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n\n }).then((result)=>{\n\n if(result.value){\n \n window.location = \"agenda\";\n\n }\n\n });\n \n\n </script>';\n }\n\n\n\n\n // var_dump($datos);\n\n // if($datos[\"TIPO_VIAJE\"] == \"Local\"){\n // ModeloCamiones::actualizarCamionesModelo(\"Disponible\",$datos[\"ID_CAMIONES\"]);\n // }\n }\n }", "function alta_entrada_bonificacion(){\n\t\t$varP=$_POST;\n\t\t$line=$this->uri->segment(4);\n\t\t$pr= new Entrada();\n\t\t$pr->usuario_id=$GLOBALS['usuarioid'];\n\t\t$pr->empresas_id=$GLOBALS['empresaid'];\n\t\t$pr->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$pr->pr_facturas_id=$varP['pr_facturas_id'.$line];\n\t\t$pr->cproductos_id=$varP['producto'.$line];\n\t\t$pr->cantidad=$varP['unidades'.$line];\n\t\t$pr->estatus_general_id=1;\n\t\t$pr->costo_unitario=0;\n\t\t$pr->tasa_impuesto=0;\n\t\t$pr->costo_total=0;\n\t\t$pr->ctipo_entrada=9;\n\t\t$pr->cproveedores_id=$this->pr_factura->get_pr_factura_entrada($varP['pr_facturas_id'.$line]);\n\t\t$pr->fecha=date(\"Y-m-d H:i:s\");\n\t\tif(isset($varP['id'.$line])==true){\n\t\t\t$pr->id=$varP['id'.$line];\n\t\t}\n\t\t// save with the related objects\n\t\tif($pr->save())\n\t\t{\n\t\t\techo form_hidden('id'.$line, \"$pr->id\"); echo form_hidden('pr_facturas_id'.$line, \"$pr->pr_facturas_id\"); echo \"<a href=\\\"javascript:borrar_detalle('$pr->id', $line)\\\"><img src=\\\"\".base_url().\"images/trash1.png\\\" width=\\\"20px\\\" title=\\\"Borrar Detalle\\\"/></a><img src=\\\"\".base_url().\"images/ok.png\\\" width=\\\"20px\\\" title=\\\"Guardado\\\"/>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "function insertarTipoVenta(){\n\t\t$this->procedimiento='vef.ft_tipo_venta_ime';\n\t\t$this->transaccion='VF_TIPVEN_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('codigo_relacion_contable','codigo_relacion_contable','varchar');\n\t\t$this->setParametro('nombre','nombre','varchar');\n\t\t$this->setParametro('tipo_base','tipo_base','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('codigo','codigo','varchar');\n\t\t$this->setParametro('id_plantilla','id_plantilla','integer');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function cl_ouvidoriaatendimento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ouvidoriaatendimento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "static public function ctrCrearTransportadoraExterno(){\n\n\t\tif(isset($_POST[\"nuevaTransportadora\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ\\. ]+$/', $_POST[\"nuevaTransportadora\"])){\n\n\t\t\t /*=============================================\n\t\t\t\tVALIDAR IMAGEN DEL LOGO\n\t\t\t\t=============================================*/\n\n\t\t\t\t$ruta = \"\";\n\n\t\t\t\tif(isset($_FILES[\"nuevoLogo\"][\"tmp_name\"])){\n\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"nuevoLogo\"][\"tmp_name\"]);\n\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR EL LOGO DE LA TRANSPORTADORA\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t$nuevaTransportadoraDir = str_replace(array('ñ','Ñ','á','é','í','ó','ú','Á','É','Í','Ó','Ú','.',' '),array('n','N','a','e','i','o','u','A','E','I','O','U','_','_'),trim($_POST[\"nuevaTransportadora\"]));\n\n\t\t\t\t\t$directorio = \"vistas/img/transportadoras/\".$nuevaTransportadoraDir;\n\n\t\t\t\t\tmkdir($directorio, 0755);\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\tif($_FILES[\"nuevoLogo\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/transportadoras/\".$nuevaTransportadoraDir.\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"nuevoLogo\"][\"tmp_name\"]);\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES[\"nuevoLogo\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/transportadoras/\".$nuevaTransportadoraDir.\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"nuevoLogo\"][\"tmp_name\"]);\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t/* =====================================\n\t\t\t\t\tVALIDAR TRANSPORTADORA\n\t\t\t\t========================================== */\n\n\t\t\t\t$tabla = \"transportadoras\";\n\n\t\t\t\t$datos = array(\"transportadora\" => $_POST[\"nuevaTransportadora\"],\n\t\t\t\t\t \"logo\"=>$ruta);\n\n\t\t\t\t$respuesta = ModeloTransportadoras::mdlIngresarTransportadora($tabla, $datos);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\ttitle: \"¡La transportadora ha sido guardada correctamente!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\twindow.location = \"radicador\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\n\t\t\t\t\t</script>';\n\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n\n\t\t\t\techo '<script>\n\n\t\t\t\t\tswal({\n\n\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\ttitle: \"¡La transportadora no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\n\t\t\t\t\t\t\twindow.location = \"radicador\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\n\t\t\t\t</script>';\n\n\t\t\t}\n\n\n\t\t}\n\n\n\t}", "function motivoDeAnulacion(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNRE' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "function procesar_anidado($parametros=null, $no_borrar=null)\r\n\t{\r\n\t\t$resultado = null;\r\n\t\t$this->_log->debug( $this->get_txt() . \"[ toba_cn: procesar_anidado ]\", 'toba');\r\n\t\t$this->evt__validar_datos();\r\n\t\t$resultado = $this->evt__procesar_especifico($parametros);\r\n\t\t$this->limpiar_memoria($no_borrar);\r\n\t\treturn $resultado;\r\n\t}", "function crearComentario($bd,$usuario){\n //Hago un filtrado previo por si hay valores indeseables en el array\n $arrayFiltrado=array();\n foreach ($_POST as $k => $v)\n $arrayFiltrado[$k] = filtrado($v);\n $entrada = new Entrada($arrayFiltrado[\"entrada\"]);\n $comentario = new Comentario(NULL,$arrayFiltrado[\"comentario\"],$arrayFiltrado[\"fechacreacion\"]);\n $daoComentario = new Comentarios($bd);\n $daoComentario->addComentario($comentario,$entrada,$usuario);\n return true;\n}", "function crearProyecto($proyecto){\n //no implementado por no requerimiento del proyecto\n }", "function motivoDeAnulacionAsig(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNAS' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "private function iniciar_pagina_anuncio(){\n\t\t//==========necesarios para anuncios===============\n\t\trequire_once 'inc/clases/form_busqueda_builder.class.php';\t//para formularios ($Form)\n\t\trequire_once 'inc/clases/public/empresa.class.php';\t\t\t//pagina de empresa (y empresas)\n\t\trequire_once 'inc/clases/public/pagina_anuncio.class.php';\t\t//pagina anuncio(Modulo)\n\n\n\t\t$Anuncio = new Pagina_anuncio();\n\t\t//var_dump($Anuncio);\n\t\tif($Anuncio->correcto == false){\n\t\t\t$this->forzar_404();\n\t\t}else{\n\t\t\t//var_dump('esta ok');\n\t\t\t$this->anuncio = $Anuncio->salida;\n\t\t\t$empresa = $this->anuncio['ussr'];\n\t\t\t$this->Empresa = new Empresa();\n\t\t\t$this->Empresa->extraigo_para_anuncios($empresa);\n\n\t\t}\n\t}", "public function buscarEstudianteAcuerdo() {\n\n $sql = \"SELECT \n D.tipodocumento, D.nombrecortodocumento, EG.numerodocumento, EG.idestudiantegeneral,\n EG.nombresestudiantegeneral, EG.apellidosestudiantegeneral, EG.expedidodocumento, C.codigocarrera\n FROM \n estudiantegeneral EG\n INNER JOIN estudiante E ON ( E.idestudiantegeneral = EG.idestudiantegeneral )\n INNER JOIN documento D ON ( D.tipodocumento = EG.tipodocumento )\n INNER JOIN carrera C ON ( C.codigocarrera = E.codigocarrera )\n INNER JOIN FechaGrado FG ON ( FG.CarreraId = C.codigocarrera )\n INNER JOIN AcuerdoActa A ON ( A.FechaGradoId = FG.FechaGradoId )\n INNER JOIN DetalleAcuerdoActa DAC ON ( DAC.AcuerdoActaId = A.AcuerdoActaId AND E.codigoestudiante = DAC.EstudianteId )\n WHERE\n E.codigoestudiante = ?\n AND D.CodigoEstado = 100\n AND DAC.EstadoAcuerdo = 0\n AND DAC.CodigoEstado = 100\";\n\n $this->persistencia->crearSentenciaSQL($sql);\n $this->persistencia->setParametro(0, $this->getCodigoEstudiante(), false);\n $this->persistencia->ejecutarConsulta();\n if ($this->persistencia->getNext()) {\n $this->setIdEstudiante($this->persistencia->getParametro(\"idestudiantegeneral\"));\n $this->setNumeroDocumento($this->persistencia->getParametro(\"numerodocumento\"));\n $this->setNombreEstudiante($this->persistencia->getParametro(\"nombresestudiantegeneral\"));\n $this->setApellidoEstudiante($this->persistencia->getParametro(\"apellidosestudiantegeneral\"));\n $this->setExpedicion($this->persistencia->getParametro(\"expedidodocumento\"));\n\n $tipoDocumento = new TipoDocumento(null);\n $tipoDocumento->setIniciales($this->persistencia->getParametro(\"tipodocumento\"));\n $tipoDocumento->setDescripcion($this->persistencia->getParametro(\"nombrecortodocumento\"));\n\n $fechaGrado = new FechaGrado(null);\n\n $carrera = new Carrera(null);\n $carrera->setCodigoCarrera($this->persistencia->getParametro(\"codigocarrera\"));\n\n $fechaGrado->setCarrera($carrera);\n\n $this->setTipoDocumento($tipoDocumento);\n\n $this->setFechaGrado($fechaGrado);\n }\n\n $this->persistencia->freeResult();\n }", "function buscar_comprobante_doc_venta($id_cuenta, $id_anexo, $id_serie, $id_numero ) {\n $sql = \"SELECT\n\t\t\t\t\t prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\t, sum(if(prosic_moneda.id_moneda=1,prosic_detalle_comprobante.importe_soles,prosic_detalle_comprobante.importe_dolares*prosic_tipo_cambio.venta_financiero)*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_soles\n\t\t\t\t\t, sum(if(prosic_moneda.id_moneda=1,prosic_detalle_comprobante.importe_soles*prosic_tipo_cambio.venta_financiero,prosic_detalle_comprobante.importe_dolares)*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_dolares\n\t\t\t\tFROM prosic_detalle_comprobante\n\t\t\t\tINNER JOIN prosic_plan_contable ON prosic_detalle_comprobante.id_plan_contable=prosic_plan_contable.id_plan_contable\n\t\t\t\tINNER JOIN prosic_anexo ON prosic_detalle_comprobante.id_anexo = prosic_anexo.id_anexo\n\t\t\t\tINNER JOIN prosic_moneda ON prosic_detalle_comprobante.id_moneda = prosic_moneda.id_moneda\n\t\t\t\tLEFT JOIN prosic_tipo_cambio ON prosic_detalle_comprobante.fecha_doc_comprobante=prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\tWHERE 1=1 \";\n\t\t\t\tif ($id_cuenta != '')$sql.=\" AND prosic_plan_contable.cuenta_plan_contable LIKE '%\" . $id_cuenta . \"%'\";\n if ($id_anexo != '')$sql.=\" AND prosic_anexo.codigo_anexo LIKE '%\" . $id_anexo . \"%'\";\n if ($id_numero != '')$sql.=\" AND prosic_detalle_comprobante.nro_doc_comprobante LIKE '%\" . $id_numero . \"%'\";\n\t\t\t$sql.=\" group by prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\thaving importe_soles>0\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function novo_aluno()\n\t{\n\t\t//================= INICIO SELECT DINAMICO [CARREGA TODOS OS PAISES NO SELECT PAIS] =================\n\t\t$dados['pais'] = $this->Select_Dinamico_Model->busca_pais();\n\t\t//=================\tCHAMA A VIEW do FURMULARIO CRIAR ALUNO =================\n\t\t$this->load->model(\"Aluno_Model\", \"aluno\");\n\t\t$this->load->view('layout/cabecalho_secretaria');\n\t \t$this->load->view('layout/menu_lateral_secretaria');\n\t\t$this->load->view('conteudo/_secretaria/_aluno/criar_aluno', $dados);\n\t\t$this->load->view('layout/rodape');\n\t\t$this->load->view('layout/script');\n\t}", "public function mostraElencoProvvedimenti($pagina) {\r\n \r\n $pagina->setJsFile(\"\");\r\n $operatore = $_SESSION[\"op\"];\r\n $ruolo = $operatore->getFunzione();\r\n $pagina->setHeaderFile(\"./view/header.php\"); \r\n OperatoreController::setruolo($pagina);\r\n $pagina->setMsg('');\r\n \r\n if (isset($_REQUEST['id'])) {\r\n $id = $_REQUEST['id'];\r\n $nuovoProvvedimento = ProvvedimentoFactory::getProvvedimento($id);\r\n $pagina->setTitle(\"Modifica operatore\");\r\n $pagina->setContentFile(\"./view/operatore/nuovoProvvedimento.php\");\r\n $update = true;\r\n } else {\r\n $pagina->setJsFile(\"./js/provvedimenti.js\");\r\n $pagina->setTitle(\"Elenco provvedimenti Unici\");\r\n $pagina->setContentFile(\"./view/operatore/elencoProvvedimenti.php\"); \r\n }\r\n include \"./view/masterPage.php\";\r\n }", "public function assinarETravarDocumentoProcesso( $objUnidadeDTO, $arrParametros, $documentoDTO, $objProcedimentoDTO ){\n\t\t $orgaoRN = new OrgaoRN();\n\t\t\t$orgaoDTO = new OrgaoDTO();\n\t\t\t$orgaoDTO->retTodos();\n\t\t\t$orgaoDTO->retStrEmailContato();\n\t\t\t$orgaoDTO->setNumIdOrgao( $objUnidadeDTO->getNumIdOrgao() );\n\t\t\t$orgaoDTO->setStrSinAtivo('S');\n\t\t\t$orgaoDTO = $orgaoRN->consultarRN1352($orgaoDTO);\n\n\t\t\tif (!empty($arrParametros['selCargo'])){\n\t\t\t\t//consultar nome do cargao funcao selecionada na combo\n\t\t\t\t$cargoRN = new CargoRN();\n\t\t\t\t$cargoDTO = new CargoDTO();\n\n\t\t\t\t//alteracoes seiv3\n\t\t\t\t$cargoDTO->retNumIdCargo();\n\t\t\t\t$cargoDTO->retStrExpressao();\n\t\t\t\t$cargoDTO->retStrSinAtivo();\n\n\t\t\t\t$cargoDTO->setNumIdCargo( $arrParametros['selCargo'] );\n\t\t\t\t$cargoDTO->setStrSinAtivo('S');\n\t\t\t\t$cargoDTO = $cargoRN->consultarRN0301($cargoDTO);\n\n\t\t\t\tif (!is_null($cargoDTO)){\n\t\t\t\t\t$cargoExpressao = \"Usuário Externo - \" . $cargoDTO->getStrExpressao();\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$cargoExpressao = $arrParametros['selCargoFuncao'];\n\t\t\t}\n\n\t\t\t//liberando assinatura externa para o documento\n\t\t\t$objAcessoExternoDTO = new AcessoExternoDTO();\n\t\t\t\n\t\t\t//trocado de $TA_ASSINATURA_EXTERNA para $TA_SISTEMA para evitar o envio de email de notificação\n\t\t\t$objAcessoExternoDTO->setStrStaTipo(AcessoExternoRN::$TA_ASSINATURA_EXTERNA ); \n\t\t\t\n\t\t\t//checar se o proprio usuario ja foi adicionado como interessado (participante) do processo\n\t\t\t$objUsuarioDTO = new UsuarioDTO();\n\t\t\t$objUsuarioDTO->retTodos();\n\n\t\t\t$idUsuario = !empty(SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno()) ? SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno() : SessaoSEI::getInstance()->getNumIdUsuario();\n\t\t\t$objUsuarioDTO->setNumIdUsuario( $idUsuario );\n\n\t\t\t$objUsuarioRN = new UsuarioRN();\n\t\t\t$objUsuarioDTO = $objUsuarioRN->consultarRN0489( $objUsuarioDTO );\n\t\t\t$idContato = $objUsuarioDTO->getNumIdContato();\n\t\t\t\n\t\t\t$objParticipanteDTO = new ParticipanteDTO();\n\t\t\t$objParticipanteDTO->retStrSiglaContato();\n\t\t\t$objParticipanteDTO->retStrNomeContato();\n\t\t\t$objParticipanteDTO->retNumIdUnidade();\n\t\t\t$objParticipanteDTO->retDblIdProtocolo();\n\t\t\t$objParticipanteDTO->retNumIdParticipante();\n\t\t\t$objParticipanteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );\n\t\t\t$objParticipanteDTO->setNumIdContato( $idContato );\n\t\t\t$objParticipanteDTO->setDblIdProtocolo( $objProcedimentoDTO->getDblIdProcedimento() );\n\t\t\t\t\t\t\n\t\t\t$objParticipanteRN = new ParticipanteRN();\n\t\t\t$arrObjParticipanteDTO = $objParticipanteRN->listarRN0189($objParticipanteDTO);\n\t\t\t\n\t\t\tif( $arrObjParticipanteDTO == null || count( $arrObjParticipanteDTO ) == 0){\n\t\t\t\t\n\t\t\t\t//cadastrar o participante\n\t\t\t\t$objParticipanteDTO = new ParticipanteDTO();\n\t\t\t\t$objParticipanteDTO->setNumIdContato( $idContato );\n\t\t\t\t$objParticipanteDTO->setDblIdProtocolo( $objProcedimentoDTO->getDblIdProcedimento() );\n\t\t\t\t$objParticipanteDTO->setStrStaParticipacao( ParticipanteRN::$TP_ACESSO_EXTERNO );\n\t\t\t\t$objParticipanteDTO->setNumIdUnidade( $objUnidadeDTO->getNumIdUnidade() );\n\t\t\t\t$objParticipanteDTO->setNumSequencia(0);\n\t\t\t\t\n\t\t\t\t$objParticipanteDTO = $objParticipanteRN->cadastrarRN0170( $objParticipanteDTO );\n\t\t\t\t$idParticipante = $objParticipanteDTO->getNumIdParticipante();\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$idParticipante = $arrObjParticipanteDTO[0]->getNumIdParticipante();\n\t\t\t}\n\n\t\t\tif (!empty(SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno())){\n\t\t\t\t//alteracoes seiv3\n\t\t\t\t$objAcessoExternoDTO->setStrEmailUnidade($orgaoDTO->getStrEmailContato() ); //informando o email do orgao associado a unidade\n\n\t\t\t\t$objAcessoExternoDTO->setDblIdDocumento( $documentoDTO->getDblIdDocumento() );\n\t\t\t\t$objAcessoExternoDTO->setNumIdParticipante( $idParticipante );\n\n\n\t\t\t\t$objAcessoExternoDTO->setNumIdUsuarioExterno( SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno() );\n\t\t\t\t$objAcessoExternoDTO->setStrSinProcesso('N'); //visualizacao integral do processo\n\n\t\t\t\t$objMdPetAcessoExternoRN = new MdPetAcessoExternoRN();\n\t\t\t\t$objAcessoExternoDTO = $objMdPetAcessoExternoRN->cadastrarAcessoExternoCore($objAcessoExternoDTO);\n\t\t\t}\n\n\t\t\t//realmente assinando o documento depois da assinatura externa ser liberada\n\n\t\t\t//seiv3 - só permite assinar doc externo (upload) nato-digital se tiver o tipo de conferencia setado\n\t\t\t//setar temporariamente e depois remover da entidade\n\t\t\t$documentoRN = new DocumentoRN();\n\t\t\t$documentoPetRN = new MdPetDocumentoRN();\n\t\t\t$documentoBD = new DocumentoBD( $this->getObjInfraIBanco() );\n\t\t\t$bolRemoverTipoConferencia = false;\n\t\t\t\n\t\t\tif( !$documentoDTO->isSetNumIdTipoConferencia() || $documentoDTO->getNumIdTipoConferencia()==null ){\n\n // buscando o menor tipo de conferencia\n $tipoConferenciaDTOConsulta = new TipoConferenciaDTO();\n $tipoConferenciaDTOConsulta->retTodos();\n $tipoConferenciaDTOConsulta->setStrSinAtivo('S');\n $tipoConferenciaDTOConsulta->setOrd('IdTipoConferencia', InfraDTO::$TIPO_ORDENACAO_ASC);\n $tipoConferenciaRN = new TipoConferenciaRN();\n $arrTipoConferenciaDTO = $tipoConferenciaRN->listar($tipoConferenciaDTOConsulta);\n $numIdTipoConferencia = $arrTipoConferenciaDTO[0]->getNumIdTipoConferencia();\n // fim buscando o menor tipo de conferencia\n\n\t\t\t\t//setando um tipo de conferencia padrao (que sera removido depois), apenas para passar na validação\n\t\t\t\t$documentoDTO->setNumIdTipoConferencia($numIdTipoConferencia);\n\t\t\t\t$documentoAlteracaoDTO = new DocumentoDTO();\n\t\t\t\t$documentoAlteracaoDTO->retDblIdDocumento();\n\t\t\t\t$documentoAlteracaoDTO->retNumIdTipoConferencia();\n\t\t\t\t$documentoAlteracaoDTO->setDblIdDocumento( $documentoDTO->getDblIdDocumento() );\n\t\t\t\t$documentoAlteracaoDTO = $documentoRN->consultarRN0005( $documentoAlteracaoDTO );\n\t\t\t\t\n\t\t\t\t$documentoAlteracaoDTO->setNumIdTipoConferencia($numIdTipoConferencia);\n\t\t\t\t$documentoBD->alterar( $documentoAlteracaoDTO );\n\t\t\t\t$bolRemoverTipoConferencia = true;\n\t\t\t\t\n\t\t\t\t$objAssinaturaDTO = new AssinaturaDTO();\n\t\t\t\t$objAssinaturaDTO->setStrStaFormaAutenticacao(AssinaturaRN::$TA_SENHA);\n\t\t\t\t$objAssinaturaDTO->setNumIdUsuario($idUsuario);\n\t\t\t\t$objAssinaturaDTO->setNumIdOrgaoUsuario( SessaoSEI::getInstance()->getNumIdOrgaoUsuario() );\n\n\t\t\t\t$objAssinaturaDTO->setStrSenhaUsuario( $arrParametros['pwdsenhaSEI'] );\n\t\t\t\t$objAssinaturaDTO->setStrCargoFuncao( $cargoExpressao );\n\n\t\t\t\tif (empty(SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno())){\n//\t\t\t\t\t$objAssinaturaDTO->setNumIdContextoUsuario( null );\n\t\t\t\t}\n\n\t\t\t\t$documentoDTO->setStrDescricaoTipoConferencia(\"do próprio documento nato-digital\");\n\t\t\t\t$objAssinaturaDTO->setArrObjDocumentoDTO(array($documentoDTO));\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t$objAssinaturaDTO = new AssinaturaDTO();\n\t\t\t\t$objAssinaturaDTO->setStrStaFormaAutenticacao(AssinaturaRN::$TA_SENHA);\n\t\t\t\t$objAssinaturaDTO->setNumIdUsuario(SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno() );\n\t\t\t\t$objAssinaturaDTO->setStrSenhaUsuario( $arrParametros['pwdsenhaSEI'] );\n\t\t\t\t$objAssinaturaDTO->setStrCargoFuncao( $cargoExpressao );\n\t\t\t\t$objAssinaturaDTO->setArrObjDocumentoDTO(array($documentoDTO));\t\t\n\n\t\t\t}\n\n\t\t\t$objAssinaturaDTO = $documentoPetRN->assinar($objAssinaturaDTO);\n\n\t\t\t//alteracoes seiv3 - removendo o tipo de conferencia padrao que foi informado\n\t\t\tif( $bolRemoverTipoConferencia ){\n\t\t\t\t$documentoDTO->setNumIdTipoConferencia(null);\n\t\t\t\t$documentoBD->alterar( $documentoDTO );\n\t\t\t}\n\n\t\t\t//nao aplicando metodo alterar da RN de Documento por conta de regras de negocio muito especificas aplicadas ali\n\t\t\t$documentoDTO->setStrSinBloqueado('S');\n\t\t\t$documentoBD->alterar( $documentoDTO );\n\n\t\t\tif (!empty(SessaoSEIExterna::getInstance()->getNumIdUsuarioExterno())){\n\t\t\t\t//remover a liberação de acesso externo -> AcessoRN.excluir nao permite exclusao, por isso chame AcessoExternoBD diretamente daqui\n\t\t\t\t$objAcessoExternoBD = new AcessoExternoBD($this->getObjInfraIBanco());\n\t\t\t\t$objAcessoExternoBD->excluir( $objAcessoExternoDTO );\n\t\t\t}\n\t}", "function insertarPeriodoVenta(){\n $this->procedimiento='obingresos.ft_periodo_venta_ime';\n $this->transaccion='OBING_PERVEN_INS';\n $this->tipo_procedimiento='IME';\n\n //Define los parametros para la funcion\n\n $this->setParametro('id_gestion','id_gestion','int4');\n $this->setParametro('id_tipo_periodo','id_tipo_periodo','integer');\n\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function ajustecambiario($periodo,$ejer,$moneda){\n\t\t\t// le kite el periodo and p.idperiodo=\".$periodo.\"\n\t\t\t$sql=$this->query(\"select m.IdPoliza,m.Cuenta,sum(m.Importe) importe,m.TipoMovto,c.description,p.relacionExt,p.concepto,c.manual_code,p.idperiodo\n\t\t\tfrom cont_movimientos m,cont_polizas p,cont_accounts c,cont_config conf\n\t\t\twhere m.cuenta=c.account_id and c.currency_id=\".$moneda.\" and p.idejercicio=\".$ejer.\" and c.`main_father`!=conf.CuentaBancos\n\t\t\tand m.IdPoliza=p.id and p.activo=1 and m.Activo=1 and p.relacionExt!=0 and p.idperiodo<=\".$periodo.\"\n\t\t\tgroup by p.relacionExt,m.TipoMovto\n\t\t\t\");\n\t\t\tif($sql->num_rows>0){\n\t\t\t\treturn $sql;\n\t\t\t}else{\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\t\n\t\t}", "function modificarSolicitudObligacionPago()\r\n {\r\n $this->procedimiento = 'tes.ft_solicitud_obligacion_pago_ime';\r\n $this->transaccion = 'TES_SOOBPG_MOD';\r\n $this->tipo_procedimiento = 'IME';\r\n\r\n //Define los parametros para la funcion\r\n $this->setParametro('id_obligacion_pago', 'id_obligacion_pago', 'int4');\r\n $this->setParametro('id_proveedor', 'id_proveedor', 'int4');\r\n $this->setParametro('tipo_obligacion', 'tipo_obligacion', 'varchar');\r\n $this->setParametro('id_moneda', 'id_moneda', 'int4');\r\n $this->setParametro('obs', 'obs', 'varchar');\r\n $this->setParametro('porc_retgar', 'porc_retgar', 'numeric');\r\n $this->setParametro('id_subsistema', 'id_subsistema', 'int4');\r\n $this->setParametro('id_funcionario', 'id_funcionario', 'int4');\r\n $this->setParametro('porc_anticipo', 'porc_anticipo', 'numeric');\r\n $this->setParametro('fecha', 'fecha', 'date');\r\n $this->setParametro('id_depto', 'id_depto', 'int4');\r\n $this->setParametro('tipo_cambio_conv', 'tipo_cambio_conv', 'numeric');\r\n $this->setParametro('pago_variable', 'pago_variable', 'varchar');\r\n\r\n $this->setParametro('total_nro_cuota', 'total_nro_cuota', 'int4');\r\n $this->setParametro('fecha_pp_ini', 'fecha_pp_ini', 'date');\r\n $this->setParametro('rotacion', 'rotacion', 'int4');\r\n $this->setParametro('id_plantilla', 'id_plantilla', 'int4');\r\n\r\n $this->setParametro('tipo_anticipo', 'tipo_anticipo', 'varchar');\r\n $this->setParametro('id_contrato', 'id_contrato', 'int4');\r\n\r\n //$this->setParametro('id_funcionario_responsable','id_funcionario_responsable','int4');\r\n\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }", "public function GenerarPedidoCrecer($refVenta)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$fechaConfirmacion=date(\"m/d/Y h:m:s\" );\r\n\t\t\t\r\n\t\t\t//ACTUALIZAMOS EL ESTADO DE PEDIDO WEB A CONFIRMADO Y AGREGAMOS LA FECHA DE CONFIRMACION\r\n\t\t\t//$recordSett = &$this->conexion->conectarse()->Execute(\"\tUPDATE PedidoWeb\r\n\t\t\t//SET FechaRespuesta ='\".$fechaConfirmacion.\"', Estado = 1\r\n\t\t\t//WHERE (CodigoTransaccion = '\".$refVenta.\"' AND Estado = 3)\");\t\r\n\t\t\t\r\n\t\t\t//CREAMOS EL PEDIDO EN CRECER\r\n\t\t\t//1.OBTENEMOS LA INFORMACION DEL PEDIDO DESDE LA TABLA TEMPORAL\r\n\t\t\t\r\n\t\t\t//Id--0\r\n\t\t\t//CodigoTransaccion--1\r\n\t\t\t//IdPoliza--2\r\n\t\t\t//FechaCreacion--3\r\n\t\t\t//FechaRespuesta--4\r\n\t\t\t//NombreTitularFactura--5\r\n\t\t\t//DocumentoTitularFactura--6\r\n\t\t\t//DireccionTitularFactura--7\r\n\t\t\t//TelefonoTitularFactura--8\r\n\t\t\t//EmailTitularFactura--9\r\n\t\t\t//TelefonoContacto--10\r\n\t\t\t//TelefonoMovilContacto--11\r\n\t\t\t//DireccionContacto--12\r\n\t\t\t//NombreContactoEmergencia--13\r\n\t\t\t//ApellidoContactoEmergencia--14\r\n\t\t\t//TelefonoContactoEmergencia--15\r\n\t\t\t//EmailContactoEmergencia--16\r\n\t\t\t//Estado--17\r\n\t\t\t//FechaInicio--18\r\n\t\t\t//FechaFin--19\r\n\t\t\t//Precio--20\r\n\t\t\t//Region--21\r\n\t\t\t//TrmIata--22\t\t\t\r\n\t\t\t\r\n\t\t\t$pedidoWeb = &$this->conexion->conectarse()->Execute(\"SELECT Id, CodigoTransaccion, IdPoliza, FechaCreacion, FechaRespuesta, NombreTitularFactura, DocumentoTitularFactura, DireccionTitularFactura, TelefonoTitularFactura, EmailTitularFactura, TelefonoContacto, TelefonoMovilContacto, DireccionContacto, \r\n\t\t\tNombreContactoEmergencia, ApellidoContactoEmergencia, TelefonoContactoEmergencia, EmailContactoEmergencia,\r\n\t\t\t Estado, FechaInicio, FechaFin, Precio, Region, TrmIata \r\n\t\t\t FROM dbo.PedidoWeb\t\tWHERE CodigoTransaccion= '\".$refVenta.\"'\");\t\t\r\n\r\n\t\t\t//2.VALIDAMOS EL CLIENTE SI NO EXISTE CREAMOS EL CLIENTE Y SU CONTACTO.\t\t\t\r\n\t\t\t$existeCliente = &$this->conexion->conectarse()->Execute(\"SELECT DISTINCT Identificacion,Id FROM dbo.Empresas\r\n\t\t\tWHERE Identificacion='\".$pedidoWeb->fields[6].\"' \");\t\r\n\t\t\t\r\n\t\t\t$IdCliente=\"\";\r\n\t\t\t//CREAMOS EL CLIENTE NUEVO \r\n\t\t\tif($existeCliente->fields[0]==\"\"){\r\n\t\t\t\t\r\n\t\t\t\techo \"Entramos a creacion\";\r\n\t\t\t\t\r\n\t\t\t\t$IdCliente=$this->fun->NewGuid();\r\n\t\t\t\t$IdContacto=$this->fun->NewGuid();\r\n\t\t\t\t$IdPedido=$this->fun->NewGuid();\r\n\t\t\t\t$IdProductoCotizacion=$this->fun->NewGuid();\r\n\t\t\t\t$IdFactura=$this->fun->NewGuid();\t\t\t\t\r\n\t\t\t\t$grupo=2;//ASESORES\r\n\t\t\t\t$prioridad=2;\r\n\t\t\t\t$seguimiento=\"Creado desde el portal web \". $fechaConfirmacion.\"\\n\";\r\n\t\t\t\t$moneda=2;//DOLARES\r\n\t\t\t\t$viaContacto=2;//WEB\r\n\t\t\t\t$formaPago=1;\r\n\t\t\t\t//CREAMOS LA EMPRESA\r\n\t\t\t\t$crearCliente = &$this->conexion->conectarse()->Execute( \"INSERT INTO Empresas\r\n (Id, TipoEmpresa, Identificacion, Dv, RazonSocial, Antiguedad, Telefono, Fax, Direccion, Mail, Url, Ciudad, Departamento, Pais, Aniversario, TieneAniversario, \r\n FechaIngreso, IdActividadEconomica, Movil, Observaciones, SeguimientoHistorico, Estado, IdAsesor, RepresentanteLegal, IdTipoMonedaImportacion, \r\n TipoNacionalidad, IdEmpleadoModif, Imagen)\r\n\t\t\t\t\t\tVALUES ('\".$IdCliente.\"','N/A','\".$pedidoWeb->fields[6].\"','N','\".$pedidoWeb->fields[5].\"','0',\r\n\t\t\t\t\t\t'\".$pedidoWeb->fields[8].\"','0','\".$pedidoWeb->fields[7].\"','\".$pedidoWeb->fields[9].\"','-',NULL,NULL,\r\n\t\t\t\t\t\tNULL,NULL,NULL,'\".$fechaConfirmacion.\"',\r\n\t\t\t\t\t\tNULL,'\".$pedidoWeb->fields[11].\"','Ninguna',\r\n\t\t\t\t\t\tNULL,'0',NULL,'Ninguno',\r\n\t\t\t\t\t\t'2','false',NULL,\r\n\t\t\t\t\t\tNULL)\");\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL CLIENTE\r\n\t\t\t\t$crearCliente = &$this->conexion->conectarse()->Execute( \"INSERT INTO Clientes\r\n (Id, Ingreso, Inicio, Fin, CodigoSwift, IdTipoCliente, IdActividadEconomica)\r\n\t\t\t\tVALUES ('\".$IdCliente.\"','\".$fechaConfirmacion.\"','\".$fechaConfirmacion.\"',NULL,'0',NULL,'0')\");\r\n\t\t\t\t\r\n\t\t\t\t//NOTIFICAMOS DE LA COMPRA AL TITLULAR DE LA FACTURA\r\n\t\t\t\t/////////$this->fun->SendMailConfirmacionPago($pedidoWeb->fields[9], $pedidoWeb->fields[5], $pedidoWeb->fields[6]);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL CONTACTO.\t\t\t\t\r\n\t\t\t\t$crearContacto= &$this->conexion->conectarse()->Execute(\"INSERT INTO Contactos(Id, Descripcion, Cargo, Direccion, Telefono, Extension, Celular, Fax, EmailEmpresa, EmailPersonal, Observacion, Cumpleanno, TieneCumpleanno, Estado)\r\n\t\t\t\tVALUES ('\".$IdContacto.\"','\".$pedidoWeb->fields[13].\" \".$pedidoWeb->fields[14].\"',NULL,NULL,'\".$pedidoWeb->fields[15].\"',NULL,NULL,NULL,'\".$pedidoWeb->fields[16].\"','\".$pedidoWeb->fields[16].\"',NULL,NULL,NULL,'true')\");\r\n\t\t\t\t\r\n\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\tVALUES ('\".$IdCliente.\"','\".$IdContacto.\"')\");\r\n\r\n\t\t\t\t//CREAMOS EL PEDIDO\r\n\t\t\t\t\r\n\t\t\t\t\t$crearPedido = &$this->conexion->conectarse()->Execute(\"INSERT INTO OrdenCompraCliente\r\n (Id, FechaElaboracion, IdCliente, IdPaisOrigen, IdSedeCliente, IdRegionDestino, IdContactoEmergencia, FechaSalida, FechaRegreso, CantidadPasajeros, IdContacto, \r\n Codigo, IdAutor, IdEmpleado, FechaModificacion, SubtotalSinDto, Subtotal, ValorIva, Total, Trm_dia, UtilidadSobreCosto, Estado, GrupoAsignado, Prioridad, \r\n Probabilidad, Observaciones, SeguimientoHistorico, FechaRecepcion, Moneda, FormaPago, TiempoEntrega, TiempoVigencia, Instalacion, \r\n IdEmpleadoModif, IdViadeContacto)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdPedido.\"','\".$fechaConfirmacion.\"','\".$IdCliente.\"','1',\r\n\t\t\t\t\t\t\t'00000000-0000-0000-0000-000000000000','\".$pedidoWeb->fields[21].\"',\r\n\t\t\t\t\t\t\t'\".$IdContacto.\"','\".$pedidoWeb->fields[18].\"','\".$pedidoWeb->fields[19].\"','0','\".$IdContacto.\"','',\r\n\t\t\t\t\t\t\t'7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','0','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[22].\"',\r\n\t\t\t\t\t\t\t'true','1','\".$grupo.\"','\".$prioridad.\"','100',NULL,'\".$seguimiento.\"',\r\n\t\t\t\t\t\t\t'\".$fechaConfirmacion.\"','\".$moneda.\"','\".$formaPago.\"',NULL,NULL,'false','00000000-0000-0000-0000-000000000000','\".$viaContacto.\"')\");\r\n\t\t\t\t\t//CREAMOS EL PRODUCTO COTIZACION.\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t// OBTENEMOS LA CANTIDAD DE PASAJEROS.\t\t\t\t\t\t\r\n\t\t\t\t\t\t$cantidadPasajeros = &$this->conexion->conectarse()->Execute(\"SELECT COUNT(*) AS Expr1\r\n\t\t\t\t\t\tFROM PasajerosPedido\r\n\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$productoCotizacion = &$this->conexion->conectarse()->Execute(\"INSERT INTO ProductosCotizacion\r\n (Id, IdProducto, IdReferencia, Cantidad, ValorVenta, SubtotalSinDescuento, ValorVentaCliente, IVA, AplicarIva, IdFormaEnvio, TipoTrasporte, UtilidadGlobal, Utilidad, \r\n UtilidadEnPorcentaje, UtilidadDespuesCosto, Arancel, ComicionProveedor, IdEmpleado, FechaModificacion, FechaElaboracion, Moneda, ComentarioAdicional, \r\n Descuento, Aumento)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdProductoCotizacion.\"','\".$pedidoWeb->fields[2].\"','\".$IdPedido.\"','\".$cantidadPasajeros->fields[0].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"',\r\n\t\t\t\t\t\t\t'0','true','0','0','0','0','true','false','0',\r\n\t\t\t\t\t\t\t'0','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$fechaConfirmacion.\"','4','','0','0')\");\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL PASAJERO PRODUCTO COTIZACION.\r\n\t\t\t\t\t\t//CONSULTAMOS LOS PASAJEROS ASOCIADOS AL PEDIDO\t\t\t\t\t\t\r\n\t\t\t\t\t\t$pedidoPasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id, IdPedido, Nombre, Apellido, Documento, Email, FechaNacimiento\r\n\t\t\t\t\t\t\tFROM PasajerosPedido \r\n\t\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\t\t\r\n\t\t\t\t\t\tforeach($pedidoPasajero as $k => $row) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$idPasajero=\"\";\r\n\t\t\t\t\t\t\t$numeroPoliza=\"\";// ACA DEBO LLAMAR EL WEBSERVICE\r\n\t\t\t\t\t\t\t$idPasajeroProducto=$this->fun->NewGuid();\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id\r\n\t\t\t\t\t\t\t\tFROM Pasajero\r\n\t\t\t\t\t\t\t\tWHERE (Identificacion = '\". $row[4].\"')\");\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//NOTIFICAMOS A LOS PASAJEROS DE LA COMPRA\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t///////////$this->fun->SendMailConfirmacionPago($row[5], $row[2], $row[3]);\r\n\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif($existePasajero->fields[0]==\"\"){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//CREAMOS PASAJERO\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$idPasajero=$this->fun->NewGuid();\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\tINSERT INTO Pasajero\r\n \t\t(Id, Nombre, Apellido, Identificacion, FechaNacimiento, Telefono, Celular, Email, Estado, Direccion, Observaciones, SeguimientoHistorico)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$row[2].\"','\".$row[3].\"','\".$row[4].\"','\".$row[6].\"','\".$pedidoWeb->fields[10].\"','\".$pedidoWeb->fields[11].\"','\".$row[5].\"','true','\".$pedidoWeb->fields[12].\"','-','\".$seguimiento.\"')\");\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if($existePasajero->fields[0]!=\"\"){\r\n\t\t\t\t\t\t\t//\techo \"Entramos al caso cuando el pasajero ya existe\";\r\n\t\t\t\t\t\t\t\t$idPasajero=$existePasajero->fields[0];\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS FACTURA.\t\t\t\t\r\n\t\t\t\t//CREAMOS FACTURA ORDEN COMPRA.\t\t\t\t\r\n\t\t\t\t//CREAMOS ALERTAS FACTURACION.\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t//EL CLIENTE YA EXISTE - ASOCIAMOS TODO EL PEDIDO\r\n\t\t\telse if($existeCliente->fields[0]!=\"\") {\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$IdCliente=$existeCliente->fields[1];\t\t\t\t\t\t\r\n\t\t\t\t$IdContacto=$this->fun->NewGuid();\r\n\t\t\t\t$IdPedido=$this->fun->NewGuid();\r\n\t\t\t\t$IdProductoCotizacion=$this->fun->NewGuid();\r\n\t\t\t\t$IdFactura=$this->fun->NewGuid();\t\t\t\t\r\n\t\t\t\t$grupo=2;//ASESORES\r\n\t\t\t\t$prioridad=2;\r\n\t\t\t\t$seguimiento=\"Creado desde el portal web \". $fechaConfirmacion.\"\\n\";\r\n\t\t\t\t$moneda=2;//DOLARES\r\n\t\t\t\t$viaContacto=2;//WEB\r\n\t\t\t\t$formaPago=1;\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL CONTACTO.\t\t\t\t\r\n\t\t\t\t$crearContacto= &$this->conexion->conectarse()->Execute(\"INSERT INTO Contactos(Id, Descripcion, Cargo, Direccion, Telefono, Extension, Celular, Fax, EmailEmpresa, EmailPersonal, Observacion, Cumpleanno, TieneCumpleanno, Estado)\r\n\t\t\t\tVALUES ('\".$IdContacto.\"','\".$pedidoWeb->fields[13].\" \".$pedidoWeb->fields[14].\"',NULL,NULL,'\".$pedidoWeb->fields[15].\"',NULL,NULL,NULL,'\".$pedidoWeb->fields[16].\"','\".$pedidoWeb->fields[16].\"',NULL,NULL,NULL,'true')\");\r\n\t\t\t\t\r\n\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\tVALUES ('\".$IdCliente.\"','\".$IdContacto.\"')\");\r\n\r\n\t\t\t\t//CREAMOS EL PEDIDO\r\n\t\t\t\t\r\n\t\t\t\t$crearPedido = &$this->conexion->conectarse()->Execute(\"INSERT INTO OrdenCompraCliente\r\n (Id, FechaElaboracion, IdCliente, IdPaisOrigen, IdSedeCliente, IdRegionDestino, IdContactoEmergencia, FechaSalida, FechaRegreso, CantidadPasajeros, IdContacto, \r\n Codigo, IdAutor, IdEmpleado, FechaModificacion, SubtotalSinDto, Subtotal, ValorIva, Total, Trm_dia, UtilidadSobreCosto, Estado, GrupoAsignado, Prioridad, \r\n Probabilidad, Observaciones, SeguimientoHistorico, FechaRecepcion, Moneda, FormaPago, TiempoEntrega, TiempoVigencia, Instalacion, \r\n IdEmpleadoModif, IdViadeContacto)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdPedido.\"','\".$fechaConfirmacion.\"','\".$IdCliente.\"','1',\r\n\t\t\t\t\t\t\t'00000000-0000-0000-0000-000000000000','\".$pedidoWeb->fields[21].\"',\r\n\t\t\t\t\t\t\t'\".$IdContacto.\"','\".$pedidoWeb->fields[18].\"','\".$pedidoWeb->fields[19].\"','0','\".$IdContacto.\"','',\r\n\t\t\t\t\t\t\t'7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','0','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[22].\"',\r\n\t\t\t\t\t\t\t'true','1','\".$grupo.\"','\".$prioridad.\"','100',NULL,'\".$seguimiento.\"',\r\n\t\t\t\t\t\t\t'\".$fechaConfirmacion.\"','\".$moneda.\"','\".$formaPago.\"',NULL,NULL,'false','00000000-0000-0000-0000-000000000000','\".$viaContacto.\"')\");\r\n\t\t\t\t //CREAMOS EL PRODUCTO COTIZACION.\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\t// OBTENEMOS LA CANTIDAD DE PASAJEROS.\t\t\t\t\t\t\r\n\t\t\t\t\t\t$cantidadPasajeros = &$this->conexion->conectarse()->Execute(\"SELECT COUNT(*) AS Expr1\r\n\t\t\t\t\t\tFROM PasajerosPedido\r\n\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$productoCotizacion = &$this->conexion->conectarse()->Execute(\"INSERT INTO ProductosCotizacion\r\n (Id, IdProducto, IdReferencia, Cantidad, ValorVenta, SubtotalSinDescuento, ValorVentaCliente, IVA, AplicarIva, IdFormaEnvio, TipoTrasporte, UtilidadGlobal, Utilidad, \r\n UtilidadEnPorcentaje, UtilidadDespuesCosto, Arancel, ComicionProveedor, IdEmpleado, FechaModificacion, FechaElaboracion, Moneda, ComentarioAdicional, \r\n Descuento, Aumento)\r\n\t\t\t\t\t\t\tVALUES ('\".$IdProductoCotizacion.\"','\".$pedidoWeb->fields[2].\"','\".$IdPedido.\"','\".$cantidadPasajeros->fields[0].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"','\".$pedidoWeb->fields[20].\"',\r\n\t\t\t\t\t\t\t'0','true','0','0','0','0','true','false','0',\r\n\t\t\t\t\t\t\t'0','7e33a6e3-f03d-4211-9ef3-767aa2fa56fc','\".$fechaConfirmacion.\"','\".$fechaConfirmacion.\"','4','','0','0')\");\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t//CREAMOS EL PASAJERO PRODUCTO COTIZACION.\r\n\t\t\t\t\t\t//CONSULTAMOS LOS PASAJEROS ASOCIADOS AL PEDIDO\t\t\t\t\t\t\r\n\t\t\t\t\t\t$pedidoPasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id, IdPedido, Nombre, Apellido, Documento, Email, FechaNacimiento\r\n\t\t\t\t\t\t\tFROM PasajerosPedido \r\n\t\t\t\t\t\t\tWHERE (IdPedido = '\".$pedidoWeb->fields[0].\"')\");\t\t\r\n\t\t\t\t\t\tforeach($pedidoPasajero as $k => $row) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$idPasajero=\"\";\r\n\t\t\t\t\t\t\t$numeroPoliza=\"\";// ACA DEBO LLAMAR EL WEBSERVICE\r\n\t\t\t\t\t\t\t$idPasajeroProducto=$this->fun->NewGuid();\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"SELECT Id\r\n\t\t\t\t\t\t\t\tFROM Pasajero\r\n\t\t\t\t\t\t\t\tWHERE (Identificacion = '\". $row[4].\"')\");\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t//NOTIFICAMOS A LOS PASAJEROS DE LA COMPRA\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t///////////\t$this->fun->SendMailConfirmacionPago($row[5], $row[2], $row[3]);\r\n\t\t\t\r\n\t\t\t\t\t\t\tif($existePasajero->fields[0]==\"\"){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//CREAMOS PASAJERO\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$idPasajero=$this->fun->NewGuid();\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$existePasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\tINSERT INTO Pasajero\r\n \t\t(Id, Nombre, Apellido, Identificacion, FechaNacimiento, Telefono, Celular, Email, Estado, Direccion, Observaciones, SeguimientoHistorico)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$row[2].\"','\".$row[3].\"','\".$row[4].\"','\".$row[6].\"','\".$pedidoWeb->fields[10].\"','\".$pedidoWeb->fields[11].\"','\".$row[5].\"','true','\".$pedidoWeb->fields[12].\"','-','\".$seguimiento.\"')\");\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if($existePasajero->fields[0]!=\"\"){\r\n\t\t\t\t\t\t\t//\techo \"Entramos al caso cuando el pasajero ya existe\";\r\n\t\t\t\t\t\t\t\t$idPasajero=$existePasajero->fields[0];\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS EL CONTACTO DE EMERGENCIA\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociarContacto= &$this->conexion->conectarse()->Execute(\" INSERT INTO EmpresaContactos (IdEmpresa, IdContacto)\r\n\t\t\t\t\t\t\t\tVALUES ('\".$idPasajero.\"','\".$IdContacto.\"')\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t//ASOCIAMOS AL PASAJERO PRODUCTO COTIZACION\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$asociamospasajero = &$this->conexion->conectarse()->Execute(\"\r\n\t\t\t\t\t\t\t\t\tINSERT INTO PasajerosProductosCotizacion (Id, IdPasajero, IdProductoCotizacion, Poliza, Estado, Aumento, Descuento, ValorUnitario)\r\n\t\t\t\t\t\t\t\t\tVALUES ('\".$idPasajeroProducto.\"','\".$idPasajero.\"','\".$IdProductoCotizacion.\"','\".$numeroPoliza.\"','true','0','0','0')\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\r\n\r\n\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\techo 'Caught exception: ', $e->getMessage(), \"\\n\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "static function crear( toba_modelo_instancia $instancia, $nombre, $usuarios_a_vincular , $dir_inst_proyecto=null)\n\t{\n\t\t//- 1 - Controles\n\t\t$dir_template = toba_dir() . self::template_proyecto;\n\t\tif ( $nombre == 'toba' ) {\n\t\t\tthrow new toba_error(\"INSTALACIÓN: No es posible crear un proyecto con el nombre 'toba'\");\n\t\t}\n\t\tif ( self::existe( $nombre ) ) {\n\t\t\ttoba_logger::instancia()->error(\"INSTALACIÓN: Ya existe una carpeta con el nombre '$nombre' en la carpeta 'proyectos'\");\n\t\t\tthrow new toba_error(\"INSTALACIÓN: Ya existe una carpeta con el nombre especificado en la carpeta 'proyectos'\");\n\t\t}\n\t\ttry {\n\n\t\t\t//- 2 - Modificaciones en el sistema de archivos\n\t\t\t$dir_proyecto = (is_null($dir_inst_proyecto)) ? $instancia->get_path_proyecto($nombre): $dir_inst_proyecto;\n\t\t\t$url_proyecto = $instancia->get_url_proyecto($nombre);\n\n\t\t\t// Creo la CARPETA del PROYECTO\n\t\t\t$excepciones = array();\n\t\t\t$excepciones[] = $dir_template.'/www/aplicacion.produccion.php';\n\t\t\ttoba_manejador_archivos::copiar_directorio( $dir_template, $dir_proyecto, $excepciones);\n\n\t\t\t// Modifico los archivos\n\t\t\t$editor = new toba_editor_archivos();\n\t\t\t$editor->agregar_sustitucion( '|__proyecto__|', $nombre );\n\t\t\t$editor->agregar_sustitucion( '|__instancia__|', $instancia->get_id() );\n\t\t\t$editor->agregar_sustitucion( '|__toba_dir__|', toba_manejador_archivos::path_a_unix( toba_dir() ) );\n\t\t\t$editor->agregar_sustitucion( '|__version__|', '1.0.0');\n\t\t\t$editor->procesar_archivo( $dir_proyecto . '/www/aplicacion.php' );\n\n\t\t\t$modelo = $dir_proyecto . '/php/extension_toba/modelo.php';\n\t\t\t$comando = $dir_proyecto . '/php/extension_toba/comando.php';\n\t\t\t$editor->procesar_archivo($comando);\n\t\t\t$editor->procesar_archivo($modelo);\n\t\t\t$editor->procesar_archivo($dir_proyecto.'/www/rest.php');\n\t\t\t$editor->procesar_archivo($dir_proyecto.'/www/servicios.php');\n\n\t\t\trename($modelo, str_replace('modelo.php', $nombre.'_modelo.php', $modelo));\n\t\t\trename($comando, str_replace('comando.php', $nombre.'_comando.php', $comando));\n\t\t\t$ini = $dir_proyecto.'/proyecto.ini';\n\t\t\t$editor->procesar_archivo($ini);\n\n\t\t\t// Asocio el proyecto a la instancia\n\t\t\t$instancia->vincular_proyecto( $nombre, $dir_inst_proyecto, $url_proyecto);\n\n\t\t\t//- 3 - Modificaciones en la BASE de datos\n\t\t\t$db = $instancia->get_db();\n\t\t\ttry {\n\t\t\t\t$db->abrir_transaccion();\n\t\t\t\t$db->retrasar_constraints();\n\t\t\t\t$db->ejecutar( self::get_sql_metadatos_basicos( $nombre ) );\n\t\t\t\t$sql_version = self::get_sql_actualizar_version( toba_modelo_instalacion::get_version_actual(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$nombre);\n\t\t\t\t$db->ejecutar($sql_version);\n\t\t\t\tforeach( $usuarios_a_vincular as $usuario ) {\n\t\t\t\t\tself::do_vincular_usuario($db, $nombre, $usuario, array('admin'));\n\t\t\t\t}\n\t\t\t\t$db->cerrar_transaccion();\n\t\t\t} catch ( toba_error $e ) {\n\t\t\t\t$db->abortar_transaccion();\n\t\t\t\t$txt = 'PROYECTO : Ha ocurrido un error durante la carga de METADATOS del PROYECTO. DETALLE: ';\n\t\t\t\ttoba_logger::instancia()->error($txt . $e->getMessage());\n\t\t\t\tthrow new toba_error( $txt );\n\t\t\t}\n\t\t} catch ( toba_error $e ) {\n\t\t\t// Borro la carpeta creada\n\t\t\tif ( is_dir( $dir_proyecto ) ) {\n\t\t\t\t$instancia->desvincular_proyecto( $nombre );\n\t\t\t\ttoba_manejador_archivos::eliminar_directorio( $dir_proyecto );\n\t\t\t}\n\t\t\tthrow $e;\n\t\t}\n\t}", "public function setVendedor($nome,$comissao){\n try{\n $x = 1;\n $Conexao = Conexao::getConnection();\n $query = $Conexao->prepare(\"INSERT INTO vendedor (nome,comissao) VALUES ('$nome',$comissao)\"); \n $query->execute(); \n // $query = $Conexao->query(\"DELETE FROM vendedor WHERE id_vendedor = (SELECT top 1 id_vendedor from vendedor order by id_vendedor desc)\"); \n // $query->execute();\n return 1;\n\n }catch(Exception $e){\n echo $e->getMessage();\n return 2;\n exit;\n } \n }", "function motivoDeAnulacionDev(){\n\t\t$sql = \"SELECT * FROM motivo_movimiento WHERE tipo_motivo='ANULACIÓNDV' and status='1'\";\n\t\treturn $this->ejecuta($sql);\n\t}", "function buscar_comprobante_documento($id_cuenta, $id_anexo, $id_serie, $id_numero ) {\n $sql = \"SELECT\n\t\t\t\t\t prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\t, sum(prosic_detalle_comprobante.importe_soles*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)) as importe_soles\n\t\t\t\t\t, sum(prosic_detalle_comprobante.importe_soles*if(prosic_detalle_comprobante.cargar_abonar='A',1,-1)/prosic_tipo_cambio.compra_sunat) as importe_dolares\n\t\t\t\tFROM prosic_detalle_comprobante\n\t\t\t\tINNER JOIN prosic_plan_contable ON prosic_detalle_comprobante.id_plan_contable=prosic_plan_contable.id_plan_contable\n\t\t\t\tINNER JOIN prosic_anexo ON prosic_detalle_comprobante.id_anexo = prosic_anexo.id_anexo\n\t\t\t\tINNER JOIN prosic_moneda ON prosic_detalle_comprobante.id_moneda = prosic_moneda.id_moneda\n\t\t\t\tLEFT JOIN prosic_tipo_cambio ON prosic_detalle_comprobante.fecha_doc_comprobante=prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\tWHERE 1=1 \";\n\t\t\t\tif ($id_cuenta != '')$sql.=\" AND prosic_plan_contable.cuenta_plan_contable LIKE '%\" . $id_cuenta . \"%'\";\n if ($id_anexo != '')$sql.=\" AND prosic_anexo.codigo_anexo LIKE '%\" . $id_anexo . \"%'\";\n if ($id_numero != '')$sql.=\" AND prosic_detalle_comprobante.nro_doc_comprobante LIKE '%\" . $id_numero . \"%'\";\n\t\t\t$sql.=\" group by prosic_plan_contable.id_plan_contable\n\t\t\t\t\t, prosic_plan_contable.cuenta_plan_contable\n\t\t\t\t\t, prosic_anexo.codigo_anexo\n\t\t\t\t\t, prosic_anexo.descripcion_anexo\n\t\t\t\t\t, prosic_detalle_comprobante.id_tipo_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.ser_doc_comprobante\n\t\t\t\t\t, prosic_detalle_comprobante.nro_doc_comprobante\n\t\t\t\t\t, prosic_moneda.id_moneda\n\t\t\t\t\t, prosic_detalle_comprobante.fecha_doc_comprobante\n\t\t\t\t\t, prosic_tipo_cambio.fecha_tipo_cambio\n\t\t\t\t\thaving importe_soles>0\";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function cargar_data_registro_venta($nombre_anio='', $nombre_mes='', $nrocomprobante='', $limit='') {\n $sql = \"SELECT\n prosic_comprobante.id_comprobante\n , prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.status_comprobante\n , prosic_anexo.codigo_anexo\n , prosic_subdiario.id_subdiario\n , prosic_subdiario.codigo_subdiario\n , prosic_subdiario.nombre_subdiario\n , prosic_anio.nombre_anio\n , prosic_mes.nombre_mes\n , prosic_tipo_comprobante.codigo_tipo_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n ,prosic_comprobante.nro_comprobante\n ,prosic_moneda.codigo_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo\n ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_mes\n ON (prosic_comprobante.id_mes = prosic_mes.id_mes)\n INNER JOIN prosic_anio\n ON (prosic_comprobante.id_anio = prosic_anio.id_anio)\n INNER JOIN prosic_subdiario\n ON (prosic_comprobante.id_subdiario = prosic_subdiario.id_subdiario)\n INNER JOIN prosic_tipo_comprobante\n ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_plan_contable\n ON (prosic_comprobante.id_plan_contable = prosic_plan_contable.id_plan_contable)\n INNER JOIN prosic_moneda\n ON (prosic_comprobante.id_moneda= prosic_moneda.id_moneda)\n\t\t\tWHERE prosic_comprobante.id_subdiario=2 \";\n if ($nombre_anio != ''\n )$sql.=\" AND prosic_anio.nombre_anio='\" . $nombre_anio . \"'\";\n if ($nombre_mes != ''\n )$sql.=\" AND prosic_mes.nombre_mes='\" . $nombre_mes . \"'\";\n if ($nrocomprobante != ''\n )$sql.=\" AND prosic_comprobante.nro_comprobante like'%\" . $nrocomprobante . \"%' \";\n if ($limit != ''\n )$sql.=$limit;\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function cocinar_pedido() {\n\t\tglobal $bd;\n\t\tglobal $x_from;\n\t\tglobal $x_idpedido;\n\t\tglobal $x_idcliente;\n\t\t\n\t\t$x_array_pedido_header = $_POST['p_header'];\n \t$x_array_pedido_body = $_POST['p_body'];\n\t\t$x_array_subtotales=$_POST['p_subtotales'];\n\t\t\n\t\t$idc=$x_array_pedido_header['idclie'] == '' ? ($x_idcliente == '' ? 0 : $x_idcliente) : $x_array_pedido_header['idclie'];\n\t\t// $idc = cocinar_registro_cliente();\n\t\t// $x_array_pedido_footer = $_POST['p_footer'];\n\t\t// $x_array_tipo_pago = $_POST['p_tipo_pago'];\n\n\t\t //sacar de arraypedido || tipo de consumo || local || llevar ... solo llevar\n\t\t $count_arr=0;\n\t\t $count_items=0;\n\t\t $item_antes_solo_llevar=0;\n\t\t $solo_llevar=0;\n\t\t $tipo_consumo;\n\t\t $categoria;\n\t\t \n\t\t $sql_pedido_detalle='';\n\t\t $sql_sub_total='';\n\n\t\t $numpedido='';\n\t\t $correlativo_dia='';\n\t\t $viene_de_bodega=0;// para pedido_detalle\n\t\t $id_pedido;\n\n\t\t \t\t \n\t\t // cocina datos para pedidodetalle\n\t\t foreach ($x_array_pedido_body as $i_pedido) {\n\t\t\tif($i_pedido==null){continue;}\n\t\t\t// tipo de consumo\n\t\t\t//solo llevar\n\t\t\t$pos = strrpos(strtoupper($i_pedido['des']), \"LLEVAR\");\n\t\t\t\n\t\t\t\n\t\t\t//subitems // detalles\n\t\t\tforeach ($i_pedido as $subitem) {\n\t\t\t\tif(is_array($subitem)==false){continue;}\n\t\t\t\t$count_items++;\n\t\t\t\tif($pos!=false){$solo_llevar=1;$item_antes_solo_llevar=$count_items;}\n\t\t\t\t$tipo_consumo=$subitem['idtipo_consumo'];\n\t\t\t\t$categoria=$subitem['idcategoria'];\n\n\t\t\t\t$tabla_procede=$subitem['procede']; // tabla de donde se descuenta\n\n\t\t\t\t$viene_de_bodega=0;\n\t\t\t\tif($tabla_procede===0){$viene_de_bodega=$subitem['procede_index'];}\n\n\t\t\t\t//armar sql pedido_detalle con arrPedido\n\t\t\t\t$precio_total=$subitem['precio_print'];\n\t\t\t\tif($precio_total==\"\"){$precio_total=$subitem['precio_total'];}\n\n\t\t\t\t//concatena descripcion con indicaciones\n\t\t\t\t$indicaciones_p=\"\";\n\t\t\t\t$indicaciones_p=$subitem['indicaciones'];\n\t\t\t\tif($indicaciones_p!==\"\"){$indicaciones_p=\" (\".$indicaciones_p.\")\";$indicaciones_p=strtolower($indicaciones_p);}\n\t\t\t\t\n\t\t\t\t$sql_pedido_detalle=$sql_pedido_detalle.'(?,'.$tipo_consumo.','.$categoria.','.$subitem['iditem'].','.$subitem['iditem2'].',\"'.$subitem['idseccion'].'\",\"'.$subitem['cantidad'].'\",\"'.$subitem['cantidad'].'\",\"'.$subitem['precio'].'\",\"'.$precio_total.'\",\"'.$precio_total.'\",\"'.$subitem['des'].$indicaciones_p.'\",'.$viene_de_bodega.','.$tabla_procede.'),'; \n\n\t\t\t}\n\n\t\t\t$count_arr++;\n\t\t}\t\t\n\t\t\n\t\tif($count_items==0){return false;}//si esta vacio\n\n\t\tif($item_antes_solo_llevar>1){$solo_llevar=0;} // >1 NO solo es para llevar\n\n\t\t//armar sql pedido_subtotales con arrTotales\t\t\n\t\t// $importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t// $importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\t// for ($z=0; $z < count($x_array_subtotales); $z++) {\t\n\t\t// \t$importe_total = $x_array_subtotales[$z]['importe'];\t\t\n\t\t// \t$sql_sub_total=$sql_sub_total.'(?,\"'.$x_array_subtotales[$z]['descripcion'].'\",\"'.$x_array_subtotales[$z]['importe'].'\"),';\n\t\t// }\n\t\t\n\t\t// subtotales\t\t\n\t\t$sql_subtotales = '';\n\t\t$importe_total=0; // la primera fila es subtotal o total si no hay adicionales\n\t\t$importe_subtotal = $x_array_subtotales[0]['importe'];\n\t\tforeach ( $x_array_subtotales as $sub_total ) {\n\t\t\t$tachado = $sub_total['tachado'] === \"true\" ? 1 : 0; \n\t\t\t$importe_row = $tachado === 1 ? $sub_total['importe_tachado'] : $sub_total['importe'];\n\t\t\t$importe_total = $sub_total['importe'];\n\t\t\t$sql_subtotales = $sql_subtotales.\"(?,\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",'\".$sub_total['descripcion'].\"','\".$importe_row.\"',\".$tachado.\"),\";\n\t\t}\n\n //guarda primero pedido para obtener el idpedio\n\t\tif(!isset($_POST['estado_p'])){$estado_p=0;}else{$estado_p=$_POST['estado_p'];}//para el caso de venta rapida si ya pago no figura en control de pedidos\n\t\tif(!isset($_POST['idpedido'])){$id_pedido=0;}else{$id_pedido=$_POST['idpedido'];}//si se agrea en un pedido / para control de pedidos al agregar\t\t\n\n if($id_pedido==0){ // nuevo pedido\n\t\t\t//num pedido\n\t\t\t$sql=\"select count(idpedido) as d1 from pedido where idorg=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['idsede'];\n\t\t\t$numpedido=$bd->xDevolverUnDato($sql);\n\t\t\t$numpedido++;\n\n\t\t\t//numcorrelativo segun fecha\n\t\t\t$sql=\"SELECT count(fecha) AS d1 FROM pedido WHERE (idorg=\".$_SESSION['ido'].\" and idsede=\".$_SESSION['idsede'].\") and STR_TO_DATE(fecha,'%d/%m/%Y')=curdate()\";\n\t\t\t$correlativo_dia=$bd->xDevolverUnDato($sql);\n\t\t\t$correlativo_dia++;\n\n\t\t\t// si es delivery y si trae datos adjuntos -- json-> direccion telefono forma pago\n\t\t\t$json_datos_delivery=array_key_exists('arrDatosDelivery', $x_array_pedido_header) ? $x_array_pedido_header['arrDatosDelivery'] : '';\n\t\t\t\n\n // guarda pedido\n $sql=\"insert into pedido (idorg, idsede, idcliente, fecha,hora,fecha_hora,nummesa,numpedido,correlativo_dia,referencia,total,total_r,solo_llevar,idtipo_consumo,idcategoria,reserva,idusuario,subtotales_tachados,estado,json_datos_delivery)\n\t\t\t\t\tvalues(\".$_SESSION['ido'].\",\".$_SESSION['idsede'].\",\".$idc.\",DATE_FORMAT(now(),'%d/%m/%Y'),DATE_FORMAT(now(),'%H:%i:%s'),now(),'\".$x_array_pedido_header['mesa'].\"','\".$numpedido.\"','\".$correlativo_dia.\"','\".$x_array_pedido_header['referencia'].\"','\".$importe_subtotal.\"','\".$importe_total.\"',\".$solo_llevar.\",\".$tipo_consumo.\",\".$x_array_pedido_header['idcategoria'].\",\".$x_array_pedido_header['reservar'].\",\".$_SESSION['idusuario'].\",'\". $x_array_pedido_header['subtotales_tachados'] .\"',\".$estado_p.\",'\".$json_datos_delivery.\"')\";\n $id_pedido=$bd->xConsulta_UltimoId($sql);\n \n\t\t}else{\n\t\t\t//actualiza monto\n\t\t\t$sql=\"update pedido set total=FORMAT(total+\".$xarr['ImporteTotal'].\",2), subtotales_tachados = '\".$x_array_pedido_header['subtotales_tachados'].\"' where idpedido=\".$id_pedido;\n\t\t\t$bd->xConsulta_NoReturn($sql);\n }\n\n //armar sql completos\n\t\t//remplazar ? por idpedido\n\t\t$sql_subtotales = str_replace(\"?\", $id_pedido, $sql_subtotales);\n\t\t$sql_pedido_detalle = str_replace(\"?\", $id_pedido, $sql_pedido_detalle);\n\n\t\t//saca el ultimo caracter ','\n\t\t$sql_subtotales=substr ($sql_subtotales, 0, -1);\n\t\t$sql_pedido_detalle=substr ($sql_pedido_detalle, 0, -1);\n\n\t\t//pedido_detalle\n\t\t$sql_pedido_detalle='insert into pedido_detalle (idpedido,idtipo_consumo,idcategoria,idcarta_lista,iditem,idseccion,cantidad,cantidad_r,punitario,ptotal,ptotal_r,descripcion,procede,procede_tabla) values '.$sql_pedido_detalle;\n\t\t//pedido_subtotales\n\t\t$sql_subtotales='insert into pedido_subtotales (idpedido,idorg,idsede,descripcion,importe, tachado) values '.$sql_subtotales;\n\t\t// echo $sql_pedido_detalle;\n\t\t//ejecutar\n //$sql_ejecuta=$sql_pedido_detalle.'; '.$sql_sub_total.';'; // guarda pedido detalle y pedido subtotal\n $bd->xConsulta_NoReturn($sql_pedido_detalle.';');\n\t\t$bd->xConsulta_NoReturn($sql_subtotales.';');\n\t\t\n\t\t// $x_array_pedido_header['id_pedido'] = $id_pedido; // si viene sin id pedido\n\t\t$x_idpedido = $id_pedido;\n\n\t\t// SI ES PAGO TOTAL\n\t\tif ( strrpos($x_from, \"b\") !== false ) { $x_from = str_replace('b','',$x_from); cocinar_pago_total(); }\n\n\t\t\n\t\t// $x_respuesta->idpedido = $id_pedido; \n\t\t// $x_respuesta->numpedido = $numpedido; \n\t\t// $x_respuesta->correlativo_dia = $correlativo_dia; \n\t\t\n\t\t$x_respuesta = json_encode(array('idpedido' => $id_pedido, 'numpedido' => $numpedido, 'correlativo_dia' => $correlativo_dia));\n\t\tprint $x_respuesta.'|';\n\t\t// $x_respuesta = ['idpedido' => $idpedido];\n\t\t// print $id_pedido.'|'.$numpedido.'|'.$correlativo_dia;\n\t\t\n\t}", "function listarProcesoCompraPedido(){\n\t\t$this->procedimiento='adq.f_proceso_compra_sel';\n\t\t$this->transaccion='ADQ_PROCPED_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t$this->setParametro('id_proceso_compra','id_proceso_compra','int4');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_proceso_compra','int4');\n\t\t$this->captura('id_depto','int4');\n\t\t$this->captura('num_convocatoria','varchar');\n\t\t$this->captura('id_solicitud','int4');\n\t\t$this->captura('id_estado_wf','int4');\n\t\t$this->captura('fecha_ini_proc','date');\n\t\t$this->captura('obs_proceso','varchar');\n\t\t$this->captura('id_proceso_wf','int4');\n\t\t$this->captura('num_tramite','varchar');\n\t\t$this->captura('codigo_proceso','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('estado','varchar');\n\t\t$this->captura('num_cotizacion','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t$this->captura('desc_depto','varchar');\n\t\t$this->captura('desc_funcionario','text');\n\t\t$this->captura('desc_solicitud','varchar');\n\t\t$this->captura('desc_moneda','varchar');\n\t\t\n\t\t \n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function grabar() {\n $res = FALSE;\n $fec = $this->fecha;\n $vot = $this->votacion;\n $txt = $this->texto;\n $op1 = $this->opcion1;\n $op2 = $this->opcion2;\n $op3 = $this->opcion3;\n $op4 = $this->opcion4;\n \n if ($fec) {\n $res = Funciones::gEjecutarSQL(\"REPLACE INTO VOTACIONES (FECHA,NUMVOT,TEXTO,OPCION1,OPCION2,OPCION3,OPCION4) VALUES ('$fec','$vot','$txt','$op1','$op2','$op3','$op4')\");\n if ($res) {\n $res = $this->grabarVotos();\n }\n }\n return $res;\n }", "function addVivienda($calle, $numero_exterior, $codigo_postal = false, $numero_interior = \"\", $referencia = \"\", $telefono_fijo = \"0\", $telefono_movil = \"0\",\n\t\t\t$es_principal = false, $regimen = FALLBACK_PERSONAS_REGIMEN_VIV, $tipo = FALLBACK_PERSONAS_TIPO_VIV, $tiempo_de_residir = DEFAULT_TIEMPO, \n\t\t\t$colonia = \"\", $TipoDeAcceso = \"\", $gps = \"\",\n\t\t\t$clave_de_localidad = false, $clave_de_pais = EACP_CLAVE_DE_PAIS, \n\t\t\t$nombre_pais = \"\", $nombre_estado = \"\", $nombre_municipo = \"\", $nombre_localidad = \"\"){\n\t\t\n\t\t//$xViv\t\t\t\t= new cPersonasVivienda($this->getCodigo(), $tipo);\n\t\t\n\t\t$fechaalta \t\t\t= fechasys();\n\t\t$eacp\t\t\t\t= EACP_CLAVE;\n\t\t$socio\t\t\t\t= $this->mCodigo;\n\t\t$xT\t\t\t\t\t= new cTipos();\n\t\t$xLc\t\t\t\t= new cLocal();\n\t\t$xQL\t\t\t\t= new MQL();\n\t\t//depurar calle y numero 18Jul2013\n\t\t$calle\t\t\t\t= str_replace(\"CALLE\", \"\", strtoupper($calle));\n\t\t//Inicia al Socio 20120620\n\t\t$this->init();\n\t\t$DSocio\t\t\t\t= $this->getDatosInArray();\n\t\t$TipoDeIngreso\t\t= $DSocio[\"tipoingreso\"];\n\t\t$codigo_postal\t\t= setNoMenorQueCero($codigo_postal);\n\t\t$sucursal\t\t\t= getSucursal();\n\t\t$sucess\t\t\t\t= true;\n\t\t$usuario\t\t\t= getUsuarioActual();\n\t\t//Fixed\n\n\t\t\n\t\t\n\t\t$msg\t\t\t\t= \"\";\n\t\t$TipoDeAcceso\t\t= ($TipoDeAcceso == \"\") ? \"calle\" : $TipoDeAcceso;\n\t\t$clave_de_municipio\t= $xLc->DomicilioMunicipioClave();\n\t\t$clave_de_estado\t= $xLc->DomicilioEstadoClaveNum();\n\t\t$clave_de_localidad\t= setNoMenorQueCero($clave_de_localidad);\n\t\t$clave_de_pais\t\t= (trim($clave_de_pais) == \"\") ? EACP_CLAVE_DE_PAIS : $clave_de_pais;\n\t\t/* 1 part 2 fiscal 3 laboral*/\n\t\t//verifica los codigos postales\n\t\t$xCol\t\t\t\t= new cDomiciliosColonias();\n\t\tif($clave_de_pais == EACP_CLAVE_DE_PAIS){\n\t\t\tif( $xCol->existe($codigo_postal) == true){\n\t\t\t\t$estado\t\t\t\t\t= $xCol->getNombreEstado();\n\t\t\t\t$nombre_localidad\t\t\t\t= $xCol->getNombreLocalidad();\n\t\t\t\t$municipio\t\t\t\t= $xCol->getNombreMunicipio();\n\t\t\t\t$colonia\t\t\t\t= ( trim($colonia) == \"\" ) ? $xCol->getNombre() : $xT->cChar( $colonia );\t\n\t\t\t\t$clave_de_estado\t\t= $xCol->getClaveDeEstado();\n\t\t\t\t$clave_de_municipio\t\t= $xCol->getClaveDeMunicipio();\n\t\t\t\t$msg\t\t\t\t\t.= \"WARN\\t$socio\\tEl CP queda en $codigo_postal, Localidad en $nombre_localidad, municipio en $municipio, Colonia $colonia\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t\t\t.= \"WARN\\tEL C.P.($codigo_postal) No existe, se carga el de la Caja Local\\r\\n\";\n\t\t\t\t\n\t\t\t\t\tif( SISTEMA_CAJASLOCALES_ACTIVA == true){\n\t\t\t\t\t\t$this->init();\n\t\t\t\t\t\t$xCL\t\t\t= new cCajaLocal($this->mCajaLocal);\n\t\t\t\t\t\t$DCols\t\t\t= $xCL->getDatosInArray();\n\t\t\t\t\t\t$codigo_postal\t\t= ( isset($DCols[\"codigo_postal\"]) ) ? setNoMenorQueCero(($DCols[\"codigo_postal\"])) : $xLc->DomicilioCodigoPostal();\n\t\t\t\t\t\t$msg\t\t\t.= \"WARN\\tSe obtiene el C.P. por caja Local ($codigo_postal) \\r\\n\";\n\t\t\t\t\t\tif( $xCol->existe($codigo_postal) == true){\n\t\t\t\t\t\t\t$estado\t\t\t\t\t= $xCol->getNombreEstado();\n\t\t\t\t\t\t\t$nombre_localidad\t\t\t\t= $xCol->getNombreLocalidad();\n\t\t\t\t\t\t\t$municipio\t\t\t\t= $xCol->getNombreMunicipio();\n\t\t\t\t\t\t\t$colonia\t\t\t\t= ( trim($colonia) == \"\" ) ? $xCol->getNombre() : $xT->cChar( $colonia );\n\t\t\t\t\t\t\t$clave_de_estado\t\t= $xCol->getClaveDeEstado();\n\t\t\t\t\t\t\t$clave_de_municipio\t\t= $xCol->getClaveDeMunicipio();\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif($codigo_postal <= 0){\n\t\t\t\t\t\t$msg\t\t\t.= \"ERROR\\tEL C.P.($codigo_postal) No existe, se carga el de la Sucursal\\r\\n\";\n\t\t\t\t\t\t$codigo_postal\t= $xLc->DomicilioCodigoPostal();\n\t\t\t\t\t}\n\t\n\t\t\t}\n\t\t} else {\n\t\t\t$clave_de_estado\t\t\t\t= FALLBACK_PERSONAS_DOMICILIO_ID_ESTADO;\n\t\t\t$clave_de_municipio\t\t\t\t= FALLBACK_PERSONAS_DOMICILIO_ID_MUNICIPIO;\n\t\t\tif($codigo_postal <= 0){\t$codigo_postal = 1; } \n\t\t}\n\n\t\t$xLoc\t\t\t\t\t= new cDomicilioLocalidad($clave_de_localidad);\n\t\tif( $clave_de_localidad <= 0 ){\n\t\t\t$clave_de_localidad\t= $xLoc->setBuscar($nombre_localidad, $clave_de_estado, $clave_de_municipio);\n\t\t\tif( setNoMenorQueCero($clave_de_localidad) <= 0 ){\n\t\t\t\t$clave_de_localidad\t\t\t= $xLc->DomicilioLocalidadClave();\n\t\t\t}\n\t\t\t$xLoc->set($clave_de_localidad);\n\t\t} else {\n\t\t\t$xLoc->init();\n\t\t}\n\t\t$nombre_localidad\t\t\t\t= ($nombre_localidad == \"\") ? $xLoc->getNombre() : $nombre_localidad;\n\t\t//Tipos de Acceso calle, avenida, callejon privada, andador\n\t\tif($nombre_pais == \"\"){\n\t\t\t$xPais\t= new cDomiciliosPaises($clave_de_pais);\n\t\t\t//$xPais->getPaisPorMoneda($moneda)\n\t\t\t$xTP\t= new cPersonas_domicilios_paises();\n\t\t\t$xTP->setData( $xTP->query()->initByID($clave_de_pais) );\n\t\t\t$nombre_pais\t= $xTP->nombre_oficial()->v();\n\t\t\t$municipio\t\t= ($nombre_municipo == \"\") ? $nombre_localidad : strtoupper($nombre_municipo);\n\t\t\t$estado\t\t\t= ($nombre_estado == \"\") ? $nombre_localidad : strtoupper($nombre_estado);\n\t\t}\n\t\t\n\t\t$estado\t\t\t\t= ($nombre_estado == \"\") ? $xLc->DomicilioEstado() : strtoupper($nombre_estado);\n\t\t$nombre_localidad\t= ($nombre_localidad == \"\") ? $xLc->DomicilioLocalidad() : strtoupper($nombre_localidad);\n\t\t$municipio\t\t\t= ($nombre_municipo == \"\") ? $xLc->DomicilioMunicipio() : strtoupper($nombre_municipo);\n\t\t\n\t\t$calle\t\t\t\t= setCadenaVal($calle);\n\t\t$colonia\t\t\t= setCadenaVal($colonia);\n\t\t$estado\t\t\t\t= setCadenaVal($estado);\n\t\t$nombre_localidad\t= setCadenaVal($nombre_localidad);\n\t\t$municipio\t\t\t= setCadenaVal($municipio);\n\t\t$sql\t\t= \"INSERT INTO socios_vivienda(socio_numero, tipo_regimen, calle, numero_exterior, numero_interior, colonia,\n\t\t\t\tlocalidad, estado, municipio, telefono_residencial, telefono_movil,\n\t\t\t\ttiempo_residencia, referencia, idusuario, principal, tipo_domicilio, codigo_postal,\n\t\t\t\tfecha_alta, codigo , sucursal,\n\t\t\t\teacp, coordenadas_gps, tipo_de_acceso, fecha_de_verificacion, oficial_de_verificacion, estado_actual, clave_de_localidad,\n\t\t\t\tclave_de_pais, nombre_de_pais)\n\t\t\t\tVALUES\n\t\t\t\t($socio, $regimen, '$calle', '$numero_exterior', '$numero_interior', '$colonia',\n\t\t\t\t'$nombre_localidad', '$estado', '$municipio', '$telefono_fijo','$telefono_movil',\n\t\t\t\t$tiempo_de_residir, '$referencia', $usuario, '$es_principal', $tipo, '$codigo_postal',\n\t\t\t\t'$fechaalta', $socio, '$sucursal',\n\t\t\t\t'$eacp', '$gps', '$TipoDeAcceso', '$fechaalta', $usuario, 99, $clave_de_localidad,\n\t\t\t\t'$clave_de_pais', '$nombre_pais')\";\n\t\t$sucess\t\t= $xQL->setRawQuery($sql);\n\t\tif ( $sucess != false ){\n\t\t\t$id\t\t\t\t\t= $xQL->getLastInsertID();\n\t\t\t$this->mIDVivienda\t= $id;\n\t\t\t$msg\t\t\t.= \"OK\\tSe agrega la Vivienda con ID $id CP $codigo_postal y Localidad $clave_de_localidad del pais $nombre_pais\\r\\n\";\n\t\t\t//Actualiza el Dato de Domicilio del Grupo Solidario\n\t\t\tif( ($TipoDeIngreso == TIPO_INGRESO_GRUPO) AND (intval($es_principal) == SYS_UNO) ){\n\t\t\t\t$xGrp\t= new cGrupo($this->mCodigo);\n\t\t\t\t$DDom\t= $this->getDatosDomicilio();\n\t\t\t\t$arrUp\t= array(\n\t\t\t\t\t\t\"direccion_gruposolidario\" => $this->getDomicilio(),\n\t\t\t\t\t\t\"colonia_gruposolidario\" => $DDom[\"colonia\"]\n\t\t\t\t);\n\t\t\t\t$xGrp->setUpdate($arrUp);\n\t\t\t\t$msg\t.= $xGrp->getMessages();\n\t\t\t}\n\t\t\t$this->setCuandoSeActualiza();\n\t\t}\n\t\t$this->mMessages\t.= $msg;\n\t\treturn $sucess;\n\t}", "function addItemProceso($arregloDatos) {\n $arregloDatos[num_levante] = $arregloDatos[id_levante];\n if(empty($arregloDatos[tipo_retiro])) {\n $arregloDatos[tipo_movimiento] = 3;\n } else {\n $arregloDatos[tipo_movimiento] = $arregloDatos[tipo_retiro];\n }\n $arregloDatos[tipo_movimiento] = 30;\n $this->datos->addItemRetiro($arregloDatos);\n $arregloDatos[tipo_movimiento] = 8;\n $this->datos->addItemProceso($arregloDatos);\n $arregloDatos[mostrar] = 1;\n $arregloDatos[id_item] = NULL;\n $this->controlarTransaccion($arregloDatos);\n unset($arregloDatos[orden]);\n $arregloDatos[plantilla] = 'levanteListadoMercanciaRetiro.html';\n $arregloDatos[thisFunction] = 'getInvParaRetiro';\n $this->pantalla->setFuncion($arregloDatos,$this->datos);\n }", "function cosultarItem2($id) {\n global $textos, $sql;\n\n if (!isset($id) || (isset($id) && !$sql->existeItem('facturas_venta', 'id', $id))) {\n $respuesta = array();\n $respuesta['error'] = true;\n $respuesta['mensaje'] = $textos->id('NO_HA_SELECCIONADO_ITEM');\n\n Servidor::enviarJSON($respuesta);\n return NULL;\n }\n\n $objeto = new FacturaVenta($id);\n $respuesta = array();\n\n $codigo .= HTML::campoOculto('id', $id);\n\n $codigo1 = HTML::parrafo($textos->id('CLIENTE') . ': ' . HTML::frase($objeto->cliente, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('NIT') . ': ' . HTML::frase($objeto->idCliente, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('FECHA_FACTURA') . ': ' . HTML::frase($objeto->fechaFactura, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('USUARIO_QUE_FACTURA') . ': ' . HTML::frase($objeto->usuario, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo($textos->id('MODO_PAGO') . ': ' . HTML::frase($textos->id('MODO_PAGO' . $objeto->modoPago), 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo1 .= HTML::parrafo('', 'negrilla margenSuperior');\n\n if ($objeto->modoPago == '2') {\n $codigo2 = HTML::parrafo($textos->id('FECHA_VENCIMIENTO') . ': ' . HTML::frase($objeto->fechaVtoFactura, 'sinNegrilla'), 'negrilla margenSuperior');\n }\n \n $codigo2 .= HTML::parrafo($textos->id('SEDE') . ': ' . HTML::frase($objeto->sede, 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo2 .= HTML::parrafo($textos->id('VALOR_FLETE') . ': ' . HTML::frase(Recursos::formatearNumero($objeto->valorFlete, '$'), 'sinNegrilla'), 'negrilla margenSuperior');\n $codigo2 .= HTML::parrafo($textos->id('OBSERVACIONES') . ': ' . HTML::frase($objeto->observaciones, 'sinNegrilla'), 'negrilla margenSuperior');\n\n $datosTabla = array(\n HTML::frase($textos->id('PLU'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('ARTICULO'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('CANTIDAD'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('DESCUENTO'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('PRECIO'), 'negrilla margenIzquierda'),\n HTML::frase($textos->id('SUBTOTAL'), 'negrilla margenIzquierda')\n );\n\n $subtotalFactura = 0;\n\n $listaArticulos = array();\n foreach ($objeto->listaArticulos as $article) {\n unset($article->id);\n unset($article->idFactura);\n \n if (strlen($article->articulo) > 60) {\n $article->articulo = substr($article->articulo, 0, 60) . '.';\n }\n \n if ($article->descuento == 0 || $article->descuento == '0') {\n $article->subtotal = $article->cantidad * $article->precio;\n \n } else {\n $article->subtotal = ($article->cantidad * $article->precio) - ( ( ($article->cantidad * $article->precio) * $article->descuento) / 100 );\n \n }\n \n $article->descuento = Recursos::formatearNumero($article->descuento, '%', '0');\n \n $article->precio = Recursos::formatearNumero($article->precio, '$');\n \n $subtotalFactura += $article->subtotal;\n\n $article->subtotal = Recursos::formatearNumero($article->subtotal, '$');\n\n $listaArticulos[] = $article;\n }\n\n $subtotalFactura += $objeto->valorFlete;\n $impuestoIva = ($subtotalFactura * $objeto->iva) / 100;\n\n $subtotalFactura += $impuestoIva;\n\n $idTabla = 'tablaListaArticulosConsulta';\n $clasesColumnas = array('', '', '', '', '');\n $clasesFilas = array('centrado', 'centrado', 'centrado', 'centrado', 'centrado', 'centrado');\n $opciones = array('cellpadding' => '5', 'cellspacing' => '5', 'border' => '2');\n $clase = 'tablaListaArticulosConsulta';\n \n $contenedorListaArticles = HTML::tabla($datosTabla, $listaArticulos, $clase, $idTabla, $clasesColumnas, $clasesFilas, $opciones);\n\n\n $codigo4 = HTML::parrafo($textos->id('IVA') . HTML::frase($objeto->iva . '% ', 'sinNegrilla') . HTML::frase(Recursos::formatearNumero($impuestoIva, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n $codigo4 .= HTML::parrafo($textos->id('DESCUENTOS') . ': ', 'negrilla margenSuperior letraVerde');\n\n $totalFactura = $subtotalFactura;\n\n if (!empty($objeto->concepto1) && !empty($objeto->descuento1)) {\n $pesosDcto1 = ($totalFactura * $objeto->descuento1) / 100;\n $totalFactura = $totalFactura - $pesosDcto1;\n $codigo4 .= HTML::parrafo($objeto->concepto1 . ': ' . HTML::frase($objeto->descuento1 . '%', 'sinNegrilla') . HTML::frase(Recursos::formatearNumero($pesosDcto1, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n }\n\n if (!empty($objeto->concepto2) && !empty($objeto->descuento2)) {\n $pesosDcto2 = ($totalFactura * $objeto->descuento2) / 100;\n $totalFactura = $totalFactura - $pesosDcto2;\n $codigo4 .= HTML::parrafo($objeto->concepto2 . ': ' . HTML::frase($objeto->descuento2 . '%', 'sinNegrilla') . HTML::frase(Recursos::formatearNumero($pesosDcto2, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n }\n\n if (!empty($objeto->fechaLimiteDcto1) && !empty($objeto->porcentajeDcto1)) {\n $pesosDctoExtra1 = ($totalFactura * $objeto->porcentajeDcto1) / 100;\n $codigo4 .= HTML::parrafo($textos->id('FECHA_LIMITE_PAGO_PARA_DESCUENTO') . ': ' . $objeto->fechaLimiteDcto1 . ' ' . $textos->id('PORCENTAJE_DESCUENTO') . ': ' . HTML::frase($objeto->porcentajeDcto1 . '%', 'sinNegrilla') . HTML::frase(Recursos::formatearNumero($pesosDctoExtra1, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n }\n\n if (!empty($objeto->fechaLimiteDcto2) && !empty($objeto->porcentajeDcto2)) {\n $pesosDctoExtra2 = ($totalFactura * $objeto->porcentajeDcto2) / 100;\n $codigo4 .= HTML::parrafo($textos->id('FECHA_LIMITE_PAGO_PARA_DESCUENTO') . ': ' . $objeto->fechaLimiteDcto2 . ' ' . $textos->id('PORCENTAJE_DESCUENTO') . ': ' . HTML::frase($objeto->porcentajeDcto2 . '%', 'sinNegrilla') . HTML::frase(Recursos::formatearNumero($pesosDctoExtra2, '$'), 'sinNegrilla margenIzquierdaDoble'), 'negrilla margenSuperior');\n }\n\n $codigo5 = HTML::parrafo($textos->id('SUBTOTAL') . ': ' . HTML::frase(Recursos::formatearNumero($subtotalFactura, '$'), 'sinNegrilla titulo'), 'negrilla margenSuperior');\n $codigo5 .= HTML::parrafo('', 'negrilla margenSuperior');\n $codigo5 .= HTML::parrafo('', 'negrilla margenSuperior');\n $codigo5 .= HTML::parrafo($textos->id('TOTAL') . HTML::frase(Recursos::formatearNumero($totalFactura, '$'), 'sinNegrilla letraAzul grande'), 'negrilla margenSuperior titulo');\n $codigo5 .= HTML::parrafo($objeto->facturaDigital, 'negrilla margenSuperior');\n\n\n $contenedor1 = HTML::contenedor($codigo1, 'contenedorIzquierdo');\n $contenedor2 = HTML::contenedor($codigo2, 'contenedorDerecho');\n $contenedor3 = HTML::contenedor($contenedorListaArticles, 'contenedorListadoArticulos');\n $contenedor4 = HTML::contenedor($codigo4, 'contenedorIzquierdo');\n $contenedor5 = HTML::contenedor($codigo5, 'contenedorDerecho');\n\n $codigo .= $contenedor1 . $contenedor2 . $contenedor3 . $contenedor4 . $contenedor5;\n\n $respuesta['generar'] = true;\n $respuesta['codigo'] = $codigo;\n $respuesta['titulo'] = HTML::parrafo($textos->id('CONSULTAR_ITEM'), 'letraBlanca negrilla subtitulo');\n $respuesta['destino'] = '#cuadroDialogo';\n $respuesta['ancho'] = 800;\n $respuesta['alto'] = 600;\n\n Servidor::enviarJSON($respuesta);\n \n}", "function inserirAgencia(){\n\n $banco = abrirBanco();\n //declarando as variáveis usadas na inserção dos dados\n $nomeAgencia = $_POST[\"nomeAgencia\"];\n $cidadeAgencia = $_POST[\"cidadeAgencia\"];\n\n //a consulta sql\n $sql = \"INSERT INTO Agencias(nomeAgencia,cidadeAgencia) VALUES ('$nomeAgencia','$cidadeAgencia')\";\n \n //executando a inclusão\n $banco->query($sql);\n //fechando a conexao com o banco\n $banco->close();\n voltarIndex();\n\n }", "public function enfocarCamaraPresidencia() {\n\n self::$presidencia->enfocar();\n\n }", "function listarDetallePeriodoAgencia(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_PERDETAG_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n\n $this->setCount(false);\n\n $this->setParametro('id_periodo_venta','id_periodo_venta','int4');\n $this->setParametro('id_agencia','id_agencia','int4');\n $this->setParametro('tipo','tipo','varchar');\n\n\n //Definicion de la lista del resultado del query\n $this->captura('id_periodo_venta','int4');\n $this->captura('tipo','varchar');\n $this->captura('fecha','text');\n $this->captura('pnr','varchar');\n $this->captura('apellido','varchar');\n $this->captura('moneda','varchar');\n $this->captura('monto_boleto','numeric');\n $this->captura('comision','numeric');\n $this->captura('monto_credito_debito','numeric');\n $this->captura('ajuste','varchar');\n $this->captura('garantia','varchar');\n $this->captura('autorizacion_deposito','varchar');\n $this->captura('monto_credito_debito_mb','numeric');\n $this->captura('tipo_cambio','numeric');\n $this->captura('cierre_periodo','varchar');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function adicionaraluno() {\n\t\t/* Carrega o modelo */\n\t\t$this->load->model('cursos_model');\n\n\t\t// Maximo de Cursos\n\t\t$intMax = 20;\n\t\t//Recebendo a listagem de alunos\n\t\t$objCursos = $this->cursos_model->listar($intMax, 0);\n\n\t\tself::header();\n\t\t$this->load->view('administracao/adicionaraluno', array(\"objCursos\" => $objCursos));\n\t\tself::footer();\n\t}", "function grabar($datos)\n\t{\n\t\tif (($datos[IDPROVEEDOR]=='') && ($this->exist(\"$this->catalogo.catalogo_proveedor\",'IDPROVEEDOR',\" WHERE NOMBREFISCAL = '$datos[NOMBREFISCAL]'\" )))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$reg_proveedor[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t$reg_proveedor[NOMBREFISCAL] = trim(strtoupper($datos[NOMBREFISCAL]));\n\t\t\t$reg_proveedor[NOMBRECOMERCIAL] = trim(strtoupper($datos[NOMBRECOMERCIAL]));\n\t\t\t$reg_proveedor[IDTIPODOCUMENTO] = $datos[IDTIPODOCUMENTO];\n\t\t\t$reg_proveedor[IDDOCUMENTO] = trim($datos[IDDOCUMENTO]);\n\t\t\t$reg_proveedor[EMAIL1] = trim(strtolower($datos[EMAIL1]));\n\t\t\t$reg_proveedor[EMAIL2] = trim(strtolower($datos[EMAIL2]));\n\t\t\t$reg_proveedor[EMAIL3] = trim(strtolower($datos[EMAIL3]));\n\t\t\t$reg_proveedor[ACTIVO] = $datos[ACTIVO];\n\t\t\t$reg_proveedor[INTERNO] = $datos[INTERNO];\n\n\t\t\tif ($datos[ARREVALRANKING]=='SKILL'){\n\t\t\t\t$reg_proveedor[ARREVALRANKING]=$datos[ARREVALRANKING];\n\t\t\t\t$reg_proveedor[SKILL]= $datos[SKILL];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$reg_proveedor[ARREVALRANKING]='CDE';\n\t\t\t}\n\t\t\t$reg_proveedor[EVALFIDELIDAD]=$datos[EVALFIDELIDAD];\n\t\t\t$reg_proveedor[EVALINFRAESTRUCTURA]=$datos[EVALINFRAESTRUCTURA];\n\t\t\t$reg_proveedor[IDMONEDA]=$datos[IDMONEDA];\n\t\t\t$reg_proveedor[OBSERVACIONES]=$datos[OBSERVACIONES];\n\n\t\t\t$reg_proveedor[BRSCH] = $datos[BRSCH];\n\t\t\t$reg_proveedor[FDGRV] = $datos[FDGRV];\n\t\t\t$reg_proveedor[ZTERM] = $datos[ZTERM];\n\t\t\t$reg_proveedor[MWSKZ] = $datos[MWSKZ];\n\t\t\t$reg_proveedor[PARVO] = $datos[PARVO];\n\t\t\t$reg_proveedor[PAVIP] = $datos[PAVIP];\n\t\t\t$reg_proveedor[FECHAINICIOACTIVIDADES]= trim($datos[ANIO].'-'.$datos[MES].'-'.$datos[DIA]);\n\n\t\t\t$prov_ubigeo[CVEPAIS]= $datos[CVEPAIS];\n\t\t\t$prov_ubigeo[CVEENTIDAD1]= $datos[CVEENTIDAD1];\n\t\t\t$prov_ubigeo[CVEENTIDAD2]= $datos[CVEENTIDAD2];\n\t\t\t$prov_ubigeo[CVEENTIDAD3]= $datos[CVEENTIDAD3];\n\t\t\t$prov_ubigeo[CVEENTIDAD4]= $datos[CVEENTIDAD4];\n\t\t\t$prov_ubigeo[CVEENTIDAD5]= $datos[CVEENTIDAD5];\n\t\t\t$prov_ubigeo[CVEENTIDAD6]= $datos[CVEENTIDAD6];\n\t\t\t$prov_ubigeo[CVEENTIDAD7]= $datos[CVEENTIDAD7];\n\t\t\t$prov_ubigeo[CVETIPOVIA]= $datos[CVETIPOVIA];\n\t\t\t$prov_ubigeo[DIRECCION]= $datos[DIRECCION];\n\t\t\t$prov_ubigeo[NUMERO]= $datos[NUMERO];\n\t\t\t$prov_ubigeo[CODPOSTAL] = $datos[CODPOSTAL];\n\t\t\t$prov_ubigeo[LATITUD] = $datos[LATITUD];\n\t\t\t$prov_ubigeo[LONGITUD] = $datos[LONGITUD];\n\t\t\t$prov_ubigeo[IDUSUARIOMOD]= $datos[IDUSUARIOMOD];\n\t\t\t$prov_ubigeo[REFERENCIA1]= $datos[REFERENCIA1];\n\t\t\t$prov_ubigeo[REFERENCIA2]= $datos[REFERENCIA2];\n\n\t\t\t$datos_telf[CODIGOAREA] = $datos[CODIGOAREA];\n\t\t\t$datos_telf[IDTIPOTELEFONO] = $datos[IDTIPOTELEFONO];\n\t\t\t$datos_telf[NUMEROTELEFONO] = $datos[NUMEROTELEFONO];\n\t\t\t$datos_telf[EXTENSION] = $datos[EXTENSION];\n\t\t\t$datos_telf[IDTSP] = $datos[IDTSP];\n\t\t\t$datos_telf[COMENTARIO]=$datos[TELF_COMENTARIO];\n\t\t\t$datos_telf[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\n\t\t\t$this->borrar_telefono($datos[IDPROVEEDOR]); // BORRA LOS PROVEEDORES\n\n\t\t\tif ( $datos[IDPROVEEDOR]=='')\n\t\t\t{\n\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor\",$reg_proveedor);\n\t\t\t\t$datos[IDPROVEEDOR] = $this->reg_id(); //OBTIENE EL ID DEL NUEVO PROVEEDOR\n\t\t\t\t$prov_ubigeo[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t\t\t$prov_horario[IDPROVEEDOR]=$datos[IDPROVEEDOR];\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_ubigeo\",$prov_ubigeo);\n\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_horario\",$prov_horario);\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$this->update(\"$this->catalogo.catalogo_proveedor\",$reg_proveedor,\" where IDPROVEEDOR = '$datos[IDPROVEEDOR]'\");\n\t\t\t\t$this->update(\"$this->catalogo.catalogo_proveedor_ubigeo\",$prov_ubigeo,\" where IDPROVEEDOR = '$datos[IDPROVEEDOR]'\");\n\t\t\t}\n\n\t\t\tif ($datos[IDPROVEEDOR]!='')\n\t\t\t{\n\t\t\t\tfor($i=0;$i<count($datos_telf[NUMEROTELEFONO]);$i++)\n\t\t\t\t{\n\t\t\t\t\t$telf[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t\t$telf[CODIGOAREA]=$datos_telf[CODIGOAREA][$i];\n\t\t\t\t\t$telf[IDTIPOTELEFONO]=$datos_telf[IDTIPOTELEFONO][$i];\n\t\t\t\t\t$telf[NUMEROTELEFONO]=$datos_telf[NUMEROTELEFONO][$i];\n\t\t\t\t\t$telf[EXTENSION]=$datos_telf[EXTENSION][$i];\n\t\t\t\t\t$telf[IDTSP]=$datos_telf[IDTSP][$i];\n\t\t\t\t\t$telf[COMENTARIO]=$datos_telf[COMENTARIO][$i];\n\t\t\t\t\t$telf[IDUSUARIOMOD] = $datos_telf[IDUSUARIOMOD];\n\t\t\t\t\t$telf[PRIORIDAD]=$i+1;\n\n\t\t\t\t\t$this->insert_reg(\"$this->catalogo.catalogo_proveedor_telefono\",$telf);\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$datos_sociedad = $datos[IDSOCIEDAD];\n\n\n\t\t\t// GRABA LOS SERVICIOS DEL PROVEEDOR //\n\t\t\t$sql=\"delete from catalogo_proveedor_servicio where IDPROVEEDOR='$datos[IDPROVEEDOR]'\";\n\t\t\t$this->query($sql);\n\n\t\t\t$nueva_prioridad=1;\n\n\t\t\tforeach ($datos[CHECKSERVICIO] as $servi)\n\t\t\t{\n\t\t\t\t$servicio[IDSERVICIO] = $servi;\n\t\t\t\t$servicio[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t$servicio[PRIORIDAD] = $nueva_prioridad;\n\t\t\t\t$servicio[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\n\t\t\t\tif ($servi!='')\n\t\t\t\t{\n\t\t\t\t\t$this->insert_reg('catalogo_proveedor_servicio',$servicio);\n\t\t\t\t\t$nueva_prioridad++;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// GRABA LAS SOCIEDADES DEL PROVEEDOR\n\t\t\t$sql=\"delete from catalogo_proveedor_sociedad where IDPROVEEDOR='$datos[IDPROVEEDOR]'\";\n\t\t\t$this->query($sql);\n\t\t\tforeach ($datos[IDSOCIEDAD] as $soc)\n\t\t\t{\n\t\t\t\t$sociedad[IDSOCIEDAD] = $soc;\n\t\t\t\t$sociedad[IDPROVEEDOR] = $datos[IDPROVEEDOR];\n\t\t\t\t$sociedad[IDUSUARIOMOD] = $datos[IDUSUARIOMOD];\n\t\t\t\t$this->insert_reg('catalogo_proveedor_sociedad',$sociedad);\n\t\t\t}\n\t\t\treturn $datos[IDPROVEEDOR];\n\t\t}\n\t\treturn $datos[IDPROVEEDOR];\n\t}", "function Cuerpo($acceso,$id_contrato)\n\t{\n\t\t//echo \"SELECT *FROM vista_contrato where id_contrato='$id_contrato'\";\n\t\t$acceso->objeto->ejecutarSql(\"SELECT tarifa_ser FROM vista_tarifa where id_serv='BM00001'\");\n\t\t\n\t\tif($row=row($acceso)){\n\t\t\t$costo_inst=utf8_decode(trim($row['tarifa_ser']));\n\t\t}\n\t\t//echo \"update contrato set contrato_imp='SI' where id_contrato='$id_contrato'\";\n\t\t$acceso->objeto->ejecutarSql(\"update contrato set contrato_imp='SI' where id_contrato='$id_contrato'\");\n\t\t$acceso->objeto->ejecutarSql(\"SELECT *FROM vista_contrato where id_contrato='$id_contrato'\");\n\t\tif($row=row($acceso)){\n\t\t\n\t\t\t$observacion=utf8_decode(trim($row['observacion']));\n\t\t\t$costo_contrato=utf8_decode(trim($row['costo_contrato']));\n\t\t\t$tipo_cliente=utf8_decode(trim($row['tipo_cliente']));\n\t\t\t$nombrecli=utf8_decode(trim($row['nombrecli']));\n\t\t\t$apellidocli=utf8_decode(trim($row['apellido']));\n\t\t\t$nombrecli=utf8_decode(trim($row['nombre']));\n\t\t\t$etiqueta=utf8_decode(trim($row['etiqueta']));\n\t\t\t$cedulacli=utf8_decode(trim($row['cedula']));\n\t\t\t\n\t\t\t$fecha=formatofecha(trim($row[\"fecha_contrato\"]));\n\t\t\t$fecha_nac=formatofecha(trim($row[\"fecha_nac\"]));\n\t\t\t\n\t\t\t\n\t\t\t$nro_contrato=trim($row['nro_contrato']);\n\t\t\t$id_contrato=trim($row['id_contrato']);\n\t\t\n\t\t\n\t\t\t$puntos=utf8_decode(trim($row['puntos']));\n\t\t\t$deuda=utf8_decode(trim($row['deuda']));\n\t\t\tif($deuda==\"\"){\n\t\t\t\t$deuda=0;\n\t\t\t}\n\t\t\t\n\t\t\t$deuda=number_format($deuda, 2, ',', '.');\n\t\t\t$nombre_zona=utf8_decode(trim($row['nombre_zona']));\n\t\t\t$nombre_sector=utf8_decode(trim($row['nombre_sector']));\n\t\t\t$nombre_calle=utf8_decode(trim($row['nombre_calle']));\n\t\t\t$numero_casa=utf8_decode(trim($row['numero_casa']));\n\t\t\t$telefono=utf8_decode(trim($row['telefono']));\n\t\t\t$telf_casa=utf8_decode(trim($row['telf_casa']));\n\t\t\t$telf_adic=utf8_decode(trim($row['telf_adic']));\n\t\t\t$email=utf8_decode(trim($row['email']));\n\t\t\t$direc_adicional=utf8_decode(trim($row['direc_adicional']));\n\t\t\t$id_persona=utf8_decode(trim($row['id_persona']));\n\t\t\t$postel=utf8_decode(trim($row['postel']));\n\t\t\t$taps=utf8_decode(trim($row['taps']));\n\t\t\t$pto=utf8_decode(trim($row['pto']));\n\t\t\t$edificio=utf8_decode(trim($row['edificio']));\n\t\t\t$numero_piso=utf8_decode(trim($row['numero_piso']));\n\t\t}\n\t\t$acceso->objeto->ejecutarSql(\"SELECT nombre,apellido FROM persona where id_persona='$id_persona' LIMIT 1 offset 0 \");\n\t\t\n\t\tif($row=row($acceso)){\n\t\t\t$vendedor=utf8_decode(trim($row['nombre'])).\" \".utf8_decode(trim($row['apellido']));\n\t\t\t\n\t\t}\n\n\t\tif($tipo_cliente=='JURIDICO'){\n\t\t\t$rif=$cedulacli;\n\t\t\t$cedulacli='';\n\t\t}\n\t\t\n\t\t\n\t\t$this->Ln();\t\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetXY(10,35);\t\t\n\t\t$this->Cell(195,10,\"Abonado: $nro_contrato\",\"0\",0,\"R\");\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t$this->SetXY(40,50);\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PERSONA JURIDICA.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Razón Social.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Actividad.\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"RIF. $rif\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail.\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Telef.\",\"1\",0,\"J\");\n\t\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Representante Legal\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"C.I: \",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Cargo en la Empresa.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PERSONA NATURAL.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Apellidos y Nombres: $nombrecli $apellidocli\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Cédula: $cedulacli\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Fecha de Nac: $fecha_nac\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Profesión u Oficio: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: $telf_casa\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: $telefono\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: $telf_adic\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"E-mail: $email\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Ingreso Mensual: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Deposito en Garantia: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(130,6,\"Tipo Vivienda: Propia ___ Alquilado ___ Canon Mensual: ____\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(65,6,\"Vencimiento del Contrato: / / \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"DATOS DEL CONYUGUE.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Apellidos y Nombres: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Cédula: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Fecha de Nac: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Profesión u Oficio: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail: \",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Ingreso Mensual.\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"DOMICILIO DEL SERVICIO\",\"1\",0,\"C\");\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Apellidos: $apellidocli\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Vendedor: $vendedor\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Suscriptor Nº: $nro_contrato\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Fecha: $fecha\",\"1\",0,\"J\");*/\n\t\t\t\t\n\t\n\t\t/*if($tipo_cliente=='JURIDICO'){\n\t\t\t$rif=$cedulacli;\n\t\t\t$cedulacli='';\n\t\t}*/\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"C.I. $cedulacli\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"RIF. $rif\",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Ocupación: \",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Grupo Familiar Nº:\",\"1\",0,\"J\");\n\t\tif($fecha_nac=='11/11/1111'){\n\t\t\t$fecha_nac='';\n\t\t}\n\t\t$this->Cell(65,6,\"Fecha de Nacimiento : $fecha_nac\",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',12);\n\t\t$this->SetX(10);\n\t\t$this->SetFillColor(76,136,206);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(195,6,\"DOMICILIO DE SERVICIO\",\"1\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);*/\n\t\t\n\t\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Urb o Sector: $nombre_sector\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(97,6,\"Calle n°: \",\"1\",0,\"J\");\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Avenida o Calle: $nombre_calle\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(97,6,\"Vereda : \",\"1\",0,\"J\");\t\t\n\t\t\n\t\tif($edificio!='')\n\t\t\t$apto=$numero_casa;\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Edificio: $edificio\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Piso:\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"N° de Casa o Apto: $numero_casa $apto\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(130,6,\"Referencia o Zona: $nombre_zona N°Poste:$postel\",\"1\",0,\"J\");\n\t\t//$this->Cell(65,6,\"N° de Poste: $postel\",\"0\",0,\"J\");\n\t\t$this->Cell(65,6,\"Ruta Cuenta: \",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Zona: $nombre_zona\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Manzana: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Urb.: $nombre_sector\",\"1\",0,\"J\");*/\n\t\t\n\t\t/*if($edificio!='')\n\t\t\t$apto=$numero_casa;\n\t\t\n\t\t$this->Cell(97,6,\"Apto.: $apto\",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"Edificio: $edificio\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Cod. Postal: \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Telf. Hab: $telf_casa\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Celular: $telefono\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Telef Ofic: $telf_adic\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t//Rect( float x, float y, float w, float h [, string style])\n\t\t$this->Cell(98,6,\"Vivienda Alquilada: SI ____ NO ____\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Fecha de Vencimineto de Alquiler: \",\"1\",0,\"J\");\n\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"E-mail: $email\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"Proveedor de Internet: \",\"1\",0,\"J\");*/\n\t\t\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','B',12);\n\t\t$this->SetX(10);\n\t\t$this->SetFillColor(76,136,206);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(195,6,\"SERVICIOS CONTRATADOS\",\"1\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);*/\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"SERVICIOS CONTRATADOS\",\"1\",0,\"C\");\t\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"SERVICIOS \",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,6,\"CANT.\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"P. UNITARIO \",\"1\",0,\"C\");\n\t\t$this->Cell(35,6,\"P. TOTAL \",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Instalación Principal\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"1\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Tomas Adicionales\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Cable Coaxial\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Conectores\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\"Espliter\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(30,5,\"\",\"1\",0,\"C\");\n\t\t$this->Cell(35,5,\"\",\"1\",0,\"C\");\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,5,\" \",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(60,5,\"TOTAL A PAGAR BS\",\"1\",0,\"R\");\n\t\t$this->Cell(35,5,\"$costo_inst\",\"1\",0,\"C\");\n\t\n\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(50,5,\"FECHA ESTIMADA\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(25,5,\"\",\"LRT\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(25,5,\"HORA\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(30,5,\"\",\"LRT\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(30,5,\"TOTAL A\",\"LRT\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(35,5,\"$costo_contrato\",\"LRT\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(50,5,\"DE INSTALACION\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(25,5,\"\",\"LRB\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(25,5,\"SUGERIDA\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(30,5,\"\",\"LRB\",0,\"C\");\n\t\t$this->SetTextColor(255,255,255);\n\t\t$this->Cell(30,5,\"PAGAR Bs.\",\"LRB\",0,\"C\",'1');\n\t\t$this->SetTextColor(0,0,0);\n\t\t$this->Cell(35,5,\"\",\"LRB\",0,\"C\");*/\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','B',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"PROGRAMACIÓN\",\"1\",0,\"C\");\t\t\t\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Descripción.\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\"Monto\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"Firma Abonado\",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Descripción\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\"Monto\",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\"Firma Abonado\",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Familiar Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Extendido Bs \",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Premium I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Premium I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(45,6,\"Paquete Adulto Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(40,6,\"Paquete Comercial I Bs\",\"1\",0,\"C\");\n\t\t$this->Cell(25,6,\" \",\"1\",0,\"C\");\n\t\t$this->Cell(30,6,\" \",\"1\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"Monto de Contrato: Bs. $costo_inst\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(95,6,\"Firma del Abonado:_________________________ \",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(100,6,\"Puntos Adicionales:_________________________\",\"1\",0,\"J\");\t\t\n\t\t$this->Cell(95,6,\"Costo Punto Adicional:_______________________\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Tiempo de Instalación:\",\"1\",0,\"J\");\n\t\t$this->Cell(65,6,\"Total a Cancelar Mensual:\",\"1\",0,\"J\");\n\t\t$this->Cell(30,6,\"Total:\",\"1\",0,\"J\");\n\t\t$this->Cell(35,6,\"Contrato:\",\"1\",0,\"J\");\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',11);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"Observaciones.\",\"1\",0,\"J\");\n\t\t\t\t\t\t\n\t\t\n\t\t/*$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(195,6,\"$observacion\",\"1\",0,\"J\");*/\n\t\t\n\t/*\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(98,6,\"RECIBO DE PAGO\",\"1\",0,\"J\");\n\t\t$this->Cell(97,6,\"*EL PRECIO INCLUYE EL IMPUESTO DE LEY\",\"1\",0,\"J\");\n\t\t\n\t\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(35,6,\"Efectivo\",\"1\",0,\"C\");\n\t\t$this->Cell(35,6,\"Cheque\",\"1\",0,\"C\");\n\t\t$this->Cell(65,6,\"Cargo Cta. Cte.\",\"1\",0,\"C\");\n\t\t$this->Cell(60,6,\"Tarjeta de Credito:\",\"1\",0,\"C\");\n\t\t\n\t\n\t\t$this->Ln();\n\t\t$this->SetFont('times','',12);\n\t\t$this->SetX(10);\n\t\t$this->Cell(35,6,\"Bs. $costo_contrato\",\"1\",0,\"L\");\n\t\t$this->Cell(35,6,\"Nº.\",\"1\",0,\"L\");\n\t\t$this->Cell(65,6,\"Cta. Nº Bco.\",\"1\",0,\"L\");\n\t\t$this->Cell(60,6,\"Nombre:\",\"1\",0,\"L\");\n\t\t\n\t\n\t\t\n\t\t\n\t\t$this->Ln(15);\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Nota:\",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"En caso de que el televisor no acepte la señal de todos los canales del cable, es posible que amerite la instalación de un amplificador de sintonia, el cual deberá ser adquirido por el SUSCRIPTOR\",\"0\",\"J\");\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Atención: \",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"La Empresa. No autoriza el retiro de televisores y/o VHS por el personal de la empresa. El SUSCRIPTOR conoce y acepta las condiciones del contrato del servicio que apacen al dorso del presente\",\"0\",\"J\");\n\t\t\n\t\t$this->SetFont('times','',9);\n\t\t$this->SetX(10);\n\t\t$this->Cell(13,5,\"Aviso: \",\"0\",0,\"L\");\n\t\t$this->MultiCell(164,5,\"Se le informa a todos los suscriptores y publico en general de acuerdo a la Ley Orgánica de Telecomunicaciones, en el Artículo 189, Literal 2: será penado con prisión de uno (1) a cuatro (4) años, el que utilizando equipos o tecnologías de cualquier tipo, proporciones a un tercero el acceso o disfrute en forma fraudulenta o indebida de un serbicio o facilidad de telecomunicaciones \",\"0\",\"J\");\n\t\t\n\t\t\n\t\t\n\t\t$this->Ln(10);\n\t\t$this->SetFont('times','',10);\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,5,\"________________________\",\"0\",0,\"C\");\n\t\t$this->Cell(65,5,\"_________________________________\",\"0\",0,\"C\");\n\t\t$this->Cell(65,5,\"__________________________\",\"0\",0,\"C\");\n\t\t\n\t\t$this->Ln();\n\t\t\n\t\t$this->SetX(10);\n\t\t$this->Cell(65,6,\"Firma del Vendedor\",\"0\",0,\"C\");\n\t\t$this->Cell(65,6,\"Nombre y Apellido del Suscriptor\",\"0\",0,\"C\");\n\t\t$this->Cell(65,6,\"Firma del Suscriptor\",\"0\",0,\"C\");*/\n\t\t\n\t\t/*$this->Ln(4);\n\t\t\n\t\t$this->SetDrawColor(76,136,206);\n\t\t$this->SetLineWidth(.4);\n\t\t$this->SetFont('times','I',12);\n\t\t$this->SetX(10);\n\t\t$this->MultiCell(195,5,'Av. Perimetral, Centro Comercial Residencial Central. P.B. Local Nº 07. Cúa, Edo. Miranda.\[email protected] / [email protected]',\"TB\",\"C\");*/\n\t\t\n\t\t//$this->clausulas();\n\t\t\n\t\treturn $cad;\n\t}", "public function enviarNuestroSonido( ) {\n $cmd = new ComandoFlash(\"VIDEOCONFERENCIA\",\"NUESTRO_SONIDO\",$this->getNuestroSonido());\n $this->enviarPeticion($cmd->getComando());\n\n }", "private function processarParametros() {\n\n /**\n * Busca os usuarios definidos para notificar quando acordo ira vencer, ordenando pelo dia\n */\n $oDaoMensageriaUsuario = db_utils::getDao('mensagerialicenca_db_usuarios');\n $sSqlUsuarios = $oDaoMensageriaUsuario->sql_query_usuariosNotificar('am16_sequencial', 'am16_dias');\n $rsUsuarios = db_query($sSqlUsuarios);\n $iTotalUsuarios = pg_num_rows($rsUsuarios);\n\n if ($iTotalUsuarios == 0) {\n throw new Exception(\"Nenhum usuário para notificar.\");\n }\n\n /**\n * Percorre os usuarios e define propriedades necessarias para buscar acordos\n */\n for ($iIndiceUsuario = 0; $iIndiceUsuario < $iTotalUsuarios; $iIndiceUsuario++) {\n\n /**\n * Codigo do usuario para notificar: mensageriaacordodb_usuario.ac52_sequencial\n */\n $iCodigoMensageriaLicencaUsuario = db_utils::fieldsMemory($rsUsuarios, $iIndiceUsuario)->am16_sequencial;\n\n /**\n * Codigo dos usuarios que serao notificados\n * - usado para verificar os usuarios que ja foram notificados\n * - mensageriaacordodb_usuario.ac52_sequencial\n */\n $this->aCodigoMensageriaLicencaUsuario[] = $iCodigoMensageriaLicencaUsuario;\n\n /**\n * Usuario para notificar\n * - mensageriaacordodb_usuario\n */\n $oMensageriaLicencaUsuario = MensageriaLicencaUsuarioRepository::getPorCodigo($iCodigoMensageriaLicencaUsuario);\n\n /**\n * Codigo do usuario do sistema\n * - db_usuarios.id_usuario\n */\n $iCodigoUsuario = $oMensageriaLicencaUsuario->getUsuario()->getCodigo();\n\n /**\n * Data de vencimento:\n * - Soma data atual com dias definidos na rotina de parametros de mensageria\n */\n $iDias = $oMensageriaLicencaUsuario->getDias();\n $this->aDataVencimento[] = date('Y-m-d', strtotime('+ ' . $iDias . ' days'));\n }\n\n return true;\n }", "function EstadoCuentaDes(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_AGTD_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n $this->setParametro('id_agencia','id_agencia','int4');\n //Definicion de la lista del resultado del query\n $this->captura('fecha_ini','date');\n $this->captura('fecha_fin','date');\n $this->captura('titulo','varchar');\n $this->captura('mes','varchar');\n $this->captura('fecha','date');\n $this->captura('autorizacion__nro_deposito','varchar');\n $this->captura('id_periodo_venta','int4');\n $this->captura('monto_total','numeric');\n $this->captura('neto','numeric');\n $this->captura('monto','numeric');\n $this->captura('cierre_periodo','varchar');\n $this->captura('ajuste','varchar');\n $this->captura('tipo','varchar');\n $this->captura('transaccion','varchar');\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n // var_dump($this->respuesta);exit;\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function alta_entrada(){\n $e = new Entrada();\n\t\t$precio=$_POST['costo_unitario'];\n\t\t$producto_id=$_POST['cproductos_id'];\n $e->usuario_id = $GLOBALS['usuarioid'];\n $e->empresas_id = $GLOBALS['empresaid'];\n $related = $e->from_array($_POST);\n //if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n $f = new Pr_factura();\n $f->get_by_id($e->pr_facturas_id);\n $e->espacios_fisicos_id = $f->espacios_fisicos_id;\n $e->lote_id = $f->lote_id;\n $e->costo_total = ($e->cantidad * $e->costo_unitario);\n\t\t$e->existencia = $e->cantidad;\n $e->cproveedores_id = $f->cproveedores_id;\n $e->fecha = date(\"Y-m-d H:i:s\");\n if ($e->id == 0)\n unset($e->id);\n if ($e->save($related)) {\n echo $e->id;\n\t\t\t$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n } else\n echo 0;\n }", "function autorizar_producto_san_luis($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n $fecha_hoy=date(\"Y-m-d H:i:s\",mktime());\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen,deposito_destino\r\n from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_origen = $res->fields[\"deposito_origen\"];\r\n $id_deposito_destino = $res->fields[\"deposito_destino\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM Producto San Luis nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"]; \r\n ///////////////////////////////////////\r\n $sql = \"select id_recibidos_mov,cantidad\r\n from recibidos_mov where id_detalle_movimiento=$id_detalle_movimiento \r\n and ent_rec=0\";\r\n $detalle_rec = sql($sql) or fin_pagina();\r\n $id_recibido_mov = $detalle_rec->fields[\"id_recibidos_mov\"];\r\n if($id_recibido_mov==\"\") {\r\n\t \t //insert\r\n\t\t $sql = \"select nextval('recibidos_mov_id_recibidos_mov_seq') as id_recibido_mov\";\r\n\t\t $res_1 = sql($sql) or fin_pagina();\r\n\t\t $id_recibido_mov = $res_1->fields[\"id_recibido_mov\"];\r\n\t\t $sql=\"insert into recibidos_mov(id_recibidos_mov,id_detalle_movimiento,cantidad,ent_rec)\r\n\t\t values($id_recibido_mov,$id_detalle_movimiento,$cantidad,0)\";\r\n }else {\r\n\t //update\r\n\t $sql=\"update recibidos_mov set cantidad=cantidad+$cantidad\r\n\t where id_recibidos_mov=$id_recibido_mov\";\r\n }//del else\r\n sql($sql) or fin_pagina();\r\n $sql =\"insert into log_recibidos_mov(id_recibidos_mov,usuario,fecha,cantidad_recibida,tipo)\r\n values($id_recibido_mov,'\".$_ses_user[\"name\"].\"','$fecha_hoy',$cantidad,'entrega')\";\r\n sql($sql) or fin_pagina();\r\n /////////////////////////////////////// \r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_origen,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n //Inserto la Mercaderia entrante en el stock BS AS \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n $comentario = \"Producto San Luis perteneciente al PM nro: $id_mov\";\r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \r\n\t //el id_tipo_movimiento le hardcodeo uno de la tabla stock.tipo_movimiento\r\n\t $id_tipo_movimiento='13';\r\n\t //el ingreso del producto es a \"disponible\" por lo tanto la funcion no toma en cuenta los parametros que siguen\r\n\t $a_stock='disponible';\r\n\t agregar_stock($id_prod_esp,$cantidad,$id_deposito_destino,$comentario,$id_tipo_movimiento,$a_stock,$id_tipo_reserva,\"\",$id_detalle_movimiento,$id_licitacion,$nro_caso);\r\n\t $res->movenext();\r\n }//del for\r\n $db->completetrans();\r\n\r\n }", "function evt__agregar()\n\t{\n\t\t$this->set_pantalla('pant_edicion');\n\t}", "function alta_inventario(){\n\t\t\n\t\t$u= new Pr_factura();\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->empresas_id=$GLOBALS['empresaid'];\n\t\t$u->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$u->fecha_captura=date(\"Y-m-d H:i:s\");\n\t\t$u->fecha=date(\"Y-m-d H:i:s\");\n\t\t$u->cproveedores_id=1;\n $u->fecha_pago=date(\"Y-m-d H:i:s\");\n $u->ctipo_factura_id=2;\n\t\t$fecha=explode(\" \", $_POST['fecha']);\n\t\t$u->fecha=$fecha[2].\"/\".$fecha[1].\"/\".$fecha[0];\n\t\tunset($_POST['fecha']);\n\t\tunset($_POST['tipo_entrada']);\n\t\t$related = $u->from_array($_POST);\n\t\t// save with the related objects\n\t\t\n\t\tif($u->save($related)){\n //Dar de alta el lote si el proveedor no es el inicial\n if($u->cproveedores_id>0){\n $l=new Lote();\n $l->fecha_recepcion=$u->fecha;\n $l->espacio_fisico_inicial_id=$u->espacios_fisicos_id;\n $l->pr_factura_id=$u->id;\n $l->save(); \n $u->lote_id=$l->id;\n $u->save();\n }\n }\n\t\t\techo \"<input type='hidden' name='id' id='id' value='$u->id'>\";\n \n\t}", "public function generar(){\n if (!$this->ordenante instanceof bancfiles_n34_ordenante) {\n\n throw new Bancfiles_Exception('Ordenante no existente');\n }\n \n // si no hi ha beneficiaris llancem una excepcio\n if ( ($this->linies_diez = count($this->beneficiarios)) ==0) {\n\n throw new Bancfiles_Exception('Beneficiarios == 0');\n }\n \n $this->buffer = $this->ordenante->generar_cap()\n .$this->ordenante->generar_nombre()\n .$this->ordenante->generar_domicilio()\n .$this->ordenante->generar_plaza();\n \n foreach ($this->beneficiarios as $beneficiario){\n \n $this->buffer = $this->buffer\n .$beneficiario->generar_registre10($this->ordenante->nif)\n .$beneficiario->generar_registre11($this->ordenante->nif);\n \n \n } \n \n // 4 del ordenant\n // 1 totals\n // 2 per cada beneficiari\n $this->linies = 5+(count($this->beneficiarios)<<1);\n\n $this->buffer .= $this->generar_totals();\n \n return $this;\n }", "function add($nombre, $apellidopaterno = \"\", $apellidomaterno = \"\",\n\t\t\t$rfc = \"\", $curp = \"\", $cajalocal = DEFAULT_CAJA_LOCAL,\n\t\t\t$fecha_de_nacimiento = false, $lugar_de_nacimiento = \"\",\n\t\t\t$tipo_de_ingreso = FALLBACK_PERSONAS_TIPO_ING, $estado_civil = DEFAULT_ESTADO_CIVIL,\n\t\t\t$genero = DEFAULT_GENERO, $dependencia = FALLBACK_CLAVE_EMPRESA, $regimen_conyugal = DEFAULT_REGIMEN_CONYUGAL,\n\t\t\t$personalidad_juridica = PERSONAS_FIGURA_FISICA, $grupo_solidario = DEFAULT_GRUPO, $observaciones = \"\",\n\t\t\t$identificado_con = 1, $documento_de_identificacion = \"0\", $codigo = false, $sucursal = false,\n\t\t\t$movil\t= \"\", $correo = \"\", $dependientes = 0, $fecha = false, $riesgo = AML_PERSONA_BAJO_RIESGO, $clave_fiel = \"\", \n\t\t\t$pais = EACP_CLAVE_DE_PAIS, $regimen_fiscal = DEFAULT_REGIMEN_FISCAL){\n\t\t$sucess\t\t\t\t\t= false;\n\t\t$xF\t\t\t\t\t\t= new cFecha();\n\t\t$xLoc\t\t\t\t\t= new cLocal();\n\t\t//$ql\t\t\t\t\t\t= new MQL();\n\t\t//Reparando\n\t\t$fecha_de_entrevista \t= $xF->getFechaISO($fecha);\n\t\t$fecha_de_alta\t\t\t= $xF->getFechaISO($fecha);\n\t\t$fecha_de_revision\t\t= $xF->getFechaISO($fecha);\n\t\t$estatus\t\t\t\t= FALLBACK_PERSONAS_ESTADO;\n\t\t$region\t\t\t\t\t= FALLBACK_PERSONAS_REGION;\n\t\t\n\t\t$nombre\t\t\t\t\t= addslashes($nombre);\n\t\t$apellidomaterno\t\t= addslashes($apellidomaterno);\n\t\t$apellidopaterno\t\t= addslashes($apellidopaterno);\n\t\t\n\t\t$nombre\t\t\t\t\t= utf8_decode( strtoupper($nombre) );\n\t\t$apellidopaterno\t\t= utf8_decode( strtoupper($apellidopaterno) );\n\t\t$apellidomaterno\t\t= utf8_decode( strtoupper($apellidomaterno) );\n\t\t$dependientes\t\t\t= setNoMenorQueCero($dependientes);\n\t\t$eacp\t\t\t\t\t= EACP_CLAVE;\n\t\t$sucursal\t\t\t\t= ($sucursal == false) ? getSucursal() : $sucursal;\n\t\t$usuario\t\t\t\t= getUsuarioActual();\n\t\t$codigo\t\t\t\t\t= ($codigo == false) ? $this->mCodigo : $codigo;\n\t\t$fecha_de_nacimiento\t= $xF->getFechaISO($fecha_de_nacimiento);\n\t\t$cajalocal\t\t\t\t= setNoMenorQueCero($cajalocal);\n\t\t$cajalocal\t\t\t\t= ($cajalocal == 0) ? $xLoc->getCajaLocal() : $cajalocal;\n\t\tif($codigo == false){\n\t\t\t$xCL\t\t\t\t= new cCajaLocal($cajalocal); $xCL->init();\n\t\t\t$codigo\t\t\t\t= $xCL->getUltimoSocioRegistrado(true)+1;\n\t\t\t$this->mCodigo\t\t= $codigo;\n\t\t}\n\t\t//purgar RFC\n\t\tif($pais == \"MX\"){\n\t\t\t$xMex\t= new cReglasDePais();\n\t\t\t$rfc\t= $xMex->getValidIDFiscal($rfc);\n\t\t\t\n\t\t}\n\t\t$rfc\t\t= ($rfc == \"\") ? DEFAULT_PERSONAS_RFC_GENERICO : $rfc;\n\t\t$sql = \"INSERT INTO socios_general(codigo, nombrecompleto, apellidopaterno, apellidomaterno, rfc, curp, \n\t\t\t\t\tfechaentrevista, fechaalta, estatusactual, region, cajalocal,\n\t\t\t\t\tfechanacimiento, lugarnacimiento, tipoingreso,\n\t\t\t\t\testadocivil, genero, eacp, observaciones, idusuario,\n\t\t\t\t\tgrupo_solidario, personalidad_juridica, dependencia,\n\t\t\t\t\tregimen_conyugal, sucursal, fecha_de_revision, tipo_de_identificacion, documento_de_identificacion,\n\t\t\t\t\tcorreo_electronico, telefono_principal, dependientes_economicos, pais_de_origen, nivel_de_riesgo_aml, clave_de_firma_electronica,\n\t\t\tregimen_fiscal)\n \t\t\tVALUES\n\t\t\t\t\t($codigo, '$nombre', '$apellidopaterno', '$apellidomaterno', '$rfc', '$curp',\n\t\t\t\t\t'$fecha_de_entrevista', '$fecha_de_alta', $estatus, $region, $cajalocal,\n\t\t\t\t\t'$fecha_de_nacimiento', '$lugar_de_nacimiento', $tipo_de_ingreso,\n\t\t\t\t\t$estado_civil, $genero, '$eacp', '$observaciones', $usuario,\n\t\t\t\t\t$grupo_solidario, $personalidad_juridica, $dependencia,\n\t\t\t\t\t'$regimen_conyugal', '$sucursal', '$fecha_de_revision', $identificado_con, '$documento_de_identificacion',\n\t\t\t\t\t'$correo', '$movil', $dependientes, '$pais', $riesgo, '$clave_fiel', $regimen_fiscal)\";\n\t\t\n\t\t$x\t\t\t= my_query($sql);\n\t\t$this->mCodigo\t= $codigo;\n\t\tif ($x[\"stat\"] == false){\n\t\t\t$this->mMessages .= \"ERROR\\tSe fallo al agregar la persona $codigo\\r\\n\";\n\t\t\t$sucess\t\t\t= false;\n\t\t} else {\n\t\t\t$this->mMessages .= \"OK\\tSe agrego el Socio $codigo con Nombre $nombre $apellidopaterno $apellidomaterno \\r\\n\";\n\t\t\t$this->init();\t\t//Iniciar\n\t\t\t//Agregar en la Tabla de Grupos Solidarios si aplica\n\t\t\t//2012-06-20 si es grupo y es persojna moral\n\t\t\tif ( $tipo_de_ingreso == TIPO_INGRESO_GRUPO AND $personalidad_juridica == PERSONAS_FIGURA_MORAL ){\n\t\t\t\t$xGrup\t\t= new cGrupo($codigo);\n\t\t\t\t$this->addToGrupos(DEFAULT_SOCIO, DEFAULT_SOCIO, $sucursal, $fecha);\n\t\t\t\t//$xGrup->add($nombre, \"\", DEFAULT_SOCIO, DEFAULT_SOCIO, 10, 1, $codigo, $sucursal, $fecha_de_alta, $codigo);\n\t\t\t\t//$this->mMessages .= \"OK\\tSe Agrega Nuevo Grupo con clave $codigo\\r\\n\";\n\t\t\t}\n\t\t\tif(MODULO_AML_ACTIVADO == true){\n\t\t\t\tif( $this->mNoAML == false ){\n\t\t\t\t\t\n\t\t\t\t\t//checar lista negra\n\t\t\t\t\t$xAml\t= new cAMLPersonas($codigo);\n\t\t\t\t\t$xAml->init($codigo);\n\t\t\t\t\t$ln\t\t= $xAml->getBuscarEnListaNegra($nombre, $apellidopaterno, $apellidomaterno);\n\t\t\t\t\tif($ln == true){\n\t\t\t\t\t\t$xCM\t= new cAML();\n\t\t\t\t\t\t$xCM->sendAlerts($codigo, AML_OFICIAL_DE_CUMPLIMIENTO, 901001, $xAml->getMessages());\n\t\t\t\t\t}\n\t\t\t\t\tif($pais != EACP_CLAVE_DE_PAIS){\n\t\t\t\t\t\t//verificar persona extranjera\n\t\t\t\t\t\t$xCM\t= new cAML();\n\t\t\t\t\t\t$xCM->sendAlerts($codigo, AML_OFICIAL_DE_CUMPLIMIENTO, 801009, \"PERSONA EXTRANJERA REGISTRADA\");\n\t\t\t\t\t}\n\t\t\t\t\tif($riesgo == AML_PERSONA_ALTO_RIESGO){\n\t\t\t\t\t\t//verificar persona extranjera\n\t\t\t\t\t\t$xCM\t= new cAML();\n\t\t\t\t\t\t$xCM->sendAlerts($codigo, AML_OFICIAL_DE_CUMPLIMIENTO, 901001, \"PERSONA ALTAMENTE RIESGOSA REGISTRADA\");\n\t\t\t\t\t}\n\t\t\t\t\t//buscar persona SDN\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sucess\t= true;\n\t\t}\n\t\treturn $sucess;\n\t}", "function procesar_carga ($datos){\n \n if(strcmp($datos['tipo'], \"Definitiva\")==0){\n $this->s__dia=$datos['dia_semana'];\n \n //if($this->validar_datos($datos['hora_inicio'], $datos['hora_fin'])){\n //if($this->existe_definitiva($datos)){\n $secuencia= recuperar_secuencia('asignacion_id_asignacion_seq');\n $this->registrar_asignacion($datos);\n $this->registrar_asignacion_definitiva($datos);\n //agregamos el equipo de catedra si existe\n if(count($this->s__docentes_seleccionados)>0){\n foreach($this->s__docentes_seleccionados as $clave=>$docente){\n $catedra=array(\n 'id_asignacion' => $secuencia,\n 'nro_doc' => $docente['nro_doc'],\n 'tipo_doc' => $docente['tipo_doc']\n );\n \n $this->dep('datos')->tabla('catedra')->nueva_fila($catedra);\n $this->dep('datos')->tabla('catedra')->sincronizar();\n $this->dep('datos')->tabla('catedra')->resetear();\n }\n }\n //}\n// else{\n// $mensaje=\" Está intentando solapar asignaciones \";\n// //$mensaje=\"Error Horario Repetido {$this->s__error}\";\n// toba::notificacion()->agregar(utf8_d_seguro($mensaje));\n// }\n// }\n// else{\n// $mensaje=\" La hora de inicio debe ser menor a la hora de fin \";\n// toba::notificacion()->agregar($mensaje);\n// }\n }\n else{\n if($this->validar_datos($datos['hora_inicio'], $datos['hora_fin'], $datos['fecha_inicio'], $datos['fecha_fin'])){\n if($this->existe_periodo($datos)){\n $this->registrar_asignacion($datos);\n $this->registrar_asignacion_periodo($datos);\n }\n else{\n $mensaje=\" Está intentando solapar asignaciones \";\n toba::notificacion()->agregar(utf8_decode($mensaje), $nivel);\n }\n }\n else{\n $mensaje=\" Datos inconsistentes en la fecha u hora \";\n toba::notificacion()->agregar($mensaje, $nivel);\n }\n }\n }", "function agregarPacienteBD($objeto) {\n\n\t\t$conexion = $this->conectarBD(\"ADMIN\",\"1234\");\n #$conexion = $this->conectar($_SESSION['user'], $_SESSION['pass']);\n\n $result = oci_parse($conexion, \"INSERT INTO PACIENTE VALUES (\".$objeto->getCI().\", '\".$objeto->getNombres().\"', '\".$objeto->getApellidos().\"', '\".$objeto->getProfesion().\"', '\".$objeto->getLugarRes().\"', to_date('\".$objeto->getFechaNac().\"', 'YYYY-MM-DD'),'\".$objeto->getID_Historial().\"','\".$objeto->getDiagnostico().\"', '\".$objeto->getInterQuir().\"')\");\n oci_execute($result);\n\n $this->desconectar($conexion);\n return $result;\n }", "function entrada_por_traspaso(){\n\t\t$e= new Entrada();\n\t\t$e->usuario_id=$GLOBALS['usuarioid'];\n\t\t$e->empresas_id=$GLOBALS['empresaid'];\n\t\t$related = $e->from_array($_POST);\n\t\t//if($e->costo_unitario=='undefined') $e->costo_unitario=0;\n\t\t$e->espacios_fisicos_id=$GLOBALS['espacios_fisicos_id'];\n\t\t$e->costo_total=($e->cantidad * $e->costo_unitario);\n\t\t$e->cproveedores_id=1;\n\t\t$e->fecha=date(\"Y-m-d H:i:s\");\n\t\tif($e->id==0)\n\t\t\tunset($e->id);\n\t\tif($e->save($related)) {\n\t\t\techo $e->id;\n\t\t} else\n\t\t\techo 0;\n\t}", "function agregarJuego($coleccionJuegos,$puntos,$indicePalabra){\n $coleccionJuegos[] = array(\"puntos\"=> $puntos, \"indicePalabra\" => $indicePalabra); \n return $coleccionJuegos;\n}", "function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Scheda argomento\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}", "public static function orden($orden_nuevo, $id_modulo, $id_actividad)\n {\n $query_tmp = query('SELECT orden, modulo_id, actividad_id from tr_actividad where modulo_id = ' . $id_modulo.' and estatus = 1');\n $query_tmp_act = query('SELECT orden from tr_actividad where actividad_id =' . $id_actividad);\n $arreglo_tmp_act = arreglo($query_tmp_act);\n\n $orden_anterior = $arreglo_tmp_act['orden'];\n\n //2do paso; update del parametro id_actividad donde se actualiza el orden nuevo\n $update = update('tr_actividad', 'orden = ' . $orden_nuevo . '', 'actividad_id =' . $id_actividad);\n //3er paso: usar este while para comparar los valores de la activdad con el orden nuevo\n $json = array();\n while ($arreglo = arreglo($query_tmp)) {\n //aqui se van a pintar los valores del orden por arreglo\n if ($arreglo['actividad_id'] != $id_actividad) {\n // echo $arreglo['orden'].'='.$orden_anterior.'?'.$arreglo['orden'].'='.$orden_nuevo.'?,'; \n\n //4to paso comparaciòn del orden anterior con el arreglo[orden]\n if ($arreglo['orden'] > $orden_anterior) {\n if ($arreglo['orden'] > $orden_nuevo) {\n // echo 'queda igual';\n } else {\n // $arreglo['orden']=orden($arreglo['orden']-1);\n $resta = $arreglo['orden'] - 1;\n $update = update(\"tr_actividad\", \"orden='\" . $resta . \"'\", \"actividad_id='\" . $arreglo['actividad_id'] . \"'\");\n // echo 'se resta';\n }\n } else {\n if ($arreglo['orden'] < $orden_nuevo) {\n // echo 'queda igual';\n } else {\n // $arreglo['orden']=orden($arreglo['orden']+1);\n $suma = $arreglo['orden'] + 1;\n $update = update(\"tr_actividad\", \"orden='\" . $suma . \"'\", \"actividad_id='\" . $arreglo['actividad_id'] . \"'\");\n // echo 'se suma'.'<br>';\n }\n }\n } else {\n // echo ' no hace nada';\n }\n }\n /*\n foreach ($actividad_id = actividad_id) {\n echo \"Se modifican\";\n for ($i=0; $i < ; $i++) {\n }\n\n }*/\n return $json;\n }", "function nuevoIngreso() {\n $this->view->title = 'Nuevo Ingreso Personal';\n \n $this->view->anio = $this->model->anio();\n \n //Cargamos la lista de paises//\n $this->view->consultaPaises = $this->model->consultaPaises();\n \n /*Cargamos la lista de escuelas publicas y privadas*/\n //$this->view->escuelas = $this->model->CargaEscuelas();\n \n /*Cargamos la lista de colegios publicos y privados*/\n $this->view->colegios = $this->model->CargaColegios();\n \n /*Cargamos la lista de Universidades*/\n $this->view->universidad = $this->model->CargaUniversidades();\n\n //Cargamos la lista de provincias//\n $this->view->consultaProvincias = $this->model->consultaProvincias();\n \n //Cargamos la lista de estado civil//\n $this->view->estadoCivilList = $this->model->estadoCivilList();\n\n \n\n /* CARGAMOS LA LISTA DE ESPECIALIDADES */\n //$this->view->consultaEspecialidades = $this->model->consultaEspecialidades();\n\n $this->view->render('header');\n $this->view->render('personal/nuevoIngreso');\n $this->view->render('footer');\n }", "public function AnularOrdenDePago(OrdenDePago $op)\n {\n \t$detalleDePago\t=\t$op->GetDetalleDePago();\n \t\n \tforeach ($detalleDePago as $d)\n \t{\n \t\t$PagoTipoId\t=\t$d->PagoTipoId;\n \t\t\n \t\t// si es un tipo de pago: Cheque propio (id = 1)\n \t\tif($PagoTipoId == 1)\n \t\t{\n \t\t\t$Cheque\t\t= Doctrine::getTable('Cheque')->FindOneById($d->ChequeId);\n \t\t\tif(!is_object($Cheque))\n \t\t\t\tthrow new Exception('No existe el cheque para anular');\n \t\t\t \n \t\t\t$Cheque->Estado\t=\t'Anulado';\n \t\t\t$Cheque->FechaAnulacion\t=\tdate('Y-m-d');\n \t\t\t$Cheque->save();\n \t\t}\n \t\t// si pago con cheque tercero en cartera, cambiar estado\n \t\tif($PagoTipoId == 4)\n \t\t{\n \t\t\t$Cheque\t\t= Doctrine::getTable('Cheque')->FindOneById($d->ChequeId);\n \t\t\tif(!is_object($Cheque))\n \t\t\t\tthrow new Exception('No existe el cheque para anular');\n \t\t\t \n \t\t\t$Cheque->Estado\t=\t'En cartera';\n \t\t\t$Cheque->save();\n \t\t}\n \t\t\n \t\t// si pague con retencion, la creo nuevamente al anular\n \t\tif(($PagoTipoId == 6)||($PagoTipoId ==7)||($PagoTipoId == 8)\n \t\t\t\t||($PagoTipoId == 9)||($PagoTipoId == 10)||($PagoTipoId == 11))\n \t\t{\n \t\t\t\n \t\t\t$detalle\t\t= Doctrine::getTable('CobranzaDetalle')->FindOneById($d->RetencionUtilizadaId);\n \t\t\tif(!is_object($detalle))\n \t\t\t\tthrow new Exception('No existe la retencion');\n \t\t\t// se marca la retencion utilizada\n \t\t\t$detalle->RetencionUtilizada\t=\t'NO';\n \t\t\t$detalle->save();\n \t\t}\n \t\t\n \t\t// si es efectivo, incrementar saldo en efectivo\n \t\tif($PagoTipoId == 2)\n \t\t{\n \t\t\t$Configuracion = Doctrine::GetTable ( 'Configuracion' )->FindOneByNombre('SaldoEfectivo');\n \t\t\t$Configuracion->Valor +=\t$d->Importe;\n \t\t\t$Configuracion->save();\n \t\t\t\n \t\t\t$data['Detalle'] = 'OP #' . $op->Id . ' anulada';\n \t\t\t$data['Importe']\t=\t$d->Importe;\n \t\t\t$data['Saldo']\t=\t$Configuracion->Valor;\n \t\t\t$data['Debe']\t=\t$data['Importe'];\n \t\t\t\n \t\t\t$g = new Classes_GestionEconomicaManager();\n \t\t\t$g->AddHistorialEfectivo($data);\n \t\t}\n \t\t\n \t\t// si es un tipo de pago: transferencia (id = 13),\n \t\t// - actualizar saldo de la cuenta de banco asociada\n \t\tif($PagoTipoId == 13)\n \t\t{\n \t\t\tlist($banco, $cuenta)\t=\texplode('-', $d->Detalle);\n \t\t\t\n \t\t\tif(isset($cuenta) && is_numeric($cuenta))\n \t\t\t{\n \t\t\n \t\t\t\t$banco\t\t= Doctrine::getTable('Banco')->FindOneByNumeroDeCuenta($cuenta);\n \t\t\t\tif(!is_object($banco))\n \t\t\t\t\tthrow new Exception('El banco ingresado no existe');\n \t\t\n \t\t\t\t$ctacte\t\t=\tnew Classes_CuentaCorrienteManager();\n \t\t\t\t$data['Debe']\t=\t$d->Importe;\n \t\t\t\t$data['Saldo']\t=\t$banco->SaldoCuenta;\n \t\t\t\t$data['BancoId']\t=\t$banco->Id;\n \t\t\t\t$data['Detalle']\t=\t'Tranferencia bancaria de OP '.$op->Numero. ' anulada';\n \t\t\t\t$ctacte->AddConceptoBancoCuentaCorriente($data);\n \t\t\t}\n \t\t}\n \t\t\n \t}\n }", "function recuperarGanadores(){\n\t\t$votopro = new VotaProfesional();\n\t\t$res = $votopro->recuperarGanadores();\n\t\treturn $res;\n\t}", "function EstadoCuenta(){\n $this->procedimiento='obingresos.ft_periodo_venta_sel';\n $this->transaccion='OBING_SALAT_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n $this->setParametro('id_agencia','id_agencia','int4');\n //Definicion de la lista del resultado del query\n $this->captura('id_agencia','int4');\n $this->captura('id_periodo_venta','int4');\n $this->captura('nombre','varchar');\n $this->captura('mes','varchar');\n $this->captura('fecha_ini','date');\n $this->captura('fecha_fin','date');\n $this->captura('credito','varchar');\n $this->captura('total_credito','numeric');\n $this->captura('debito','varchar');\n $this->captura('total_debito','numeric');\n $this->captura('saldo','numeric');\n //Ejecuta la instruccion\n $this->armarConsulta();\n $this->ejecutarConsulta();\n // var_dump($this->respuesta);exit;\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function agregar_docente(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n\r\n\r\n if(empty($_POST[\"nombre\"]) or empty($_POST[\"apellido\"]) or empty($_POST[\"num_identidad\"])){\r\n header(\"Location:\".Conectar::ruta().\"admin/profesores/crear.php?m=1\");\r\n exit();\r\n }\r\n $esta='activo';\r\n $conectar=parent::conexion();\r\n $sql=\"insert into docente values(null,?,?,?,?,now());\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->bindValue(1, $_POST[\"nombre\"]);\r\n $sql->bindValue(2, $_POST[\"apellido\"]);\r\n $sql->bindValue(3, $_POST[\"num_identidad\"]);\r\n $sql->bindValue(4, $esta);\r\n $sql->execute();\r\n $resultado=$sql->fetch(PDO::FETCH_ASSOC);\r\n header(\"Location:\".Conectar::ruta().\"admin/profesores/index.php?m=2\");\r\n \r\n }", "function palabraDescubierta($coleccionLetras){\n \n /*>>> Completar el cuerpo de la función, respetando lo indicado en la documentacion <<<*/\n}", "private function cargarAsistentes($fecha, $orden=0) {\n $this->cargarDatosOmision($fecha, $orden);\n switch ($orden) {\n case 1 : $orden = \"PROPIETARIO, A.CODAPAR\"; break;\n case 2 : $orden = \"REPRESENTANTE, A.CODAPAR\"; break;\n default: $orden = \"A.CODAPAR\"; break;\n }\n if ($fecha) {\n $rRes = Funciones::gEjecutarSQL(\"SELECT A.CODAPAR,CONCAT(A.PORTAL,'-',A.PISO,A.LETRA) AS APARTAMENTO,JA.CODPERS,CONCAT(P.APELLIDOS,' ',P.NOMBRE) AS ASISTENTE,JA.REPRESENTADO,JA.VOTO,A.COEFICIENTEFASE,A.COEFICIENTEBLOQ,IF(JA.REPRESENTADO='S',(SELECT CONCAT(PE.APELLIDOS,' ',PE.NOMBRE) AS PERSONA FROM PROPIETARIOS PR LEFT JOIN PERSONAS PE ON PR.CODPERS=PE.CODPERS WHERE PR.CODAPAR=A.CODAPAR AND IFNULL(PR.BAJA,'9999-99-99')=(SELECT MIN(IFNULL(BAJA,'9999-99-99')) FROM PROPIETARIOS WHERE CODAPAR=PR.CODAPAR AND IFNULL(BAJA,'9999-99-99')>'$fecha') ORDER BY IFNULL(PR.BAJA,'9999-99-99') DESC,PR.ORDEN LIMIT 1),CONCAT(P.APELLIDOS,' ',P.NOMBRE)) AS PROPIETARIO,IF(JA.REPRESENTADO='S',CONCAT(P.APELLIDOS,' ',P.NOMBRE),'') AS REPRESENTANTE FROM ASISTENTES JA LEFT JOIN APARTAMENTOS A ON A.CODAPAR=JA.CODAPAR LEFT JOIN PERSONAS P ON P.CODPERS=JA.CODPERS WHERE JA.FECHA='$fecha' ORDER BY $orden\");\n while($aRow = $rRes->fetch(PDO::FETCH_ASSOC)) {\n $this->aAsistentes[$aRow['CODAPAR']] = array($aRow['APARTAMENTO'],$aRow['CODPERS'], $aRow['ASISTENTE'], $aRow['REPRESENTADO'],$aRow['VOTO'],$aRow['COEFICIENTEFASE'],$aRow['COEFICIENTEBLOQ'],$aRow['PROPIETARIO'],$aRow['REPRESENTANTE']);\n }\n $rRes->closeCursor();\n }\n }", "public function Ativar(){\n \n $idFrota = $_GET['id'];\n \n $frota = new Frota();\n \n $frota->id = $idFrota ;\n \n $frota::Ativando($frota);\n \n }", "function Nuevo()\n{\n /**\n * Crear instancia de concesion\n */\n $Titlulo = new Titulo();\n /**\n * Colocar los datos del GET por medio de los metodos SET\n */\n $Titlulo->setId_titulo(filter_input(INPUT_GET, \"id_titulo\"));\n $Titlulo->setUso_id(filter_input(INPUT_GET, \"uso_id\"));\n $Titlulo->setTitular(filter_input(INPUT_GET, \"titular\"));\n $Titlulo->setVol_amparado_total(filter_input(INPUT_GET, \"vol_amparado_total\"));\n $Titlulo->setNum_aprov_superf(filter_input(INPUT_GET, \"num_aprov_superf\"));\n $Titlulo->setVol_aprov_superf(filter_input(INPUT_GET, \"vol_aprov_superf\"));\n $Titlulo->setNum_aprov_subt(filter_input(INPUT_GET, \"num_aprov_subt\"));\n $Titlulo->setVol_aprov_subt(filter_input(INPUT_GET, \"vol_aprov_subt\"));\n $Titlulo->setPuntos_desc(filter_input(INPUT_GET, \"puntos_desc\"));\n $Titlulo->setVol_desc_diario(filter_input(INPUT_GET, \"vol_desc_diario\"));\n $Titlulo->setZonas_fed_amp_titulo(filter_input(INPUT_GET, \"zonas_fed_amp_titulo\"));\n $Titlulo->setSupeficie(filter_input(INPUT_GET, \"supeficie\"));\n $Titlulo->setFecha_reg(filter_input(INPUT_GET, \"fecha_reg\"));\n if ($Titlulo->Insert() != null) {\n echo 'OK';\n } else {\n echo 'Ya se encuentra en la Base de Datos';\n }\n}", "public function plus_abonados();", "public function RegistreComision($fecha,$ValorComision, $TipoVenta,$comisionista,$idVenta,$Paga)\r\n{\r\n\r\n\t\t\t\t\t\r\n\t\t$tabla=\"comisionesporventas\";\r\n\t\t$NumRegistros=8;\r\n\t\r\n\t\t$this->NombresColumnas(\"colaboradores\");\r\n\t\t\r\n\t\t$DatosColaborador=$this->DevuelveValores($comisionista);\r\n\t\t\t\t\t\t\t\r\n\t\t$CuentaPUC=\"233520$comisionista\";\r\n\t\t$NombreCuenta=\"Comision por pagar del colaborador $DatosColaborador[Nombre] CC $DatosColaborador[Identificacion]\";\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$Columnas[0]=\"Fecha\";\t\t\t\t\t\t\t$Valores[0]=$fecha;\r\n\t\t$Columnas[1]=\"CuentaPUC\";\t\t\t\t\t\t$Valores[1]=$CuentaPUC;\r\n\t\t$Columnas[2]=\"NombreCuenta\";\t\t\t\t\t$Valores[2]=$NombreCuenta;\r\n\t\t$Columnas[3]=\"Valor\";\t\t\t\t\t\t\t$Valores[3]=$ValorComision;\r\n\t\t$Columnas[4]=\"TipoVenta\";\t\t\t\t\t\t$Valores[4]=$TipoVenta;\r\n\t\t$Columnas[5]=\"Colaboradores_idColaboradores\";\t$Valores[5]=$comisionista;\r\n\t\t$Columnas[6]=\"Ventas_NumVenta\";\t\t\t\t\t$Valores[6]=$idVenta;\r\n\t\t$Columnas[7]=\"Paga\";\t\t\t\t\t\t\t$Valores[7]=$Paga;\r\n\t\t\t\t\t\t\t\r\n\t\t$this->InsertarRegistro($tabla,$NumRegistros,$Columnas,$Valores);\r\n\r\n\r\n}", "function setNuevaCuenta($origen, $subproducto, $socio,\n\t\t\t\t\t\t\t$observaciones = \"\", $credito = 1,\n\t\t\t\t\t\t\t$mancomunado1 = \"\", $mancomunado2 = \"\",\n\t\t\t\t\t\t\t$grupo = false, $fecha_de_alta = false,\n\t\t\t\t\t\t\t$tipo_de_cuenta = CAPTACION_TIPO_VISTA, $tipo_de_titulo = 99, $DiasInvertidos = false,\n\t\t\t\t\t\t\t$tasa = false, $CuentaDeInteres\t= false, $FechaVencimiento = false\n\t\t\t\t\t\t\t){\n\n\n\t\t$xT\t\t\t\t= new cTipos(0);\n\t\t$xF\t\t\t\t= new cFecha();\n\t\t$xLog\t\t\t= new cCoreLog();\n\t\t$socio\t\t\t= setNoMenorQueCero($socio);\n\t\t$ready\t\t\t= true;\n\t\t$tipo_de_cuenta\t= setNoMenorQueCero($tipo_de_cuenta);\n\t\t$tipo_de_titulo\t= setNoMenorQueCero($tipo_de_titulo);\n\t\t$credito\t\t= setNoMenorQueCero($credito);\n\t\t$grupo\t\t\t= setNoMenorQueCero($grupo);\n\t\t$DiasInvertidos\t= setNoMenorQueCero($DiasInvertidos);\n\t\t$tasa\t\t\t= setNoMenorQueCero($tasa, 4);\n\t\t$CuentaDeInteres= setNoMenorQueCero($CuentaDeInteres);\n\t\t$estado\t\t\t= 10;\n\t\t//Corrige el numero de persona\n\t\tif($socio <= DEFAULT_SOCIO AND $this->mSocioTitular > DEFAULT_SOCIO ){\n\t\t\t$xLog->add(\"WARN\\tCAMBIO Persona $socio a \" . $this->mSocioTitular . \"\\r\\n\", $xLog->DEVELOPER);\n\t\t\t$socio\t\t= $this->mSocioTitular;\n\t\t}\n\t\t$xSoc\t\t\t\t= new cSocio($socio);\n\t\tif($xSoc->init() == true){\n\t\t\t//$cuenta\t\t\t= $xSoc->getIDNuevoDocto($tipo_de_cuenta, $subproducto);\n\t\t\t$cuenta\t\t\t= $xSoc->getIDNuevoDocto(iDE_CAPTACION);\n\t\t\t$CuentaDeInteres= $xSoc->getCuentaDeCaptacionPrimaria(CAPTACION_TIPO_VISTA, CAPTACION_PRODUCTO_INTERESES);\n\t\t\tif($grupo == DEFAULT_GRUPO OR $grupo == 0){ $grupo = $xSoc->getClaveDeGrupo(); }\n\t\t} else {\n\t\t\t$xLog->add(\"ERROR\\tAl cargar la Persona $socio\\r\\n\", $xLog->DEVELOPER);\n\t\t\t$ready\t\t\t= false; //el socio existe\n\t\t}\n\t\t$xLog->add($xSoc->getMessages(), $xLog->DEVELOPER);\n\t\t//corrige la Cuenta de Intereses\n\t\t$CuentaDeInteres\t= ($CuentaDeInteres <= 0) ? DEFAULT_CUENTA_CORRIENTE : $CuentaDeInteres;\n\n\t\t$fecha_de_alta\t\t\t= $xF->getFechaISO($fecha_de_alta);\n\t\t$FechaVencimiento\t\t= $xF->getFechaISO($FechaVencimiento);\n\t\tif($tipo_de_cuenta == CAPTACION_TIPO_PLAZO){\n\t\t\t$DiasInvertidos\t\t= ($DiasInvertidos <=0 ) ? $this->mDiasInvertidos : $DiasInvertidos;\n\t\t\t$tasa\t\t\t\t= ($tasa <= 0) ? $this->mTasaInteres : $tasa;\n\t\t\t$FechaVencimiento\t= ($xF->getInt($FechaVencimiento) <= $xF->getInt($fecha_de_alta) ) ? $xF->setSumarDias($DiasInvertidos, $fecha_de_alta) : $FechaVencimiento;\n\t\t\t$estado\t\t\t\t= 20;\n\t\t\t$xLog->add(\"WARN\\tInversion Dias $DiasInvertidos Tasa $tasa Vencimiento $FechaVencimiento\\r\\n\", $xLog->DEVELOPER);\n\t\t\tif($xF->setRestarFechas($FechaVencimiento, $fecha_de_alta) != $DiasInvertidos){\n\t\t\t\t$DiasInvertidos\t= $xF->setRestarFechas($FechaVencimiento, $fecha_de_alta);\n\t\t\t\t$xLog->add(\"WARN\\tCAMBIO Inversion Dias $DiasInvertidos ($FechaVencimiento, $fecha_de_alta)\\r\\n\", $xLog->DEVELOPER);\n\t\t\t}\n\t\t} else {\n\t\t\t$xLog->add(\"WARN\\tVista $socio Producto $tipo_de_cuenta sub-producto $subproducto Origen $origen\\r\\n\", $xLog->DEVELOPER);\n\t\t}\n\t\t\n\t\t$xCta\t\t= new cCaptacion_cuentas();\n\t\t$xCta->cuenta_de_intereses($CuentaDeInteres);\n\t\t$xCta->dias_invertidos($DiasInvertidos);\n\t\t$xCta->eacp(EACP_CLAVE);\n\t\t$xCta->estatus_cuenta($estado);\n\t\t$xCta->fecha_afectacion($fecha_de_alta);\n\t\t$xCta->fecha_apertura($fecha_de_alta);\n\t\t$xCta->fecha_baja($xF->getFechaMaximaOperativa());\n\t\t$xCta->fecha_conciliada($fecha_de_alta);\n\t\t$xCta->idusuario(getUsuarioActual());\n\t\t$xCta->inversion_fecha_vcto($FechaVencimiento);\n\t\t$xCta->inversion_periodo(0);\n\t\t$xCta->minimo_mancomunantes(0);\n\t\t$xCta->nombre_mancomunado1($mancomunado1);\n\t\t$xCta->nombre_mancomunado2($mancomunado2);\n\t\t$xCta->numero_cuenta($cuenta);\n\t\t$xCta->numero_grupo($grupo);\n\t\t$xCta->numero_socio($socio);\n\t\t$xCta->numero_solicitud($credito);\n\t\t$xCta->observacion_cuenta($observaciones);\n\t\t$xCta->oficial_de_captacion(getUsuarioActual());\n\t\t$xCta->origen_cuenta($origen);\n\t\t$xCta->saldo_conciliado(0);\n\t\t$xCta->saldo_cuenta(0);\n\t\t$xCta->sucursal(getSucursal());\n\t\t$xCta->tasa_otorgada($tasa);\n\t\t$xCta->tipo_cuenta($tipo_de_cuenta);\n\t\t$xCta->tipo_titulo($tipo_de_titulo);\n\t\t$xCta->tipo_subproducto($subproducto);\n\t\t$xCta->ultimo_sdpm(0);\n\t\tif($ready == true){ \n\t\t\t$rs \t= $xCta->query()->insert()->save();\n\t\t\t$ready \t= ($rs == false) ? false : true;\n\t\t}\n\t\t//Asignar valores cargados\n\t\tif ( $ready == true) {\n\t\t\t$xLog->add(\"OK\\tSe Agrego Existosamente la Cuenta $cuenta del subproducto $subproducto \\r\\n\");\n\t\t\t$this->mSucess \t\t\t\t= true;\n\t\t\t$this->mSocioTitular\t\t= $socio;\n\t\t\t$this->mGrupoAsociado\t\t= $grupo;\n\t\t\t$this->mCreditoAsoc\t\t\t= $credito;\n\t\t\t$this->mNumeroCuenta\t\t= $cuenta;\n\t\t\t$this->mDiasInvertidos\t\t= $DiasInvertidos;\n\t\t\t$this->mFechaVencimiento\t= $FechaVencimiento;\n\t\t\t$this->mTasaInteres\t\t\t= $tasa;\n\t\t\t$this->mFechaOperacion\t\t= $fecha_de_alta;\n\t\t\t$this->init();\t\n\t\t} else {\n\t\t\t$xLog->add(\"ERROR\\tError al agregar la Cuenta $cuenta del subproducto $subproducto\\r\\n\");\n\t\t\t$this->mSucess \t\t\t\t= false;\n\t\t}\n\t\t//setLog($xLog->getMessages());\n\t\t$this->mMessages\t\t\t\t.= $xLog->getMessages();\n\t\treturn $this->mNumeroCuenta;\n\t}", "public static function Nueva_Version_Orden($fecha_ingreso, $id_cotizacion, $id_cliente, $id_locacion, $id_actividad, $num_muestras, $id_usuario, $estado, $version, $num_orden, $prioridad, $version_informe)\n {\n // Sentencia INSERT\n $comando = \"INSERT INTO ordenes (fecha_ingreso, id_cotizacion, id_cliente, id_locacion, id_actividad, num_muestras, id_usuario, estado, impreso, version, num_orden, razon_jt, razon_dt, razon_dc, recibido, enviado, prioridad,version_informe) VALUES( ?,?,?,?,?,?,?,?,0,?,?,'','','',0,0,?,? )\";\n\n // Preparar la sentencia\n $sentencia = Database::getInstance()->getDb()->prepare($comando);\n\n return $sentencia->execute(\n array(\n $fecha_ingreso,\n $id_cotizacion,\n $id_cliente, \n $id_locacion,\n $id_actividad,\n $num_muestras,\n $id_usuario,\n $estado,\n $version,\n $num_orden,\n $prioridad,\n $version_informe\n )\n );\n\n }", "function datosNuevoProducto($id_nombre_producto = NULL,$nombre,$codigo,$version,$familia) {\n\t\t$this->id_nombre_producto = $id_nombre_producto;\n\t\t$this->nombre = $nombre;\n\t\t$this->codigo = $codigo;\n\t\t$this->version = $version;\n\t\t$this->familia = $familia;\n\t}" ]
[ "0.635557", "0.63552326", "0.62349355", "0.62111616", "0.62100804", "0.62070215", "0.6202533", "0.6199596", "0.619888", "0.6178704", "0.6150873", "0.6138089", "0.60869896", "0.60787857", "0.60729885", "0.606127", "0.60530365", "0.6046606", "0.60459876", "0.6032204", "0.6028872", "0.60170346", "0.601468", "0.6012284", "0.6011698", "0.6007226", "0.6006043", "0.60060185", "0.6003494", "0.6003369", "0.6000521", "0.59891444", "0.5986972", "0.59828126", "0.5982677", "0.5982036", "0.59803706", "0.5980146", "0.59559315", "0.59517777", "0.5950023", "0.5947081", "0.59461296", "0.5939079", "0.59357905", "0.5924546", "0.59238505", "0.5916963", "0.5911835", "0.5911382", "0.59071654", "0.590073", "0.58984464", "0.58960897", "0.5895552", "0.58955437", "0.5891703", "0.5883646", "0.5883191", "0.5882644", "0.58805704", "0.58802426", "0.5868566", "0.5868561", "0.58679307", "0.58652604", "0.5864064", "0.58609194", "0.58557874", "0.58534324", "0.5849928", "0.5848981", "0.5843104", "0.58408606", "0.5840037", "0.5839611", "0.5838231", "0.5834036", "0.5833173", "0.5832842", "0.58309615", "0.58302593", "0.5825011", "0.5823741", "0.58236533", "0.58212525", "0.58164364", "0.58158886", "0.58158624", "0.5814804", "0.58135283", "0.5812917", "0.5801006", "0.580022", "0.5794437", "0.57923186", "0.5788016", "0.5787896", "0.57868487", "0.57860476", "0.5785718" ]
0.0
-1
FUNCION PARA EDITAR APODERADO
public function update($apPaternoApoderado, $apMaternoApoderado, $nombresApoderado, $dniApoderado, $fechaNacApoderado, $direccionApoderado, $idApoderado) { $sql = "CALL SP_APODERADOS_UPDATE(?,?,?,?,?,?,?)"; $conn = $this -> $mysqli -> open(); $stmt = $conn->prepare($sql); $stmt -> bind_param('ssssssi', $apPaternoApoderado, $apMaternoApoderado, $nombresApoderado, $dniApoderado, $fechaNacApoderado, $direccionApoderado, $idApoderado); $result = $this -> $mysqli -> executeIUD("$stmt"); $conn -> close(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function editar()\n {\n }", "public function editar()\n {\n }", "function procEdit($ar=NULL){\n $this->getComposedFullnam($ar);\n return parent::procEdit($ar);\n }", "public function edit_toko(){\n\t}", "public function edit() {\n\t\t\t\n\t\t}", "public function edit()\n\t{\n\t\t//\n\t}", "public function editar(){\n $cedula = $_GET['cedula'];\n //2. usar el modelo para traer de la BD el estudiante\n $estudiante = $this->model->buscarEstudiante($cedula);\n //3. llamar a la vista de editar\n require_once 'view/include/header.php';\n require_once 'view/estudiante/editar.php';\n require_once 'view/include/footer.php';\n }", "public function edit()\n\t{\n\t\t\n\t}", "public function editar ()\n {\n try {\n // Define a ação de editar\n $acao = Orcamento_Business_Dados::ACTION_EDITAR;\n \n if ( $this->_requisicao->isGet () ) {\n // Retorna parâmetros informados via get, após validações\n $parametros = $this->trataParametroGet ( 'cod' );\n \n // Busca os dados a exibir, após validações\n $registro = $this->trataRegistro ( $acao, $parametros );\n \n // Cria o formulário populado com os dados\n $formulario = $this->popularFormulario ( $acao, $registro );\n \n // Faz transformações no formulário, se necessário\n $formulario = $this->transformaFormulario ( $formulario, $acao );\n \n // Bloqueia a edição de campos de chave primária (ou composta)\n $this->bloqueiaCamposChave ( $formulario );\n \n // Bloqueia todos os campos\n $this->bloqueiaCamposTodos ( $acao, $formulario, $registro );\n \n // Exibe o formulário\n $this->view->formulario = $formulario;\n } else {\n // Cria o formulário vazio\n $formulario = $this->retornaFormulario ( $acao );\n \n // Grava o novo registro\n $this->gravaDados ( $acao, $formulario );\n }\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }", "function cl_editalrua() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"editalrua\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function Editar($id, $fecha_emision, $condicion_pago, $estado, $fecha_pago, $observaciones_pago, $tipo) {\n $fecha=explode(\"-\", $fecha_emision);\n $fecha_vencimiento=date(\"Y-m-d\",mktime(0,0,0,$fecha[1],$fecha[2]+$condicion_pago,$fecha[0]));\n $q=\"UPDATE \".self::$table.\"\nSET condicionpago='$condicion_pago', fechaemision='$fecha_emision',\nfechavencimiento='$fecha_vencimiento', estado='$estado', fecha_pago='$fecha_pago',\nobservaciones_pago='$observaciones_pago', tipo='$tipo'\nWHERE id=$id\";\n return DBManager::execute($q);\n }", "function evt__form_pase__modificacion($datos)\r\n\t{\r\n $car=$this->controlador()->dep('datos')->tabla('cargo')->get();\r\n $datos['id_cargo']=$car['id_cargo'];\r\n \r\n \r\n //print_r($pase_nuevo);exit;\r\n if($this->dep('datos')->tabla('pase')->esta_cargada()){//es modificacion\r\n $pas=$this->dep('datos')->tabla('pase')->get();\r\n if($pas['tipo']<>$datos['tipo']){\r\n toba::notificacion()->agregar('no puede cambiar el tipo del pase', 'info'); \r\n }else{\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n }\r\n }else{//es alta de un pase nuevo\r\n $this->dep('datos')->tabla('pase')->set($datos);\r\n $this->dep('datos')->tabla('pase')->sincronizar();\r\n $pase_nuevo=$this->dep('datos')->tabla('pase')->get();\r\n $p['id_pase']=$pase_nuevo['id_pase'];\r\n $this->dep('datos')->tabla('pase')->cargar($p);//lo cargo para que se sigan viendo los datos en el formulario\r\n if($datos['tipo']=='T'){//si el pase es temporal\r\n //ingreso un cargo en la unidad destino\r\n //la ingresa con fecha de alta = desde\r\n $nuevo_cargo['id_persona']=$car['id_persona'];\r\n $nuevo_cargo['codc_carac']=$car['codc_carac'];\r\n $nuevo_cargo['codc_categ']=$car['codc_categ'];\r\n $nuevo_cargo['codc_agrup']=$car['codc_agrup'];\r\n $nuevo_cargo['chkstopliq']=$car['chkstopliq'];\r\n $nuevo_cargo['fec_alta']=$datos['desde'];\r\n $nuevo_cargo['pertenece_a']=$datos['destino'];\r\n $nuevo_cargo['generado_x_pase']=$pase_nuevo['id_pase']; \r\n $res=$this->controlador()->dep('datos')->tabla('cargo')->agregar_cargo($nuevo_cargo);\r\n if($res==1){\r\n toba::notificacion()->agregar('Se ha creado un nuevo cargo en el destino del pase', 'info');\r\n }\r\n \r\n }else{//pase definitivo entonces tengo que modificar la fecha del cargo en la unidad destino con la fecha de alta del definitivo\r\n $nuevafecha = strtotime ( '-1 day' , strtotime ( $datos['desde'] ) ) ;\r\n $nuevafecha = date ( 'Y-m-d' , $nuevafecha );\r\n //print_r($nuevafecha);exit;\r\n $salida=$this->controlador()->dep('datos')->tabla('cargo')->modificar_alta($datos['id_cargo'],$datos['destino'],$datos['desde']);\r\n //le coloca fecha de baja al cargo de la unidad origen\r\n $this->controlador()->dep('datos')->tabla('cargo')->finaliza_cargo($datos['id_cargo'],$nuevafecha);\r\n if($salida==1){\r\n toba::notificacion()->agregar('Se ha modificado la fecha del cargo generado a partir del pase temporal', 'info');\r\n }\r\n \r\n } \r\n }\r\n \r\n\t}", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "function editar_plan_temporada_producto(){\t\t\n\t\t$this->accion=\"Editar Datos del Plan\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$this->asignar_valores3();\n\t\t\t\n\t\t\t$sql=\"UPDATE habitaciones2 SET nombre='$this->nombre', orden='$this->prioridad', listar='$this->mostrar', precio='$this->precio', descripcion='$this->descripcion', maxAdultos='$this->maxadultos' WHERE id='$this->temporada'\";\n\t\t\t$id=$this->id;\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/producto/detalle.php?id=$id#next\");\n\t\t\texit();\n\t\t}else{\n\t\t\t$this->mostrar_plan();\n\t\t}\n\t}", "abstract function ActualizarDatos();", "public function editar() {\n\t\t$POST = array();\n\n\t\tif(!empty($this->request->data['img']))\n\t\t{\t\t\t\t\t\n\t\t\t$this->request->data['img'] = $this->DIRUPLOAD.$this->request->data['img'];\t\t\t\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\t$imgAtual = $this->Produto->query(sprintf(\"Select img FROM produtos where id = %d\", $this->request->data['id']));\n\t\t\t$this->request->data['img'] = $imgAtual[0]['produtos']['img'];\n\t\t}\t\t\n\n\t\t##apagando indice de tokenrequest pois ele não existe na tabela de categorias\n\t\tunset($this->request->data['TokenRequest']);\t\t\t\n\n\t\t$POST = array('Produto'=>$this->request->data);\t\n\t\tif ($this->Produto->save($POST)) \n\t\t{\n\t\t\t$this->Message = 'Produto editado com sucesso';\n\t\t\t$this->Return = true;\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$this->Message = 'Ocorreu um erro na edição de seu produto.';\n\t\t\t$this->Return = false;\t\n\t\t}\n\n\t\t$this->EncodeReturn();\t\n\t}", "public function editarAportante(){ \n if(isset($_POST[\"cedulaE\"]))\n {\n $aportante=new Aportante($this->adapter);\n $aportante->setAportanteID($_POST[\"idE\"]);\n $aportante->setCedula($_POST[\"cedulaE\"]);\n $aportante->setNames($_POST[\"namesE\"]);\n $aportante->setLastnames($_POST[\"lastnamesE\"]);\n $aportante->setPhoneHome($_POST[\"phoneHomeE\"]);\n\t\t\t$aportante->setPhoneMobile($_POST[\"phoneMobileE\"]);\n\t\t\t$aportante->setEmail($_POST[\"emailE\"]);\n $save=$aportante->update(); // Manda a actualizar la moto en el modelo\n } \n $this->redirect(\"BandejaCallcenters\", \"index\"); // COntrolador + Vista\n }", "function editar_temporada_producto(){\t\t\n\t\t$this->accion=\"Editar Temporada\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\"){\n\t\t\t$temporada=$_GET['id'];\n\t\t\t$this->asignar_valores2();\n\t\t\t$this->desde=$this->convertir_fecha($this->desde);\n\t\t\t$this->hasta=$this->convertir_fecha($this->hasta);\n\t\t\t\n\t\t\t$sql=\"UPDATE temporadas2 SET activa='$this->mostrar', orden='$this->prioridad', fecha_inicio='$this->desde', fecha_fin='$this->hasta', texto_alternativo='$this->alternativo', titulo_adicional='$this->titulo', precio_pax_adic='$this->paxadicional', edadNinosDesde1='$this->desde_a', edadNinosHasta1='$this->hasta_a', precio_ninos='$this->precio_a', edadNinosDesde2='$this->desde_b', edadNinosHasta2='$this->hasta_b', precio_ninos2='$this->precio_b' WHERE id='$temporada'\";\n\t\t\t\n\t\t\t$id=$this->id;\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/producto/detalle.php?id=$id#next\");\n\t\t\texit();\n\t\t}else{\n\t\t\t$this->mostrar_temporada();\n\t\t}\n\t}", "public function editar(){\n\t\t\n\t\t$this->form_validation->set_rules('resposta', 'RESPOSTA', 'trim');\n\t\tif ($this->form_validation->run()==TRUE):\n\t\t$dados = elements(array('resposta'), $this->input->post());\n\t\t$this->Comentarios->do_update($dados, array('id_comentario'=>$this->input->post('idcomentario')));\n\t\tendif;\n\t\tset_tema('titulo', 'Resposta de Coment&aacute;rio');\n\t\tset_tema('conteudo', load_modulo('Comentarios', 'editar'));\n\t\tload_template();\n\t}", "public function Editar(){\n \n // Istancia a classe \"Funcionario\" do arquivo \"funcionario_class\".\n $funcionario = new Funcionario();\n $endereco = new Endereco();\n \n // Pega o id do registro e os demais dados para fazer uma atualização do mesmo.\n // Variáevis do funcionário.\n $funcionario->idFuncionario = $_GET['id'];\n $funcionario->nome = $_POST['txt_nome'];\n $funcionario->sobrenome = $_POST['txt_sobrenome'];\n $funcionario->rg = $_POST['txt_rg'];\n $funcionario->cpf = $_POST['txt_cpf'];\n $funcionario->usuario = $_POST['txt_usuario'];\n $funcionario->senha = $_POST['txt_senha'];\n $funcionario->idNivelFuncionario = $_POST['cbx_nivelFuncionario'];\n $funcionario->idEndereco = $_GET['idEnd'];\n // Variáveis do endereço do funcionário.\n $endereco->bairro = $_POST['txt_bairro'];\n $endereco->logradouro = $_POST['txt_logradouro'];\n $endereco->cep = $_POST['txt_cep'];\n $endereco->cidade = $_POST['cbx_cidade'];\n $endereco->idEndereco = $_GET['idEnd'];\n \n // Chama o metodo para atualizar o endereço do funcionário.\n $sucess = $endereco::Update($endereco);\n \n // Chama o metodo para atualizar o funcionário apenas se a atualização do endereço dele foi bem sucedida.\n if($sucess == 1){\n $funcionario::Update($funcionario);\n }\n \n }", "public function edit( )\r\n {\r\n //\r\n }", "public function editData() {\n $this->daftar_barang = array_values($this->daftar_barang);\n $data_barang = json_encode($this->daftar_barang, JSON_PRETTY_PRINT);\n file_put_contents($this->file, $data_barang);\n $this->ambilData();\n }", "public function mostrar_editar($datos) {\r\n\t\t\t $this -> pantalla_edicion('editar',$datos);\r\n\t\t }", "protected function alterar(){\n header(\"Content-type: text/html;charset=utf-8\");\n $sql = \"SHOW FULL FIELDS FROM \" . $this->table;\n $execute = conexao::toConnect()->executeS($sql);\n $sets = \"\";\n $id_registro = '';\n $contador = \"\";\n $count = 1;\n foreach ($execute as $contar) {\n if ($contar->Key != 'PRI') {\n $atributos_field = $contar->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($this->$get() != null) {\n $contador = $contador + 1;\n }\n }\n }\n foreach ($execute as $key => $attr){\n if ($attr->Key != 'PRI') {\n $atributos_field = $attr->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($this->$get() != null) {\n if ($count != $contador) {\n $sets .= $attr->Field . \" = '\" . $this->$get() . \"',\";\n } else {\n $sets .= $attr->Field . \" = '\" . $this->$get().\"'\";\n }\n $count = $count + 1;\n }\n }else{\n $id_registro = $attr->Field;\n }\n }\n $update = \"UPDATE \".$this->table.\" SET \".$sets.\" WHERE \".$id_registro.\" = \".$this->getIdTable();\n\n $execute_into = conexao::toConnect()->executeQuery($update);\n if (count($execute_into) > 0) {\n return $execute_into;\n }else{\n return false;\n }\n }", "function editar_operador(){\t\t\n\t\t$this->accion=\"Editando Datos del Operador\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\" && isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$this->asignar_valores();\n\t\t\t$sql=\"UPDATE operador SET cantidad_op='$this->cantidad', nombre_op='$this->nombre', apellido_op='$this->apellido', cedula_op='$this->cedula' WHERE id_op='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/operador/\");\n\t\t}else{\n\t\t\t\n\t\t\t$this->mostrar_operador();\n\t\t\t\n\t\t}\n\t\t\n\t}", "function edit($param) {\n extract($param);\n $sql = \"UPDATE operario SET fk_usuario='$id_usuario', nombres='$nombres', apellidos='$apellidos' WHERE fk_usuario='$id_usuario';\n UPDATE usuario SET id_usuario='$id_usuario', direccion='$direccion', telefonos='$telefonos', correos='$correos', contrasena='$contrasena' WHERE id_usuario = '$id_usuario'; \"; // <-- el ID de la fila asignado en el SELECT permite construir la condición de búsqueda del registro a modificar\n $conexion->getPDO()->exec($sql);\n echo $conexion->getEstado();\n }", "function EDIT()\n{\n\t//si se cumple la condicion\n\tif ($this->Comprobar_atributos() === true){\n\t$sql = \"SELECT * FROM EDIFICIO WHERE CODEDIFICIO= '$this->codedificio'\";\n \n\n $result = $this->mysqli->query($sql);\n \n //si se cumple la condicion\n if ($result->num_rows == 1) { //Si existe el edificio lo editamos\n //actualizamos los datos\n\t$sql = \"UPDATE EDIFICIO\n\t\t\tSET \n\t\t\tCODEDIFICIO = '$this->codedificio',\n\t\t\tNOMBREEDIFICIO = '$this->nombreedificio',\n\t\t\tDIRECCIONEDIFICIO = '$this->direccionedificio',\n\t\t\tCAMPUSEDIFICIO = '$this->campusedificio' \n\t\t\tWHERE \n\t\t\tCODEDIFICIO= '$this->codedificio'\";\n\t//si se ha actualizado guardamos un mensaje de éxito en la variable resultado\n\tif ($this->mysqli->query($sql)) //Si la consulta se ha realizado correctamente, mostramos mensaje \n\t{\n\t\t$resultado = 'Actualización realizada con éxito';\n\t}\n\t//si no\n\telse //Si no, mostramos mensaje de error\n\t{\n\t\t$resultado = 'Error de gestor de base de datos';\n\t}\n\treturn $resultado;//devolvemos el mensaje\n}\n\t}//si no\n\telse{\n\t\treturn $this->erroresdatos;\n\t}\n}", "public function edit()\n {\n \n }", "function editar_producto(){\t\t\n\t\t$this->accion=\"Editando Datos del Producto\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\" && isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$this->asignar_valores();\n\t\t\t$this->fecha=$this->convertir_fecha($this->fecha);\n\t\t\t$sql=\"UPDATE producto SET nombre_pro='$this->nombre', categoria_pro='$this->categoria', prioridad_pro='$this->prioridad', detal_pro='$this->detal', mayor_pro='$this->mayor', limite_pro='$this->limite', descripcion_pro='$this->descripcion', claves_pro='$this->claves', marca_pro='$this->marca',hotel_pro='$this->hotel',principal_pro='$this->principal' WHERE id_pro='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/producto/\");\n\t\t}else{\n\t\t $this->mostrar_producto();\n\t\t $sql=\"SELECT * FROM categoria ORDER BY prioridad_cat ASC\";\n\t\t $consulta=mysql_query($sql) or die(mysql_error());\n\t\t while ($resultado = mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=\"si\";\n\t\t\t\t$this->listado[] = $resultado;\n\t\t }\n\t\t}\n\t}", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function editar()\n {\n\t\tif($this->_Method == \"POST\")\n\t\t{\n\t\t\t$this->editar_post();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->editar_get();\n\t\t}\n }", "public function editar()\n\t{\n\t\t$estado = new Estado();\n\t\t$estado->idestado = $_POST['idestado'];\n\t\t$estado->nombre = $_POST['nombreeditar'];\n\t\t$estado->poblacion_hombres = $_POST['poblacionHeditar'];\n\t\t$estado->poblacion_mujeres = $_POST['poblacionMeditar'];\n\t\t$estado->poblacion_total = $_POST['poblacionTeditar'];\n\t\t$estado->edad_promedio = $_POST['edadPeditar'];\n\t\t$estado->update();\n\t\t//redireccionamos a la vista agregarEstado\n\t\theader(\"location: index.php?controller=Direccion&action=agregarEstado\");\n\t}", "public static function modificaProfiloAzienda()\n {\n $vd = new ViewDescriptor();\n $vd->setTitolo(\"SardiniaInFood: Profilo\");\n $vd->setLogoFile(\"../view/in/logo.php\");\n $vd->setMenuFile(\"../view/in/menu_modifica_profilo.php\");\n $vd->setContentFile(\"../view/in/azienda/modifica_profilo_azienda.php\");\n $vd->setErrorFile(\"../view/in/error_in.php\");\n $vd->setFooterFile(\"../view/in/footer_empty.php\");\n \n require_once \"../view/Master.php\";\n }", "public function Edit()\n\t{\n\t\t\n\t}", "public function editar($conexion,$nombre,$apellido,$edad,$telefono,$direccion,$id){\r\n // PROCEDIMIENTO ALMACENADO\r\n $query= \"call editar_acu('$nombre','$apellido','$edad',',$telefono','$direccion',$id)\"; \r\n $consulta=mysqli_query($conexion,$query);\r\n if($consulta){\r\n $respuesta=\"Actualizado con exito\";\r\n \r\n }else{\r\n $respuesta=\"problemas al actualizar\";\r\n }\r\n return $respuesta;\r\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function editar(){\n log_message('DEBUG', '#TRAZA | #TRAZ-PROD-TRAZASOFT | Etapa | editar()');\n $id = $this->input->get('id'); // batch_id\n\n $data['tarea'] = $this->Etapas->validarPedidoMaterial($id);\n\n $this->load->model(ALM . 'Articulos');\n #$data['articulos'] = $this->Articulos->obtenerXTipos(array('Proceso', 'Final'));\n\n $data['accion'] = 'Editar';\n $data['etapa'] = $this->Etapas->buscar($id)->etapa;\n $data['idetapa'] = $data['etapa']->id;\n\n #$data['materias'] = $this->Articulos->obtenerXTipos(array('Proceso', 'Final', 'Materia Prima'));\n // $data['productos'] = $this->Articulos->obtenerXTipos(array('Proceso', 'Producto'));\n\n // trae tablita de materia prima Origen y producto\n $data['matPrimas'] = $this->Etapas->getPedido($id)->articulos->articulo;\n\n $data['detaEmpaque'] = $this->Etapas->getPedidoEmpaque($id)->articulos->articulo;\n #Obtener Articulos por Etapa\n $data['productos_etapa'] = $this->Etapas->obtenerArticulos($data['etapa']->etap_id)['data'];\n\n $data['productos_salida_etapa'] = $this->Etapas->getSalidaEtapa($data['etapa']->etap_id)['data'];\n $data['productos_entrada_etapa'] = $this->Etapas->getEntradaEtapa($data['etapa']->etap_id)['data'];\n\n $data['op'] = $data['etapa']->titulo;\n $data['lang'] = lang_get('spanish', 4);\n\n $data['establecimientos'] = $this->Establecimientos->listar()->establecimientos->establecimiento;\n $data['fecha'] = $data['etapa']->fecha;\n\n if ($data['etapa']->tiet_id == 'prd_tipos_etapaFraccionamiento') {\n // trae lotes segun entrega de materiales de almacen.(81)\n $data['recipientes'] = $this->Recipientes->obtener('DEPOSITO', 'TODOS', $data['etapa']->esta_id)['data'];\n $data['ordenProd'] = $data['etapa']->orden;\n $data['articulos_fraccionar'] = $this->Etapas->getEntradaEtapa($data['etapa']->etap_id)['data'];\n $data['articulos_fracc_salida'] = $this->Etapas->getSalidaEtapa($data['etapa']->etap_id)['data'];\n\n $this->load->view('etapa/fraccionar/fraccionar', $data);\n } else {\n $data['formulas'] = $this->Formulas->getFormulas()->formulas->formula;\n $data['tareas'] = []; //$this->Tareas->listar()->tareas->tarea;\n $data['templates'] = []; //$this->Templates->listar()->templates->template;\n $data['recursosmateriales'] = []; //$this->Recursos_Materiales->listar()->recursos->recurso;\n $data['rec_trabajo'] = $this->Recursos->obtenerXTipo('TRABAJO')['data'];\n $this->load->view('etapa/abm_editar', $data);\n }\n }", "public function edit(Comida $comida)\n {\n //\n }", "function alterar($id_operacao,$codigo,$descricao,$papeis,$dbhw){\n\tglobal $convUTF, $esquemaadmin;\n\tif ($convUTF != true){\n\t\t$descricao = utf8_decode($descricao);\n\t}\n\t$dataCol = array(\n\t\t\"codigo\" => $codigo,\n\t\t\"descricao\" => $descricao\n\t);\n\t$resultado = i3GeoAdminUpdate($dbhw,\"i3geousr_operacoes\",$dataCol,\"WHERE id_operacao = $id_operacao\");\n\tif($resultado === false){\n\t\treturn false;\n\t}\n\t//apaga todos os papeis\n\t$resultado = excluirPapeis($id_operacao,$dbhw);\n\tif($resultado === false){\n\t\treturn false;\n\t}\n\tif(!empty($papeis)){\n\t\t//atualiza papeis vinculados\n\t\tforeach($papeis as $p){\n\t\t\t$resultado = adicionaPapel($id_operacao,$p,$dbhw);\n\t\t\tif($resultado === false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn $id_operacao;\n}", "public function edit(Paquete $paquete)\n {\n //\n }", "function EDIT()\r\n{\r\n\t// se construye la sentencia de busqueda de la tupla en la bd\r\n $sql = \"SELECT * FROM NOTICIA WHERE (idNoticia = '$this->idNoticia')\";\r\n // se ejecuta la query\r\n $result = $this->mysqli->query($sql);\r\n // si el numero de filas es igual a uno es que lo encuentra\r\n if ($result->num_rows == 1)\r\n {\t// se construye la sentencia de modificacion en base a los atributos de la clase\r\n\t\t$sql = \"UPDATE NOTICIA SET \r\n\t\t\t\t\tidNoticia = '$this->idNoticia',\r\n\t\t\t\t\timageURL = '$this->imageURL',\r\n\t\t\t\t\tenlace = '$this->enlace',\r\n\t\t\t\t\ttexto = '$this->texto'\t\t\t\t\t\r\n\t\t\t\tWHERE ( idNoticia = '$this->idNoticia')\";\r\n\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\r\n if (!($resultado = $this->mysqli->query($sql))){\r\n\t\t\treturn 'Error en la modificación'; \r\n\t\t}\r\n\t\telse{ \r\n\t\t\treturn 'Modificado correctamente.';\r\n\t\t\t\r\n\t\t}\r\n }\r\n else // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\r\n \treturn 'No existe en la base de datos';\r\n}", "public function edita()\n\t {\t\n\t\t$id=$_REQUEST['id'];\n\t\t$car=$_REQUEST['car'];\n\t\t$nom=$_REQUEST['nom'];\n\t\t$cod=$_REQUEST['cod'];\n\t\t$niv=$_REQUEST['niv'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$cur_data=array();\n\t\t$cur_data['id_curso']=$id;\n\t\t$cur_data['id_carrera']=$car;\n\t\t$cur_data['nombre']=$nom;\n\t\t$cur_data['codigo']=$cod;\n\t\t$cur_data['nivel']=$niv;\n\t\t$cur_data['observacion']=$obs;\n\t\t$cur_data['estado']=$est;\n\t\t\n\t\tprint_r($cur_data);\n\t\t$curso=new cursos;\n\t\t$curso->edit($cur_data);\n\t\t$data1=$curso->lista();\n\t\t$this->principal();\n\t }", "function editar_pr_factura_inventario(){\n\n\t\t $u = new entrada();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n\t$precio=$_POST['costo_unitario'];\n\t$producto_id=$_POST['cproductos_id'];\n $u->fecha = date(\"Y-m-d H:i:s\");\n $related = $u->from_array($_POST);\n\t $f = new Pr_factura();\n $f->get_by_id($u->pr_facturas_id);\n $u->espacios_fisicos_id = $f->espacios_fisicos_id;\n $u->lote_id = $f->lote_id;\n $u->costo_total = ($u->cantidad * $u->costo_unitario);\n\t$u->existencia = $u->cantidad;\n $u->cproveedores_id = $f->cproveedores_id;\n $u->fecha = date(\"Y-m-d H:i:s\");\n if ($u->id == 0)\n unset($u->id);\n if ($u->save($related)) {\n$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n echo $u->id;\n } else\n echo 0; \n \n\t}", "public function edit()\n { \n }", "function desplegarCampoActualizar(Detallesmantenimientosdetablas $detalle,$numeroGrid,$valor=''){\n $size=$detalle->getTamanoCampo();\n $max=$detalle->getTamanoMaximoCampo();\n $javascript=$detalle->getJavascriptDesdeCampo();\n $valorPorDefecto=$valor;\n $id=$detalle->getIdCampo();\n $tipo=$detalle->getIdTipoCampo();\n $requerido=$detalle->getNulidadCampo();\n $accion=strtoupper($detalle->getAccionCampo());\n\n Campos::inicioFila();\n $ayuda=$detalle->getDescripcionCampo();\n\n if ($tipo == 14) { //Si es tipo Separador de Campos\n Campos::columnaGrid($numeroGrid);\n echo \"<center><strong>\" . $detalle->getNombreCampo() . \"</strong></center>\";\n Campos::finColumnaGrid();\n return;\n } else {\n Campos::columnaGrid($numeroGrid);\n echo $detalle->getNombreCampo();\n C::finColumnaGrid();\n }\n\n Campos::columnaGrid($numeroGrid);\n //Aqui empieza la captura...\n if($tipo==1){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n if(trim($valorPorDefecto)==\"\"){\n $valorPorDefecto=null;\n }\n C::texto($id,$valorPorDefecto,10,10,\" READONLY \");\n }else if($tipo==2){\n $resFecha=$detalle->getRestriccionDeFechas();\n if(trim($resFecha)==\"\"){\n $resFecha=null;\n }\n C::texto($id,$valorPorDefecto,15,15,\" READONLY \");\n }else if($tipo==3){\n C::texto($id,$valorPorDefecto,10,10,\" READONLY \");\n }else if($tipo==5){\n C::entero($id,$valorPorDefecto,$size,$max,$javascript.\" READONLY \");\n }else if($tipo==6){\n C::flotante($id,$valorPorDefecto,$size,$max,$javascript.\" READONLY \");\n }else if($tipo==7){\n C::texto($id,$valorPorDefecto,$size,$max,$javascript.\" READONLY \");\n }else if($tipo==8){\n $filas=$detalle->getAltoCampo();\n c::oculto($id,$valorPorDefecto);\n echo $valorPorDefecto;\n }else if($tipo==9){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id.\"selectDisabled\", $rsT, $valorPorDefecto,\" DISABLED \");\n C::oculto($id,$valorPorDefecto);\n }else if($tipo==10){\n $chequeado=false;\n if($valorPorDefecto==1){\n $chequeado=true;\n }\n C::chequeSiNo($id,'',$chequeado,1,\" DISABLED \");\n } else if($tipo==12){\n C::texto($id, $valorPorDefecto, $size, $max, $javascript.\" READONLY\");\n }else if($tipo==13){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSet($id.\"selectDisabled\", $rsT, $valorPorDefecto,\" DISABLED \");\n C::oculto($id,$valorPorDefecto);\n }else if($tipo==20){\n C::editorHTMLPopUp($id, $valorPorDefecto, $detalle->getNombreCampo());\n }else if($tipo==25){\n $query=generarQueryCapturaExtranjera($detalle);\n $rsT=new ResultSet($query);\n C::selectAPartirDeResultSetConBusqueda($id, $rsT, $valorPorDefecto);\n }else if($tipo==27){\n $chequeado=false;\n if($valorPorDefecto=='A'){\n $chequeado=true;\n }\n C::chequeActivo($id,'',$chequeado);\n }else if($tipo==29){\n C::selectCatalogoId($id,$detalle->getCatalogoId(), $valorPorDefecto);\n }\n C::finColumnaGrid();\n}", "function EDIT()\n{ //COMPROBAR SI EXISTEN TODOS MEDIANTE EL SELECT\n\t//si se cumple la condicion\n\tif ($this->Comprobar_atributos() === true){\n\t $sql = \"SELECT *\n\t\t\tFROM PROF_ESPACIO\n\t\t\tWHERE (\n\t\t\t\t(DNI = '$this->DNI' AND CODESPACIO = '\".$this->CODESPACIO.\"') \n\t\t\t)\";\n\t//si no guardamos un mensaje de error en la variable resultado\n\t\t\tif($result = $this->mysqli->query($sql)){\t\n\t//si se cumple la condicion\n\tif ($result->num_rows == 0){ // existe el usuario\n\t\t$sql = \"UPDATE PROF_ESPACIO SET DNI = '$this->DNI',CODESPACIO = '$this->CODESPACIO' WHERE DNI= '$this->DNI' AND CODESPACIO = '\".$this->CODESPACIO.\"'\";\n\t//si se cumple la condicion\n\t\tif ($this->mysqli->query($sql))\n\t{\n\t\t$resultado = 'Actualización realizada con éxito';\n\t}\n\t//si no\n\telse\n\t{\n\t\t$resultado = 'Error de gestor de base de datos';//guarda mensaje de error en la variable resultado\n\t}\n\treturn $resultado;\n\t}\n\t//si no\n\telse\n\t{\n\t\treturn 'El elemento no existe en la BD';//devuelve el mensaje\n\t}\n\t}//si no\n\telse{\n\t\treturn 'Error de gestor de base de datos';//devuelve el mensaje\n}\n\t}//si no\n\telse{\n\t\treturn $this->erroresdatos;\n\t}\n}", "public function edit() {\n }", "function opcion__actualizar()\n\t{\n\t\t$this->consola->titulo(\"1.- Exportando METADATOS\");\n\t\t$this->opcion__exportar();\n\n\t\t$this->consola->titulo(\"2.- Actualizando el proyecto utilizando SVN\");\n\t\t$p = $this->get_proyecto();\n\t\t$p->actualizar();\n\n\t\t$this->consola->titulo(\"3.- Regenerando el proyecto en la instancia\");\n\t\t$p->regenerar();\n\t}", "public function editar(){\n if(!isLoggedIn()){\n redirect('usuarios/login');\n }\n //check User Role -- Only ADMINISTRADOR allowed\n if(!checkLoggedUserRol(\"ADMINISTRADOR\")){\n redirect('dashboard');\n }\n \n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n $data = [\n 'especialidadToEditId' => trim($_POST['especialidadToEditId']),\n 'especialidadToEditNombre' => trim($_POST['especialidadToEditNombre'])\n ];\n \n // Validar carga de especialidadToEditId\n if(empty($data['especialidadToEditId'])){\n $data['especialidadToEdit_error'] = 'No se ha seleccionado la especialidad a editar';\n }\n\n // Validar carga de especialidadToEditId\n if(empty($data['especialidadToEditNombre'])){\n $data['especialidadToEdit_error'] = 'No se permite editar a un título vacío';\n }\n\n // Asegurarse que no haya errores\n if(empty($data['especialidadToEdit_error'])){\n // Crear especialidad\n if($this->especialidadModel->actualizarEspecialidad($data)){\n flash('especialidad_success', 'Especialidad editada exitosamente');\n redirect('especialidades');\n }\n else{\n die('Ocurrió un error inesperado');\n }\n }\n else{\n flash('especialidad_error', $data['especialidadToEdit_error'], 'alert alert-danger');\n redirect('especialidades');\n }\n }\n }", "function modificaRuta()\r\n\t{\r\n\t\t$query = \"UPDATE \" . self::TABLA . \" SET Ruta='\".$this->Ruta.\"'\tWHERE IDRuta = \".$this->IdRuta.\";\";\r\n\t\treturn parent::modificaRegistro( $query);\r\n\t}", "function ajax_edita($id=false, $campo=false, $valor=false){\n\t\t$data = date('Y-m-d H:i:s');\n\t\t$sql = \"UPDATE briefing SET {$campo} = '{$valor}', ultima_alteracao='{$data}' WHERE id =\".$id; \n\t\t\n\t\t$this->db->query($sql); \n\t}", "function editar($id_paciente,$id_doctor,$id_microcirugia, $id_microcirugia_pte,$honorarios_micr,$paquete,$total,$items,$cuantos,$array_json){\n /*\n $tmp_tbl=\"CREATE TEMPORARY TABLE IF NOT EXISTS tmp_micro\n SELECT * FROM microcirugia_paciente_det\n WHERE id_microcirugia_pte='$id_microcirugia_pte'\";\n \t$result0=_query($tmp_tbl);\n */\n $array = json_decode($array_json, true);\n $tmp_tbl='CREATE TEMPORARY TABLE IF NOT EXISTS tmp_micro LIKE microcirugia_paciente_det';\n \t$result0=_query($tmp_tbl);\n\n $fecha=date(\"Y-m-d\");\n $hora=date(\"H:i:s\");\n $id_empleado=$_SESSION[\"id_usuario\"];\n $tipoprodserv = \"Microcirugia\";\n $datos_antiguos=array();\n\n $sql_pa=\"SELECT * FROM microcirugia_paciente_det\n WHERE id_microcirugia_pte='$id_microcirugia_pte'\";\n $result_pa=_query($sql_pa);\n $nrows_pa=_num_rows($result_pa);\n for($n=0;$n<$nrows_pa;$n++){\n \t\t\t$rows_pa=_fetch_array($result_pa);\n \t\t\t$id_microcirugia_pte_det=$rows_pa['id_microcirugia_pte_det'];\n \t\t\t$id_prod=$rows_pa['id_producto'];\n \t\t\t$tipo1=$rows_pa['tipo'];\n \t\t\t$cantidad1=$rows_pa['cantidad'];\n $precio1=$rows_pa['precio'];\n \t\t\t$datos_antiguos[]=$id_microcirugia_pte_det.\"|\".$id_prod.\"|\".$tipo1.\"|\".$cantidad1.\"|\".\"1\";\n }\n _begin();\n if ($cuantos>0){\n\n //actualizar microcirugia\n if($paquete==1){\n $costo_paciente=$honorarios_micr;\n $honorarios_doctor=$honorarios_micr-$total;\n $total_hosp=$total;\n $total_final=$honorarios_micr;\n }\n if($paquete==0){\n $honorarios_doctor=$honorarios_micr;\n $total_hosp=$total;\n $total_final=$total+$honorarios_doctor;\n $costo_paciente= $total_final;\n }\n\n $tabl0 = \"microcirugia_paciente\";\n $fd0 = array(\n 'costo_paciente' => $costo_paciente,\n 'hora_fin' => $hora,\n 'honorarios_doctor' => $honorarios_doctor,\n 'total_insumos' => $total,\n 'realizado' => 1,\n );\n $wc0=\"WHERE id_microcirugia_pte='$id_microcirugia_pte'\";\n $update = _update($tabl0, $fd0, $wc0);\n\n //facturar\n $tabl1 = \"factura\";\n //agregar a factura\n $fd1= array(\n 'fecha'=>$fecha,\n 'hora_inicio'=>$hora,\n 'id_cliente'=>$id_paciente,\n 'subtotal'=>$total_final,\n 'alias_tiposerv'=>'HOS',\n 'id_doctor'=>$id_doctor,\n 'total_hosp' => $total_hosp,\n 'total_doctor' => $honorarios_doctor,\n 'total' => $total_final,\n );\n $wc1=\"WHERE id_transacc='$id_microcirugia_pte'\n AND alias_tiposerv='HOS'\";\n\n\n $ins1 = _update($tabl1, $fd1,$wc1);\n\n foreach ($array as $fila){\n //Actualizar detalle microcirugia y luego detalle factura\n $id_producto=$fila['id'];\n $id_presentacion=$fila['id_presentacion'];\n $subtotal=$fila['subtotal'];\n $cantidad=$fila['cantidad'];\n $precio_venta=$fila['precio'];\n $tipop=$fila['tipop'];\n if($tipop==\"P\"){\n $sql_pres=\"SELECT unidad FROM presentacion_producto\n WHERE id_presentacion='$id_presentacion' AND id_producto='$id_producto'\";\n $res_pres=_query($sql_pres);\n $unidad=_fetch_result($res_pres);\n $cantidad_real=$cantidad*$unidad;\n }\n else{\n $unidad=1;\n $cantidad_real=$cantidad*$unidad;\n }\n //buscar los elementos del DOM, y comparar si estan guardados\n $sql1=\"SELECT * FROM microcirugia_paciente_det\n WHERE id_microcirugia_pte='$id_microcirugia_pte'\n AND id_producto='$id_producto'\n AND tipo='$tipop'\n \";\n $result1=_query($sql1);\n $nrows1=_num_rows($result1);\n if($nrows1>0){\n $row1=_fetch_array($result1);\n $id_microcirugia_pte_det=$row1['id_microcirugia_pte_det'];\n $cantidad_pedido_previo=$row1['cantidad'];\n\n }else {\n $cantidad_pedido_previo=0;\n }\n\n //\n $tabl2=\"microcirugia_paciente_det\";\n $fd2= array(\n 'id_microcirugia_pte' => $id_microcirugia_pte,\n 'id_producto' => $id_producto,\n 'cantidad' => $cantidad_real,\n 'precio' => $precio_venta,\n 'tipo' => $tipop,\n );\n\n //\n if($nrows1==0){\n $ins2 = _insert($tabl2,$fd2 );\n $id_microcirugia_pte_det=_insert_id();\n }\n if($nrows1>0){\n $wc2=\" WHERE id_producto='$id_producto'\n AND id_microcirugia_pte='$id_microcirugia_pte' and tipo='$tipop'\";\n $ins2 = _update( $tabl2 , $fd2,$wc2 );\n }\n //tabla temporal\n $tbltmp = 'tmp_micro';\n $fdtmp= array(\n 'id_microcirugia_pte' => $id_microcirugia_pte,\n 'id_microcirugia_pte_det' => $id_microcirugia_pte_det,\n 'id_producto' => $id_producto,\n 'cantidad' => $cantidad_real,\n 'precio' => $precio_venta,\n 'tipo' => $tipop,\n );\n $ins3 = _insert( $tbltmp , $fdtmp );\n if($tipop=='P'){\n //actualizar el stock en base a este pedido\n \t\t\t$table_st= 'stock';\n \t\t\t$sqls=\"SELECT stock FROM stock WHERE id_producto='$id_producto'\";\n \t\t\t$results=_query($sqls);\n \t\t\t$rows=_fetch_array($results);\n \t\t\t$nrow_cants=_num_rows($results);\n \t\t\tif ($nrow_cants>0){\n \t\t\t\t$cantidad_stock=$rows['stock'];\n \t\t\t\tif($cantidad_stock<0)\n \t\t\t \t $cantidad_stock=0;\n \t\t\t $actualiza_stock=$cantidad_real-$cantidad_pedido_previo;\n \t\t\t $stock_final=$cantidad_stock-$actualiza_stock;\n \t\t\t $where_clause_st=\"WHERE id_producto='$id_producto'\";\n \t\t\t\t $fd_st = array(\n \t\t\t\t 'stock' => $stock_final,\n \t\t\t\t );\n \t\t\t\t $insertar_st= _update($table_st,$fd_st, $where_clause_st );\n \t\t\t\t//Actualizar en stock si hay registro del producto\n }\n //stock ubicacion\n // $ins4=_query($sql4);\n $sql_su=\"SELECT cantidad,id_ubicacion FROM stock_ubicacion\n WHERE id_producto='$id_producto'\";\n $res5=_query($sql_su);\n $n5=_num_rows($res5);\n $diferencia=0;\n $cantidad_nueva=$cantidad_pedido_previo-$cantidad_real;\n $cantidad_act=abs($cantidad_nueva);\n for($j=0;$j<$n5;$j++){\n $cant_actualizar=0;\n $row5=_fetch_array($res5);\n $cantidad_su=$row5['cantidad'];\n $id_ubicacion=$row5['id_ubicacion'];\n //cuando se ha modificado la nueva cantidad y hay que sumar al stock por ubic.\n if($cantidad_nueva>=0){\n $sql5=\"UPDATE stock_ubicacion\n SET cantidad=cantidad+$cantidad_nueva\n WHERE id_producto='$id_producto'\n AND id_ubicacion='$id_ubicacion'\";\n $ins5=_query($sql5);\n break;\n }\n //cuando se ha modificado la nueva cantidad y hay que restar al stock por ubic.\n if($cantidad_nueva<0){\n $diferencia=$cantidad_su-$cantidad_act;\n if($diferencia>0){\n // $cant_actualizar=$cantidad_su-$cantidad_real;\n $sql5=\"UPDATE stock_ubicacion\n SET cantidad=cantidad-$cantidad_act\n WHERE id_producto='$id_producto'\n AND id_ubicacion='$id_ubicacion'\";\n $ins5=_query($sql5);\n break;\n }\n if($diferencia<=0){\n $cantidad_act=$cantidad_act-$cantidad_su;\n $sql5=\"UPDATE stock_ubicacion\n SET cantidad=0\n WHERE id_producto='$id_producto'\n AND id_ubicacion='$id_ubicacion'\";\n $ins5=_query($sql5);\n }\n\n }\n /*EJ: $cantidad_real=4 ;$cantidad_pedido_previo=2\n $cantidad_nueva=$cantidad_pedido_previo-$cantidad_real;\n $cantidad_nueva=-2 que deben restarse del inventario !!!\n Ahora hay que ver si el stock de la ubicacion es mayor que cantidad nueva!!!\n if($cantidad_nueva<0){\n $diferencia=$cantidad_su-abs($cantidad_nueva);\n\n }\n\n $cantidad_real=2 ;$cantidad_pedido_previo=4\n $cantidad_nueva=$cantidad_pedido_previo-$cantidad_real;\n $cantidad_nueva=2 que deben sumarse al inventario\n */\n if($cantidad_nueva<0){\n $diferencia=$cantidad_su-abs($cantidad_nueva);\n\n }\n $cantidad_nueva=$cantidad_real-$cantidad_pedido_previo;\n\n $diferencia=$cantidad_su-$cantidad_real;\n\n $actualiza_stock=$cantidad_real-$cantidad_pedido_previo;\n \t\t\t $stock_final=$cantidad_stock-$actualiza_stock;\n\n if($diferencia>=0){\n $cant_actualizar=$cantidad_su+$diferencia;\n\n $sql5=\"UPDATE stock_ubicacion\n SET cantidad=cantidad-$cantidad_nueva\n WHERE id_producto='$id_producto'\n AND id_ubicacion='$id_ubicacion'\";\n $ins5=_query($sql5);\n break;\n }\n if($diferencia<0){\n $cantidad_real=$cantidad_nueva-$cantidad_su;\n $sql5=\"UPDATE stock_ubicacion\n SET cantidad=0\n WHERE id_producto='$id_producto'\n AND id_ubicacion='$id_ubicacion'\";\n $ins5=_query($sql5);\n }\n }//stock_ubicacion\n //stock ubicacion\n\n\n }\n //devolver el stock de los eliminados de la lista y actualizarlos a la bd\n \t\t\t//saco el numero de elementos\n \t\t $longitud = count($datos_antiguos);\n \t\t\t//Recorro todos los elementos\n \t\t\t$existe=0;\n \t\t\tfor($u=0; $u<$longitud; $u++){\n //saco el valor de cada elemento\n \t $id_prodx=$datos_antiguos[$u];\n \t list($id_mpdet0,$id_p,$tipo11,$cant1,$borrado0)=explode(\"|\",$id_prodx);\n \t\t$sql_tmp=\"SELECT * FROM tmp_micro as tm\n \t\t WHERE tm.id_microcirugia_pte='$id_microcirugia_pte'\n \t\t and tm.id_microcirugia_pte_det='$id_mpdet0'\n \t\t AND tm.id_producto='$id_p'\n \t\t AND tm.tipo='$tipo11'\n \t\t \";\n\n \t\t$result_tmp=_query($sql_tmp);\n \t\t$row_tmp=_fetch_array($result_tmp);\n \t\t$nrow_tmp=_num_rows($result_tmp);\n\n \t\tif ($nrow_tmp>0){\n \t\t\tfor($q=0;$q<$nrow_tmp;$q++){\n \t\t\t\t$datos_antiguos[$u]=$id_mpdet0.\"|\".$id_p.\"|\".$tipo11.\"|\".$cant1.\"|\".\"0\";\n \t\t\t\t$existe+=1;\n \t\t\t}\n \t\t}\n }\n } // end foreach ($array as $fila){\n $table2='microcirugia_paciente_det';\n for($v=0; $v<$longitud; $v++){\n\n $id_prod2=$datos_antiguos[$v];\n list($id_mp2,$id_pr,$tipo11,$cant2,$borrado)=explode(\"|\",$id_prod2);\n $stock_final2=0;\n if ($tipo11=='P'){\n if ($borrado=='1'){\n\n $sql6=\"SELECT stock FROM stock WHERE id_producto='$id_pr'\";\n $result6=_query($sql6);\n $row6=_fetch_array($result6);\n $nrow_cant6=_num_rows($result6);\n $cantidad_stock2=$row6['stock'];\n $stock_final2=$cantidad_stock2+$cant2;\n\n $where_clause_st2=\"WHERE id_producto='$id_pr'\";\n $fd_st2 = array(\n 'stock' => $stock_final2,\n );\n\n $insertar_st2= _update($table_st,$fd_st2, $where_clause_st2 );\n\n $wc3=\" WHERE id_microcirugia_pte='$id_microcirugia_pte'\n AND id_producto='$id_pr' and tipo='$tipo11'\n and id_microcirugia_pte_det='$id_mp2'\n \";\n $delete1 = _delete( $tabl2 ,$wc3);\n }\n }\n }\n $drop1=\" DROP TABLE tmp_micro\";\n\t\t\t$resultx=_query($drop1);\n }\n if($ins1&&$ins2){\n _commit(); // transaction is committed\n $xdatos['typeinfo']='Success';\n }\n else{\n _rollback(); // transaction rolls back\n $xdatos['typeinfo']='Error';\n $xdatos['msg']='Registro de Pedido no pudo ser Actualizado !';\n $xdatos['process']='noinsert';\n // $xdatos['insertados']=\"cual falla upd1 :\".$updates4.\" upd2:\".$updates2.\" upd3:\".$insertar3 ;\n }\n\n echo json_encode($xdatos);\n }", "public function edit()\n { }", "static public function ctrEditarRepuesto(){\n\n\t\tif(isset($_POST[\"editDescripcion\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editDescripcion\"]) &&\n\t\t\t preg_match('/^[0-9]+$/', $_POST[\"editStock\"]) &&\t\n\t\t\t preg_match('/^[0-9.]+$/', $_POST[\"editPrecioCompra\"]) &&\n\t\t\t preg_match('/^[0-9.]+$/', $_POST[\"editPrecioVenta\"])){\n\n\t\t \t\t/*=============================================\n\t\t\t\tVALIDAR IMAGEN\n\t\t\t\t=============================================*/\n\n\t\t\t \t$ruta = $_POST[\"imagenActualProducto\"];\n\n\t\t\t \tif(isset($_FILES[\"editImagen\"][\"tmp_name\"]) && !empty($_FILES[\"editImagen\"][\"tmp_name\"])){\n\n\t\t\t\t\tlist($ancho, $alto) = getimagesize($_FILES[\"editImagen\"][\"tmp_name\"]);\n\n\t\t\t\t\t$nuevoAncho = 500;\n\t\t\t\t\t$nuevoAlto = 500;\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tCREAMOS EL DIRECTORIO DONDE VAMOS A GUARDAR LA FOTO DEL USUARIO\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t$directorio = \"vistas/img/productos/\".$_POST[\"editCodigo\"];\n\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tPRIMERO PREGUNTAMOS SI EXISTE OTRA IMAGEN EN LA BD\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\tif(!empty($_POST[\"imagenActualProducto\"]) && $_POST[\"imagenActualProducto\"] != \"vistas/img/productos/default/anonymous.png\"){\n\n\t\t\t\t\t\tunlink($_POST[\"imagenActualProducto\"]);\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\tmkdir($directorio, 0755);\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t/*=============================================\n\t\t\t\t\tDE ACUERDO AL TIPO DE IMAGEN APLICAMOS LAS FUNCIONES POR DEFECTO DE PHP\n\t\t\t\t\t=============================================*/\n\n\t\t\t\t\tif($_FILES[\"editImagen\"][\"type\"] == \"image/jpeg\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/productos/\".$_POST[\"editCodigo\"].\"/\".$aleatorio.\".jpg\";\n\n\t\t\t\t\t\t$origen = imagecreatefromjpeg($_FILES[\"editImagen\"][\"tmp_name\"]);\t\t\t\t\t\t\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagejpeg($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($_FILES[\"editImagen\"][\"type\"] == \"image/png\"){\n\n\t\t\t\t\t\t/*=============================================\n\t\t\t\t\t\tGUARDAMOS LA IMAGEN EN EL DIRECTORIO\n\t\t\t\t\t\t=============================================*/\n\n\t\t\t\t\t\t$aleatorio = mt_rand(100,999);\n\n\t\t\t\t\t\t$ruta = \"vistas/img/productos/\".$_POST[\"editCodigo\"].\"/\".$aleatorio.\".png\";\n\n\t\t\t\t\t\t$origen = imagecreatefrompng($_FILES[\"editImagen\"][\"tmp_name\"]);\t\t\t\t\t\t\n\n\t\t\t\t\t\t$destino = imagecreatetruecolor($nuevoAncho, $nuevoAlto);\n\n\t\t\t\t\t\timagecopyresized($destino, $origen, 0, 0, 0, 0, $nuevoAncho, $nuevoAlto, $ancho, $alto);\n\n\t\t\t\t\t\timagepng($destino, $ruta);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$tabla = \"repuestos\";\n\n\t\t\t\t$datos = array(\"id_categoria\" => $_POST[\"editCategoria\"],\n\t\t\t\t\t\t\t \"codigo\" => $_POST[\"editCodigo\"],\n\t\t\t\t\t\t\t \"descripcion\" => $_POST[\"editDescripcion\"],\n\t\t\t\t\t\t\t \"stock\" => $_POST[\"editStock\"],\n\t\t\t\t\t\t\t \"precio_unidad\" => $_POST[\"editPrecioCompra\"],\n\t\t\t\t\t\t\t \"total_pagar\" => $_POST[\"editPrecioVenta\"],\n\t\t\t\t\t\t\t \"imagen\" => $ruta);\n\n\t\t\t\t$respuesta = ModeloProductos::mdlEditarRepuesto($tabla, $datos);\n\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t\t title: \"El producto ha sido editado correctamente\",\n\t\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El producto no puede ir con los campos vacíos o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"productos\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\t\t\t}\n\t\t}\n\n\t}", "function EDIT() {\n\t\t// se construye la sentencia de busqueda de la tupla en la bd\n\t\t$sql = \"SELECT * FROM ENTREGA WHERE (login = '$this->login' AND IdTrabajo = '$this->IdTrabajo')\";\n \n\t\t// Variable que almacena la sentencia sql\n\t\t$result = $this->mysqli->query( $sql );\n\t\t// si el numero de filas es igual a uno es que lo encuentra\n\t\tif ( $result->num_rows == 1 ) { // se construye la sentencia de modificacion en base a los atributos de la clase\n\t\t\t//Si la ruta no es vacia actualiza la entrega\n if($this->Ruta <> null){\n //Variable que almacena la sentencia sql\n\t\t\t\t$sql = \"UPDATE ENTREGA SET \n\t\t\t\t\tlogin = '$this->login',\n\t\t\t\t\t IdTrabajo='$this->IdTrabajo',\n Alias='$this->Alias',\n Horas='$this->Horas',\n Ruta='$this->Ruta'\n\t\t\t\tWHERE ( login = '$this->login' AND IdTrabajo = '$this->IdTrabajo'\n\t\t\t\t)\";//se construye la sentencia sql de modificacion\n\n }\n //Si la ruta es vacia\n else{\n //Variable que almacena la sentencia sql\n $sql = \"UPDATE ENTREGA SET \n\t\t\t\t\tlogin = '$this->login',\n\t\t\t\t\t IdTrabajo='$this->IdTrabajo',\n Alias='$this->Alias',\n Horas='$this->Horas'\n\t\t\t\tWHERE ( login = '$this->login' AND IdTrabajo = '$this->IdTrabajo'\n\t\t\t\t)\";//se construye la sentencia sql de modificacion\n \n }\n\t\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\n\t\t\tif ( !( $resultado = $this->mysqli->query( $sql ) ) ) {\n\t\t\t\treturn 'Error en la modificación';\n\t\t\t}\n \n // si no hay problemas con la modificación se indica que se ha modificado\n else { \n\t\t\t\treturn 'Modificado correctamente';\n\t\t\t}\n // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\n\t\t} else \n\t\t\treturn 'No existe en la base de datos';\n\t}", "public function Editar($idMotorista){\n $motorista = new Motorista();\n\n require_once('trata_imagem.php');\n\n // echo $idOnibus;\n\n // iniciado variaveis\n $diretorio_completo=Null;\n $MovUpload=false;\n $imagem_file=Null;\n $foto=\"nada\";\n\n //pegando a foto\n if (!empty($_FILES['imagem']['name'])) {\n $imagem_file = true;\n $diretorio_completo=salvarFoto($_FILES['imagem'],'arquivo');\n if ($diretorio_completo == \"Erro\") {\n $MovUpload=false;\n }else {\n $MovUpload=true;\n }\n }else {\n $imagem_file = false;\n }\n\n if ($imagem_file == true && $MovUpload==true) {\n $foto =$diretorio_completo;\n }else {\n $foto=\"nada\";\n }\n $motorista->id = $idMotorista;\n $motorista->imagem=$diretorio_completo;\n $motorista->imagem = $foto;\n $motorista->nome = $_POST['txtNome'];\n $motorista->email = $_POST['txtEmail'];\n $motorista->data_nasc = $_POST['txtDataNasc'];\n $motorista->sexo = $_POST['rdoSexo'];\n $motorista->telefone = $_POST['txtTelefone'];\n $motorista->celular = $_POST['txtCelular'];\n $motorista->cpf = $_POST['txtCPF'];\n $motorista->rg = $_POST['txtRG'];\n $motorista->cnh = $_POST['txtcnh'];\n $motorista->ativar = $_POST['chkAtivo'];\n if(isset($_POST['ativo'])){\n $motorista->ativo = '1';\n }else{\n $motorista->ativo = '0';\n }\n\n $motorista::Update($motorista);\n\n }", "public function Editar(){\n $ca = new Categoria();\n \n if(isset($_REQUEST['id'])){\n $ca = $this->model->Obtener($_REQUEST['id']);\n }\n \n require_once 'view/header.php';\n require_once 'view/categoria/editar.php';\n require_once 'view/footer.php';\n }", "public function presupuestoModificado(){\n $this->iPresupuestoModificado = $this->iPresupuestoInicial;\n $this->save();\n }", "public function modificacionLibro() {\n\t\t\t$idlibros = $this->input->post('idlibro'); \n\t\t\t$titulo = $this->input->post('titulo'); \n\t\t\t$precio = $this->input->post('precio'); \n\n\t\t\t//validar si datos informados\n\t\t\tif (empty($titulo) || empty($precio) || empty($idlibros)) {\n\t\t\t\t$respuesta = \"todos los datos son obligatorios\";\n\t\t\t} else {\n\t\t\t\t//llamar al modelo para la modificación\n\t\t\t\t$libro = $this->Libreria->modificaLibro($idlibros, $titulo, $precio);\n\t\t\t\t$datos['libro']=$libro;\n\t\t\t}\n\n\t\t\t//recuperar las secciones \n\t\t\t$datos = $this->cargarSecciones();\n\n\t\t\t//consulta al modelo para recuperar el array de libros\n\t\t\t$libros = $this->Libreria->consultaLibros();\n\t\t\t$datos['libros']=$libros;\n\t\t\t$respuesta=\"modificacion efectuada\";\n\t\t\t//cargamos la vista\n\t\t\t$datos['idlibros'] = $idlibros;\n\t\t\t$datos['titulo'] = $titulo;\n\t\t\t$datos['precio'] = $precio;\n\t\t\t$datos['respuesta'] = $respuesta;\n\t\t\t$this->load->view('modificacion', $datos);\n\n\t\t}", "function editar_link(){\t\t\n\t\t$this->accion=\"Editando Datos del Enlace\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\" && isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$this->asignar_valores();\n\t\t\t$sql=\"SELECT * FROM link WHERE nombre_cat='999999' AND id_cat!='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\tif($resultado=mysql_fetch_array($consulta)){\n\t\t\t\t$this->mensaje=1;\n\t\t\t}else{\n\t\t\t\t$sql=\"UPDATE link SET tipo_cat='$this->tipo', nombre_cat='$this->nombre', etiqueta_cat='$this->etiqueta', claves_cat='$this->claves', descripcion_cat='$this->descripcion', prioridad_cat='$this->prioridad',icono_cat='$this->icono' WHERE id_cat='$id'\";\n\t\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t\theader(\"location:/admin/link/\");\n\t\t\t}\n\t\t}else{\n\t\t $this->mostrar_link();\n\t\t}\n\t}", "public function editar()\n {\n if ( isset($_GET['recno']) && !empty($_GET['recno']) )\n {\n $SA1 = $this->objPDO->prepare('SELECT * FROM SA1010 WHERE R_E_C_N_O_ = :recno');\n $SA1->bindValue(':recno', $_GET['recno']);\n $SA1->execute();\n \n return $SA1->fetchAll();\n }\n else if ( isset($_POST['nome']) && !empty($_POST['nome']) )\n {\n $SA1 = $this->objPDO->prepare('UPDATE SA1010 SET A1_NOME = :nome, A1_NREDUZ = :nreduz, A1_MUN = :cidade WHERE R_E_C_N_O_ = :recno');\n $SA1->bindValue(':nome', $_POST['nome']);\n $SA1->bindValue(':nreduz', $_POST['nreduz']);\n $SA1->bindValue(':cidade', $_POST['cidade']);\n $SA1->bindValue(':recno', $_POST['recno']);\n $SA1->execute();\n }\n \n header('Location: /'); \n }", "public function edit()\n {\n \n \n }", "public function edita()\n\t {\t\n\t\t$car=$_REQUEST['car'];\n\t\t$per=$_REQUEST['per'];\n\t\t$logi=$_REQUEST['logi'];\n\t\t$pas=$_REQUEST['pas'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$user_data=array();\n\t\t$user_data['carnet']=$car;\n\t\t$user_data['login']=$logi;\n\t\t$user_data['password']=$pas;\n\t\t$user_data['estado']=$est;\n\t\t$user_data['observacion']=$obs;\n\t\t$user_data['perfil']=$per;\n\t\t\n\t\t//print_r($user_data);\n\t\t$usuario=new Usuarios;\n\t\t$usuario->edit($user_data);\n\t\t$data1=$usuario->lista();\n\t\t$this->principal();\n\t }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit(Postulado $postulado)\n {\n //\n }", "public function edit()\n {\n //\n }", "function EDIT(){\r\n $stmt = $this->db->prepare(\"UPDATE edificio SET\r\n nombre_edif = ?, telef_edif = ?, agrup_edificio = ?\r\n\t\t\t\t\tWHERE edificio_id = ?\");\r\n $resultado = $stmt->execute(array($this->nombre_edif, $this->telef_edif, $this->agrup_edificio,\r\n $this->edificio_id));\r\n\r\n if($resultado === true){\r\n return true;\r\n }else{\r\n return 'Error inesperado al intentar cumplir su solicitud de modificacion';\r\n }\r\n }", "public function atualizar(){\r\n return (new Database('atividades'))->update('id = '.$this->id,[\r\n 'titulo' => $this->titulo,\r\n 'descricao' => $this->descricao,\r\n 'ativo' => $this->ativo,\r\n 'data' => $this->data\r\n ]);\r\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "function update() {\r\n $exp_id = VAR3;\r\n $fil_id = VAR4;\r\n $seccion = VAR5;\r\n \r\n // Find ser_id\r\n $expediente = new tab_expediente ();\r\n $tab_expediente = $expediente->dbselectById($exp_id);\r\n $ser_id = $tab_expediente->getSer_id();\r\n \r\n // Tab_archivo\r\n $this->archivo = new tab_archivo();\r\n $row = $this->archivo->dbselectByField(\"fil_id\", $fil_id);\r\n $row = $row[0]; \r\n \r\n\r\n \r\n // Tab_doccorr\r\n $tab_doccorr = new Tab_doccorr();\r\n $sql = \"SELECT * \r\n FROM tab_doccorr \r\n WHERE fil_id='\" . $row->fil_id . \"'\";\r\n $doccorr = $tab_doccorr->dbSelectBySQL($sql);\r\n if($doccorr){\r\n $doccorr = $doccorr[0]; \r\n // Nur\r\n $hojas_ruta = new hojas_ruta();\r\n $this->registry->template->dco_id = $doccorr->dco_id;\r\n $this->registry->template->fil_cite = $hojas_ruta->obtenerSelect($doccorr->fil_cite);\r\n $seguimientos = new seguimientos();\r\n $this->registry->template->fil_nur_s = $seguimientos->obtenerSelect($doccorr->fil_nur_s);\r\n\r\n $this->registry->template->fil_nur = $doccorr->fil_nur;\r\n $this->registry->template->fil_asunto = $doccorr->fil_asunto;\r\n $this->registry->template->fil_sintesis = $doccorr->fil_sintesis;\r\n }else{\r\n // Nur\r\n $this->registry->template->dco_id = \"\";\r\n $this->registry->template->fil_cite = \"\";\r\n $this->registry->template->fil_nur_s = \"\";\r\n $this->registry->template->fil_nur = \"\";\r\n $this->registry->template->fil_asunto = \"\";\r\n $this->registry->template->fil_sintesis = \"\"; \r\n }\r\n// $this->registry->template->fil_nur = \"\";\r\n// $this->registry->template->fil_asunto = \"\";\r\n// $this->registry->template->fil_sintesis = \"\";\r\n// $this->registry->template->fil_cite = \"\";\r\n// $this->registry->template->fil_nur_s = \"\";\r\n \r\n \r\n\r\n\r\n // Tab_exparchivo\r\n $sql = \"SELECT * \r\n FROM tab_exparchivo \r\n WHERE fil_id='\" . $row->fil_id . \"'\";\r\n $exa_row = $this->archivo->dbSelectBySQL($sql);\r\n $exa_row = $exa_row[0];\r\n $this->registry->template->exp_id = $exp_id;\r\n $this->registry->template->tra_id = $exa_row->tra_id;\r\n $this->registry->template->cue_id = $exa_row->cue_id;\r\n $this->registry->template->exa_id = $exa_row->exa_id;\r\n \r\n $expediente = new expediente ();\r\n // Tab_archivo\r\n $this->registry->template->seccion = $seccion;\r\n $this->registry->template->fil_id = $fil_id;\r\n $this->registry->template->fil_codigo = $row->fil_codigo;\r\n $this->registry->template->fil_nro = $row->fil_nro;\r\n $this->registry->template->fil_titulo = $row->fil_titulo;\r\n $this->registry->template->fil_subtitulo = $row->fil_subtitulo;\r\n $this->registry->template->fil_fecha = $row->fil_fecha;\r\n $this->registry->template->fil_mes = $expediente->obtenerSelectMes($row->fil_mes);\r\n $this->registry->template->fil_anio = $expediente->obtenerSelectAnio($row->fil_anio); \r\n \r\n $idioma = new idioma (); \r\n $this->registry->template->idi_id = $idioma->obtenerSelect($row->idi_id);\r\n\r\n $this->registry->template->fil_proc = $row->fil_proc;\r\n $this->registry->template->fil_firma = $row->fil_firma;\r\n $this->registry->template->fil_cargo = $row->fil_cargo;\r\n // Include dynamic fields\r\n $expcampo = new expcampo();\r\n $this->registry->template->filcampo = $expcampo->obtenerSelectCampos($ser_id); \r\n $sopfisico = new sopfisico();\r\n $this->registry->template->sof_id = $sopfisico->obtenerSelect($row->sof_id);\r\n $this->registry->template->fil_nrofoj = $row->fil_nrofoj;\r\n $this->registry->template->fil_tomovol = $row->fil_tomovol;\r\n $this->registry->template->fil_nroejem = $row->fil_nroejem;\r\n $this->registry->template->fil_nrocaj = $row->fil_nrocaj;\r\n $this->registry->template->fil_sala = $row->fil_sala;\r\n $archivo = new archivo ();\r\n $this->registry->template->fil_estante = $archivo->obtenerSelectEstante($row->fil_estante);\r\n $this->registry->template->fil_cuerpo = $row->fil_cuerpo;\r\n $this->registry->template->fil_balda = $row->fil_balda;\r\n $this->registry->template->fil_tipoarch = $row->fil_tipoarch;\r\n $this->registry->template->fil_mrb = $row->fil_mrb;\r\n \r\n $this->registry->template->fil_ori = $row->fil_ori;\r\n $this->registry->template->fil_cop = $row->fil_cop;\r\n $this->registry->template->fil_fot = $row->fil_fot;\r\n \r\n $this->registry->template->fil_confidencilidad = $row->fil_confidencialidad;\r\n $this->registry->template->fil_obs = $row->fil_obs;\r\n \r\n $this->registry->template->required_archivo = \"\"; \r\n\r\n //palabras clave\r\n $palclave = new palclave();\r\n $this->registry->template->pac_nombre = $palclave->listaPC();\r\n $this->registry->template->fil_descripcion = $palclave->listaPCFile($row->fil_id);\r\n \r\n $arc = new archivo ();\r\n $this->registry->template->confidencialidad = $arc->loadConfidencialidad('1');\r\n $this->registry->template->PATH_WEB = PATH_WEB;\r\n $this->registry->template->PATH_DOMAIN = PATH_DOMAIN;\r\n $exp = new expediente ();\r\n if ($seccion == \"estrucDocumental\") {\r\n $this->registry->template->PATH_EVENT = \"update_save\";\r\n $this->registry->template->linkTree = $exp->linkTree($exp_id, $exa_row->tra_id, $exa_row->cue_id);\r\n } else {\r\n $this->registry->template->PATH_EVENT = \"update_saveReg\";\r\n $this->registry->template->linkTree = $exp->linkTreeReg($exp_id, $exa_row->tra_id, $exa_row->cue_id);\r\n }\r\n $this->menu = new menu ();\r\n $liMenu = $this->menu->imprimirMenu($seccion, $_SESSION ['USU_ID']);\r\n $this->registry->template->men_titulo = $liMenu;\r\n \r\n $this->registry->template->GRID_SW = \"true\";\r\n $this->registry->template->PATH_J = \"jquery-1.4.1\";\r\n $this->registry->template->tituloEstructura = $this->tituloEstructuraD;\r\n $this->registry->template->show('header');\r\n $this->registry->template->controller = $seccion;\r\n $this->llenaDatos(VAR3);\r\n $this->registry->template->show('regarchivo.tpl');\r\n }", "public function edit() {\n\n }", "public function actionEditPrecioUnitario()\r\n {\r\n Yii::import('booster.components.TbEditableSaver');\r\n $es = new TbEditableSaver('DetalleVenta');\r\n $es->scenario='update';\r\n// /$_cantidad= $es->value;\r\n $es->onBeforeUpdate= function($event) {\r\n\r\n $model=$this->loadModel(yii::app()->request->getParam('pk')); //obteniendo el Model de detalleCompra\r\n \r\n //incrementando el credito disponible para para el cliente\r\n Cliente::model()->actualizarCreditoDisponible($model, 0);\r\n \r\n $_precioUnitario= yii::app()->request->getParam('value');\r\n \r\n $_total= round($model->cantidad*$_precioUnitario,2);//calculando el subtotal\r\n $_subtotal= $_subtotal= Producto::model()->getSubtotal($_total); //round($_total/((int)Yii::app()->params['impuesto']*0.01+1),2); //calculando impuesto\r\n $_impuesto= round($_total-$_subtotal,2); //calculando total\r\n \r\n $event->sender->setAttribute('subtotal', $_subtotal);//Actualizando Cantidad\r\n $event->sender->setAttribute('impuesto', $_impuesto);//Actualizando impuesto\r\n $event->sender->setAttribute('total', $_total); //actualizando total\r\n \r\n };\r\n $es->onAfterUpdate=function($event){\r\n $model=$this->loadModel(yii::app()->request->getParam('pk'));\r\n //actualizando el credito disponible para el cliente.\r\n Cliente::model()->actualizarCreditoDisponible($model, 1);\r\n };\r\n \r\n $es->update();\r\n }", "public function editar(){\n $sql = \"UPDATE especialidad SET Especialidad = ? WHERE Id_Especialidad = ?;\";\n //preparando la consulta\n $query = $this->conexion->prepare($sql);\n //bindeando los parametros de la consulta prepar\n $query->bindParam(1, $this->especialidad);\n $query->bindParam(2, $this->id_especialidad);\n //ejecutando\n $result = $query->execute();\n //retornando true si se ejecuto, false si no\n return $result;\n }", "function modificarPartidaEjecucion(){\n\t\t$this->procedimiento='pre.ft_partida_ejecucion_ime';\n\t\t$this->transaccion='PRE_PAREJE_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_partida_ejecucion','id_partida_ejecucion','int4');\n\t\t$this->setParametro('id_int_comprobante','id_int_comprobante','int4');\n\t\t$this->setParametro('id_moneda','id_moneda','int4');\n\t\t$this->setParametro('id_presupuesto','id_presupuesto','int4');\n\t\t$this->setParametro('id_partida','id_partida','int4');\n\t\t$this->setParametro('nro_tramite','nro_tramite','varchar');\n\t\t$this->setParametro('tipo_cambio','tipo_cambio','numeric');\n\t\t$this->setParametro('columna_origen','columna_origen','varchar');\n\t\t$this->setParametro('tipo_movimiento','tipo_movimiento','varchar');\n\t\t$this->setParametro('id_partida_ejecucion_fk','id_partida_ejecucion_fk','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('fecha','fecha','date');\n\t\t$this->setParametro('monto_mb','monto_mb','numeric');\n\t\t$this->setParametro('monto','monto','numeric');\n\t\t$this->setParametro('valor_id_origen','valor_id_origen','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function EDIT()\n{\n\t//si los atributos estan comprobado\n\tif ($this->Comprobar_atributos() === true){\n\t$sql = \"SELECT * FROM CENTRO WHERE CODCENTRO= '$this->CODCENTRO'\";\n \n\n $result = $this->mysqli->query($sql);\n //actualizamos los datos\n //si se cumple la condicion\n if ($result->num_rows == 1) {\n\t\t$sql = \"UPDATE CENTRO \n\t\t\t\tSET \n\t\t\t\tCODCENTRO = '$this->CODCENTRO',\n\t\t\t\tCODEDIFICIO = '$this->CODEDIFICIO',\n\t\t\t\tNOMBRECENTRO = '$this->NOMBRECENTRO',\n\t\t\t\tDIRECCIONCENTRO = '$this->DIRECCIONCENTRO',\n\t\t\t\tRESPONSABLECENTRO = '$this->RESPONSABLECENTRO' \n\t\t\t\tWHERE \n\t\t\t\tCODCENTRO= '$this->CODCENTRO'\";\n\t\t//si se ha actualizado guardamos un mensaje de éxito en la variable resultado\n\t\t//si se cumple la condicion\n\t\tif ($this->mysqli->query($sql))\n\t\t{\n\t\t\t$resultado = 'Actualización realizada con éxito'; \n\t\t}\n\t\t//si no\n\t\telse//si no guardamos un mensaje de error en la variable resultado\n\t\t{\n\t\t\t$resultado = 'Error de gestor de base de datos';\n\t\t}\n\t\t\n\t}\n\n\t//si no\n\telse \n\t{\n\t\t$resultado = 'No existe en la base de datos';\n\t}\n\treturn $resultado;//devuelve el mensaje\n\t}//si no\n\telse{\n\t\treturn $this->erroresdatos;//devuelve el mensaje\n\t}\n}", "function editar_pelicula($peliActual){\n // leemos todas las pelis, y las volcamos al fichero menos la pasada como argumento\n\n $lesPelis=readPelis();\n\n // obrim el fitxer de pelis per a escriptura. \n $f = fopen(filePeliculas, \"w\");\n\n foreach($lesPelis as $peli){\n\n // guardem la peli llegida o l'actual, si és el cas\n if ($peli[\"id\"]==$peliActual[\"id\"]){\n $p=$peliActual;\n }\n else{\n $p=$peli;\n }\n\n //convertim $peli (array asociatiu) en array\n\n $valors_peli=array();\n foreach($p as $k=>$v){\n array_push($valors_peli,$v);\n }\n\n //escrivim al fitxer\n fputcsv($f,$valors_peli,\",\");\n\n }\n\n fclose($f);\n \n \n\n}", "function editar_plan2(){\t\n\t\tif (isset($_GET['valor']) && $_GET['valor']!=\"\" && isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$valor=$_GET['valor']; \n\t\t\t$back=$_GET['back'];\n\t\t\t\n\t\t\t$sql=\"UPDATE habitaciones2 SET listar='$valor' WHERE id='$id'\";\n\t\t\t//echo \"Entro: \".$sql;\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\t\n\t\t\t//if($valor==1)\n\t\t\t\t//$this->enviar_correos2($id);\n\t\t\theader(\"location: /admin/producto/detalle.php?id=$back#next\");\n\t\t}\n\t}", "abstract protected function renderEdit();", "public function edit(ResultAtividade $resultAtividade)\n {\n //\n }", "function editar_anuncio(Anuncio $anuncioEdita){\n global $mybd;\n\t\t$STH = $mybd->DBH->prepare(\"Update anuncio Set anu_titulo=:ti,anu_descricao=:de,anu_morada=:mo,anu_email=:em,anu_estado=:es,anu_telefone=:te,anu_codigopostal=:co,anu_wcprivativo=:wc,anu_mobilada=:mob,anu_utensilios=:ut,anu_despesas=:des,anu_animais=:ani,anu_latitude=:la,anu_longitude=:lo,anu_preco=:pre,anu_internet=:inte,anu_rapazes=:rap,anu_raparigas=:ra,anu_disponibilidade=:di Where anu_id=:an;\");\n if(!$STH->execute($anuncioEdita->to_array_com_id()))return false;\n return true;//\n }", "public function edit(Prueva $prueva)\n {\n //\n }" ]
[ "0.7405901", "0.7074608", "0.6548474", "0.6481434", "0.64493936", "0.6429536", "0.6424435", "0.64093924", "0.6399432", "0.63721234", "0.6363312", "0.63542366", "0.62935376", "0.6282681", "0.6257702", "0.6234157", "0.6221439", "0.62150127", "0.6208706", "0.6208135", "0.6188598", "0.6169752", "0.6155675", "0.6151192", "0.61430484", "0.6137919", "0.61215156", "0.6119933", "0.611951", "0.6115672", "0.6115672", "0.61064833", "0.60969675", "0.60827255", "0.6068884", "0.60598457", "0.605542", "0.605542", "0.605542", "0.60479575", "0.60479575", "0.60479575", "0.6041964", "0.6023498", "0.6022295", "0.6020015", "0.6015547", "0.6014291", "0.6006134", "0.6005737", "0.60002285", "0.59997195", "0.59994066", "0.5998722", "0.5993787", "0.59917927", "0.5980519", "0.5980254", "0.59785753", "0.5976069", "0.5975008", "0.5973689", "0.5973272", "0.5972865", "0.5970084", "0.5967052", "0.59529895", "0.5950596", "0.5947029", "0.59403074", "0.59403074", "0.59403074", "0.59403074", "0.59403074", "0.59403074", "0.59403074", "0.59403074", "0.59403074", "0.59403074", "0.59403074", "0.59403074", "0.5938832", "0.5938361", "0.59365743", "0.59363353", "0.5923371", "0.5923371", "0.5923371", "0.5923371", "0.59194154", "0.5914744", "0.5911991", "0.5904902", "0.5900742", "0.59004134", "0.58980614", "0.5897219", "0.5895391", "0.5895091", "0.58873075", "0.58804506" ]
0.0
-1
FUNCION PARA ELIMINAR APODERADO
public function delete($id) { $sql = "DELETE FROM Apoderados WHERE idApoderado = ?"; return $this->$mysqli->delete($sql, $id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function obtener()\n {\n }", "public function AggiornaPrezzi(){\n\t}", "public function Executar()\r\n {\r\n require_once RAIZ.'/Module/Application/View/HTML/Pecas/Detalhes.php';\r\n }", "public function elso()\n {\n }", "function cl_procprocessodoc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"procprocessodoc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function masodik()\n {\n }", "function cl_aguacoletorexporta() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacoletorexporta\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function mostra(){\n }", "public function metodo_publico() {\n }", "abstract function ActualizarDatos();", "public function pasaje_abonado();", "function cl_evolucaodividaativa() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"evolucaodividaativa\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_pcorcamfornelic() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"pcorcamfornelic\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_ouvidoriaatendimento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ouvidoriaatendimento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_moblevantamentoedi() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"moblevantamentoedi\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_diario() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"diario\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_pesdiver() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"pesdiver\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_itinerarioescolaproc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"itinerarioescolaproc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "function cl_tfd_situacaopedidotfd() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_situacaopedidotfd\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_criterioavaliacaodisciplina() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"criterioavaliacaodisciplina\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conplanoconplanoorcamento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanoconplanoorcamento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_bensetiquetaimpressa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"bensetiquetaimpressa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_sau_receitamedica() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_receitamedica\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function helper()\n\t{\n\t\n\t}", "function cl_empreendimento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empreendimento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conplanoorcamento() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanoorcamento\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "function hydrate() : void;", "function cl_rhfolhapagamento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhfolhapagamento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function __construct(){\n $this->pegaProjetos();\n }", "function cl_clientesmodulosproc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"clientesmodulosproc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function custom()\n\t{\n\t}", "function cl_moblevantamento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"moblevantamento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function d3jspie_generateur_autoriser(){}", "function cl_parametroprogressaoparcial() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"parametroprogressaoparcial\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_disbancoprocesso() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"disbancoprocesso\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function publicaciones() //Lleva ID del proveedor para hacer carga de BD\r\n\t{\r\n\t\t//Paso a ser totalmente otro modulo para generar mejor el proceso de visualizacion y carga de datos en la vistas\r\n\r\n\t}", "function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}", "function cl_conarquivospad() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conarquivospad\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_ensino() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ensino\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function catalogos() \n\t{\n\t}", "function cl_rhempenhofolharubrica() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhempenhofolharubrica\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_empage() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empage\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_avaliacaoestruturanota() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"avaliacaoestruturanota\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_far_listacontroladomed() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"far_listacontroladomed\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function archobjet_autoriser() {\n}", "function cl_aguacorte() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacorte\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_escrito() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"escrito\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_contacorrenteregravinculo() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"contacorrenteregravinculo\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_tfd_bpamagnetico() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tfd_bpamagnetico\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_ossoario() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"ossoario\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_liccomissao() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"liccomissao\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_condicionante() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"condicionante\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_sau_agendaexames() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function Documentos()\r\n\t\t{\r\n\t\t\t\r\n\t\t}", "public function buscar($objeto){\r\n\t}", "public function contrato()\r\n\t{\r\n\t}", "public function hacer(){\n // renderizamos vista\n require_once 'views/pedido/hacer.php';\n }", "function cl_rhdirfgeracao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhdirfgeracao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function Executar() : void\n {\n include RAIZ.'/Module/Application/View/HTML/Layout/Elemento/Vendedor.php';\n }", "function cl_sau_agendaexames() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function __CONSTRUCT(){\n //parent del constructor\n parent::__CONSTRUCT();\n //se carga la base de datos asignada en database.php\n $this->load->database();\n }", "public function crear()\n {\n //\n }", "function extenderPGAE()\n {\n $this->objFunc = $this->create('MODObligacionPago');\n $this->res = $this->objFunc->extenderPGAE($this->objParam);\n $this->res->imprimirRespuesta($this->res->generarJson());\n }", "public static function metodo_estatico () {\n }", "function cl_rhemitecontracheque() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhemitecontracheque\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_sau_triagemavulsa() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_triagemavulsa\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "abstract protected function external();", "abstract protected function data();", "public function nadar()\n {\n }", "function cl_rhsolicita() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhsolicita\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_aguacalc() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"aguacalc\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_empagemovslips() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empagemovslips\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_reconhecimentocontabil() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"reconhecimentocontabil\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "private function metodo_privado() {\n }", "function cl_rhgeracaofolhaarquivo() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhgeracaofolhaarquivo\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_conplanosis() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"conplanosis\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_tipovistoriasrec() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tipovistoriasrec\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_alunoaltcampos() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"alunoaltcampos\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function cl_escolabase() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"escolabase\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"].\"?ed77_i_escola=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_escola\"].\"&ed18_c_nome=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed18_c_nome\"].\"&ed31_c_descr=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed31_c_descr\"].\"&ed77_i_base=\".@$GLOBALS[\"HTTP_POST_VARS\"][\"ed77_i_base\"]);\n }", "function crearPlantilla($datos);", "function cl_db_projetoscliente() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"db_projetoscliente\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function serch()\n {\n }", "public function __construct() {\n $this->ambilData();\n }", "function cl_iptuconstr() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"iptuconstr\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function alimentar()\n {\n }", "function cl_rhestagio() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhestagio\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function get_data()\n {\n\n\n }", "public function retorno(){\n\n $cod_pedido = $_REQUEST[\"cod_pedido\"];\n $sacarDatosPedido = (new Orm)->sacarDatosPedidoPasarela($cod_pedido);\n $data=0;\n echo Ti::render(\"view/pedido.phtml\", compact( \"sacarDatosPedido\", \"data\",\"cod_pedido\"));\n\n }", "function public_load() {\n\n\t}", "function cl_cemiteriorural() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"cemiteriorural\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function obtener_plantilla_controlador(){\r\n\t\t\treturn require_once \"./vistas/plantilla.php\";\r\n\t\t}", "function ambas()\n {\n print \"Ejecución de la función ambas<br>\";\n # mediante $this-> requerimos la ejecución de metodo prueba\n # de la clase actual\n $this->prueba();\n # al señalar parent:: requerimos la ejecución de metodo prueba\n # de la clase padre\n parent::prueba();\n }", "public function extras(Request $request, Response $response, $args)\n{\n //Variables\n $datin=Array();\n /*validando los argumentos que recibimos*/\n if(isset($args['idPadre'])) $idPadre = $args['idPadre'];\n if(isset($args['idContenido'])) $idContenido = $args['idContenido'];\n if(isset($args['idHijo'])) $idHijo = $args['idHijo'];\n \n $servicio=\"extras\";\n $tituloservicio=\"EXTRAS\";\n $datin=MunlimaControlador::plantillaUno($args,$servicio,$tituloservicio);\n\n $this->view->render($response, \"weblima/extras.twig\", $datin);\n return $response;\n}", "public function atencion(Request $request, Response $response, $args)\n{\n //Variables\n $datin=Array();\n /*validando los argumentos que recibimos*/\n if(isset($args['idPadre'])) $idPadre = $args['idPadre'];\n if(isset($args['idContenido'])) $idContenido = $args['idContenido'];\n if(isset($args['idHijo'])) $idHijo = $args['idHijo'];\n \n $servicio=\"atencion\";\n $tituloservicio=\"ATENCIÓN AL CIUDADANO\";\n $datin=MunlimaControlador::plantillaUno($args,$servicio,$tituloservicio);\n\n $this->view->render($response, \"weblima/extras.twig\", $datin);\n return $response;\n}", "function cl_bomov() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"bomov\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "function aggiungiAllegato($pratica,$documento){\n \n}", "function cl_alunos() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"alunos\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function __invoke()\n {\n //$data = [\"listeproduit\"=>config(\"app.listeproduit\")];\n $db = Produit::query()->select(\"nom\",'image','quantite','id')->get();// au lieu de \"Produit::all()\" pour pouvoir choisir quelle donne envoyé\n $tableaffichage=[]; //pour avoir un tableau vide pour pourvoir stocker des string et non des objets\n foreach($db as $yuumi){\n\n array_push($tableaffichage, $yuumi->getAttributes());//insere la valeur dans le tableau\n }\n return view('liste',[\"db\"=>$db]);//[\"db\"=>$db] tableau associatif pour pouvoir lui donner un nom et l'appeler dans le blade\n }", "function metodo() {\n // Funcion normal\n }" ]
[ "0.6219671", "0.61607575", "0.6137537", "0.6084427", "0.60750043", "0.6065209", "0.60042304", "0.59898716", "0.5988402", "0.5987645", "0.59820974", "0.5970289", "0.59498996", "0.5920213", "0.5918455", "0.5915346", "0.59130734", "0.5905342", "0.5896992", "0.5869345", "0.5832563", "0.58263296", "0.58080274", "0.5805045", "0.57989943", "0.5795112", "0.5794413", "0.5792945", "0.579177", "0.5771226", "0.5755535", "0.5754065", "0.5750721", "0.57388765", "0.57349753", "0.57305974", "0.57287604", "0.5715399", "0.5708907", "0.5690799", "0.56885225", "0.56801784", "0.56796515", "0.5676772", "0.56750697", "0.5674129", "0.5671845", "0.5665006", "0.5664241", "0.56613463", "0.56548184", "0.5650295", "0.56481373", "0.56468433", "0.5645439", "0.5640275", "0.5636667", "0.56362224", "0.5632625", "0.5629156", "0.5628385", "0.5624587", "0.5620463", "0.56193644", "0.56141573", "0.56046224", "0.5602843", "0.5602338", "0.5597914", "0.5596756", "0.5596495", "0.55893385", "0.5578216", "0.55776757", "0.55708486", "0.5570143", "0.5563416", "0.5562975", "0.55562", "0.5555763", "0.5550019", "0.5549504", "0.55486476", "0.5545655", "0.5542522", "0.55402815", "0.5539275", "0.5529469", "0.5527119", "0.55270994", "0.5525369", "0.5524679", "0.5523926", "0.5517106", "0.5515483", "0.551508", "0.5514067", "0.5512868", "0.55108774", "0.5489251", "0.54878503" ]
0.0
-1
FUNCION PARA LOGEARSE CON USUARIO APODERADO
public function logeo($userApoderado, $passApoderado) { $sql = "CALL SP_APODERADOS_SELECT_LOGIN(?,?)"; $conn = $this->mysqli->open(); $stmt = $conn->prepare($sql); $stmt->bind_param('ss', $userApoderado, $passApoderado); $result = $this->mysqli->search($stmt); $conn->close(); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loginprofesor_post() //INICIAR SESION = http://localhost/foxweb/Api/login\n {\n $matricula = $this->post('matricula');\n $password = $this->post('password');\n $type = $this->post('type');\n\n $datauser = $this->ApiModel->flogin($matricula, $password, $type);\n\n if ($datauser != false) {\n foreach ($datauser as $data) {\n $matricula = $data['matricula'];\n $nombre = $data['nombre'];\n $apellidos = $data['apellidos'];\n }\n\n $response = ['error' => false, 'status' => parent::HTTP_OK, \"matricula\" => $matricula, \"nombre\" => $nombre, \"apellidos\" => $apellidos];\n\n $this->response($response, parent::HTTP_OK);\n\n } else {\n\n $response = ['error' => true,'status' => parent::HTTP_NOT_FOUND, 'msg' => 'Usuario o Contraseña Invalidos!'];\n\n $this->response($response, parent::HTTP_NOT_FOUND);\n\n }\n }", "public function telaCadastroUsuario():void {\n $session =(Session::get('USER_AUTH'));\n if (!isset($session)) {\n $this->view('Home/login_viewer.php');\n }\n elseif ((int) Session::get('USER_ID')!==1) {\n Url::redirect(SELF::PAINEL_USUARIO);\n }\n else {\n $this->cabecalhoSistema();\n $this->view('Administrador/usuario/formulario_cadastro_usuario_viewer.php');\n $this->rodapeSistema();\n }\n }", "public function loginalumno_post() //INICIAR SESION = http://localhost/foxweb/Api/login\n {\n $matricula = $this->post('matricula');\n $password = $this->post('password');\n $type = $this->post('type');\n\n $datauser = $this->ApiModel->flogin($matricula, $password, $type);\n\n if ($datauser != false) {\n foreach ($datauser as $data) {\n $matricula = $data['matricula'];\n $nombre = $data['nombre'];\n $apellidos = $data['apellidos'];\n $num_grupo = $data['num_grupo'];\n }\n\n $response = ['error' => false, 'status' => parent::HTTP_OK, \"matricula\" => $matricula, \"nombre\" => $nombre, \"apellidos\" => $apellidos, \"num_grupo\" => $num_grupo];\n\n $this->response($response, parent::HTTP_OK);\n\n } else {\n\n $response = ['error' => true,'status' => parent::HTTP_NOT_FOUND, 'msg' => 'Usuario o Contraseña Invalidos!'];\n\n $this->response($response, parent::HTTP_NOT_FOUND);\n\n }\n }", "public function logar()\n {\n if ($this->checkPost()) { \n $usuario = new \\App\\Model\\Usuario;\n $usuario->setLogin($this->post['usuario']);\n $usuario->setSenha($this->post['senha']);\n $usuario->authDb();\n redirect(DEFAULTCONTROLLER.'\\logado');\n } else {\n redirect(DEFAULTCONTROLLER);\n }\n }", "public static function connect() {\n if (isset($_SESSION['login'])) {\n $type = \"Vous êtes déjà connecté\";\n $dataView = ControllerView::prepMenu();\n require_once File::build_path(array('view', 'erreur.php'));\n } else {\n $pagetitle = 'Authentification';\n $view = 'connect';\n $connexionErreur = \"\";\n $dataView = ControllerView::prepMenu();\n require File::build_path(array('view', 'view.php'));\n }\n }", "function post_conectar()\n\t{\n\t\t//En este metodo antiguamente se incluia codigo para asegurarse que el esquema de auditoria\n\t\t//guardara el usuario conectado.\n\t}", "public function iniciarSesion() {\n require_once 'views/usuarios/login.php';\n }", "public function connexionIntervenantLogin(){\n }", "public function ctrTraerLogin(){\n /*include Se utiliza para cargar codigo proveniente desde otros archivos. */\n \n include \"vistas/login.php\";\n \n }", "public function loginFreelanceBoutique() {\n $this->execGET('https://freelance.boutique/user/auth/login');\n //initial request for auth from freelance.ru\n $this->execGET('https://freelance.boutique/user/auth/freelanceru');\n }", "public function recibirdatos() {\n\t\t$passSha1 = sha1($this->input->post('password'));\n\t\t$datos = array(\n\t\t\t'usuario' => $this->input->post('usuario'),\n\t\t\t'password' => $passSha1\n\t\t\t);\n\t\t//Llamamos al modelo, Si la autentificacion es correcta damos paso a la aplicacion y sino devolvemos al login\n\t\tif($this->login_model->obtenerPass($datos) == true){\n\t\t\t//Cargamos la pagina principal\n\t\t\t$this->session->set_userdata('usuario', $datos['usuario']);\n\t\t\t//Llamamos a la clase que realiza los test de caja blanca\n\t\t\t$this->testCajaBlanca($datos);\n\t\t\t$this->mostrarDatosUser();\n\t\t\t$this->session->set_userdata('Token', true);\n\t\t}else{\n\t\t\t$this->load->view('login');\n\t\t}\n\t}", "public function verRedThinkClientEnPizarra( ) {\n $this->setComando(self::$PIZARRA_DIGITAL, \"THINK_CLIENT\");\n\n }", "public function aprobarOrdenCambio() {\n\t\t//$post_data = $this->input->post(NULL, TRUE);\n\t\t$this->output->set_content_type('application/json');\n\t\t$post_data = json_decode(file_get_contents(\"php://input\"), true);\n \tif($post_data!=null){\n\t\t\t$result['cambios'] = $this->m_proyecto->aprobarOrdenCambioCliente($post_data);\n\t\t\t$this->enviarNotificacionAdmins($post_data, 1);\n\t\t\tdie(json_encode($result));\n \t}\n\t}", "public function login()\n {\n $this->vista->index();\n }", "function startupHandler($param)\n {\n if (true) {\n $app = $param['source']->getApplication();\n $app->removeStyle('common/static/common.css');\n $app->addStyle('/static/tuit.css');\n\n $session_id = $_COOKIE['sessionid'];\n \n $ch = curl_init();\n $server_host = $_SERVER['SERVER_ADDR'];\n $browser_host = $_SERVER['HTTP_HOST'];\n $request_uri = $_SERVER['REQUEST_URI'];\n $server_port = $_SERVER['SERVER_PORT'];\n //\tmessage($_SERVER);\n $port_part = ($server_port != 80)?\":$server_port\":\"\";\n $port_part=\"\";\n\t \n\t \n\t //echo \"http://\" .$server_host . $port_part.\"/tuit/account/session/\";\n\t \t \n curl_setopt($ch, CURLOPT_URL, \"http://\" .$server_host . $port_part.\"/tuit/account/session/\");\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_COOKIE, \"sessionid=$session_id\");\n $res = curl_exec($ch);\n $info = curl_getinfo($ch);\n curl_close($ch);\n //message($_SERVER);\n\t //print_r($info);\n\t \n if ($res !== false) {\n\t \n $msg = json_decode($res);\n //message($msg);\n \n if ($msg != null && strlen($msg->username)) {\n $vg = property::get('loginTuit.viewGroup');\n $eg = property::get('loginTuit.editGroup');\n $ag = property::get('loginTuit.adminGroup');\n $can_view=$can_edit=$can_admin=0;\n if ($vg == '' || in_array($vg, $msg->groups)) {\n $can_view = 1;\n }\n if ($eg == '' || in_array($eg, $msg->groups)) {\n $can_edit = 1;\n }\n if ($ag == '' || in_array($ag, $msg->groups)) {\n $can_admin = 1;\n }\n \n //message(\"view: $can_view, edit: $can_edit, admin: $can_admin\");\n \n ciUser::setUser($msg->username,$msg->first_name . \" \" . $msg->last_name, $msg->email, $can_view, $can_edit, $can_admin);\n $param['source']->addContent('main_menu_pre',sprintf(\"<ul class='user_info'><li class='username'><a href='/tuit/account/%s'>%s - %s</a></li>\\n<li class='logout_button'><a href='/tuit/account/logout'>\"._(\"Log out\").\"</a></li></ul>\\n\",\n ciUser::$_me->username,\n ciUser::$_me->username,\n ciUser::$_me->fullname));\n \n return;\n }\n \n /* message(\"Status: \" . $info['http_code']);\n message(\"Got back \" . strlen($res) . \" characters of information\");\n message(\"Output from session query: \" . $res);\n */\n \n }\n util::redirect(\"http://\" .$browser_host .\"/tuit/account/login/?next=\" . urlencode($request_uri));\n\n }\n else {\n \n $username = $_SERVER['REMOTE_USER'];\t\n if($username) {\n ciUser::loginUser($username);\n }\n }\n \n \n }", "public function actionLogon()\r\n {\r\n// TODO: à étudier\r\n// redirection vers l'url de connexion ?\r\n// affichage direct du formulaire indiqué dans la config puis die() ?\r\n// appelle de l'action showLoginForm d'un module ?\r\n// $template=Config::get('user.loginform'); // plutôt l'url vers laquelle il faut aller ?\r\n// Routing::redirect()\r\n }", "public function login(){\n include \"app/views/nutricionista/login.php\";\n }", "private function login(){\n \n }", "protected function login()\n {\n $this->send(Response::nick($this->config['nick']));\n $this->send(Response::user(\n $this->config['nick'],\n $this->config['hostname'],\n $this->config['servername'],\n $this->config['realname']\n ));\n }", "public function index() {\r\n self::acceso();\r\n $this->view->ver('login.php'); \r\n }", "public function access()\n\t{\n\t\t// validamos que sea una peticion por post\n\t\t$this->__post();\n\t\t// validamos que existan los campos\n\t\t$errors = $this->validate( $_POST, [\n\t\t\t'username|usuario' => 'required',\n\t\t\t'password|contraseña' => 'required',\n\t\t] );\n\n\t\tif( $errors )\n\t\t{\n\t\t\techo $this->errors();\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// enviamos peticion al modelo para que inicie la sesion\n\t\t$login = $this->auth->login( $_POST['username'], $_POST['password'] );\n\t\t// explotamos el resultado\n\t\t$login = explode(\"|\", $login);\n\t\t// validamos si se logueo o no\n\t\tif( $login[0] != 'logueado' )\n\t\t{\n\t\t\t// agregamos a las variables de error la respuesta del servidor\n\t\t\tarray_push($this->errors, $login[0]);\n\t\t\t// agregamos los errores obtenidos desde la peticion hecha al model\n\t\t\techo $this->errors();\n\t\t\treturn;\n\t\t}\n\t\t// retornamos a la vista de acceso cuando se satisfatorio el logueo\n\t\techo \"true|\".$login[1];\n\t}", "public function procesarLogin()\n {\n global $URL_PATH;\n\n $usuario = new Usuario;\n $usuario->login_usu = strtolower(sanitizar($_REQUEST[\"cliente\"]));\n $usuario->password = password_hash($_REQUEST[\"password\"], PASSWORD_DEFAULT);\n $usuario->email = sanitizar($_REQUEST[\"email\"]);\n $usuario->direccion = sanitizar($_REQUEST[\"direccion\"]);\n\n $totalArticulos =(new Orm)->sumaTotalArticulos(session_id());\n $sumaTotal =$totalArticulos->suma;\n\n (new Orm)->insertarUsuario($usuario);\n \n $_SESSION['login'] = $usuario->login_usu;\n $cesta = (new Orm)->sacarProductosDeUnCliente(session_id());\n (new Orm)->guardarPedido($_SESSION['login']);\n $id_pedido = (new Orm)->idPedido($_SESSION['login']);\n\n //sacamos la id y la cantidad de la cesta uno a uno y lo vamos insertando en la tabla de producto que ha comprado el cliente.\n foreach($cesta as $sacarProductos){\n (new Orm)->guardarProductos($id_pedido[\"id\"],$sacarProductos->id_producto,$sacarProductos->cantidad);\n }\n sleep(3);\n $cod_comercio = 2222;\n $cod_pedido = $id_pedido[\"id\"];\n $concepto = \"Mercadito Plaza Turia\";\n header(\"Location: http://localhost/pasarela/index.php?cod_comercio=$cod_comercio&cod_pedido=$cod_pedido&importe=$sumaTotal&concepto=$concepto\");\n \n }", "public function please_login()\n {\n echo json_encode(array(\"status\"=>\"success\", \"msg\"=>\"Naaaa\"));\n die();\n }", "private function loginToWigle() {\n\t\t$this->sendCurlRequest(self::WIGLE_LOGIN_URL,array(\"credential_0\"=>$this->user,\"credential_1\"=>$this->password));\n }", "public function Login($parametros) {\n $helper = HelperFactory::getInstance('auth');\n\n //manda o login para o authHelper\n $helper->setUser($parametros['txt_login']);\n\n //manda a senha para o authHelper\n $helper->setPass($parametros['txt_senha']);\n\n //chama o metodo login\n $helper->login();\n }", "public function correu(){\n echo \" correu !\";\n }", "public function enviarNuestroSonido( ) {\n $cmd = new ComandoFlash(\"VIDEOCONFERENCIA\",\"NUESTRO_SONIDO\",$this->getNuestroSonido());\n $this->enviarPeticion($cmd->getComando());\n\n }", "private function _login(){\r\n\r\n // It will always be called via ajax so we will respond as such\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n try {\r\n\r\n\r\n $username = $_POST['username'];\r\n $password = $_POST['password'];\r\n\r\n $path = ROOT.'/site/config/auth.txt';\r\n $adapter = new AuthAdapter($path,\r\n 'MRZPN',\r\n $username,\r\n $password);\r\n\r\n //$result = $adapter->authenticate($username, $password);\r\n\r\n $auth = new AuthenticationService();\r\n $result = $auth->authenticate($adapter);\r\n\r\n\r\n if(!$result->isValid()){\r\n $result->error = \"Incorrect username and password combination!\";\r\n /*\r\n foreach ($result->getMessages() as $message) {\r\n $result->error = \"$message\\n\";\r\n }\r\n */\r\n } else {\r\n $response = 200;\r\n $result->url = WEBROOT;\r\n }\r\n\r\n\r\n\r\n } catch (Exception $e) {\r\n $result->error = $e->getMessage();\r\n }\r\n\r\n }\r\n\r\n // Return the response\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n }", "public function auth()\n\t{\n\t\t$r = $this->do_auth();\n\t\t$x['status'] = $r;\n\t\techo json_encode($x);die;\n\t}", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "private function aim_login()\r\n\t{\r\n\t\tfwrite($this->resource, \"FLAPON\\r\\n\\r\\n\");\r\n\t\tfread($this->resource, 10);\r\n\r\n\t\tmt_srand((double)microtime() * 1000000);\r\n\t\t$this->count = (int)mt_rand(1, 10000);\r\n\r\n\t\t$signon_data = pack(\"Nnna\" . strlen($this->user['screenname']), 1, 1, strlen($this->user['screenname']), $this->user['screenname']);\r\n\t\t$msg = pack(\"aCnn\", '*', 1, $this->count, strlen($signon_data)) . $signon_data;\r\n\t\tif ($this->user['debug']) $this->aim_debug($msg, AIM_SENT);\r\n\t\tfwrite($this->resource, $msg);\r\n\t\tunset($signon_data, $msg);\r\n\t\t$this->count++;\r\n\r\n // TOC2 signon method\r\n $this->aim_send_raw(sprintf('toc2_signon %s %s %s %s %s TAC %s',\r\n $this->conn['auth_serv'], $this->conn['auth_port'], $this->user['screenname'], $this->aim_roast_pass($this->user['password']),\r\n $this->conn['language'], $this->aim_toc2_hash($this->user['screenname'], $this->user['password'])));\r\n\r\n\t\tsleep(1);\r\n\r\n\t\ttry {\r\n\t\t\tif ($this->aim_connected()) {\r\n\t\t\t\t$this->aim_recv();\r\n\t\t\t\t$this->utilities->aim_set_info(\"Powered by <a href=\\\"http://projects.evilwalrus.com/andrew/TAC/manual/\\\">TAC</a> - (PHP \" . phpversion() . \"/\" . PHP_OS . \")<br><br>CVS: \" . $this->user['revision']);\r\n\t\t\t\t$this->buddy->aim_add_buddy($this->user['screenname']);\r\n\t\t\t\t$this->aim_send_raw('toc_init_done');\r\n $this->buddy->aim_list_mode(LIST_PERMIT_ALL);\r\n\t\t\t\t$this->user['timer'] = time();\r\n\t\t\t} \r\n\t\t} catch (TACException $ex) {\r\n\t\t\t$ex->display();\r\n\t\t} \r\n\t}", "private function conectar(){\n try{\n\t\t\t$this->conexion = Conexion::abrirConexion(); /*inicializa la variable conexion, llamando el metodo abrirConexion(); de la clase Conexion por medio de una instancia*/\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie($e->getMessage()); /*Si la conexion no se establece se cortara el flujo enviando un mensaje con el error*/\n\t\t}\n }", "function mostrar_inventario()\r\n { \r\n \r\n $data['sistema'] = $this->sistema;\r\n if($this->acceso(25)){\r\n //**************** inicio contenido ***************\r\n\t\t\r\n $parametro = $this->input->post(\"parametro\");\r\n if ($parametro==\"\" || $parametro==null)\r\n $resultado = $this->Inventario_model->get_inventario(); \r\n else\r\n $resultado = $this->Inventario_model->get_inventario_parametro($parametro);\r\n \r\n echo json_encode($resultado); \r\n\t\t\r\n //**************** fin contenido ***************\r\n\t\t\t}\r\n\t\t\t\r\n }", "public function rechazarOrdenCambio() {\n\t\t//$post_data = $this->input->post(NULL, TRUE);\n\t\t$this->output->set_content_type('application/json');\n\t\t$post_data = json_decode(file_get_contents(\"php://input\"), true);\n \tif($post_data!=null){\n\t\t\t$result['cambios'] = $this->m_proyecto->rechazarOrdenCambioCliente($post_data);\n\t\t\t$this->enviarNotificacionAdmins($post_data, 2);\n\t\t\tdie(json_encode($result));\n \t}\n }", "public function login();", "public function login();", "function formConnexion() {\n\t\tif (isset($_SESSION['id'])) {\n\t\t\theader(\"Location: ?module=accueil\");\n\t\t\texit();\n\t\t}\n\t\telse\n\t\t\t$this -> vue -> afficheConnexion('');\n\t}", "function login($usuario, $password) {\r\n$integrator = ZendExt_IoC::getInstance();\r\nreturn $integrator->getInstance()->seguridad->AutenticarUsuarioApi($usuario,$password);\r\n}", "public function run()\n\t{\n\t\t$respuesta=new \\stdClass();\n $error = \"\";\n\t\t$error.= (!isset($_GET['callback'])) ? \"{ Error de Callback } \" : \"\";\n\t\tif ($error == \"\") {\n \t$callback=$_GET['callback'];\n \n $modeUsuario =new Usuario000101();\n\t\t\t$modeUsuario->id_usuario = 1;\n \n\t\t\t$modeUsuario->primer_nombre_usuario = \"admin\";\n \n\t\t\t$modeUsuario->segundo_nombre_usuario = \"admin\";\n \n\t\t\t$modeUsuario->apellido_paterno_usuario = \"admin\";\n \n\t\t\t$modeUsuario->apellido_materno_usuario = \"admin\";\n \n\t\t\t$modeUsuario->codigo_usuario = \"admin\";\n \n\t\t\t$modeUsuario->login_usuario = \"admin\";\n \n\t\t\t$modeUsuario->contrasena_usuario = sha1(\"admin\");\n \n\t\t\t$modeUsuario->fecha_nacimiento_usuario=date(\"Y-m-d\");\n \n\t\t\t$modeUsuario->sexo_usuario = \"m\";\n \n\t\t\t$modeUsuario->telefono_usuario = \"admin\";\n \n\t\t\t$modeUsuario->celular_usuario = \"admin\";\n \n\t\t\t$modeUsuario->correo_usuario = \"admin\";\n \n\t\t\t$modeUsuario->direccion_usuario = \"admin\";\n \n\t\t\t$modeUsuario->imagen_usuario = \"admin\";\n \n\t\t\t$modeUsuario->observaciones_usuario = \"admin\";\n \n\t\t\t$modeUsuario->acceso_ip_usuario = \"\";\n \n\t\t\t$modeUsuario->fecha_creacion_usuario=date(\"Y-m-d\");\n \n\n\t\t\t$modeUsuario->save();\n\t\t\t\n\t\t\t$modeUsuarioTipo = new UsuarioTipo000201();\n\t\t\t$modeUsuarioTipo->nombre_usuario_tipo\t\t=\"admin\";\n\t\t\t$modeUsuarioTipo->descripcion_usuario_tipo\t=\"administrador\";\n\t\t\t$modeUsuarioTipo->save();\n\n\t\t\t$modeUsuarioTipoUsuario=new UsuarioTipoUsuario000102();\n\t\t\t$modeUsuarioTipoUsuario->fk_id_usuario_tipo = $modeUsuarioTipo->getPrimaryKey();\n\t\t\t$modeUsuarioTipoUsuario->fk_id_usuario\t\t= $modeUsuario->getPrimaryKey();\n\t\t\t$modeUsuarioTipoUsuario->save();\n \n \t$arreglo = [\n\t\t\t\t\t\t\t'Accion010201',\n\t\t\t\t\t\t\t'AccionNotificacion010203',\n\t\t\t\t\t\t\t'AccionTipo010204',\n\t\t\t\t\t\t\t'AccionTransicion010202',\n\t\t\t\t\t\t\t'Actividad010501',\n\t\t\t\t\t\t\t'Actividad050101',\n\t\t\t\t\t\t\t'ActividadEconomica020004',\n\t\t\t\t\t\t\t'ActividadEstado010602',\n\t\t\t\t\t\t\t'ActividadTipo010504',\n\t\t\t\t\t\t\t'ActividadTransicion010502',\n\t\t\t\t\t\t\t'ActividadUsuario050103',\n\t\t\t\t\t\t\t'AlcanceAcreditacionCert030003',\n\t\t\t\t\t\t\t'AlcanceAcreditacionCert041303',\n\t\t\t\t\t\t\t'AlcanceAcreditacionInsp030003',\n\t\t\t\t\t\t\t'AlcanceAcreditacionInsp041303',\n\t\t\t\t\t\t\t'AlcanceAcreditacionLab030003',\n\t\t\t\t\t\t\t'AnexoConvenio041301',\n\t\t\t\t\t\t\t'AspectosEvaluados040803',\n\t\t\t\t\t\t\t'CampoCalibracion040004',\n\t\t\t\t\t\t\t'Certificado041401',\n\t\t\t\t\t\t\t'CodigoPeticion010404',\n\t\t\t\t\t\t\t'CriterioEvaluacion040004',\n\t\t\t\t\t\t\t'CriterioSatisfaccion041204',\n\t\t\t\t\t\t\t'CriterioSupervision041104',\n\t\t\t\t\t\t\t'DesignacionEvaluador041001',\n\t\t\t\t\t\t\t'DetalleCalibracion040301',\n\t\t\t\t\t\t\t'DetalleCertificacion040501',\n\t\t\t\t\t\t\t'DetalleEquipos040201',\n\t\t\t\t\t\t\t'DetalleInspeccion040401',\n\t\t\t\t\t\t\t'EquipoEval040803',\n\t\t\t\t\t\t\t'EquipoPeticion010701',\n\t\t\t\t\t\t\t'Estado010601',\n\t\t\t\t\t\t\t'EstadoNotificacion010203',\n\t\t\t\t\t\t\t'EstadoTipo010604',\n\t\t\t\t\t\t\t'EvalTecnica040801',\n\t\t\t\t\t\t\t'Evaluacion030001',\n\t\t\t\t\t\t\t'Feriado050104',\n\t\t\t\t\t\t\t'Gestion050104',\n\t\t\t\t\t\t\t'GestionTipoActividad050103',\n\t\t\t\t\t\t\t'InfoEnsayo040101',\n\t\t\t\t\t\t\t'InformeAcred041301',\n\t\t\t\t\t\t\t'InformeEvaluacion040601',\n\t\t\t\t\t\t\t'LogSistema030003',\n\t\t\t\t\t\t\t'NoConformidad040701',\n\t\t\t\t\t\t\t'NormaReferencia020004',\n\t\t\t\t\t\t\t'ObsPeticionAccion010303',\n\t\t\t\t\t\t\t'Oec020001',\n\t\t\t\t\t\t\t'OecAcreditacionSolicitada020003',\n\t\t\t\t\t\t\t'OecActividad020002',\n\t\t\t\t\t\t\t'OecContacto020003',\n\t\t\t\t\t\t\t'OecTipo020004',\n\t\t\t\t\t\t\t'OecTitulo020004',\n\t\t\t\t\t\t\t'Pais020004',\n\t\t\t\t\t\t\t'ParticipantesCurso050103',\n\t\t\t\t\t\t\t'PersonalAutorizado041303',\n\t\t\t\t\t\t\t'Peticion010401',\n\t\t\t\t\t\t\t'PeticionAccion010301',\n\t\t\t\t\t\t\t'PeticionArchivo010401',\n\t\t\t\t\t\t\t'PeticionArchivoTipo010404',\n\t\t\t\t\t\t\t'PeticionEstado010403',\n\t\t\t\t\t\t\t'PlanEvaluacion030003',\n\t\t\t\t\t\t\t'Proceso010101',\n\t\t\t\t\t\t\t'ProveedorEval040803',\n\t\t\t\t\t\t\t'PruebaParticipacion040901',\n\t\t\t\t\t\t\t'Reporte030004',\n\t\t\t\t\t\t\t'SatisfaccionCliente041201',\n\t\t\t\t\t\t\t'SatisfaccionEvaluacion041203',\n\t\t\t\t\t\t\t'SupervisionCriterio041103',\n\t\t\t\t\t\t\t'SupervisionEvaluador041101',\n\t\t\t\t\t\t\t'TipoActividad050104',\n\t\t\t\t\t\t\t'TipoCurso050104',\n\t\t\t\t\t\t\t'Transicion010202',\n\t\t\t\t\t\t\t'Usuario000101',\n\t\t\t\t\t\t\t'UsuarioOec000102',\n\t\t\t\t\t\t\t'UsuarioPrivilegio000004',\n\t\t\t\t\t\t\t'UsuarioProceso000102',\n\t\t\t\t\t\t\t'UsuarioTipo000201',\n\t\t\t\t\t\t\t'UsuarioTipoPrivilegio000202',\n\t\t\t\t\t\t\t'UsuarioTipoUsuario000102',\n\t\t\t\t\t\t\t'Vacacion050104',\n\t\t\t ];\n foreach ($arreglo as $valor) {\n \n for ($i=1;$i<=4;$i++) {\n $model = new UsuarioPrivilegio000004();\n switch ($i) {\n case 1:\n $model->accion_usuario_privilegio\t\t\t= \"create\";\n $model->nombre_privilegio_usuario_privilegio= \"crea \".$valor;\n break;\n case 2:\n $model->accion_usuario_privilegio\t\t\t= \"index\";\n $model->nombre_privilegio_usuario_privilegio= \"lee \".$valor;\n break;\n case 3:\n $model->accion_usuario_privilegio\t\t\t= \"update\";\n $model->nombre_privilegio_usuario_privilegio= \"actualiza \".$valor;\n break;\n case 4:\n $model->accion_usuario_privilegio\t\t\t= \"delete\";\n $model->nombre_privilegio_usuario_privilegio= \"elimina \".$valor;\n break;\n } \n\t\t\t\t\t$model->opciones_usuario_privilegio\t\t= \"controlador\";\n $model->funcion_usuario_privilegio\t\t= $valor; \n $model->descripcion_usuario_privilegio\t= \"automatico\";\n\t\t\t\t\tif ($model->validate())\n\t\t\t\t\t\t$model->save(); \n }\n }\n \n $model = new UsuarioTipoPrivilegio000202();\n\t\t\t$registros=UsuarioPrivilegio000004::find()->all();\n\t\t\tforeach($registros as $registro):\n\t\t\t\t$model = new UsuarioTipoPrivilegio000202();\n\t\t\t\t$model->fk_id_usuario_tipo=$modeUsuarioTipo->getPrimaryKey();\n\t\t\t\t$model->fk_id_usuario_privilegio = $registro->id_usuario_privilegio;\n\t\t\t\t$model->save();\n\t\t\tendforeach;\n \n $respuesta->meta=array(\"success\"=>\"true\",\"msg\"=>\"Se crearon los registros exitosamente !!!\");\n\t\t\treturn $this->controller->renderPartial('create',array('model'=>$respuesta,'callback'=>$callback));\n\t\t} else {\n\t\t\t$respuesta->meta=[\"success\"=>\"false\",\"msg\"=>$error];\n\t\t\treturn $this->controller->renderPartial('create',['model'=>$respuesta,'callback'=>'']);\n\t\t}\n\t}", "function login() {\n $provider = \\Iternova\\Common\\Controller::get( 'provider' );\n\n // Proveedor\n switch ( $provider ) {\n case 'yahoo':\n $openid_url = 'http://me.yahoo.com';\n break;\n case 'google':\n $openid_url = 'https://www.google.com/accounts/o8/id';\n break;\n case 'facebook':\n $openid_url = 'facebook.anyopenid.com';\n break;\n case 'twitter':\n $openid_url = 'twitter.anyopenid.com';\n break;\n }\n\n if ( $provider === 'yahoo' || $provider === 'google' ) {\n // Usamos openID\n $openid = new LightOpenID;\n $openid->identity = $openid_url;\n $openid->returnUrl = 'http://zgzagua.es?action=login_confirm';\n $openid->required = [ 'namePerson/friendly', 'contact/email', 'namePerson', 'identityProvider/userId' ];\n echo '<script type=\"text/javascript\">$(location).attr(\\'href\\',\\'' . $openid->authUrl() . '\\');</script>';\n } elseif ( $provider === 'twitter' ) {\n // Usamos twitter oauth\n /* Start session and load library. */\n require_once( 'libs/twitter/twitteroauth/twitteroauth.php' );\n require_once( 'libs/twitter/config.php' );\n\n /* Build TwitterOAuth object with client credentials. */\n $connection = new TwitterOAuth( CONSUMER_KEY, CONSUMER_SECRET );\n\n /* Get temporary credentials. */\n $request_token = $connection->getRequestToken( OAUTH_CALLBACK );\n\n /* Save temporary credentials to session. */\n $_SESSION[ 'oauth_token' ] = $token = $request_token[ 'oauth_token' ];\n $_SESSION[ 'oauth_token_secret' ] = $request_token[ 'oauth_token_secret' ];\n echo '<script type=\"text/javascript\">$(location).attr(\\'href\\',\\'' . $connection->getAuthorizeURL( $token ) . '\\');</script>';\n }\n }", "public function index($Parametros){\n //Se verifica si el usuario esta memorizado en las cookie de su computadora y las compara con la BD, para recuperar sus datos y autorellenar el formulario de inicio de sesion, las cookies de registro de usuario se crearon en validarSesion.php\n if(isset($_COOKIE[\"id_usuario\"]) AND isset($_COOKIE[\"clave\"])){//Si la variable $_COOKIE esta establecida o creada\n // echo \"Cookie afiliado =\" . $_COOKIE[\"id_usuario\"] .\"<br>\";\n // echo \"Cookie clave =\" . $_COOKIE[\"clave\"] .\"<br>\";\n \n $Cookie_usuario = $_COOKIE[\"id_usuario\"];\n \n //Se CONSULTA el usuario registrados en el sistema con el correo dado como argumento\n $usuarioRec= $this->ConsultaLogin_M->consultarUsuarioRecordado($Cookie_usuario);\n $Datos=[\n \"usuarioRecord\"=>$usuarioRec,\n ];\n \n //Se entra al formulario de sesion que esta rellenado con los datos del usuario\n $this->vista(\"paginas/login_Vrecord\", $Datos);\n }\n else{\n $Datos = $Parametros;\n //Se carga la vista login_V\n $this->vista(\"paginas/login_V\", $Datos);\n }\n }", "function trataImagem($nomeIntegrador=false){\n\t\t$this->enviaMensagemTelegramWeb(\"\\xF0\\x9F\\x94\\xB4\\xF0\\x9F\\x94\\xB4 ATENCAO \\xF0\\x9F\\x94\\xB4\\xF0\\x9F\\x94\\xB4\");\n\t\t$this->enviaMensagemTelegramWeb(\"=====================%0A \\xF0\\x9F\\x98\\xB1 FALHA $nomeIntegrador \\xF0\\x9F\\x98\\xB1%0A=====================%0APor Favor Resolva a imagem abaixo!%0AResponda: /resp SoLuCao\");\n\t\t$this->enviaImagem();\n\t\t$this->monitoraRespostaImagem();\n\t}", "function conectar($servidor=\"\",$usuario=\"\",$password=\"\",$bdatos=\"\"){\r\n\t\t/*if($this->modo == \"1\"){\r\n\t\t\t$this->auditoria = false;\r\n\t\t}#end if*/\r\n\r\n\t\tif($this->modo == \"\"){\r\n\t\t\t$this->bdatos = C_BDATOS_2;\r\n\t\t\t$this->usuario = C_USUARIO_2;\r\n\t\t\t$this->password = C_PASSWORD_2;\r\n\t\t}//end if\r\n\r\n\t\tif($this->modo == \"2\"){\r\n\t\t\t$this->bdatos = C_BDATOS_3;\r\n\t\t\t$this->usuario = C_USUARIO_3;\r\n\t\t\t$this->password = C_PASSWORD_3;\r\n\t\t}//end if\r\n\t\t\r\n\t\t\r\n\t\tif ($servidor!=\"\"){\r\n\t\t\t\t$this->servidor = $servidor;\r\n\t\t}// end if\r\n\t\tif ($usuario!=\"\"){ \r\n\t\t\t\t$this->usuario = $usuario;\r\n\t\t}// end if\r\n\t\tif ($password!=\"\"){\r\n\t\t\t\t$this->password = $password;\r\n\t\t}// end if\r\n\t\tif ($bdatos!=\"\"){\r\n\t\t\t\t$this->bdatos = $bdatos;\r\n\t\t}// end if\r\n\r\n\t\tif($this->imprimir_conexion==true and $this->ip_imprimir_conexion!=\"\"){\r\n\t\t\tif(isset($_SERVER['HTTP_X_FORWARDED_FOR'] ) && $_SERVER['HTTP_X_FORWARDED_FOR'] == $this->ip_imprimir_conexion){\r\n\t\t\t\t//echo \" <br>--> (\".$this->servidor.\", \".$this->usuario.\", \".$this->password.\", \".$this->query.\")\";\r\n\t\t\t//\techo \" <br>--> (\".$this->servidor.\", \".$this->usuario.\", \".$this->password.\")<br>\".$this->query.\"<hr>\";\r\n\t\t\t}#end if\r\n\t\t}#end if\r\n\r\n\t\t//echo \"<div style=\\\"z-index:10;width:auto;position:relative;height:auto;background-color:#FFF;border:#F00 solid 2px;margin:5px;display:block;\t\\\"> (\".$this->servidor.\", \".$this->usuario.\", \".$this->password.\")<br>\".$this->query.\"</div>\";\r\n\t\t//echo \" <br><br>\".$this->query.\"<hr>\";\r\n\t\t//die;\r\n\t\t//$this->servidor = \"172.17.2.31\";\r\n\t\t//exit;\r\n\t\t$cn = false;\r\n\t\t$this->conexion = mysqli_connect($this->servidor,$this->usuario,$this->password,$this->bdatos); \r\n\t\tif (mysqli_connect_errno()) {\r\n\t\t printf(\"Error en conexión: %s\\n\", mysqli_connect_error());\r\n\t\t exit();\r\n\t\t}else{\r\n\t\t\t$this->estado = true;\r\n\t\t}\r\n }", "function auth_ntou($str, $email, $password)\n{\n\n if ($str == \"ntou\") {\n //ntou(libraries)\n $data_arr = array();\n $data_arr[\"username\"] = $email;\n $data_arr[\"password\"] = $password;\n $data_arr[\"ok\"] = \"登入\";\n\n $response = http($target = \"https://140.121.40.253/user/user_login_auth.jsp?\", $ref = \"\", $method = \"POST\", $data_arr, EXCL_HEAD);\n\n if ($response[\"ERROR\"]==\"\") {\n http_get(\"https://140.121.40.253/user/user_login_auth.jsp?\", $ref = \"\");\n http_get(\"https://140.121.40.253/user/_allowuser.jsp?\", $ref = \"\");\n $web_page = http_get(\"http://google.com.tw\", $ref = \"\");\n $web_page = $web_page[\"FILE\"];\n\n if (stristr($web_page, \"Authentication Required for Wireless Access\")) {\n echo \"auth_fail\";\n } else {\n echo \"auth_success\";\n }\n } else {\n echo \"It's auth or you are not in this wireless access point.\";\n }\n } else {\n //TANetRoaming,ntou-guest\n }\n}", "public static function connected(){\n\t\trequire_once (File::build_path(array('lib','Security.php'))); \n\t\t$pwd= Security::chiffrer($_GET['password']);\n\n\t\tif(ModelBenevole::checkPassword($_GET['login'], $pwd)){\n\t\t\t$id = ModelBenevole::getIDbyLogin($_GET['login']);\n\t\t\t$bene = ModelBenevole::select($id);\n\n\t\t\tif($bene->__get('nonce') == null){ \n\t\t\t\t$id = ModelBenevole::getIDbyLogin($_GET['login']);\n\t\t\t\t$b = ModelBenevole::select($id); \n\t\t\t\t$pagetitle = 'Vous êtes connecté';\n\t\t\t\t$controller = 'benevole';\n\t\t\t\t$view = 'detail'; //renvoie sur le détail \n\t\t\t\t$_SESSION['login'] = $_GET['login'];\n\t\t\t}else{\n\t\t\t\t$pagetitle = 'Compte non validé';\n\t\t\t\t$controller = 'benevole';\n\t\t\t\t$view = 'error'; //renvoie sur l'erreur\n\t\t\t}\n\t\t\trequire_once (File::build_path(array('view','view.php'))); \n\t\t}else{\n\t\t\t$pagetitle = 'Mauvais identifiants et/ou mot de passe';\n\t\t\t$controller = 'benevole';\n\t\t\t$view = 'error';\n\t\t\trequire_once (File::build_path(array('view','view.php'))); \n\t\t}\n\t}", "public static function login() {\n \n $identificado = Login::get();\n \n echo \"<section class='container st-login'>\";\n echo \"<div class='row'>\";\n echo \"<div class='col-md-12'>\";\n echo \"<div class='login'>\";\n echo $identificado ?\n \"Hola <a href='/usuario/show/$identificado->id' class='logname'>$identificado->usuario</a>|\n <a href='/login/logout' class='logout'>salir</a>\" :\n \"<a href='/login' class='regis-link'>Identifícate</a><a class='regis-link' href='/usuario/create'>Regístrate</a>\";\n \n echo \"</div>\";\n \n echo \"</div>\";\n echo \"</div>\";\n echo \"</section>\";\n \n }", "function loginClient()\n\t{\n\t\tsession_destroy();\n\n\t\tilUtil::redirect(ILIAS_HTTP_PATH.\"/login.php?client_id=\".$this->setup->getClient()->getId());\n\t}", "function login()\n {\n \t \t$data = file_get_contents('php://input');\n \t\t$this->logservice->log($this->module_name, \"DEBUG\",\"EVENT\",$this->IP,\"$data \");\n\t\t$busData = json_decode($data ,true);\n\t\t//查找该用户名与密码\n\t\t$criteria = array();\n\t\t$criteria[\"and\"] = array(\"Name\" => $busData[\"name\"],\"Password\" => $busData[\"password\"]);\n\t\t$userDat = $this->User->read($criteria);\n\t\tif (!empty($userDat)) {\n\t\t\t\t\n\t\t\t//更新用户的状态\n\t\t\t$data_in = array('Status' => 1);\n \t\t$upd_criteria['and'] = array('User_Id' => $userDat[0]['User_Id']);\n \t\t$result = $this->User->update($data_in, $upd_criteria);\n\t \tif($result !== false)\n\t \t{\n\t\t\t\t$rspData[\"userID\"] =$userDat[0][\"User_Id\"];\n\t\t\t\t$rspData[\"state\"] = \"OK\";\n\t\t\t\t$rspData[\"erroInfo\"] = \"登陆成功ID为\".$userDat[0][\"User_Id\"];\n\n\t\t\t\t$rspInfo = json_encode($rspData);\n\t\t\t\techo $rspInfo;\n\t\t }\n\n\t\t}\n }", "public function mostrarTipoUsuario(){\n\t$tipoUsuario=$this->altaUsuario_m->mostrarTipoUsuario();\n\tif($tipoUsuario){\n\n\t\t\t\t$respuesta_json= array(\n\t\t\t \t\t'code' => 200,\n\t\t\t \t\t'message' => 'ok',\n\t\t\t \t\t'data' => json_encode($tipoUsuario)\n\t\t\t \t );\n\t\t\t\techo json_encode($respuesta_json);\n\t\t\t}else{\n\t\t\t\t$respuesta_json= array(\n\t\t\t \t\t'code' => 600,\n\t\t\t \t\t'message' => 'error',\n\t\t\t \t\t'data' => 'Error' \n\t\t\t \t );\n\t\t\t\techo json_encode($respuesta_json);\n\t\t\t}\n}", "public function Authecticate()\n{\n\t\n\n global $dbObj,$common;\n\t\t\t\n$username = $common->replaceEmpty('username','');\n$userpassword = $common->replaceEmpty('password','');\n\t\t\t\n$result= array();\n \t\t\t \n if($action='login'){\n\t\t\t\t \n $sql_username =\"SELECT * from ras_users where username = '\".$username.\"' and block = '0' \"; \n $rs_username = $dbObj->runQuery($sql_username);\n \n \tif($rows_username = mysql_fetch_assoc($rs_username)){ \n\t\t $dbpassword = $rows_username['password']; \n\t\t\t\t \n\t\tif(JUserHelper::verifyPassword($userpassword, $rows_username['password'], $rows_username['id'])){\n\t\t\t\n\t\t$datelogged = date('Y-m-d H:i:s');\n\t\t$sqlLog = \"INSERT INTO ras_user_visit_log SET userID='\".$rows_username['id'].\"', useFrom = 'Android', dateLogged='\".$datelogged.\"'\";\n\t\t$dbObj->runQuery($sqlLog);\n\t\t\n\t\t $result[]=$rows_username; \n echo json_encode(array('status'=>'1',$result));\n\t\t }\n\t\t \n\t\t else{\n\t\t\t\t$result[] = \"0\";\n\t\t\t\techo json_encode($result); \n\t\t\t\t}\n\t\t\t\t\n}\n else{\n\t\t\t\t$result[] = \"No Record\";\n\t\t\t\techo json_encode($result); \n\t\t\t\t}\n\n} // action close\n\n}", "function tmp()\n {\n //$xlog = new Model\\Xlog;\n\n //$xlog->decodeAgent();\n\n //Fazendo login\n //Lib\\User::this()->login('admin', 'admin#123');\n //Lib\\User::this()->setCriptoCookie();\n\n //Lib\\User::this()->unsetCriptoCookie();\n $user = new Lib\\User();\n\n $user->login('jessica', 'jessica#123');\n\n //$user->unsetCriptoCookie();\n //\n //\n Lib\\App::p($user->get(), true);\n Lib\\App::p(Lib\\User::this()->get(), true);\n Lib\\App::p($_SERVER['REMOTE_ADDR'], true);\n Lib\\App::p($_SERVER['HTTP_USER_AGENT'], true);\n Lib\\App::p($_SERVER['HTTP_ACCEPT_LANGUAGE'], true);\n\n echo \"<br>OS: </b>\".$this->operating_system_detection();\n\n echo '<hr/>';\n\n $jsonBrowser = json_encode(get_browser());\n\n echo '<br><b>Tamanho do arquivo: </b>'.strlen($jsonBrowser).'<br>';\n Lib\\App::p(json_decode($jsonBrowser), true);\n\n\n //Fazendo login\n //Lib\\User::this()->login('jessica', 'jessica#123');\n //Lib\\User::this()->setCriptoCookie();\n\n //Lib\\App::p(Lib\\User::this()->get(), true);\n\n echo \"<hr/><b>Finished!</b>\";\n }", "public function connexion() {\n\t\t$vue = new View(\"Connexion\");\n\t\t$vue->generer();\n\t}", "public function handleLogin(){\n $username = htmlentities(trim($_POST['username']));\n $password = htmlentities(trim($_POST['password']));\n $loginSebagai = htmlentities(trim($_POST['login_sebagai']));\n\n $loginResult = WebDb::handleLogin($username,$password, $loginSebagai);\n\n if(!$loginResult) {\n Session::set(\"login_gagal\",\"Username atau password salah\");\n header(\"Location: /it-a\");\n die();\n }\n Session::set(\"user_id\",$username);\n Session::set(\"login_sebagai\",$loginSebagai);\n header(\"Location: /it-a/dashboard\");\n }", "public function headerAction ()\n {\n $auth = new AuthenticationService();\n $auth->setStorage(new Session('user'));\n if ($auth->hasIdentity()) {\n $url =__DIR__;\n $endereco = \"\";\n if(substr_count($url,\"HelpDesk\")>0){\n \t$endereco = \"/helpdesk/public/\";\n \t \n }\n else{\n \t$endereco = \"/~hepshego/\";\n }\n $url = $endereco;\n $storage = $auth->getStorage();\n $nomeUsuario = $storage->read()->desc_cadcli;\n $idUsuario = $storage->read()->id_cadcli; \n $dataServer = array(\n 'desc_cadcli' => $nomeUsuario,\n 'id_cadcli' => $idUsuario,\n 'url'=>$endereco,\n );\n echo \"window.dataServerUsuario =\" . json_encode($dataServer);\n return $this->getResponse();\n } else {\n $auth->clearIdentity();\n $this->redirect()->toRoute('userlogin');\n }\n }", "public function ionic(){\n $data['cilindros_cli'] = $this->renglonesModel->cilindrosCLI();\n //echo \"<h2></h2>\";\n //var_dump($data);die();\n /*Cilindros CT2*/\n\n // headers for not caching the results\n //header('Cache-Control: no-cache, must-revalidate');\n //header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');\n\n // headers to tell that result is JSON\n //header('Content-type: application/json');\n\n // send the result now\n //echo json_encode($result_json);\n echo json_encode($data);\n }", "function login()\n {\t \t\n \t$data['fal'] = $this->fal_front->login();\n \t$this->load->view($this->_container, $data); \n }", "public function Autenticar(){\n try {\n $r = $this->auth->autenticar(\n $this->model->Acceder(\n $_POST['usuario'],\n $_POST['password']\n )\n );\n \n // Valida modelo de autenticacion definido\n if(__AUTH__ === 'token'){\n header(\"Location: ?c=Historia&token=$r\"); // Si fuera token, redirecciona al controlador por defecto anexando el N° de token generado\n } \n else{\n header('Location: ?c=Historia'); // En caso contrario, redireccion al controlador por defecto \n }\n } \n catch(Exception $e){\n header('Location: index.php'); // En caso de error remite a pagina inicial por defecto para validar credenciales de acceso\n }\n }", "public function login()\n\t{\n\t\tredirect($this->config->item('bizz_url_ui'));\n\t\t// show_404();\n\t\t// ////import helpers and models\n\n\t\t// ////get data from database\n\n\t\t// //set page info\n\t\t// $pageInfo['pageName'] = strtolower(__FUNCTION__);\n\n\t\t// ////sort\n\t\t\n\t\t// //render\n\t\t// $this->_render($pageInfo);\n\t}", "private function login(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"POST\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t} //es una peticion POST\n\t\tif(isset($this->datosPeticion['email'], $this->datosPeticion['pwd'])){\n\t\t\t#el constructor padre se encarga de procesar los datos de entrada\n\t\t\t$email = $this->datosPeticion['email']; \n \t\t$pwd = $this->datosPeticion['pwd'];\n \t\t//si los datos de la solicitud no es tan vacios se procesa\n \t\tif (!empty($email) and !empty($pwd)){\n \t\t\t//se valida el email\n \t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL)) { \n \t\t\t//consulta preparada mysqli_real_escape()\n \t\t\t\t$query = $this->_conn->prepare(\n \t\t\t\t\t\"SELECT id, nombre, email, fRegistro \n \t\t\t\t\t FROM usuario \n \t\t\t\t\t WHERE email=:email AND password=:pwd \");\n \t\t\t\t//se le prestan los valores a la query\n \t\t\t\t$query->bindValue(\":email\", $email); \n \t\t\t$query->bindValue(\":pwd\", sha1($pwd)); \n \t\t\t$query->execute(); //se ejecuta la consulta\n \t\t\t//Se devuelve un respuesta a partir del resultado\n \t\t\tif ($fila = $query->fetch(PDO::FETCH_ASSOC)){ \n\t\t\t $respuesta['estado'] = 'correcto'; \n\t\t\t $respuesta['msg'] = 'Los datos pertenecen a un usuario registrado';\n\t\t\t //Datos del usuario \n\t\t\t $respuesta['usuario']['id'] = $fila['id']; \n\t\t\t $respuesta['usuario']['nombre'] = $fila['nombre']; \n\t\t\t $respuesta['usuario']['email'] = $fila['email']; \n\t\t\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t\t\t } \n \t\t\t}\n \t\t} \n\t\t} // se envia un mensaje de error\n\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(3)), 400);\n\t}", "public function login() {\n $messages = $this->messages;\n require_once $this->root_path_views.\"login.php\";\n }", "function verificarlogin(){\n\t\t//Verificar si estan los datos\n\t\tif((!isset($_POST[\"nomUsuario\"]) || (!isset($_POST[\"pass\"])))){\n\n\t\t}\n\t\t//Variables a usar\n\t\t$nomUsuario=$_POST['nomUsuario'];\n \t\t$contrasenia=$_POST['pass'];\n \t\t//Se llama al metodo y pasan parametros\n \t\t$verificar = Usuario::verificarUsuario($nomUsuario,$contrasenia);\n \t\tif(!$verificar){\n \t\t\t $estatus = \"Datos incorrectos\";\n \t\t\trequire \"app/Views/login.php\";\n\n }else{\n \n \t\t // $_SESSION['Usuarios']=$verificar;\n \t$_SESSION['Usuarios']=$nomUsuario;\n header(\"Location:/Proyecto/index.php?controller=Publicaciones&action=home\");\n }\n\n\t}", "function cambioClave() {\n if (isset($_POST['id_usuario']) && isset($_POST['login']) && isset($_POST['clave']) && isset($_POST['clave_nueva'])) {\n $clave = substr(crypt($_POST['clave'], strtoupper($_POST['login'])), 3);\n $clave_nueva = substr(crypt($_POST['clave_nueva'], strtoupper($_POST['login'])), 3);\n\n $objetoCambioClave = new ClaseCambioClave($_POST['id_usuario'], $clave, $clave_nueva);\n $result = $objetoCambioClave->cambioClave();\n\n $data = ClaseJson::getJson($result);\n } else {\n $data = ClaseJson::getMessageJson(false, 'Los campos Login o Clave estan vacios');\n }\n\n echo $data;\n}", "public function enviarNumero( ) {\n $cmd = new ComandoFlash(\"VIDEOCONFERENCIA\", \"MARCADO\",$this->getNumeroIP());\n $this->enviarPeticion($cmd->getComando());\n\n }", "public static function index()\r\n {\r\n $dir = dirname(realpath(__DIR__ . ''));\r\n if (empty($_SESSION)) {\r\n @session_start();\r\n $parametrosSistema = file_get_contents($dir . \"/config/parametrosGenerales.json\");\r\n $array = json_decode($parametrosSistema, true);\r\n foreach ($array as $clave => $valor) {\r\n SessionController::guardarVariable($clave, $valor);\r\n }\r\n $parametrosDiccionario = file_get_contents($dir . \"/config/parametrosDiccionario.json\");\r\n $array = json_decode($parametrosDiccionario, true);\r\n foreach ($array as $clave => $valor) {\r\n SessionController::guardarVariable($clave, $valor);\r\n }\r\n SessionController::get_client_ip();\r\n }\r\n if(isset($_POST[\"z_c\"]) && $_POST[\"z_c\"] != \"\"){\r\n $parametros = Utilitarias::valorEncriptado($_POST[\"z_c\"]);\r\n if (isset($parametros[3]) && !SessionController::extraerVariable(\"valido_user\")) {\r\n if (file_exists(realpath($dir . \"/config/parametrosConfigCamara_\" . $parametros[3] . \".json\"))) {\r\n $parametrosSistema = file_get_contents(realpath($dir . \"/config/parametrosConfigCamara_\" . $parametros[3] . \".json\"));\r\n } else {\r\n $msj = array(\"codigoerror\" => \"E9999\", \"mensajeerror\" => \"No se encuentra configurada la camara seleccionada\");\r\n die(print_r(json_encode($msj), true));\r\n }\r\n $array = json_decode($parametrosSistema, true);\r\n SessionController::guardarVariable(\"codigoempresa\", $parametros[3]);\r\n foreach ($array as $clave => $valor) {\r\n SessionController::guardarVariable($clave, $valor);\r\n }\r\n SessionController::construirLocalPeticion();\r\n }\r\n }else{\r\n if (isset($_GET[self::TXTCODCAMARA]) && !SessionController::extraerVariable(\"valido_user\")) {\r\n if (file_exists(realpath($dir . \"/config/parametrosConfigCamara_\" . $_GET[self::TXTCODCAMARA] . \".json\"))) {\r\n $parametrosSistema = file_get_contents(realpath($dir . \"/config/parametrosConfigCamara_\" . $_GET[self::TXTCODCAMARA] . \".json\"));\r\n } else {\r\n $msj = array(\"codigoerror\" => \"E9999\", \"mensajeerror\" => \"No se encuentra configurada la camara seleccionada\");\r\n die(print_r(json_encode($msj), true));\r\n }\r\n $array = json_decode($parametrosSistema, true);\r\n SessionController::guardarVariable(\"codigoempresa\", $_GET[self::TXTCODCAMARA]);\r\n foreach ($array as $clave => $valor) {\r\n SessionController::guardarVariable($clave, $valor);\r\n }\r\n SessionController::construirLocalPeticion();\r\n }\r\n }\r\n }", "public function login (){\n\n $dao = DAOFactory::getUsuarioDAO(); \n $GoogleID = $_POST['GoogleID']; \n $GoogleName = $_POST['GoogleName']; \n $GoogleImageURL = $_POST['GoogleImageURL']; \n $GoogleEmail = $_POST['GoogleEmail'];\n $usuario = $dao->queryByGoogle($GoogleID); \n if ($usuario == null){\n $usuario = new Usuario();\n $usuario->google = $GoogleID;\n $usuario->nombre = $GoogleName;\n $usuario->avatar = $GoogleImageURL;\n $usuario->correo = $GoogleEmail;\n print $dao->insert($usuario);\n $_SESSION[USUARIO] = serialize($usuario);\n //$usuario = unserialize($_SESSION[USUARIO]);\n } else {\n $_SESSION[USUARIO] = serialize($usuario);\n }\n }", "public function login(){\n\t\t$this->user = $this->user->checkCredentials();\n\t\t$this->user = array_pop($this->user);\n\t\tif($this->user) {\n\t\t\t$_SESSION['id'] = $this->user['id'];\n\t\t\t$_SESSION['name'] = $this->user['name'];\n\t\t\t$_SESSION['admin'] = $this->user['admin'];\n\t\t\t$this->isAdmin();\n\t \t\theader('location: ../view/home.php');\n\t \t\texit;\n\t \t}\n\t\t$dados = array('msg' => 'Usuário ou senha incorreto!', 'type' => parent::$error);\n\t\t$_SESSION['data'] = $dados;\n\t\theader('location: ../view/login.php');\n \t\texit;\n\t}", "function logar(){\n //$duracao = time() + 60 * 60 * 24 * 30 * 6;\n //proteção sql\n $login = $_POST['login'];\n $senha = $_POST['senha'];\n \n\n //criptografa\n //$senha = hash(\"sha512\", $senha);\n\n /*faz o select\n $sql = \"SELECT * FROM usuario WHERE login = '$login' AND senha = '$senha'\";\n $resultado = $link->query($sql);\n\n //se der resultado pega os dados no banco\n if($link->affected_rows > 0 ){ \n $dados = $resultado->fetch_array();\n $id = $dados['id_user'];\n $nome = $dados['nome'];\n $email = $dados['email'];\n $foto = $dados['foto_usuario'];\n $login = $dados['login'];\n $senha = $dados['senha'];\n $admin = $dados['is_admin'];\n //cria as variaveis de sessão\n $_SESSION['email'] = $email;\n $_SESSION['id'] = $id;\n $_SESSION['nome'] = $nome;\n $_SESSION['foto'] = $foto;\n $_SESSION['login'] = $login;\n $_SESSION['senha'] = $senha;\n $_SESSION['isAdmin'] = $admin;\n\n # testar se o checkbox foi marcado\n if (isset($_POST['conectado'])) {\n # se foi marcado cria o cookie\n setcookie(\"conectado\", \"sim\", $duracao, \"/\");\n # neste ponto, tambem enviamos para o navegador os cookies de login e senha, com validade de 6 meses\n setcookie(\"login\" , $login, $duracao, \"/\");\n setcookie(\"senha\" , $senha, $duracao, \"/\");\n }*/\n if($login == 'admin' && $senha == 'admin'){\n ?>\n <script> location.href=\"home.php\" </script>\n <?php\n }\n else{\n $_SESSION['msg'] = \"Senha ou usuario Incorreto!\";\n }\n\n //$link->close();\n}", "static public function ctrCrearUsuario(){\n\n\n if(isset($_POST[\"nuevoUsuario\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"nuevoNombre\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoUsuario\"]) &&\n\t\t\t preg_match('/^[a-zA-Z0-9]+$/', $_POST[\"nuevoPassword\"])){\n\n\n //Validar la imagen\n\n $revisar = getimagesize($_FILES[\"nuevaFoto\"][\"tmp_name\"]);\n\n if($revisar !== false){\n\n //Crear directorio\n $directorio = \"vistas/img/usuarios/\".$_POST[\"nuevoUsuario\"];\n\t\t\t\t mkdir($directorio, 0755);\n\n //Asignar nombre a la foto\n $aleatorio = mt_rand(100,999);\n $pname = $aleatorio.\"-\".$_FILES[\"nuevaFoto\"][\"name\"];\n\n $tname = $_FILES[\"nuevaFoto\"][\"tmp_name\"];\n\n $ruta = $directorio.\"/\".$pname;\n\n move_uploaded_file($tname, $directorio.'/'.$pname);\n\n } else {\n $ruta = \"\";\n }\n\n \n\n $tabla = \"tblusuarios\";\n\n $encriptar = crypt($_POST[\"nuevoPassword\"], '$2a$07$asxx54ahjppf45sd87a5a4dDDGsystemdev$');\n\n $datos = array(\"nombre\" => $_POST[\"nuevoNombre\"],\n \"usuario\" => $_POST[\"nuevoUsuario\"],\n \"password\" => $encriptar,\n \"perfil\" => $_POST[\"nuevoPerfil\"],\n \"foto\" => $ruta\n );\n \n $respuesta = ModeloUsuarios::MdlIngresarUsuario($tabla, $datos);\n\n if($respuesta == \"ok\"){\n\n echo '<script>\n\n\t\t\t\t\tSwal.fire({\n\n\t\t\t\t\t\ticon: \"success\",\n\t\t\t\t\t\ttitle: \"El usuario ha sido guardado correctamente\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n \n }else{\n\n '<script>\n alert(\"Error al guardar el usuario\");\n\n\t\t\t\t\t</script>';\n\n }\n\n\n\n\t\t\t}else{\n\n\t\t\t\techo '<script>\n\n\t\t\t\t\tSwal.fire({\n\n\t\t\t\t\t\ticon: \"error\",\n\t\t\t\t\t\ttitle: \"¡El usuario no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n closeOnConfirm: false\n\n\t\t\t\t\t}).then(function(result){\n\n\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\twindow.location = \"usuarios\";\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\t\t\t\t\n\n\t\t\t\t</script>';\n\n\t }\t}\n\n\n\t}", "function conectar(){\n global $Usuario;\n global $Clave;\n global $_SESSION;\n $this->dataOrdenTrabajo->SetUserName($Usuario);\n $this->dataOrdenTrabajo->SetUserPassword($Clave);\n $this->dataOrdenTrabajo->SetDatabaseName($_SESSION['database']);\n $this->dataOrdenTrabajo->setConnected(true);\n }", "public function cargarImagen() {\n\n $id = $_REQUEST[\"id\"];\n\n echo $this->usuario->getCampo($id,'imagen');\n\n }", "public function login($puruka=null){\n $this->prikaz('login', ['poruka'=>$puruka]);\n }", "public function init() {\n $this->uri = ''; //En un futuro esto tomara pararemetros q vengan de GET\n session_start();\n //$this->generateFakeData();\n $this->validatePost();\n $this->requireView(); \n }", "public function start() {\n if (isset($_GET)) {\n $clientId = $_GET['clientId'];\n $client = $this->clientDao->get($clientId);\n $this->showClientData($client);\n }\n //Se actualiza al cliente\n else if (isset($_POST)) {\n $id = $_POST[ClientColumns::ID];\n $nombre = $_POST[ClientColumns::NOMBRE];\n $apellido = $_POST[ClientColumns::APELLIDO];\n $dni = $_POST[ClientColumns::DNI];\n $direccion = $_POST[ClientColumns::DIRECCION];\n $this->clientDao->\n\n\n\n }\n //Se elige al cliente\n else {\n\n }\n }", "public function actualizar_conversaciones()\n\t{\n\t\tif($this->session->userdata('logueado'))\n\t\t{\n\t\t\t$usuario=$this->session->userdata('id');\n\t\t\t$datos['conversaciones']=$this->Mensaje_model->buscar_conversaciones($usuario);\n\t\t\t\n\t\t\techo (json_encode($datos['conversaciones']));\n\t\t}\n\t\telse//SI NO ESTA LOGUEADO LE MANDAMOS AL LOGIN CON UN CAMPO REDIRECCION PARA QUE LUEGO LE LLEVE A LA PAGINA QUE QUERIA\n\t\t{\n\t\t\t$datos['errorLogin']='Por favor inicia sesion';\n\t\t\tenmarcar($this,'index.php',$datos);\n\t\t}\n\t}", "public function login() {\n\n $user_login = trim(in('id'));\n $user_pass = in('password');\n $remember_me = 1;\n\n $credits = array(\n 'user_login' => $user_login,\n 'user_password' => $user_pass,\n 'rememberme' => $remember_me\n );\n\n $re = wp_signon( $credits, false );\n\n if ( is_wp_error($re) ) {\n $user = user( $user_login );\n if ( $user->exists() ) ferror( -40132, \"Wrong password\" );\n else ferror( -40131, \"Wrong username\" );\n }\n else if ( in('response') == 'ajax' ) {\n // $this->response( user($user_login)->session() ); // 여기서 부터..\n }\n else {\n $this->response( ['data' => $this->get_button_user( $user_login ) ] );\n }\n\n }", "public function procesarLlamada(){\n\t\tif(isset($_REQUEST['url'])){ //si trae un respuesta !null\n\t\t\t//si por ejemplo pasamos explode('/','////controller///method////args///') el resultado es un array con elem vacios;\n\t //Array ( [0] => [1] => [2] => [3] => [4] => controller [5] => [6] => [7] => method [8] => [9] => [10] => [11] => args [12] => [13] => [14] => )\n\t $url = explode('/', trim($_REQUEST['url']));\n\t //con array_filter() filtramos elementos de un array pasando función callback, que es opcional.\n\t //si no le pasamos función callback, los elementos false o vacios del array serán borrados \n \t //por lo tanto entre la anterior función (explode) y esta eliminamos los '/' sobrantes de la URL -> devuelve indice/valor en un array\n\t $url = array_filter($url); \n\t $this->_metodo = strtolower(array_shift($url)); //transforma a minusculas y se quita el primer elemento del array\n \t\t$this->_argumentos = $url; \n \t\t$func = $this->_metodo;\n \n \t\tif((int) method_exists($this, $func) > 0){\n \t\t\t//Si la URL tiene argumentos ej borrarUsuario/1 (1->argumento)\n \t\t\tif (count($this->_argumentos) > 0) {\n \t\t\t\tcall_user_func_array(array($this, $this->_metodo), $this->_argumentos);\n \t\t\t} else {//si no, lo llamamos sin argumentos, al metodo del controlador ej http://localhost/login_rest/usuarios \n \t\t\tcall_user_func(array($this, $this->_metodo)); \n \t\t} \n \t\t} else // se envia el error en formato json\n \t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(0)), 404);\n\t\t}\n\t\t//se envia el error en formato json\n\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(0)), 404);\n\t}", "public function api_login_as_tourist(){\n\n \t$username = $this->input->post('username');\n $password = md5($this->input->post('password'));\n\n $user_id = $this->login_model->api_login_as_tourist($username,$password);\n\n if($user_id){\n\t\t $json_data['res'] = $user_id;\n\t\t echo json_encode($json_data);\n\t\t }else{\n\t\t $json_data['res'] = '0';\n\t\t echo json_encode($json_data);\n\t\t }\n }", "public function login()\n {\n $this->navegador\n ->findElement(WebDriverBy::cssSelector('.hide-on-med-and-down a[data-target=\"signinbox\"]'))\n ->click();\n // Digitar julio0001 em #signinbox input[name=\"login\"]\n $this->navegador\n ->findElement(WebDriverBy::cssSelector('#signinbox input[name=\"login\"]'))\n ->sendKeys('bruno.prado');\n // Digitar 123456 em #signinbox input[name=\"password\"]\n $this->navegador\n ->findElement(WebDriverBy::cssSelector('#signinbox input[name=\"password\"]'))\n ->sendKeys('1234');\n // Clicar em SIGN IN\n \n $this->navegador\n ->findElement(WebDriverBy::id('signinbox'))\n ->findElement(WebDriverBy::linkText('SIGN IN'))\n ->click(); \n \n }", "public function login(){\n var_dump($_SERVER);\n $this->display('login');\n }", "public function __construct()\n {\n include(\"dados_conexao.php\");\n include(\"servicos.php\");\n\n //& Alterar aqui depois os dados para a consulta no BD \n $this->tempoMenu = 7200; //Tempo entre a última mensagem e a possibilidade de enviar o menu novamente\n $idInstancia = 1;\n $this->idInstancia = $idInstancia;\n\n //Recebe o corpo do Json enviado pela instância\n $json = file_get_contents('php://input');\n $decoded = json_decode($json, true); //Decodifica\n\n //Grava o JSON-body no arquivo de debug\n ob_start();\n var_dump($decoded);\n $input = ob_get_contents();\n ob_end_clean();\n\n //Coloca para salvar todas as requisições recebidas em um arquivo de log\n //file_put_contents('inputs.log', $input . PHP_EOL, FILE_APPEND);\n\n\n\n //() Verifica SE É uma mensagem recebida \n if (isset($decoded['Type'])) {\n if ($decoded['Type'] == 'error_instace') {\n $this->logSis('DEB', 'error_instace - Tentativa da API: ' . $decoded['ErrorCount']);\n $this->reload($decoded['ErrorCount'], 0);\n exit(0);\n }\n $this->logSis('DEB', 'Tipo de mensagem: ' . $decoded['Type']);\n if ($decoded['Type'] == 'receveid_message') {\n $mensagemDeTexto = true;\n } else if (isset($decoded['Type']) && ($decoded['Type'] == 'receveid_audio_message' || $decoded['Type'] == 'whatsapp.StickerMessage' || $decoded['Type'] == 'receveid_video_message' || $decoded['Type'] == 'receveid_image_message' || $decoded['Type'] == 'receveid_document_message' || $decoded['Type'] == 'whatsapp.ContactMessage' || $decoded['Type'] == 'whatsapp.LocationMessage')) {\n $this->logSis('ERR', 'Cliente tentou enviar mídias');\n $mensagemDeTexto = false;\n } else {\n exit(0);\n }\n //if (isset($decoded['Type']) && ($decoded['Type'] == 'receveid_message' || $decoded['Type'] == 'receveid_audio_message')) {\n $RemoteJid = $decoded['Body']['Info']['RemoteJid'];\n $RemoteJidArray = explode(\"@\", $RemoteJid);\n $numero = $RemoteJidArray[0];\n $this->numerocliente = $numero;\n $this->numero = $numero;\n $tipoNumero = $RemoteJidArray[1];\n $idMensagemWhats = $decoded['Body']['Info']['Id'];\n $timestamp = $decoded['Body']['Info']['Timestamp'];\n $mensagem = $decoded['Body']['Text'];\n $this->stringMensagemAtual = $mensagem;\n\n\n //( Busca informações da instância CHATPRO no banco de dados \n $sql = \"SELECT * FROM tbl_instancias WHERE id_instancia = $idInstancia\";\n $query = mysqli_query($conn['link'], $sql);\n $consultaInstancia = mysqli_fetch_array($query, MYSQLI_ASSOC);\n $numRow = mysqli_num_rows($query);\n if (!$query) {\n echo \"Erro ao tentar conectar no MYSQL \" . mysqli_connect_error();\n $this->logSis('ERR', 'Mysql Connect: ' . mysqli_connect_error());\n\n exit(0);\n }\n if ($numRow == 0) { //VERIFICA SE EXISTE NO BANCO DE DADOS\n $this->logSis('ERR', \"Instância N/E: \" . $id_instancia);\n exit(0);\n } else {\n $this->APIurl = $consultaInstancia['endpoint'] . '/api/v1/';\n $this->token = $consultaInstancia['token'];\n $this->numerosuporte = $consultaInstancia['numero_suporte'];\n $this->conf_cad_dados = $consultaInstancia['conf_cad_dados'];\n $this->msg_cad_dados = $consultaInstancia['msg_cad_dados'];\n $this->msg_inicial = $consultaInstancia['msg_inicial'];\n $this->msg_erro = $consultaInstancia['msg_erro'];\n $this->menuRaiz = $consultaInstancia['menu_raiz'];\n $limite = $consultaInstancia['limite'];\n $status = $consultaInstancia['status'];\n $nome = $consultaInstancia['nome'];\n\n if ($mensagemDeTexto == false) {\n $this->logSis('DEB', 'Identificou mensagem de texto false.');\n $this->sendMessage('ErroFormatoMensagem', $this->numerocliente, \"Esse atendimento funciona somente com envio de texto.\\nFavor enviar sempre mensagens de texto.\", \"\");\n exit(0);\n }\n }\n\n\n //() Verifica se NÃO É uma mensagem recebida de um número ou GRUPO \n if ($tipoNumero == 's.whatsapp.net') {\n\n //( Consulta o contato no BD \n $sql = \"SELECT * FROM tbl_contatos WHERE numero = $numero AND id_instancia = $idInstancia\";\n $query = mysqli_query($conn['link'], $sql);\n $consultaContato = mysqli_fetch_array($query, MYSQLI_ASSOC);\n $numRow = mysqli_num_rows($query);\n\n if (!$query) {\n $this->logSis('ERR', \"Mysql Connect Erro: \" . mysqli_error($conn['link']));\n exit(0);\n }\n\n if ($numRow != 0) { //( O CONTATO EXISTE NO BANCO DE DADOS \n\n if ($consultaContato['bloqueio_bot'] == 1) {\n $this->logSis('DEB', \"Usuário bloqueado bot tentando contato. Contato: \" . $consultaContato['id_contato']);\n\n exit(0);\n }\n\n $this->id_contato = $consultaContato['id_contato'];\n $this->idContato = $consultaContato['id_contato'];\n $nome = $consultaContato['nome'];\n $email = $consultaContato['email'];\n $fase = $consultaContato['fase'];\n $teste = $consultaContato['teste'];\n\n //( Verifica as ultimas 4 mensagens trocadas, se tanto as respostas quanto os envios tiverem sido duplicados para o código\n //( Isso é pra tentar evitar BOT x BOT\n $result = fctConsultaParaArray(\n 'ConsultaBotXBot',\n \"SELECT direcao, mensagem FROM tbl_interacoes WHERE id_contato = $this->idContato ORDER BY id_interacao DESC LIMIT 4\",\n array('direcao', 'mensagem')\n );\n $arrayMensagem = [];\n $mensagemEnviada = '';\n foreach ($result as $linha) { //traz as mensagens para um array simples\n if ($mensagemEnviada == '' && $linha['direcao'] == 0) {\n $mensagemEnviada = $linha['mensagem'];\n }\n array_push($arrayMensagem, $linha['mensagem']);\n }\n $contagem = array_values(array_count_values($arrayMensagem)); //conta os itens e redefine os indices do array\n if (count($contagem) == 2 && $contagem[0] == 2 && $mensagemEnviada == $mensagem) { // Se tiver somente duas mensagens e cada uma tiver 2 mensagens é redundante\n array_push($arrayMensagem, $linha['mensagem']);\n $this->logSis('ERR', 'BOTXBOT PAROU. idContato: ' . $this->idContato);\n exit(0);\n }\n /*else{\n $this->logSis('ERR', 'BOTXBOT PASSOU. Contagem: ' . count($contagem).' Contagem0: '.$contagem[0].' Mensagem Enviada: '.$mensagemEnviada.' Mensagem do Cliente: '.$mensagem.' ArrayMensagem->'.print_r($arrayMensagem, true));\n exit(0);\n }*/\n } else { //( O CONTATO NÃO EXISTE \n $this->primeirocontato = true;\n\n //CONTATO NÃO EXISTE \n //( Insere o contato no banco de dados \n $sql = \"INSERT INTO tbl_contatos(id_instancia, numero, lista_0, teste, created_at) VALUES ('$idInstancia', '$numero', 1, 0, NOW())\";\n $resultado = mysqli_query($conn['link'], $sql);\n $this->id_contato = mysqli_insert_id($conn['link']);\n $this->idContato = mysqli_insert_id($conn['link']);\n if ($resultado != '1') {\n $this->logSis('ERR', 'Insert Contatos. Erro: ' . $resultado . mysqli_connect_error());\n }\n }\n\n //( Insere a interação que foi recebida no BD \n //& Quando inserir a mensagem do cliente, já trazer o ID para colocar na coluna id_retorno na mensagem que vamos enviar. \n //& Verificar também o retorno de erro, caso não consiga inserir o cliente. \n $resultado = $this->inserirInteracao($this->idInstancia, 0, $this->id_contato, '', '', '', '', '', '', $idMensagemWhats, $mensagem, 1);\n\n if ($resultado == '1') {\n $mensagem = explode(' ', trim($decoded['Body']['Text']));\n $palavra = mb_strtolower($mensagem[0], 'UTF-8');\n\n if ($this->primeirocontato == true) { //( Se for o primeiro contato\n //( Verifica se o e-mail é valido\n $this->validaEmail($palavra, $numero, true, $this->id_contato);\n } else if ($email == '') { //Sem e-mail cadastrado\n //( Verifica se o e-mail é valido\n $this->validaEmail($palavra, $numero, false, $this->id_contato);\n } else {\n\n //( Consulta a última interação enviada pra ver se foi a solicitação de nome \n $ultimaInteracao = $this->verificaInteracao($idInstancia, $this->id_contato);\n $tempoParaUltimaInteracao = $this->difDatasEmHoras($ultimaInteracao['dataEnvio'], date(\"Y-m-d H:i:s\"));\n\n if ($nome == '') {\n //( Caso não tenha enviado ainda a pergunta do nome\n if ($ultimaInteracao['mensagem'] != 'solicitaNome') {\n\n if ($tempoParaUltimaInteracao >= 2) { //Se tiver mais de 2 horas sem interação, dar umas boas vindas ao cliente\n $texto = 'Olá, que bom que está de volta! Para que eu possa te conhecer melhor, qual o seu nome?';\n } else {\n $texto = 'Olá, para que possamos seguir com o atendimento, por favor digite seu nome?';\n }\n $this->sendMessage(\"solicitaNome\", $numero, $texto, '');\n } else { //( Caso a última interação tenha sido solicitado o nome. \n //( Verifica a mensagem em busca do primeiro nome \n $nome = $this->verificaNome($decoded['Body']['Text']);\n if ($nome == \"\" || strlen($nome) < 2) { // não trouxe nada \n $texto = 'Não compreendi, pode por favor enviar somente o seu primeiro nome.';\n $this->sendMessage(\"solicitaNome\", $numero, $texto, '');\n } else { // encontrou o primeiro nome\n //( Salva o nome no banco \n $resultadoAtualizaNome = $this->atualizaCampo('tbl_contatos', 'nome', $nome, 'id_instancia = ' . $idInstancia . ' AND id_contato = ' . $this->id_contato);\n if ($resultadoAtualizaNome == true) {\n $textoComplementar = \"Prazer em conhecer você $nome!\\n\\n\";\n\n $this->envioMenuRaiz($numero, $textoComplementar);\n }\n }\n }\n } else {\n $this->logSis('DEB', 'Indetificou que tem nome');\n\n $this->resposta($numero, $decoded);\n }\n }\n }\n }\n }\n }", "public function verRedThinkClientEnPlasma( ) {\n\n $respuesta=self::$plasma->verEnPantallaVGA();\n return $this->isError($respuesta,\"ver el redthinkclient en\");\n }", "public function login() {\r\n if (!empty($_POST)) {\r\n $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);\r\n $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\r\n\r\n $hash = hash('sha512', $password . Configuration::USER_SALT);\r\n unset($password);\r\n\r\n $user = UserModel::getByUsernameAndPasswordHash($username, $hash);\r\n unset($hash);\r\n\r\n if ($user) {\r\n Session::set('user_id', $user->user_id);\r\n Session::set('username', $username);\r\n Session::set('ip', filter_input(INPUT_SERVER, 'REMOTE_ADDR'));\r\n Session::set('ua', filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING));\r\n\r\n Misc::redirect('');\r\n } else {\r\n $this->set('message', 'Nisu dobri login parametri.');\r\n sleep(1);\r\n }\r\n }\r\n }", "function Access()\n\t{\n\t\t$this->clear_authentication(false);\n\t\t$this->identify();\n\t}", "function login()\n {\n $post_data = array();\n $post_data['Email'] = $this->email;\n $post_data['Passwd'] = $this->password;\n $post_data['source'] = \"exampleCo-exampleApp-1\";\n $post_data['service'] = \"cl\";\n $post_data['accountType'] = \"GOOGLE\";\n\n $response = $this->post(\"/accounts/ClientLogin\", $post_data, null);\n\n if(200==$this->status)\n {\n $this->fAuth = $this->get_parsed($this->content, \"Auth=\");\n $this->isLogged = true;\n\n return 1;\n }\n $this->isLogged = false;\n return 0;\n }", "public function getLogin() {\n // redirect if user has been logged in\n $view = new View('layout');\n $view->inject('navbar', 'navbar');\n $view->inject('content', 'login');\n $view->set('pageTitle', 'Login');\n\n $view->addJavascript('/assets/js/js-cookie.js');\n $view->addJavascript('/assets/js/login.js');\n $view->addJavascript('/assets/js/sha.js');\n\n // csrf\n $manager = SessionManager::getManager();\n $manager->generateCsrfToken();\n\n echo $view->output();\n }", "public function index()\n { \n if (Login::isConnected()) {\n $this->redirectConnectedUser($_SESSION['user']['role']);\n } else {\n // Init error params\n $alert = null;\n $errorLoginMsg = null;\n $errorSignupMsg = null;\n $successMsg = null;\n\n // Catch feedback during login or signup and set alert message\n if (isset($_GET['alert'])) {\n $alert = $_GET['alert'];\n switch($alert) {\n case 'NotUser':\n $errorLoginMsg = 'L\\'identifiant saisi ne correspond à aucun utilisateur';\n break;\n case 'Login':\n $errorLoginMsg = 'L\\'identifiant ou le mot de passe saisi est incorrect.';\n break;\n case 'signup':\n $errorSignupMsg = 'Une erreur est survenue, impossible de créer le compte. Veuillez recommencer.';\n break;\n case 'success':\n $successMsg = 'Votre compte a été créé avec succès ! Connectez-vous à présent pour profiter au mieux de mon site <i class=\"fas fa-smile-wink\"></i>';\n break;\n case 'passwords':\n $errorSignupMsg = 'Les mots de passes saisis ne correspondent pas.';\n break;\n case 'userSignup':\n $errorSignupMsg = 'Un utilisateur est déjà associé à cet identifiant.';\n break;\n }\n }\n\n $this->generateView(array(\n 'errorLoginMsg' => $errorLoginMsg,\n 'errorSignupMsg' => $errorSignupMsg,\n 'successMsg' => $successMsg\n ));\n }\n }", "public function inicio($edicion = 0,$id_usuario = \"\"){\r\n\t\t$tipoDirec = self::$datoDB->selectTipoDireccion();\r\n\t\t//$ciudad\t = self::$datoDB->selectCiudad();\r\n\t\t$localidad = self::$datoDB->selectLocalidad();\r\n\t\t/* Query para llenar Email*/\r\n\t\t$tipoEmail = self::$datoDB->selectTipoCorreo();\r\n\t\t/* Query para llenar Fono*/\r\n\t\t$tipoFono = self::$datoDB->selectTipoTelefono();\r\n\t\t\r\n\r\n\t\t/* Querys si el administrador edita al usuario */\t\r\n\t\tif($edicion == 1){\r\n\t\t\t/* Datos tabla org_usuario */\r\n\t\t\t$dataUsuario = self::$datoDB->selectuDataUsuario($id_usuario);\t\t\t\t\t\r\n\t\t}\r\n?>\r\n\t<script language=\"javascript\" type=\"text/javascript\">\r\n\t\t$('#rut_us').Rut({\r\n\t\t\t on_error: function(){ alert('Rut incorrecto');\r\n\t\t\t \t\t$(\"#rut_us\").each(function(){\t\r\n\t\t\t\t\t$($(this)).val('')\r\n\t\t\t\t});},\r\n\t\t\t format_on: 'keyup'\r\n\t\t});\r\n\t</script>\r\n\r\n<div id=\"form_inicio\" align=\"center\">\r\n<form id=\"principal\" name=\"principal\" method=\"POST\" enctype=\"multipart/form-data\"><!-- action=\"controller.php?mod=4\" -->\r\n\r\n<table class=\"cuadrotexto\" align=\"center\" width=\"70%\">\r\n\t<div id='uso_default'></div>\r\n\t<?php \r\n\t\tif($edicion == 1){\r\n\t\t\tif($dataUsuario[0][11] == \"\"){\r\n\t\t\t\t$dataUsuario[0][11] = \"./Fotos/sin-imagen.jpg\";\r\n\t\t\t\t$liminaF = \"\"; \t //Si el usuario no tiene foto oculto el boton eliminar foto\r\n\t\t\t\t$fileLocked = \"\"; //si el usuario no tiene foto activo el cargar foto\r\n\t\t\t}else{\r\n\t\t\t\t$liminaF = \"<tr><td align='center'><a href='#' onClick='eliminaFoto(\\\"\".$dataUsuario[0][11].\"\\\",$id_usuario);'>Eliminar foto</a></td></tr>\";\r\n\t\t\t\t$fileLocked = \"disabled = true\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\techo \"<tr><td colspan='4' align='center' class='person'><div class='person'><img src='\".$dataUsuario[0][11].\"' width='130px' height='150px'></div></td></tr>\";\r\n\t\t\techo $liminaF;\r\n\t\t\t$colsan = \"colspan='7'\";\r\n\t\t}else{\r\n\t\t\t$colsan = \"colspan='5'\";\r\n\t\t}\r\n?>\r\n\t<tr>\r\n\t\t<td>\r\n\t\t\t<table align=\"center\" width=\"100%\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td <?=$colsan?> class=\"ui-corner-all ui-widget-header\" align=\"center\">DATOS USUARIO</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\" width=\"60px\">Rut</td>\r\n\t\t\t\t\t<td width=\"290px\"><?=self::inputText(array(\"name\"=>\"rut_us\",\"id\"=>\"rut_us\",\"onBlur\"=>\"validaRut(this.value,$edicion);\",\"value\"=>$dataUsuario[0][1]))?></td> <!-- ,\"onBlur\"=>\"validaRut()\" -->\r\n\t\t\t\t\t<td width=\"80px\"><div id=\"rut_val\"></div></td>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Foto</td>\r\n\t\t\t\t\t<td><input type=\"file\" id=\"foto_us\" name=\"foto_us\" <?=$fileLocked?>></input></td><!-- class=\"upload\" -->\t\r\n\t\t\t\t<?php \r\n\t\t\tif($edicion == 1){\r\n echo \" <script type=\\\"text/javascript\\\">\\n\"; \r\n echo \" // <![CDATA[\\n\"; \r\n echo \" $(document).ready(function() {\\n\"; \r\n echo \" $('#foto_us').uploadify({\\n\"; \r\n echo \" 'uploader' : 'uploadify/uploadify.swf',\\n\"; \r\n echo \" 'script' : 'uploadify/uploadify.php',\\n\"; \r\n echo \" 'cancelImg' : 'uploadify/cancel.png',\\n\"; \r\n echo \" 'folder' : 'Fotos',\\n\"; \r\n echo \" 'auto' : true,\\n\";\r\n echo \" 'buttonText' :'Subir Archivo',\\n\"; \r\n //echo \" 'scriptData' : {'fuente':'Status','id_informe':12067},\\n\"; \r\n echo \" 'method' : 'post',\\n\"; \r\n echo \" 'onComplete' : function(event, ID, fileObj, response, data) {\\n\"; \r\n echo \" alert('Archivo Subido Correctamente!');\\n\"; \r\n echo \" insertarUploadify('$id_usuario',response);\\n\";\r\n echo \" }\\n\"; \r\n echo \" });\\n\"; \r\n echo \" });\\n\"; \r\n echo \" // ]]>\\n\"; \r\n echo \" </script>\\n\";\r\n\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Nombres</td>\r\n\t\t\t\t\t<td><?=self::inputText(array(\"id\"=>\"nombre_us\",\"name\"=>\"nombre_us\",\"value\"=>$dataUsuario[0][12],\"maxlength\"=>100))?></td>\r\n\t\t\t\t\t<td>&nbsp;</td>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Apellidos</td>\r\n\t\t\t\t\t<td><?=self::inputText(array(\"id\"=>\"apellido_us\",\"name\"=>\"apellido_us\",\"value\"=>$dataUsuario[0][13],\"maxlength\"=>100))?></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Login</td>\r\n\t\t\t\t\t<td><?=self::inputText(array(\"id\"=>\"login_us\",\"name\"=>\"login_us\",\"onblur\"=>\"validaLogin(this.value,$edicion);\",\"value\"=>$dataUsuario[0][14],\"maxlength\"=>30))?></td>\r\n\t\t\t\t\t<td width=\"80px\"><div id=\"acep_no\"></div></td>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Fecha Nac.</td>\r\n\t\t\t\t\t<td><?=self::inputFecha(\"fecha_nac\",array(\"id\"=>\"fecha_nac\",\"value\"=>$dataUsuario[0][15],\"yearRange\"=>\"c-90:c+0\"))?></td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t\r\n\t\t\t\t<tr>\r\n\t\t\t\t<?php if($edicion == 1){\r\n\t\t\t\t\t\t\tif($dataUsuario[0][4] == \"M\"){\r\n\t\t\t\t\t\t\t\t$selectedM = \"selected\";\r\n\t\t\t\t\t\t\t\t$selectedF = \"\";\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t$selectedM = \"\";\r\n\t\t\t\t\t\t\t\t$selectedF = \"selected\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t\t\t<td class=\"cuadrotexto\">Sexo</td>\r\n\t\t\t\t\t<td>\r\n\t\t\t\t\t\t<select id=\"sexo_us\" name=\"sexo_us\">\r\n\t\t\t\t\t\t\t<option value=\"\">-Seleccione-</option>\r\n\t\t\t\t\t\t\t<option value=\"M\" <?=$selectedM?>>Masculino</option>\r\n\t\t\t\t\t\t\t<option value=\"F\" <?=$selectedF?>>Femenino</option>\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t</td>\r\n\t\t\t\t\t<td>&nbsp;</td>\r\n\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t\r\n\t\t\t<?php if($edicion != 1){?>\r\n\t\t\t<table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\" width=\"60px\">Direccion</td>\r\n\t\t\t\t\t<td colspan=\"4\"><?=self::inputText(array(\"name\"=>\"direccion_pers0\",\"id\"=>\"direccion_pers0\",\"style\"=>\"width: 100px\",\"maxlength\"=>50))?> <!-- ,\"style\"=>\"50px\" -->\r\n\t\t\t\t\tNro <?=self::inputText(array(\"id\"=>\"nmro0\",\"name\"=>\"nmro0\",\"style\"=>\"width: 50px\"))?>\r\n\t\t\t\t\tDpto <?=self::inputText(array(\"id\"=>\"dpto0\",\"name\"=>\"dpto0\",\"style\"=>\"width: 50px\",\"maxlength\"=>5))?>\r\n\t\t\t\t\t<?=self::combobox(\"tipo_direc0\",$tipoDirec,array(\"id\"=>\"tipo_direc0\",\"style\"=>\"width: 70px\",\"first_option\"=>\"-Tipo-\"))?>\r\n\t\t\t\t\t<?=self::combobox(\"local_pers0\",$localidad,array(\"id\"=>\"local_pers0\",\"style\"=>\"width: 100px\",\"first_option\"=>\"-Localidad-\"))?>\r\n\t\t\t\t\t<a href='#' onClick='AgregarCamposDireccion();'><img src='../../img/mas.jpg'></a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t\t<?php }else{?>\r\n\t\t\t\t\t<div id='muestraDirec'><?=self::muestraDireccion($id_usuario)?></div>\r\n\t\t\t\t<?php }?>\t\r\n<!-- Dinamico Direc --> <div id=\"campos_direccion\" align=\"center\"></div>\t\r\n<input type=\"hidden\" id=\"mod_direc\" name=\"mod_direc\" value=\"0\">\t\r\n\t\t\t<?php if($edicion != 1){?>\t\r\n\t\t\t<table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\" width=\"60px\">Email</td>\r\n\t\t\t\t\t<td colspan=\"2\"><?=self::inputText(array(\"id\"=>\"email0\",\"name\"=>\"email0\",\"maxlength\"=>100))?>&nbsp;\r\n\t\t\t\t\t<?=self::combobox(\"tipo_correo0\",$tipoEmail,array(\"id\"=>\"tipo_correo0\",\"style\"=>\"width:70px\",\"first_option\"=>\"-Tipo-\"))?> <a href='#' onClick='AgregarCamposEmail();'><img src='../../img/mas.jpg'></a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t<?php }else{?>\r\n\t\t\t\t\t<div id='div_muestra_email'><?=self::muestraEmail($id_usuario)?></div>\r\n\t\t\t<?php }?>\r\n\t\t\t\r\n<!-- Dinamico email --> <div id=\"campos_email\" align=\"center\"></div>\r\n<input type=\"hidden\" id=\"mod_email\" name=\"mod_email\" value=\"0\">\r\n\t\t\t<?php if($edicion != 1){?>\t\r\n\t\t\t<table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td class=\"cuadrotexto\" width=\"60px\">Fono</td>\r\n\t\t\t\t\t<td colspan=\"2\"><?=self::inputText(array(\"id\"=>\"fono0\",\"name\"=>\"fono0\",\"maxlength\"=>30))?>&nbsp;\r\n\t\t\t\t\t<?=self::combobox(\"tipo_fono0\",$tipoFono,array(\"id\"=>\"tipo_fono0\",\"style\"=>\"width: 70px\",\"first_option\"=>\"-Tipo-\"))?> <a href='#' onClick='AgregarCamposFono();'><img src='../../img/mas.jpg'></a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>\r\n\t\t\t<?php }else{?>\r\n\t\t\t\t\t<div id='div_muestra_fono'><?=self::muestraFono($id_usuario)?></div>\r\n\t\t\t<?php }?>\r\n<!-- Dinamico Fono --> <div id=\"campos_fono\" align=\"center\"></div>\r\n<input type=\"hidden\" id=\"mod_fono\" name=\"mod_fono\" value=\"0\">\r\n\t\t\t<table width=\"100%\">\r\n\t\t\t\t\t<tr><td>&nbsp;</td></tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\"4\" class=\"ui-corner-all ui-widget-header\" align=\"center\">DATOS LABORALES</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">C&oacute;digo T&eacute;cnico</td>\r\n\t\t\t\t\t\t<td><?=self::inputText(array(\"id\"=>\"codigo_tecnico_us\",\"name\"=>\"codigo_tecnico_us\",\"value\"=>$dataUsuario[0][16],\"maxlength\"=>30))?></td>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Area Funcional</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"area_fun_us\",self::$datoDB->selectAreaFun(),array(\"id\"=>\"area_fun_us\",\"default\"=>$dataUsuario[0][17]))?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Cargo</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"cargo_us\",self::$datoDB->selectCargo(),array(\"id\"=>\"cargo_us\",\"default\"=>$dataUsuario[0][18]))?></td>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Direcci&oacute;n</td> \r\n\t\t\t\t\t\t<td><?=self::combobox(\"dire_lab_us\",self::$datoDB->selectDireccionLaboral(),array(\"id\"=>\"dire_lab_us\",\"default\"=>$dataUsuario[0][19]))?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Tipo usuario</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"interno_no_us\",self::$datoDB->selectInternoNoi(),array(\"id\"=>\"interno_no_us\",\"onchange\"=>\"verificaInterino(this.value);\",\"default\"=>$dataUsuario[0][20]))?></td>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Empresa</td>\r\n\t\t\t\t\t\t<td><div id=\"empresa\"><?=self::combobox(\"empresa_us\",self::$datoDB->selectEmpresa(),array(\"id\"=>\"empresa_us\",\"default\"=>$dataUsuario[0][21]))?></div></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Fecha ing. VTR</td>\r\n\t\t\t\t\t\t<td><?=self::inputFecha(\"fecha_ingreso_vtr\",array(\"id\"=>\"fecha_ingreso_vtr\",\"value\"=>$dataUsuario[0][3],\"yearRange\"=>\"-20:+0\"))?></td>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Nivel de aprobaci&oacute;n</td><!-- Es el nivel Ap. Si. -->\r\n\t\t\t\t\t\t<td><?=self::combobox(\"nivel_apro_us\",self::$datoDB->selectNivelApSi(),array(\"id\"=>\"nivel_apro_us\",\"default\"=>$dataUsuario[0][22],\"selected\"=>\"selected\"))?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Perfil</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"perfil_us\",self::$datoDB->selectPerfil(),array(\"id\"=>\"perfil_us\",\"default\"=>$dataUsuario[0][23]))?></td>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Jefe</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"jefe_us\",self::$datoDB->selectJefes(),array(\"id\"=>\"jefe_us\",\"default\"=>$dataUsuario[0][24]))?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<?php if($edicion == 1){\r\n\t\t\t\t\t\t \t$valor = $dataUsuario[0][25];\r\n\t\t\t\t\t\t }else{\r\n\t\t\t\t\t\t\t$valor = 1;\r\n\t\t\t\t\t\t }?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class=\"cuadrotexto\">Estado</td>\r\n\t\t\t\t\t\t<td><?=self::combobox(\"estado_us\",self::$datoDB->selectEstado(),array(\"id\"=>\"estado_us\",\"default\"=>$valor))?></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t</table>\t\r\n\t<!-- ----------------- Campos dinamicos -->\r\n\t<script type=\"text/javascript\">\r\n\r\n// ********************************* DINAMICOS DIRECCION *************************\t\t\r\n\t\t\tvar nextinput2 = 0;\r\n\t\t\tfunction AgregarCamposDireccion(){\r\n\t\t\t\tdireccion\t= $(\"#direccion_pers\"+nextinput2).val();\r\n\t\t\t\ttipo_direc\t= $(\"#tipo_direc\"+nextinput2).val();\r\n\t\t\t\tlocalidad\t= $(\"#local_pers\"+nextinput2).val();\r\n\t\t\t\tnmro\t\t= $(\"#nmro\"+nextinput2).val();\r\n\t\t\t\tdpto\t\t= $(\"#dpto\"+nextinput2).val();\r\n\r\n\t\t\t\terror = \"\"\r\n\t\t\t\tcabecera = \"Debe ingresar los siguientes datos \\n\";\r\n\r\n\t\t\t\tif(direccion == \"\"){\r\n\t\t\t\t\terror += \"- Ingrese Direccion \\n\";\r\n\t\t\t\t}\r\n\t\t\t\tif(nmro == \"\"){\r\n\t\t\t\t\terror += \"- Ingrese el numero de la direccion \\n\";\r\n\t\t\t\t}\r\n\t\t\t\tif(tipo_direc == \"\"){\r\n\t\t\t\t\terror += \"- Seleccione Tipo de direccion \\n\";\r\n\t\t\t\t}\r\n\t\t\t\tif(localidad == \"\"){\r\n\t\t\t\t\terror += \"- Seleccione Localidad \\n\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif(error != \"\"){\r\n\t\t\t\t\talert(cabecera+error);\r\n\t\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t\tnextinput2++;\r\n\t\r\n\t\t\t\t\tcampo = \"<table align='left' width='100%'>\";\r\n\r\n\t\t\t\t\tcampo += \"<tr>\";\r\n\r\n\t\t\t\t\tcampo += \"<td width='65px'>&nbsp;</td>\";\r\n\r\n\t\t\t\t\tcampo += \"<td>\";\r\n\r\n\t\t\t\t\tcampo += \"&nbsp;<input type='text' id='direccion_pers\"+nextinput2+\"' name='direccion_pers\"+nextinput2+\"' style='width:100px' maxlength='50'>&nbsp;\";\r\n\t\t\t\t\tcampo += \"&nbsp;Nro <input type='text' id='nmro\"+nextinput2+\"' name='nmro\"+nextinput2+\"' style='width:50px'>&nbsp;\";\r\n\t\t\t\t\tcampo += \"&nbsp;Dpto <input type='text' id='dpto\"+nextinput2+\"' name='dpto\"+nextinput2+\"' style='width:50px' maxlength='5'>&nbsp;\";\r\n\r\n\t\t\t\t\tcampo += \"<select style='width: 70px' id='tipo_direc\"+nextinput2+\"' name='tipo_direc\"+nextinput2+\"'>\";\r\n\t\t\t\t\tcampo += \"<option value=''>-Tipo-</option>\";\r\n\t\t\t\t\t<?php for($i=0;$i<count($tipoDirec['ID_TIPO_DIRECCION_USUARIO']);$i++){?>\r\n\t\t\t\t\tcampo += \"<option value='<?=$tipoDirec['ID_TIPO_DIRECCION_USUARIO'][$i]?>'><?=$tipoDirec['NOMBRE'][$i]?></option>\";\r\n\t\t\t\t\t<?php }?>\r\n\t\t\t\t\tcampo += \"</select>&nbsp;\";\r\n\r\n\t\t\t\t\tcampo += \"<select style='width: 100px' id='local_pers\"+nextinput2+\"' name='local_pers\"+nextinput2+\"'>\";\r\n\t\t\t\t\tcampo += \"<option value=''>-Localidad-</option>\";\r\n\r\n\t\t\t\t\t<?php for($i=0;$i<count($localidad['CODI_LOCALIDAD']);$i++){?>\r\n\t\t\t\t\tcampo += \"<option value='<?=$localidad['CODI_LOCALIDAD'][$i]?>'><?=$localidad['DESC_LOCALIDAD'][$i]?></option>\";\r\n\t\t\t\t\t<?php }?>\r\n\t\t\t\t\tcampo += \"</select>&nbsp;\";\r\n\r\n\t\t\t\t\tcampo += \"<a href='#' onClick='eliminaTr(this);'><img src='../../img/menos.jpg'> Eliminar</a>\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tcampo += \"</td>\";\r\n\r\n\t\t\t\t\tcampo += \"<td>&nbsp;</td>\";\r\n\t\t\t\t\tcampo += \"</tr>\";\r\n\t\t\t\t\tcampo += \"</table>\";\r\n\r\n\t\t\t\t\t$(\"#campos_direccion\").append(campo);\r\n\t\r\n\t\t\t\t\tdocument.getElementById(\"mod_direc\").value = nextinput2;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n// ********************************* DINAMICOS EMAIL *************************\t\t\r\n\tvar nextinput = 0;\r\n\r\n\t\tfunction AgregarCamposEmail(){\r\n\t\t\tcorreo\t= $(\"#email\"+nextinput).val();\r\n\t\t\ttipo\t= $(\"#tipo_correo\"+nextinput).val();\r\n\r\n\t\t\terror = \"\"\r\n\t\t\tcabecera = \"Debe ingresar los siguientes datos \\n\";\r\n\t\t\t\r\n\t\t\tif(correo == \"\"){\r\n\t\t\t\terror += \" - Correo \\n\";\r\n\t\t\t}\r\n\t\t\tif(tipo == \"\"){\r\n\t\t\t\terror += \" - Tipo de correo \\n\";\r\n\t\t\t}\r\n\r\n\t\t\tif(error != \"\"){\r\n\t\t\t\talert(cabecera+error);\r\n\t\t\t}else{\r\n\r\n\t\t\t\tnextinput++;\r\n\t\r\n\t\t\t\tcampo = \"<table align='left' width='100%'>\";\r\n\t\t\t\tcampo += \"<tr>\";\r\n\t\r\n\t\t\t\tcampo += \"<td width='65px'>&nbsp;</td>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<td>\";\r\n\t\r\n\t\t\t\tcampo += \"<input type='text' id='email\"+nextinput+\"' name='email\"+nextinput+\"' style='width: 290px' maxlength=100>&nbsp;\";\r\n\t\t\t\tcampo += \"<select style='width:70px' id='tipo_correo\"+nextinput+\"' name='tipo_correo\"+nextinput+\"'>\";\r\n\t\t\t\tcampo += \"<option value=''>-Tipo-</option>\";\r\n\t\t\t\t<?php for($i=0;$i<count($tipoEmail['ID_TIPO_CORREO_USUARIO']);$i++){?>\r\n\t\t\t\tcampo += \"<option value='<?=$tipoEmail['ID_TIPO_CORREO_USUARIO'][$i]?>'><?=$tipoEmail['DESCRIPCION'][$i]?></option>\";\r\n\t\t\t\t<?php }?>\r\n\t\t\t\tcampo += \"</select>\";\r\n\t\r\n\t\t\t\tcampo += \"&nbsp;<a href='#' onClick='eliminaTr(this);'><img src='../../img/menos.jpg'> Eliminar</a>\";\t\r\n\t\r\n\t\t\t\tcampo += \"</td>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<td>&nbsp;</td>\";\r\n\t\r\n\t\t\t\tcampo += \"</tr>\";\r\n\t\t\t\tcampo += \"</table>\";\r\n\t\r\n\t\t\t\t$(\"#campos_email\").append(campo);\r\n\t\r\n\t\t\t\tdocument.getElementById(\"mod_email\").value = nextinput;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\r\n// ********************************* DINAMICOS FONO *************************\t\t\r\n\t\tvar nextinput3 = 0;\r\n\t\tfunction AgregarCamposFono(){\r\n\r\n\t\t\tfono\t\t= $(\"#fono\"+nextinput3).val();\r\n\t\t\ttipo_fono\t= $(\"#tipo_fono\"+nextinput3).val();\r\n\r\n\t\t\terror = \"\"\r\n\t\t\tcabecera = \"Debe ingresar los siguientes datos \\n\";\r\n\t\t\t\r\n\t\t\tif(fono == \"\"){\r\n\t\t\t\terror += \" - Fono \\n\";\r\n\t\t\t}\r\n\t\t\tif(tipo_fono == \"\"){\r\n\t\t\t\terror += \" - Tipo de Fono \\n\";\r\n\t\t\t}\r\n\r\n\t\t\tif(error != \"\"){\r\n\t\t\t\talert(cabecera+error);\r\n\t\t\t}else{\r\n\t\t\t\r\n\t\t\t\tnextinput3++;\r\n\t\r\n\t\t\t\tcampo = \"<table align='left' width='100%'>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<tr>\";\r\n\t\r\n\t\t\t\tcampo += \"<td width='65px'>&nbsp;</td>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<td>\";\r\n\t\r\n\t\t\t\tcampo += \"<input type='text' id='fono\"+nextinput3+\"' name='fono\"+nextinput3+\"' style='width:290px' maxlength=30>&nbsp;\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<select style='width:70px' id='tipo_fono\"+nextinput3+\"' name='tipo_fono\"+nextinput3+\"'>\";\r\n\t\t\t\tcampo += \"<option value=''>-Tipo-</option>\";\r\n\t\t\t\t<?php for($i=0;$i<count($tipoFono['ID_TIPO_TELEFONO']);$i++){?>\r\n\t\t\t\tcampo += \"<option value='<?=$tipoFono['ID_TIPO_TELEFONO'][$i]?>'><?=$tipoFono['DESCRIPCION_TELEFONO'][$i]?></option>\";\r\n\t\t\t\t<?php }?>\r\n\t\t\t\tcampo += \"</select>&nbsp;\";\r\n\t\r\n\t\t\t\tcampo += \"<a href='#' onClick='eliminaTr(this);'><img src='../../img/menos.jpg'> Eliminar</a>\";\t\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"</td>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"<td>&nbsp;</td>\";\r\n\t\t\t\t\r\n\t\t\t\tcampo += \"</tr>\";\r\n\t\t\t\tcampo += \"</table>\";\r\n\t\r\n\t\t\t\t$(\"#campos_fono\").append(campo);\r\n\t\r\n\t\t\t\tdocument.getElementById(\"mod_fono\").value = nextinput3;\r\n\t\t\t}\r\n\t\t}\r\n\t</script>\r\n\t<!-- ----------------- Fin campos dinamicos ----------- -->\r\n\t\t</td>\r\n\t</tr>\r\n\t<?php if($edicion == 1){?>\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"4\" align=\"center\"><?=self::inputButton(array(\"value\"=>\"Actualizar\",\"onclick\"=>\"actualizaUsuario($id_usuario);\",\"style\"=>\"width :100px\"));?></td>\r\n\t\t</tr>\r\n\t<?php }else{?>\r\n\t<tr>\r\n\t\t<td colspan=\"4\" align=\"center\"><?=self::inputButton(array(\"value\"=>\"Guardar\",\"onclick\"=>\"insertaUsuario(this.form);\",\"style\"=>\"width :100px\"));?></td>\r\n\t</tr>\r\n\t<?php }?>\r\n</table>\r\n\r\n</form>\r\n</div>\r\n<?php\r\n\t}", "function actionLogin(){\n\t\t//session_start();\n\t\t\n\t\tif (!empty($_POST['id'])){\n\t\t\t$url = 'http://localhost:8090/BlogServer/ServletDemo?username=%3Bl&password=';\n\t\t\t$html = file_get_contents($url); \n\t\t\t$respObject = json_decode($html);\n\t\t\tif (!Empty($respObject->user->$_POST['id'])){\t\t\t\t\n\t\t\t\t$_SESSION['views'] = $respObject->user->$_POST['id'];\n\t\t\t\t$art = new Article();\n\t\t\t\t$this->findall = $art->findAll();\n\t\t\t\t$this->display(\"kmblog/km_index.html\");\n\t\t\t}\n\t\t}\n\t}", "public function login()\n {\n $p=$this->input->post();\n\n $email=$p['user_email'];\n $password=$p['user_password'];\n\n $rs=$this->um->login($email,$password);\n\n $msg=array();\n\n if($rs!='')\n {\n $id=$rs->user_id;\n\n $msg['alert']='success';\n $msg['link_to']='home-page';\n $msg['user_id']=$id;\n }\n else\n {\n $msg['alert']='';\n $msg['notify']='Incorrect email and password';\n }\n\n echo json_encode($msg);\n }", "public function loginFreelanceRu() {\n $this->execGET('https://freelance.ru/login/');\n\n //Form data for send (simulate form login request)\n $data = [\n 'login' => $this->getLogin(),\n 'passwd' => $this->getPassword(),\n 'check_ip' => 'on',\n 'submit' => 'Вход',\n 'auth' => 'auth',\n 'return_url' => '/login/'\n ];\n\n $headers = [\n 'Host:freelance.ru',\n 'Origin:https://freelance.ru',\n 'Referer:https://freelance.ru/login/',\n ];\n\n return $this->execPOST('https://freelance.ru/login/', $data, $headers);\n }", "function login() { \n$a_log =\"<html><head><title>\".judul.\"</title></head>\";\n$a_log.=\"<font color=red>achan</font>@<font color=blue>\".$_SERVER['HTTP_HOST'].\"</font>:<font color=green>\".getcwd().\"</font> $ sudo su\";\n$a_log.=\"<form method='POST'><label for='pass'>[<font color=purple>sudo</font>]<font color=orange> password for achan</font>:</label><input type='password' name='pass' style='border:0;width:600px;'></form>\";\n$a_log.=\"</body></html>\"; \nif(empty($_GET['login'])==\"achan\"){\n\techo '<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL '.$_SERVER['REQUEST_URI'].' was not found on this server.</p>\n<hr>\n<address>'.$_SERVER['SERVER_SOFTWARE'].' Server at '.$_SERVER['HTTP_HOST'].' Port 80</address>\n</body></html>\n';\n}else{\n\techo $a_log;\n}\n exit; \n}", "function getTelaLogin() {\n if (isset($_COOKIE['loginUser'])) {\n $sUser = $_COOKIE['loginUser'];\n } else {\n $sUser = '';\n };\n //verifica se tem o cookie de senha\n if (isset($_COOKIE['pass'])) {\n $sPass = $_COOKIE['pass'];\n } else {\n $sPass = '';\n };\n\n if (isset($_REQUEST['soluser'])) {\n $bSoluser = $_REQUEST['soluser'];\n }\n\n $sTelaIncial = '<!DOCTYPE html>'\n . '<html class=\"no-js\" lang=\"en\">'\n . '<head>'\n //.'<meta charset=\"utf-8\">'\n . '<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">'\n . '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui\">'\n . '<link rel=\"shortcut icon\" href=\"biblioteca/assets/images/favicon.ico\">'\n . '<!-- Stylesheets -->'\n . '<link rel=\"stylesheet\" href=\"biblioteca/assets/css/bootstrap.min.css\">'\n . '<link rel=\"stylesheet\" href=\"biblioteca/assets/css/bootstrap-extend.min.css\">'\n . '<link rel=\"stylesheet\" href=\"biblioteca/assets/css/site.min.css\">'\n . '<!-- Page -->'\n . '<link rel=\"stylesheet\" href=\"biblioteca/assets/css/login.css?'\n . time()\n . '\">'\n . '<link rel=\"stylesheet\" href=\"biblioteca/assets/vendor/bootstrap-sweetalert/sweet-alert.css\">'\n . '<title>Metalbo | Acesso ao Sistema</title>'\n . '</head>'\n . '<body class=\"page-login-v3 layout-full\">'\n /* . '<video autoplay muted loop id=\"myVideo\">'\n . '<source src=\"biblioteca/assets/images/login.mp4\" type=\"video/mp4\">'\n . '</video>' */\n . '<div id=\"conteudo\">'\n . '<div class=\"page animsition vertical-align text-center\" data-animsition-in=\"fade-in\"'\n . 'data-animsition-out=\"fade-out\">'\n . '<div class=\"page-content vertical-align-middle\">'\n . '<div class=\"panel\">'\n . '<div class=\"panel-body\">'\n . '<div class=\"brand\">'\n . '<img class=\"brand-img\" src=\"biblioteca/assets/images/grupo-rex.jpg\" alt=\"Metalbo: Uma empresa do grupo Rex Máquinas\" style=\"max-width: 320px; width: 100%;\">'\n . '</div>'\n . '<form method=\"post\" id=\"frm-login\">'\n . '<div class=\"form-group form-material floating\">'\n . '<input type=\"email\" class=\"form-control\" style=\"font-size:14px;\" name=\"login\" value=\"' . $sUser . '\" />'\n . ' <label class=\"floating-label\">E-mail</label>'\n . '</div>'\n . '<div class=\"form-group form-material floating\">'\n . ' <input type=\"password\" class=\"form-control\" name=\"loginsenha\" onkeypress=\"capsLock(event)\" style=\"font-size:14px;\" value=\"' . $sPass . '\" id=\"psswd\"/>'\n . '<div id=\"divMayus\" style=\"visibility:hidden; color:red; font-size:12px; margin-top:12px\">Atenção! Caps Lock ligado.</div> '\n . ' <label class=\"floating-label\">Senha</label>'\n . '</div>'\n . ' <input type=\"button\" class=\"btn btn-block btn-success margin-top-40\" id=\"btn_entrar\" value=\"ENTRAR\" onclick=\"requestAjax(\\'frm-login\\',\\'MET_TEC_Login\\',\\'logaSistema\\',\\'\\')\" />'\n . '</form>'\n . '<p><a href=\"#\" data-target=\"#style2538359449931f24b2\" data-toggle=\"modal\" id=\"solicita\">Clique aqui para solicitar um usuário.</a></p>'\n . '<a target=\"_blank\" href=\"https://www.youtube.com/channel/UCO6rJtl4ePqsWRTztRFkE5w\"><img style=\"margin: 10px;\" src=\"biblioteca/assets/images/youtube.png\" /></a>'\n . '<a target=\"_blank\" href=\"http://facebook.com/metalbo.oficial\"><img style=\"margin: 10px;\" src=\"biblioteca/assets/images/face.png\" /></a>'\n . '<a target=\"_blank\" href=\"http://177.84.0.34:8080/DelsoftX/servlet/loginerp?\"><img style=\"width:30%;margin:10px;\" src=\"biblioteca/assets/images/delsoft.png\" /></a>'\n . '</div>'\n . '</div>'\n . '<div id=\"resultado\">'\n . '</div>'\n\n //gera modal de solicitação de usuário\n . '<form method=\"post\" id=\"frm-sol\">'\n . '<div class=\"modal fade\" id=\"style2538359449931f24b2\" aria-hidden=\"true\" aria-labelledby=\"examplePositionCenter\" '\n . 'role=\"dialog\" tabindex=\"-1\" container-fluid> '\n . ' <div class=\"modal-dialog modal-center\"> '\n . ' <div class=\"modal-content\"> '\n . ' <div class=\"modal-header\"> '\n . ' <button type=\"button\" class=\"close\" id=\"closeSol\" data-dismiss=\"modal\" aria-label=\"Close\"> '\n . ' <span aria-hidden=\"true\">×</span> '\n . ' </button> '\n . ' <h5 class=\"modal-title\">Preencha as dados para solicitar seu usuário!</h5> '\n . ' </div> '\n . ' <div class=\"modal-body\" id=\"solUser-modal\"> '\n . '<div class=\"form-group form-material floating\"> '\n . '<label class=\"control-label\" for=\"inputText\"><h5>Nome</h5></label> '\n . '<input type=\"text\" class=\"form-control\" id=\"nomeSol\" name=\"nomeSol\" placeholder=\"Insira seu nome\" require/> '\n . '</div> '\n . '<div class=\"form-group form-material\"> '\n . '<label class=\"control-label\" for=\"inputText\"><h5>Sobrenome</h5></label> '\n . '<input type=\"text\" class=\"form-control\" id=\"sobrenomeSol\" name=\"sobrenomeSol\" placeholder=\"Insira seu sobrenome\" require/> '\n . '</div> '\n . '<div class=\"form-group form-material\"> '\n . '<label class=\"control-label\" for=\"inputText\"><h5>Login</h5></label> '\n . '<input type=\"text\" class=\"form-control\" id=\"loginSol\" name=\"loginSol\" placeholder=\"Insira um e-mail para servir como login\" require/> '\n . '</div> '\n . '<div class=\"form-group form-material\"> '\n . '<label class=\"control-label\" for=\"inputText\"><h5>E-mail</h5></label> '\n . '<input type=\"text\" class=\"form-control\" id=\"emailSol\" name=\"emailSol\" placeholder=\"Insira seu e-mail para receber notificações do sistema\" require/> '\n . '</div> '\n . '<div class=\"form-group form-material\"> '\n . '<label class=\"control-label\" for=\"inputText\"><h5>Observações</h5></label> '\n . '<textarea class=\"form-control\" id=\"obsSol\" name=\"obsSol\" placeholder=\"Observação\" rows=\"3\"></textarea> '\n . '</div> '\n /*\n\n * \n * */\n . ' </div> '\n . ' <div class=\"modal-footer\"> '\n . ' <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button> '\n . ' <button type=\"button\" class=\"btn btn-success\" onclick=\"requestAjax(\\'frm-sol\\',\\'MET_TEC_Soluser\\',\\'insereSolCad\\',\\'solUser-modal\\');\">Confirmar</button> '\n . ' </div> '\n . ' </div> '\n . ' </div> '\n . '</div>'\n . '</form>'\n\n /* .'<footer class=\"page-copyright page-copyright-inverse\">'\n .'<p>SISTEMA METALBO</p>'\n .'<p>© '.Util::getYear().' - Todos os direitos reservados.</p>'\n .'<div class=\"social\">'\n .'<a class=\"btn btn-icon btn-pure\" href=\"javascript:void(0)\">'\n .' <i class=\"icon bd-twitter\" aria-hidden=\"true\"></i>'\n .' </a>'\n .'<a class=\"btn btn-icon btn-pure\" href=\"javascript:void(0)\">'\n .' <i class=\"icon bd-facebook\" aria-hidden=\"true\"></i>'\n .'</a>'\n .'<a class=\"btn btn-icon btn-pure\" href=\"javascript:void(0)\">'\n .' <i class=\"icon bd-google-plus\" aria-hidden=\"true\"></i>'\n .'</a>'\n .' </div>'\n .'</footer>' */\n . '</div>'\n . '</div>'\n . '<!-- End Page -->'\n\n //apenas para iniciar\n . '<script> var abaSelecionada = \"\";</script>'\n . '<!-- Core -->'\n . '<script src=\"biblioteca/assets/vendor/jquery/jquery.js\"></script>'\n . '<script src=\"biblioteca/assets/vendor/bootstrap/bootstrap.js\"></script>'\n . '<script src=\"biblioteca/assets/vendor/animsition/jquery.animsition.js\"></script>'\n . '<script src=\"biblioteca/assets/vendor/asscroll/jquery-asScroll.js\"></script>'\n . '<script src=\"biblioteca/assets/vendor/mousewheel/jquery.mousewheel.js\"></script>'\n . '<script src=\"biblioteca/assets/vendor/asscrollable/jquery.asScrollable.all.js\"></script>'\n . '<script src=\"biblioteca/assets/vendor/ashoverscroll/jquery-asHoverScroll.js\"></script>'\n . '<!-- Plugins -->'\n . '<script src=\"biblioteca/assets/vendor/switchery/switchery.min.js\"></script>'\n . '<script src=\"biblioteca/assets/vendor/intro-js/intro.js\"></script>'\n . '<script src=\"biblioteca/assets/vendor/screenfull/screenfull.js\"></script>'\n . '<script src=\"biblioteca/assets/vendor/slidepanel/jquery-slidePanel.js\"></script>'\n . '<!-- Plugins For This Page -->'\n . '<script src=\"biblioteca/assets/vendor/jquery-placeholder/jquery.placeholder.js\"></script>'\n . ' <script src=\"biblioteca/assets/vendor/bootstrap-sweetalert/sweet-alert.js\"></script>'\n . '<!-- Scripts -->'\n . '<script src=\"biblioteca/assets/js/core.js\"></script>'\n . '<script src=\"biblioteca/assets/js/site.js\"></script>'\n . '<script src=\"biblioteca/assets/js/sections/menu.js\"></script>'\n . '<script src=\"biblioteca/assets/js/sections/menubar.js\"></script>'\n . '<script src=\"biblioteca/assets/js/sections/gridmenu.js\"></script>'\n . '<script src=\"biblioteca/assets/js/sections/sidebar.js\"></script>'\n . '<script src=\"biblioteca/assets/js/configs/config-colors.js\"></script>'\n . '<script src=\"biblioteca/assets/js/configs/config-tour.js\"></script>'\n . ' <script src=\"biblioteca/assets/js/components/asscrollable.js\"></script>'\n . '<script src=\"biblioteca/assets/js/components/animsition.js\"></script>'\n . ' <script src=\"biblioteca/assets/js/components/slidepanel.js\"></script>'\n . '<script src=\"biblioteca/assets/js/components/switchery.js\"></script>'\n . '<!-- Scripts For This Page -->'\n . '<script src=\"biblioteca/assets/js/components/jquery-placeholder.js\"></script>'\n . '<script src=\"biblioteca/assets/js/components/material.js\"></script>'\n . '<script src=\"resources/js/ajax.js\"></script>'\n . ' <script src=\"resources/js/funcoes.js?'\n . time()\n . ' \"></script>'\n . '<script>'\n . '$(document).on(\"keydown\", function(event) {'\n . 'if(event.keyCode === 13) {'\n . 'hasFocus = $(\"#psswd\").is(\":focus\"); '\n . 'if(hasFocus){'\n . 'requestAjax(\\'frm-login\\',\\'MET_TEC_Login\\',\\'logaSistema\\',\\'\\')'\n . '}'\n . '}'\n . '});'\n . '$(\"#psswd\").focus();'\n . '</script>'\n . '</div>'\n . '</body>'\n . '</html>';\n\n\n if ($bSoluser) {\n $sTelaIncial .= '<script>'\n . ' $(document).ready(function () { '\n . ' $(\"#solicita\").click(); '\n . ' alert();'\n . '}); '\n . '</script>';\n }\n //verifica se tem a senha salva\n /* if (isset($_COOKIE['pass'])) {\n $sTelaIncial.='<script>'\n .' $(document).ready(function () { '\n .' $(\"#btn_entrar\").click(); '\n .'}); '\n .'</script>';\n } */\n\n\n return $sTelaIncial;\n }", "public function crearUsuario() {\n\n\n if ($this->seguridad->esAdmin()) {\n $id = $this->usuario->getLastId();\n $usuario = $_REQUEST[\"usuario\"];\n $contrasenya = $_REQUEST[\"contrasenya\"];\n $email = $_REQUEST[\"email\"];\n $nombre = $_REQUEST[\"nombre\"];\n $apellido1 = $_REQUEST[\"apellido1\"];\n $apellido2 = $_REQUEST[\"apellido2\"];\n $dni = $_REQUEST[\"dni\"];\n $imagen = $_FILES[\"imagen\"];\n $borrado = 'no';\n if (isset($_REQUEST[\"roles\"])) {\n $roles = $_REQUEST[\"roles\"];\n } else {\n $roles = array(\"2\");\n }\n\n if ($this->usuario->add($id,$usuario,$contrasenya,$email,$nombre,$apellido1,$apellido2,$dni,$imagen,$borrado,$roles) > 1) {\n $this->perfil($id);\n } else {\n echo \"<script>\n i=5;\n setInterval(function() {\n if (i==0) {\n location.href='index.php';\n }\n document.body.innerHTML = 'Ha ocurrido un error. Redireccionando en ' + i;\n i--;\n },1000);\n </script>\";\n } \n } else {\n $this->gestionReservas();\n }\n \n }", "public function api_login_as_guider(){\n \t\n \t$username = $this->input->post('username');\n $password = md5($this->input->post('password'));\n\n $user_id = $this->login_model->api_login_as_guider($username,$password);\n\n if($user_id){\n\t\t $json_data['res'] = $user_id;\n\t\t echo json_encode($json_data);\n\t\t }else{\n\t\t $json_data['res'] = '0';\n\t\t echo json_encode($json_data);\n\t\t }\n\n }", "function login($status = 0) {\r\n if(!$this->sock) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n $this->debug_msg('Login sequence started', 1);\r\n if(!$this->read_FLAP()) {\r\n $this->debug_msg('SRV_HELLO not received. Try reconnecting in a few minutes.', 1);\r\n return false;\r\n }\r\n $this->clear_TLVs();\r\n $this->push_TLV('UIN', $this->id['uin']);\r\n $this->push_TLV('DATA', $this->roast_pass($this->id['password']));\r\n /*$this->push_TLV('CLIENT_ID_STRING', 'ICQBasic');\r\n $this->push_TLV('CLIENT_ID', 266);\r\n $this->push_TLV('CLIENT_MAJOR_VER', 20);\r\n $this->push_TLV('CLIENT_MINOR_VER', 34);\r\n $this->push_TLV('CLIENT_LESSER_VER', 0);\r\n $this->push_TLV('CLIENT_BUILD_NUM', 2321);\r\n $this->push_TLV('DISTRIB_NUMBER', 1085);\r\n $this->push_TLV('CLIENT_LANG', 'en');\r\n $this->push_TLV('CLIENT_COUNTRY', 'us');*/\r\n // updated, to make ICQ servers happy\r\n $this->push_TLV('CLIENT_ID_STRING', 'ICQ Inc. - Product of ICQ .(TM).2003b.5.56.1.3916.85');\r\n $this->push_TLV('CLIENT_ID', 266);\r\n $this->push_TLV('CLIENT_MAJOR_VER', 5);\r\n $this->push_TLV('CLIENT_MINOR_VER', 37);\r\n $this->push_TLV('CLIENT_LESSER_VER', 1);\r\n $this->push_TLV('CLIENT_BUILD_NUM', 3728);\r\n $this->push_TLV('DISTRIB_NUMBER', 85);\r\n $this->push_TLV('CLIENT_LANG', 'en');\r\n $this->push_TLV('CLIENT_COUNTRY', 'us');\r\n $this->debug_msg('Sending CLI_IDENT...');\r\n $this->send_FLAP(1, pack('N', 1) . $this->pack_all_TLVs());\r\n $this->debug_msg('Retrieving server response...');\r\n if(!$this->read_FLAP(false, 30)) {\r\n $this->debug_msg('Server-response invalid. Try reconnecting in a few minutes.', 1);\r\n return false;\r\n }\r\n fwrite($this->sock, pack('ccnn', 0x2A, 1, $this->outseq(), 0));\r\n $this->debug_msg('Closing connection...');\r\n $this->close();\r\n $this->unpack_all_TLVs($this->flaps[0]['raw']['body']);\r\n if (isset($this->tbt[8])) {\r\n $this->error('Authorization failed, error code: ' . ord($this->tbt[8]['value']) . \". For more information try visiting <a href=\\\"{$this->tbt[4]['value']}\\\">this page</a>\", __FILE__, __LINE__);\r\n return false;\r\n }\r\n if (isset($this->tbt[5]) && isset($this->tbt[6])) {\r\n $this->debug_msg('BOS server address & cookie received, proceeding...');\r\n } else {\r\n $this->error('BOS server address & cookie NOT received, connection aborted', __FILE__, __LINE__);\r\n return false;\r\n }\r\n $bos = explode(':', $this->tbt[5]['value']);\r\n $cookie = $this->tbt[6]['value'];\r\n $this->clear_TLVs();\r\n $this->debug_msg('Connecting to BOS server...');\r\n if (!$this->connect($bos[0], $bos[1])){\r\n return false;\r\n\t\t\t\t}\r\n if(!$this->read_FLAP()) {\r\n $this->debug_msg('SRV_HELLO not received. Try reconnecting in a few minutes.', 1);\r\n return false;\r\n }\r\n $this->push_TLV('AUTH_COOKIE', $cookie);\r\n $this->debug_msg('Sending CLI_COOKIE...');\r\n $this->send_FLAP(1, pack('N', 1) . $this->pack_all_TLVs());\r\n $this->debug_msg('Retrieving server response...');\r\n if(!$this->read_FLAP()) {\r\n $this->debug_msg('Server response not received. Try reconnecting in a few minutes.', 1);\r\n return false;\r\n }\r\n $this->debug_msg('Sending server rates request...');\r\n $this->send_FLAP(2, $this->make_SNAC(1, 6));\r\n if(!$this->read_FLAP()) {\r\n $this->debug_msg('Server rates response not received in a timely manner.', 1);\r\n } else {\r\n $this->push_from_FLAP($this->flaps[0]);\r\n $num_classes = ord($this->snacs[0]['raw']['body']{1}) + (256 * ord($this->snacs[0]['raw']['body']{0}));\r\n $tmp = substr($this->snacs[0]['raw']['body'], 2 + (30 * $num_classes));\r\n $i = 0; $group_ids = array();\r\n while ($i<strlen($tmp)) {\r\n $group_ids[] = $this->word_val($tmp{$i} . $tmp{$i+1});\r\n $i += 2;\r\n $num_pairs = $this->word_val($tmp{$i} . $tmp{$i+1});\r\n $i += 2 + ($num_pairs * 4);\r\n }\r\n $this->debug_msg('Sending rates acknowledgement to make server happy...');\r\n $this->send_FLAP(2, $this->make_SNAC(1, 8, array('group_ids' => $group_ids)));\r\n }\r\n $this->debug_msg('Requesting ICBM service parameters...');\r\n $this->send_FLAP(2, $this->make_SNAC(4, 4));\r\n $this->read_FLAP(true);\r\n $this->debug_msg('Setting ICBM service parameters for channel #1...');\r\n $this->send_FLAP(2, $this->make_SNAC(4, 2, array('channel' => 1, 'msize' => 8000)));\r\n $this->debug_msg('Setting ICBM service parameters for channel #2...');\r\n $this->send_FLAP(2, $this->make_SNAC(4, 2, array('channel' => 2, 'msize' => 8000)));\r\n $this->debug_msg('Setting ICBM service parameters for channel #4...');\r\n $this->send_FLAP(2, $this->make_SNAC(4, 2, array('channel' => 4, 'msize' => 8000)));\r\n $this->read_FLAP(true);\r\n $this->debug_msg('Sending client capabilities list...');\r\n $this->send_FLAP(2, $this->make_SNAC(2, 4));\r\n if (!is_integer($status)){\r\n if (isset($this->const['STATUS_' . strtoupper($status)])) {\r\n $status = $this->const['STATUS_' . strtoupper($status)];\r\n } else {\r\n $this->error('Unknown status: ' . $status, __FILE__, __LINE__);\r\n $status = 0;\r\n }\r\n\t\t\t\t}\r\n $this->debug_msg('Sending DC_INFO & STATUS SNAC...');\r\n $this->send_FLAP(2, $this->make_SNAC(1, 30, array('status' => $status, 'statusflags' => 0, 'dc_type' => 0)));\r\n $this->read_FLAP(true);\r\n $this->debug_msg('Sending CLI_READY SNAC...');\r\n $this->send_FLAP(2, $this->make_SNAC(1, 2));\r\n $this->read_FLAP(true);\r\n $this->debug_msg('You are now logged in', 1);\r\n $this->keep_alive_time = time();\r\n return true;\r\n }", "public function hacerLogin() {\n $user = json_decode(file_get_contents(\"php://input\"));\n\n if(!isset($user->email) || !isset($user->password)) {\n http_response_code(400);\n exit(json_encode([\"error\" => \"No se han enviado todos los parametros\"]));\n }\n \n //Primero busca si existe el usuario, si existe que obtener el id y la password.\n $peticion = $this->db->prepare(\"SELECT id,idRol,password FROM users WHERE email = ?\");\n $peticion->execute([$user->email]);\n $resultado = $peticion->fetchObject();\n \n if($resultado) {\n \n //Si existe un usuario con ese email comprobamos que la contraseña sea correcta.\n if(password_verify($user->password, $resultado->password)) {\n \n //Preparamos el token.\n $iat = time();\n $exp = $iat + 3600*24*2;\n $token = array(\n \"id\" => $resultado->id,\n \"iat\" => $iat,\n \"exp\" => $exp\n );\n \n //Calculamos el token JWT y lo devolvemos.\n $jwt = JWT::encode($token, CJWT);\n http_response_code(200);\n exit(json_encode($jwt . \"?\" . $resultado->idRol));\n \n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Password incorrecta\"]));\n }\n \n } else {\n http_response_code(404);\n exit(json_encode([\"error\" => \"No existe el usuario\"])); \n }\n }", "function ejecutar(){\n\t\tif( !isset($_REQUEST['action']) ){\n\t\t\t//Obtengo los datos que se van a listar\n\t\t\t$usuarios = $this->modelo->listar();\n\t\t\t\n\t\t\t//Muestro los datos\n\t\t\tinclude('View/usuarioListaView.php');\n\t\t}\n\t\telse switch($_REQUEST['action']){\n\t\t\tcase 'insertar':\n\t\t\t\t$usuario = $this->modelo->insertar($_REQUEST['nombre'],$_REQUEST['mail'],$_REQUEST['pass'],$_REQUEST['privilegio']);\n\t\t\t\tif ( is_array($usuario) )\n\t\t\t\t\tinclude('View/usuarioInsertadoView.php');\n\t\t\t\telse\n\t\t\t\t\tinclude('View/usuarioError.php');\n\t\t\t\tbreak;\n\t\t}\t\t\t\t\n\t\t\n\t\t\n\t}", "public function cambiar_clave()\n{\n\textract($_REQUEST);//extrayendo valores de url\n\t$db=new clasedb();\n\t$conex=$db->conectar();//conectando con la base de datos\n\t\n\t$sql=\"SELECT clave FROM usuarios WHERE usuarios.id=\".$_SESSION['id_usuario'];;\n\t$res=mysqli_query($conex,$sql);//ejecutando consulta\n\t$data=mysqli_fetch_array($res);//extrayendo datos en array\n\n\theader(\"Location: ../Vistas/config/cambiarclave.php?data=\".serialize($data));\n}", "function consultarOtro(){\n $queryconsultarOtro=$this->mdlOrdenes->consultarOtro(base64_decode($_POST[\"idAtencion\"]));\n echo json_encode($queryconsultarOtro);\n }", "public function armado() {\n $validacion = new Seguridad_UsuarioValidacion();\n $validacion = $validacion->consultaUsuarioSesion();\n\n $this->_mail = $_POST['mail'];\n $this->_telefono = $_POST['telefono'];\n\n $this->_actualizarDatos();\n\n if (Inicio::confVars('generar_log') == 's') {\n $this->_cargaLog();\n }\n\n // la redireccion va al final\n $armado_botonera = new Armado_Botonera();\n\n $parametros = array('kk_generar' => '0', 'accion' => '13');\n $armado_botonera->armar('redirigir', $parametros);\n }", "public function loginAction()\n {\n $this->_helper->layout->disableLayout(); // desabilita Zend_Layout\n\n // recebe os dados do formulrio via post\n $post = Zend_Registry::get('post');\n $username = Mascara::delMaskCNPJ(Mascara::delMaskCPF($post->Login)); // recebe o login sem mscaras\n $password = $post->Senha; // recebe a senha\n\n //Pega o IP do usuario\n\n $ip = $this->buscarIp();\n\n $tbLoginTentativasAcesso = new tbLoginTentativasAcesso();\n $LoginAttempt = $tbLoginTentativasAcesso->consultarAcessoCpf($username, $ip);\n\n\n //Pega timestamp atual\n $data = new Zend_Date();\n $timestamp = $data->getTimestamp();\n\n $maxTentativas = 4;\n $tempoBan = 300; // segundos\n\n // VERIFICA SE USUARIO ESTA BANIDO\n if (isset($LoginAttempt)) {\n $tempoLogin = $timestamp - strtotime($LoginAttempt->dtTentativa);\n\n if ($tempoLogin <= $tempoBan && $LoginAttempt->nrTentativa >= $maxTentativas) {\n parent::message('Acesso bloqueado, aguarde '.gmdate(\"i\", ($tempoBan + 5 - $tempoLogin)).' minuto(s) e tente novamente!', \"/\", \"ERROR\");\n } else {\n try {\n // valida os dados\n if (empty($username) || empty($password)) { // verifica se os campos foram preenchidos\n throw new Exception(\"Login ou Senha invalidos!\");\n } elseif (strlen($username) == 11 && !Validacao::validarCPF($username)) { // verifica se o CPF ? v?lido\n throw new Exception(\"O CPF informado invalido!\");\n } elseif (strlen($username) == 14 && !Validacao::validarCNPJ($username)) { // verifica se o CNPJ ? v?lido\n throw new Exception(\"O CNPJ informado invalido!\");\n } else {\n // realiza a busca do usurio no banco, fazendo a autenticao do mesmo\n $Usuario = new Usuario();\n $buscar = $Usuario->login($username, $password);\n\n\n\n if ($buscar) { // acesso permitido\n $tbLoginTentativasAcesso->removeTentativa($username, $ip);\n\n $auth = Zend_Auth::getInstance(); // instancia da autenti��o\n\n // registra o primeiro grupo do usurio (pega unidade autorizada, org�o e grupo do usu�rio)\n $Grupo = $Usuario->buscarUnidades($auth->getIdentity()->usu_codigo, 21); // busca todos os grupos do usu�rio\n\n $GrupoAtivo = new Zend_Session_Namespace('GrupoAtivo'); // cria a sess�o com o grupo ativo\n $GrupoAtivo->codGrupo = $Grupo[0]->gru_codigo; // armazena o grupo na sess�o\n $GrupoAtivo->codOrgao = $Grupo[0]->uog_orgao; // armazena o org�o na sess�o\n $this->orgaoAtivo = $GrupoAtivo->codOrgao;\n\n // redireciona para o Controller protegido\n return $this->_helper->redirector->goToRoute(array('controller' => 'principal'), null, true);\n } // fecha if\n else {\n if ($tempoLogin > $tempoBan) {\n $tbLoginTentativasAcesso->removeTentativa($username, $ip);\n }\n $LoginAttempt = $tbLoginTentativasAcesso->consultarAcessoCpf($username, $ip);\n\n //se nenhum registro foi encontrado na tabela Usuario, ele passa a tentar se logar como proponente.\n //neste ponto o _forward encaminha o processamento para o metodo login do controller login, que recebe\n //o post igualmente e tenta encontrar usuario cadastrado em SGCAcesso\n\n //INSERE OU ATUALIZA O ATUAL ATTEMPT\n if (!$LoginAttempt) {\n $tbLoginTentativasAcesso->insereTentativa($username, $ip, $data->get('YYYY-MM-dd HH:mm:ss'));\n } else {\n $tbLoginTentativasAcesso->atualizaTentativa($username, $ip, $LoginAttempt->nrTentativa, $data->get('YYYY-MM-dd HH:mm:ss'));\n }\n\n $this->forward(\"login\", \"login\");\n //throw new Exception(\"Usurio inexistente!\");\n }\n } // fecha else\n } // fecha try\n catch (Exception $e) {\n parent::message($e->getMessage(), \"index\", \"ERROR\");\n }\n }\n }\n }" ]
[ "0.56971747", "0.5600532", "0.5587733", "0.5512041", "0.5484873", "0.5473082", "0.5416958", "0.53811824", "0.536429", "0.5354299", "0.5352881", "0.5349036", "0.53437626", "0.5338213", "0.5336974", "0.52947927", "0.5290973", "0.52608234", "0.5259112", "0.5253053", "0.5201946", "0.51966935", "0.51945066", "0.5192122", "0.5189372", "0.5169327", "0.5169167", "0.51623714", "0.51385444", "0.5127847", "0.51068723", "0.51036733", "0.5099241", "0.5097689", "0.5097612", "0.5097612", "0.5094827", "0.5088694", "0.5085704", "0.50854534", "0.5082359", "0.5079723", "0.50778294", "0.5066754", "0.50467134", "0.5046314", "0.5045559", "0.50391734", "0.5037841", "0.5036017", "0.5024245", "0.5018986", "0.5011992", "0.49984056", "0.49895862", "0.49861747", "0.49705315", "0.49697742", "0.49648586", "0.4964111", "0.4963889", "0.49604863", "0.49559867", "0.4955941", "0.49545002", "0.49480668", "0.49462745", "0.4942219", "0.4942159", "0.49384364", "0.49373123", "0.4937273", "0.4937158", "0.49358347", "0.49325025", "0.49248093", "0.49183753", "0.49164924", "0.4914915", "0.49139264", "0.49114934", "0.49094367", "0.49090645", "0.49081394", "0.49072054", "0.4904844", "0.4896299", "0.48949948", "0.48918617", "0.48900273", "0.48891276", "0.48869407", "0.48795334", "0.48787564", "0.48761338", "0.4871658", "0.48715004", "0.48656252", "0.48646674", "0.48645532", "0.4862386" ]
0.0
-1
function showCaption(); function hideCaption();
public function appendControl($name, $template);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCaption() {}", "function getCaption() {return $this->readCaption();}", "function getModifyCaption() \r\n \t{\r\n \t\treturn '';\r\n \t}", "function set_caption($caption)\n\t{\n\t\t$this->caption = $caption;\n\t}", "function image_add_caption($html, $id, $caption, $title, $align, $url, $size, $alt = '')\n {\n }", "function show(){\n\t}", "function show()\n {\n }", "function Show()\r\n\t{\r\n\r\n\t}", "function titel_show()\n{\n global $tpl;\n global $db;\n $sFormTitle = \"Nieuws beheer\";\n\n//-------------------------------\n// titel Open Event begin\n// titel Open Event end\n//-------------------------------\n\n//-------------------------------\n// Set URLs\n//-------------------------------\n//-------------------------------\n// titel Show begin\n//-------------------------------\n\n $tpl->set_var(\"FormTitle\", $sFormTitle);\n\n//-------------------------------\n// titel BeforeShow Event begin\n// titel BeforeShow Event end\n//-------------------------------\n\n//-------------------------------\n// Show fields\n//-------------------------------\n $tpl->parse(\"Formtitel\", false);\n\n//-------------------------------\n// titel Show end\n//-------------------------------\n}", "function titel_show()\n{\n global $tpl;\n global $db;\n $sFormTitle = \"Voorraadsysteem beheer\";\n\n//-------------------------------\n// titel Open Event begin\n// titel Open Event end\n//-------------------------------\n\n//-------------------------------\n// Set URLs\n//-------------------------------\n//-------------------------------\n// titel Show begin\n//-------------------------------\n\n $tpl->set_var(\"FormTitle\", $sFormTitle);\n\n//-------------------------------\n// titel BeforeShow Event begin\n// titel BeforeShow Event end\n//-------------------------------\n\n//-------------------------------\n// Show fields\n//-------------------------------\n $tpl->parse(\"Formtitel\", false);\n\n//-------------------------------\n// titel Show end\n//-------------------------------\n}", "function getAddCaption() \r\n \t{\r\n \t\treturn '';\r\n \t}", "function titel_show()\n{\n global $tpl;\n global $db;\n $sFormTitle = \"Brochure aanvraag beheer\";\n\n//-------------------------------\n// titel Open Event begin\n// titel Open Event end\n//-------------------------------\n\n//-------------------------------\n// Set URLs\n//-------------------------------\n//-------------------------------\n// titel Show begin\n//-------------------------------\n\n $tpl->set_var(\"FormTitle\", $sFormTitle);\n\n//-------------------------------\n// titel BeforeShow Event begin\n// titel BeforeShow Event end\n//-------------------------------\n\n//-------------------------------\n// Show fields\n//-------------------------------\n $tpl->parse(\"Formtitel\", false);\n\n//-------------------------------\n// titel Show end\n//-------------------------------\n}", "public function get_caption($key = 0)\n {\n }", "public function setCaption($caption) {\n\t\t$this->caption = $caption;\n\t}", "function titel_show()\n{\n global $tpl;\n global $db;\n $sFormTitle = \"Gebruiker beheer\";\n\n//-------------------------------\n// titel Open Event begin\n// titel Open Event end\n//-------------------------------\n\n//-------------------------------\n// Set URLs\n//-------------------------------\n//-------------------------------\n// titel Show begin\n//-------------------------------\n\n $tpl->set_var(\"FormTitle\", $sFormTitle);\n\n//-------------------------------\n// titel BeforeShow Event begin\n// titel BeforeShow Event end\n//-------------------------------\n\n//-------------------------------\n// Show fields\n//-------------------------------\n $tpl->parse(\"Formtitel\", false);\n\n//-------------------------------\n// titel Show end\n//-------------------------------\n}", "public function addCaption($text)\n {\n $this->captionCount++;\n $this->captionStarted = $this->timer->elapsedAsSubripTime();\n $this->captionText = $text;\n }", "function display() {\r parent::display();\r }", "public function setCaption(?string $caption): void\n\t{\n\t\t$this->caption = $caption;\n\t}", "function display_header_text()\n {\n }", "function setCaption($cap) {\n\t\t$this->lobSub->lobCaption = $cap;\n\t}", "public function hide();", "public function getCaptionShown()\n {\n return ($this->Caption && !$this->HideCaption);\n }", "private function getCaption()\n\t{\n\t\t$buffer = '';\n\t\t\n\t\tif(!$this->aImg['sFilename'])\n\t\t\treturn $buffer;\n\t\t\n\t\t// button\n\t\t$link = $this->getCaptionButton();\n\t\t\n\t\t// caption\t\t\n\t\t$buffer .= '<textarea class=\"TextareaDisable\" disabled=\"disabled\">';\n\t\t$buffer .= stripslashes($this->aImg['sCaption']);\n\t\t$buffer .= '</textarea>';\n\t\t$buffer .= '<br /><br />';\n\t\t\t\n\t\t$buffer .= $link;\t\t\t\n\t\treturn $buffer;\t\t\n\t}", "function showQuestionTitles() \n\t{\n\t\t$this->display_question_titles = 1;\n\t}", "public function ShowTitle()\n {\n return true;\n }", "function begin_frame ($caption=\"\", $center=false, $padding=10)\r\n{\r\n $tdextra = \"\";\r\n\r\n if ($caption)\r\n {\r\n print(\"<h2>$caption</h2>\");\r\n }\r\n\r\n if ($center)\r\n {\r\n $tdextra .= \" align='center'\";\r\n }\r\n\r\n print(\"<table border='1' width='100%' cellspacing='0' cellpadding='$padding'><tr><td $tdextra>\\n\");\r\n}", "function pb_hideshow_comment_js () { ?>\r\n<script type=\"text/javascript\"> \r\nvar currLayerId = \"show\"; \r\nfunction togLayer(id) { if(currLayerId) setDisplay(currLayerId, \"none\"); if(id)setDisplay(id, \"block\"); currLayerId = id; }\r\nfunction setDisplay(id,value) { var elm = document.getElementById(id); elm.style.display = value; }\r\n</script>\r\n<?php\r\n}", "function set_caption($alt, $title, $iptc_caption, $filename)\n {\n $values = array($this->_params->get('caption_type_iptc') => $iptc_caption,\n $this->_params->get('caption_type_filename') => $filename,\n $this->_params->get('caption_type_title') => $title,\n $this->_params->get('caption_type_alt') => $alt);\n\n ksort($values);\n $caption = '';\n foreach ($values as $key => $val) {\n if ($key and $val) {\n $caption = $val;\n break;\n }\n }\n\n\n return $caption;\n }", "function display()\r\n\t {\r\n\t parent::display();\r\n\t }", "public function callback_hidden( $args ) {\n $args['desc'] = '';\n $this->callback_text( $args );\n }", "function Show_Help($title,$ret_help)\n\t\t{\n\t\t\tglobal \t$Captions_arr,$ecom_siteid,$db,$ecom_hostname,$ecom_themename,\n\t\t\t\t\t$ecom_themeid,$default_layout,$inlineSiteComponents,$Settings_arr;\n\t\t\t// ** Fetch any captions for product details page\n\t\t\t$Captions_arr['HELP'] \t= getCaptions('HELP');\n\t\t\t// ** Check to see whether current user is logged in \n\t\t\t$cust_id \t= get_session_var(\"ecom_login_customer\");\n\t\t\twhile ($row_help = $db->fetch_array($ret_help))\n\t\t\t{\n\t\t\t\t$help_arr[$row_help['help_id']] = array (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'help_heading'=>stripslash_normal($row_help['help_heading']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'help_description'=>stripslashes($row_help['help_description'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t}\n\t\t\n\t\t \t\t/*$HTML_treemenu = '\t<div class=\"row breadcrumbs\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"'.CONTAINER_CLASS.'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"container-tree\">\n\t\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t<li><a href=\"'.url_link('',1).'\" title=\"'.stripslash_normal($Captions_arr['COMMON']['TREE_MENU_HOME_LINK']).'\">'.stripslash_normal($Captions_arr['COMMON']['TREE_MENU_HOME_LINK']).'</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li> &#8594; '.stripslash_normal($Captions_arr['HELP']['HELP_HEAD']).'</li>\n\n\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div></div>';*/\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$HTML_treemenu = '\t<div class=\"breadcrumbs\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"'.CONTAINER_CLASS.'\">\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"container-tree\">\n\t\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t<li><a href=\"'.url_link('',1).'\" title=\"'.stripslash_normal($Captions_arr['COMMON']['TREE_MENU_HOME_LINK']).'\">'.stripslash_normal($Captions_arr['COMMON']['TREE_MENU_HOME_LINK']).'</a></li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li> &#8594; '.stripslash_normal($Captions_arr['HELP']['HELP_HEAD']).'</li>\n\n\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div></div>';\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\techo $HTML_treemenu;\t\n\t?>\n\t\t<div class='faq_outer'>\n\t\t<a name=\"top\"></a>\n\t\t<div class=\"<?php echo CONTAINER_CLASS;?>\">\n\t\t<div class=\"panel-group\" id=\"accordion\">\n\t\t\n\t\t<?php \n\t\t\t// Showing the headings and descriptions\n\t\t\t$cntr=1;\n\t\t\tforeach ($help_arr as $k=>$v)\n\t\t\t{ \n\t\t\t\t$help_id = $k;\n\t\t\t\techo \t\"<div class=\\\"panel panel-default\\\" >\n\t\t\t\t\t\t\t<div class=\\\"panel-heading\\\">\n\t\t\t\t\t\t\t<a class=\\\"accordion-toggle\\\" data-toggle=\\\"collapse\\\" data-parent=\\\"#accordion\\\" href=\\\"#collapseOne\".$help_id.\"\\\"><div class=\\\"panel-title\\\">\n\n\t\t\t\t\t\t\t\".$cntr.'. '.$v['help_heading'].\"<i class=\\\" pull-right caret\\\"></i>\n\t\t\t\t\t\t\t</div></a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id=\\\"collapseOne\".$help_id.\"\\\" class=\\\"panel-collapse collapse out\\\">\n\t\t\t\t\t\t\t<div class=\\\"panel-body\\\">\n\t\t\t\t\t\t\t\";\n\t\t\t\t\t\t\t$cntr++;\n\t\t\t\t\t\t\t\n\t\t?>\t\n\t\t<?php \n\t\t\t\t$sr_array = array('rgb(0, 0, 0)','#000000');\n\t\t\t\t$rep_array = array('rgb(255,255,255)','#ffffff'); \n\t\t\t\t$ans_desc = str_replace($sr_array,$rep_array,$v['help_description']);\n\t\t\techo $ans_desc?>\t\t\t\n\t<?php\t\n\techo \"\n\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\";\n\t\t\t}\n\t?>\n\t\t\t</div> \n\t\t</div> \n\t\t</div>\n\t<?php\t\t\n\t\t}", "function showCategory()\r\n {\r\n }", "function display()\n {\n parent::display();\n }", "function display()\n {\n parent::display();\n }", "function display()\n {\n parent::display();\n }", "function the_title($before = '', $after = '', $display = \\true)\n {\n }", "abstract protected function show();", "function isHidden();", "abstract public function hidupkan();", "function tb_longwave_header_options_callback() {\n\techo '<p>Settings for things visible in the Head of the theme.</p>';\n}", "public function renderCaption() {\n if (!empty($this->caption)) {\n return self::html()->tag('<caption{:options}>{:content}</caption>', array('content' => $this->caption, 'options' => $this->captionOptions), $this->captionOptions);\n } else {\n return false;\n }\n }", "function display_header() {}", "function pqrc_section_title_cal()\n {\n echo \"<h2>\" . __('Post QRC Settings Section', 'post-qurcode') . \"</h2>\";\n }", "function display() {\r\n\t\tparent::display ();\r\n\t}", "function Show()\n {}", "function show_forms()\n {\n }", "function jabHtmlButton($caption, $id, $class=\"\", $name=\"\")\n{\n\tif ($name==\"\")\n\t\t$name=$id;\n\tif ($class!=\"\")\n\t\t$class=\" class=\\\"\".$class.\"\\\"\";\n\techo \"<input type=\\\"button\\\" id=\\\"$id\\\" name=\\\"$name\\\" value=\\\"$caption\\\"/>\\n\";\n}", "final function getCaption($value) {\n $titles = $this->getTitles(array($value));\n if (isset($titles[$value])) $res = $titles[$value];\n else $res = false;\n return $res;\n }", "function onBeforeShowDescription(&$row)\n {\n echo '<h3>onBeforeShowDescription</h3>'\n . JText::_('PLG_JEA_OWNER_NAME'). ' : <strong>'\n . $row->owner_name . '</strong>';\n }", "public function display() {\n\n\t\t// Register WP built-in Thickbox for popup.\n\t\tadd_thickbox();\n\n\t\tparent::display();\n\t}", "private function getCaptionButton()\n\t{\t\t\n\t\t\n\t\t$link = '<input type=\"button\" onclick=\"editCaption(';\n\t\t$link .= $this->aImg['albumId'].', '.$this->aImg['id'].');\" value=\"%s\"/>';\n\t\t\n\t\tif($this->aImg['sCaption'])\n\t\t{\n\t\t\t$link = sprintf(\n\t\t\t\t$link,\t\t\t\t\n\t\t\t\t$this->TXT_LINK_EDIT\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$link = sprintf(\n\t\t\t\t$link,\t\t\t\t\n\t\t\t\t$this->TXT_LINK_ADD\n\t\t\t);\n\t\t}\n\t\t\n\t\treturn $link;\n\t}", "public function setCaptionPosition($captionPosition) {}", "abstract public function displayHelp();", "public function getCaption()\n {\n return $this->_caption;\n }", "private function retrieve_caption() {\n\t\treturn $this->retrieve_excerpt_only();\n\t}", "public function getCaption()\n {\n return $this->caption;\n }", "public function hasCaption()\n {\n return $this->caption !== null;\n }", "function wpse_74735_replace_wp_caption_shortcode() {\n remove_shortcode( 'caption', 'img_caption_shortcode' );\n remove_shortcode( 'wp_caption', 'img_caption_shortcode' );\n add_shortcode( 'caption', 'wpse_74735_caption_shortcode' );\n add_shortcode( 'wp_caption', 'wpse_74735_caption_shortcode' );\n}", "function hideQuestionTitles() \n\t{\n\t\t$this->display_question_titles = 0;\n\t}", "function help ( $help='help text', $caption='') {\n\n\t\t$compath = JURI::root() . 'administrator/components/'.JEV_COM_COMPONENT;\n\t\t$imgpath = $compath . '/assets/images';\n\n\t\tif (empty($caption)) $caption = '&nbsp;';\n\n\t\tif (substr($help, 0, 7) == 'http://' || substr($help, 0, 8) == 'https://') {\n\t\t\t//help text is url, open new window\n\t\t\t$onclick_cmd = \"window.open(\\\"$help\\\", \\\"help\\\", \\\"height=700,width=800,resizable=yes,scrollbars\\\");return false\";\n\t\t} else {\n\t\t\t// help text is plain text with html tags\n\t\t\t// prepare text as overlib parameter\n\t\t\t// escape \", replace new line by space\n\t\t\t$help = htmlspecialchars($help, ENT_QUOTES);\n\t\t\t$help = str_replace('&quot;', '\\&quot;', $help);\n\t\t\t$help = str_replace(\"\\n\", \" \", $help);\n\n\t\t\t$ol_cmds = 'RIGHT, ABOVE, VAUTO, WRAP, STICKY, CLOSECLICK, CLOSECOLOR, \"white\"';\n\t\t\t$ol_cmds .= ', CLOSETEXT, \"<span style=\\\"border:solid white 1px;padding:0px;margin:1px;\\\"><b>X</b></span>\"';\n\t\t\t$onclick_cmd = 'return overlib(\"'.$help.'\", ' . $ol_cmds . ', CAPTION, \"'.$caption.'\")';\n\t\t}\n\n\t\t// RSH 10/11/10 - Added float:none for 1.6 compatiblity - The default template was floating images to the left\n\t\t$str = '<img border=\"0\" style=\"float: none; vertical-align:bottom; cursor:help;\" alt=\"'. JText::_('JEV_HELP') . '\"'\n\t\t. ' title=\"' . JText::_('JEV_HELP') .'\"'\n\t\t. ' src=\"' . $imgpath . '/help_ques_inact.gif\"'\n\t\t. ' onmouseover=\\'this.src=\"' . $imgpath . '/help_ques.gif\"\\''\n\t\t. ' onmouseout=\\'this.src=\"' . $imgpath . '/help_ques_inact.gif\"\\''\n\t\t. ' onclick=\\'' . $onclick_cmd . '\\' />';\n\n\t\treturn $str;\n\t}", "function display_title(){\n\techo \"Menu Page\";\n}", "function ThemeistsLogoShowcase()\n\t\t\t{\n\t\t\n\t\t\t\t//load_plugin_textdomain( self::locale, false, plugin_dir_path( dirname( dirname( __FILE__ ) ) ) . '/lang/' );\n\n\t\t\n\t\t\t\t$widget_opts = array (\n\n\t\t\t\t\t'classname' => 'ThemeistsLogoShowcase', \n\t\t\t\t\t'description' => __( 'A simple widget to showcase your client\\'s logos', self::locale )\n\n\t\t\t\t);\n\n\t\t\t\t$control_options = array(\n\n\t\t\t\t\t'width' => '400'\n\n\t\t\t\t);\n\n\t\t\t\t//Register the widget\n\t\t\t\t$this->WP_Widget( self::slug, __( self::name, self::locale ), $widget_opts, $control_options );\n\t\t\n\t\t \t// Load JavaScript and stylesheets\n\t\t \t$this->register_scripts_and_styles();\n\t\t\n\t\t\t}", "function controls()\n\t{\n\t}", "function displayCO($con_id,$dat_id,$skin,$count=0)\r\n\t{\r\n\t\tglobal $myPT;\r\n\t\t$myPT->displayCO($con_id,$dat_id,$skin,$count);\r\n\t}", "function setDisplay( )\n\t{\n\t\tglobal $bgColor, $fontColor, $fontFam, $fontSize, $headerColor;\n\t\techo \"<script type=\\\"text/javascript\\\">\\n\";\n\t\techo \"\\tdocument.body.style.background = \\\"$bgColor\\\";\\n\";\n\t\techo \"\\tdocument.getElementById(\\\"ficTitle\\\").style.color = \\\"$headerColor\\\";\\n\";\n\t\techo \"\\tdocument.getElementById(\\\"content\\\").style.background = \\\"$bgColor\\\";\\n\";\n\t\techo \"\\tdocument.getElementById(\\\"content\\\").style.color = \\\"$fontColor\\\";\\n\";\n\t\techo \"\\tdocument.getElementById(\\\"content\\\").style.fontFamily = \\\"$fontFam\\\";\\n\";\n\t\techo \"\\tdocument.getElementById(\\\"content\\\").style.fontSize = \\\"$fontSize\\\";\\n\";\n\t\techo \"\\tdocument.getElementById(\\\"content\\\").style.textTransform = \\\"none\\\";\\n\";\n\t\techo \"</script>\\n \\n\";\n\t}", "private function addCaption(string $script, PhotoswipeConfig $config): string\n {\n if (false === $config->hasCaption()) {\n // Remove the caption placeholder from the lightbox script\n return str_replace('[[PSWP_CAPTION]]', '', $script);\n }\n\n $captionScript = <<<'CAPTION'\n // Adding new caption element .pswp--caption at the end of the photoswipe container\n [[PSWP_LIGHTBOX]].on('uiRegister', function() {\n [[PSWP_LIGHTBOX]].pswp.ui.registerElement({\n name: 'caption',\n order: 9,\n isButton: false,\n appendTo: 'root',\n html: 'Caption text',\n onInit: (el, pswp) => {\n [[PSWP_LIGHTBOX]].pswp.on('change', () => {\n const currSlideElement = [[PSWP_LIGHTBOX]].pswp.currSlide.data.element;\n let captionHTML = '';\n if (currSlideElement) {\n const caption = currSlideElement.querySelector('figcaption');\n if (caption) {\n captionHTML = caption.innerHTML;\n } else {\n captionHTML = currSlideElement.querySelector('img').getAttribute('alt');\n }\n }\n el.innerHTML = captionHTML || '';\n });\n }\n });\n });\n CAPTION;\n\n return str_replace('[[PSWP_CAPTION]]', $captionScript, $script);\n }", "public function show();", "public function show();", "public function show();", "public function show();", "abstract function display();", "abstract function display();", "function wp_get_attachment_caption($post_id = 0)\n {\n }", "function makeHideItem($info){\r\n\techo '<p class=\"h\">'.$info.'</p>';\r\n}", "protected function _showText($text) {}", "function DisplayFeatures()\r\n\t{\r\n\t\tif (! $this->m_news->GetID ())\r\n\t\t{\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$newsID = $this->m_news->GetID ();\r\n\t\t// language strings \r\n\t\t$doneS = $this->GetNameString ( 'done' );\r\n\t\t$optionsS = $this->GetNameString ( 'options' );\r\n\t\t\r\n\t\t$NameS = 'Tab Name'; //$this->GetNameString('Name');\r\n\t\t\r\n\r\n\t\t// values\r\n\t\t$NameV = $this->m_news->GetName ();\r\n\t\t\r\n\t\t//Display title\r\n\t\t$name = $this->m_news->GetName ();\r\n\t\t$this->DisplayTitle ( $name, null, false );\r\n\t\t//////////////////////////////////////\r\n\t\t$panelIndex = 0;\r\n\t\t\r\n\t\tprint ( \"<div class='someGTitleBox'>$optionsS</div>\" );\r\n\t\tprint ( '<div class=\"someGBox\">' );\r\n\t\t\r\n\t\t//Forms\r\n\t\t$updating = true;\r\n\t\t$reading = false;\r\n\t\t\r\n\t\tif (CMSObject::$controller)\r\n\t\t{\r\n\t\t\t$reading = CMSObject::$controller->IsRecReadable ( $this->m_news, 'name' );\r\n\t\t\t$updating = CMSObject::$controller->IsRecUpdatable ( $this->m_news, 'name' );\r\n\t\t}\r\n\t\t\r\n\t\tif ($reading || $updating)\r\n\t\t{\r\n\t\t\t// tab header\r\n\t\t\t$this->DisplayTabHeader ( ++ $panelIndex, $NameS );\r\n\t\t\t\r\n\t\t\tif ($updating)\r\n\t\t\t{\r\n\t\t\t\t$this->DisplayFormHeadr ( 'changeName' );\r\n\t\t\t\t$this->DisplayHidden ( 'newsID', $newsID );\r\n\t\t\t\tprint ( \"<input type='text' value='$NameV' name='Name' id='Name' size='40' maxlength='32' />\\n\" );\r\n\t\t\t\t$this->DisplayFormFooter ( $doneS );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tprint ( $NameV );\r\n\t\t\t}\r\n\t\t\t// tab footer\r\n\t\t\t$this->DisplayTabFooter ();\r\n\t\t}\r\n\t\tprint ( '</div>' );\r\n\t\t\r\n\t\t// display javascript\r\n\t\tprint ( '<script type=\"text/javascript\"><!--' );\r\n\t\t\r\n\t\tfor($index = 0; $index <= $panelIndex; $index ++)\r\n\t\t\tprint ( \"var CollapsiblePanel$index = new Spry.Widget.CollapsiblePanel(\\\"CollapsiblePanel$index\\\", {contentIsOpen:false});\\n\" );\r\n\t\tprint ( '//--></script>' );\r\n\t}", "public function getCaption() {\n\t\treturn $this->caption;\n\t}", "function getTitle();", "function getTitle();", "function get_caption($filepath) {\n // first look for a caption file in the same dir as the image\n include(\"set_paths.php\");\n\n if ( is_readable(\"$filepath.caption\") ) { \n $captionfile = \"$filepath.caption\" ; \n }\n elseif ( is_readable($imagedata/$filepath.caption\") ) {\n $captionfile = \"$imagedata/$filepath.caption\" ; \n }\n else return; \n \n $caption = file_get_contents($captionfile);\n $caption = htmlentities($caption);\n \n return $caption;\n}", "function msgbox($caption, $message) {\n\treturn \"<fieldset class=\\\"msgbox\\\"><legend>\" .\n\t\t\"<img src=\\\"../images/huh.png\\\" class=\\\"picto\\\" alt=\\\"?\\\" /> \" .\n\t\t$caption . \"</legend>\\n\" .\n\t\t$message .\n\t\t\"</fieldset>\\n\\n\";\n}", "function kstFilterShortcodeCaptionAndWpCaption($attr, $content = null) {\n $output = apply_filters('kst_wp_caption_shortcode', '', $attr, $content);\n\n if ( $output != '' )\n return $output;\n\n extract(shortcode_atts(array(\n 'id'\t=> '',\n 'align'\t=> '',\n 'width'\t=> '',\n 'caption' => ''\n ), $attr));\n\n if ( $id )\n $id = 'id=\"' . $id . '\" ';\n\n if (!empty($width) )\n\n $width = ( !empty($width) )\n ? ' style=\"width: ' . ((int) $width) . 'px\" '\n : '';\n\n $better = '<div ' . $id . $width . 'class=\"wp_attachment\">';\n $better .= do_shortcode( $content );\n if ( !empty($caption) )\n $better .= '<div class=\"wp_caption\">' . $caption .'</div>';\n $better .= '</div>';\n\n return $better;\n }", "function _showtitle($img,$data){\n global $ID;\n\n if(!$data['showtitle'] ) { return ''; }\n\n //prepare link\n $lnk = ml($img['id'],array('id'=>$ID),false);\n\n // prepare output\n $ret = '';\n $ret .= '<br /><a href=\"'.$lnk.'\">';\n $ret .= hsc($this->_meta($img,'title'));\n $ret .= '</a>';\n return $ret;\n }", "function getTitle() ;", "public function renderCaption()\n {\n if (!empty($this->caption)) {\n return Html::tag('caption', $this->caption, $this->captionOptions);\n }\n\n return false;\n }", "function jabHtmlSubmitButton($caption, $id, $class=\"\", $name=\"\")\n{\n\tif ($name==\"\")\n\t\t$name=$id;\n\tif ($class!=\"\")\n\t\t$class=\" class=\\\"\".$class.\"\\\"\";\n\techo \"<input type=\\\"submit\\\" id=\\\"$id\\\" name=\\\"$name\\\" value=\\\"$caption\\\"/>\\n\";\n}", "public function caption($caption)\n {\n return $this->setProperty('caption', $caption);\n }", "function testCaption(){\n\t\t#mdx:Caption\n\t\t$select = new HtSelect('id_category');\n\t\t$select->options([1=>'Category1',2=>'Category2',3=>'Category3']);\n\t\t$select->caption('CHOOSE A CATEGORY:');\n\t\t#/mdx echo $select\n\t\t$this->expectOutputRegex(\"/select.*?CHOOSE A CATEGORY.*?/s\");\n\t\techo $select;\n\t}", "function bpfit_weight_subtab_function_to_show_title() {\n\t\t\techo 'Weight Desc.';\n\t\t}", "protected function caption_style() {\n\t\t$this->start_controls_section(\n\t\t\t'section_style_caption',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Caption', 'boostify' ),\n\t\t\t\t'tab' => Controls_Manager::TAB_STYLE,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'text_color',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Text Color', 'boostify' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'default' => '',\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .widget-image-caption' => 'color: {{VALUE}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_control(\n\t\t\t'caption_background_color',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Background Color', 'boostify' ),\n\t\t\t\t'type' => Controls_Manager::COLOR,\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .widget-image-caption' => 'background-color: {{VALUE}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->add_group_control(\n\t\t\tGroup_Control_Typography::get_type(),\n\t\t\tarray(\n\t\t\t\t'name' => 'caption_typography',\n\t\t\t\t'selector' => '{{WRAPPER}} .widget-image-caption',\n\t\t\t\t'scheme' => Scheme_Typography::TYPOGRAPHY_1,\n\t\t\t)\n\t\t);\n\n\t\t$this->add_responsive_control(\n\t\t\t'caption_padding',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Padding', 'boostify' ),\n\t\t\t\t'type' => Controls_Manager::DIMENSIONS,\n\t\t\t\t'size_units' => array( 'px', 'em', '%' ),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .widget-image-caption' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t\t$this->add_responsive_control(\n\t\t\t'caption_space',\n\t\t\tarray(\n\t\t\t\t'label' => __( 'Caption Top Spacing', 'boostify' ),\n\t\t\t\t'type' => Controls_Manager::SLIDER,\n\t\t\t\t'range' => array(\n\t\t\t\t\t'px' => array(\n\t\t\t\t\t\t'min' => 0,\n\t\t\t\t\t\t'max' => 100,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t'default' => array(\n\t\t\t\t\t'size' => 0,\n\t\t\t\t\t'unit' => 'px',\n\t\t\t\t),\n\t\t\t\t'selectors' => array(\n\t\t\t\t\t'{{WRAPPER}} .widget-image-caption' => 'margin-top: {{SIZE}}{{UNIT}}; margin-bottom: 0px;',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$this->end_controls_section();\n\t}", "public function getCaptionPosition() {}", "function TableCaption() {\n\t\tglobal $ReportLanguage;\n\t\treturn $ReportLanguage->TablePhrase($this->TableVar, \"TblCaption\");\n\t}", "function TableCaption() {\n\t\tglobal $ReportLanguage;\n\t\treturn $ReportLanguage->TablePhrase($this->TableVar, \"TblCaption\");\n\t}", "function nirvana_pptext_output( $title, $text, $id, $title_id, $text_id ) {\n\tif (!empty($title) || !empty($text)) { ?>\n\t\t<div id=\"<?php echo $id ?>\"><?php\n\t\t\tif (!empty($title)) { ?><div id=\"front-text<?php echo $title_id ?>\" class=\"ppbox\"> <h2><?php echo do_shortcode($title) ?> </h2></div><?php }\n\t\t\tif (!empty($text)) { ?><div id=\"front-text<?php echo $text_id ?>\" class=\"ppbox\"> <?php echo force_balance_tags( do_shortcode($text) ) ?> </div><?php } ?>\n\t\t</div><!--pp-text--><?php }\n}", "function pixelgrade_portfolio_items_title_alignment_overlay_control_show() {\n\t$position = pixelgrade_option( 'portfolio_items_title_position' );\n\t// We hide it when not displaying as overlay\n\tif ( 'overlay' !== $position ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "public function display_meta_box() {\n\t\t\n\t\tinclude_once( 'views/q-and-a-admin.php' );\n }", "function Show_NomoreProducts()\n\t\t{\n\t\t\tglobal $Captions_arr;\n\t\t\t$Captions_arr['SHOP_DETAILS'] \t= getCaptions('SHOP_DETAILS');\n\t\t?>\n\t\t\t<div class=\"nomoreproducts\"><?php echo $Captions_arr['SHOP_DETAILS']['NOMORE_PROD_MSG']?></div>\n\t\t\t \t\n\t\t<?php\t\n\t\t}", "function single_cat_title($prefix = '', $display = \\true)\n {\n }", "function wpse_74735_caption_shortcode( $attr, $content = NULL )\n{\n $caption = img_caption_shortcode( $attr, $content );\n $caption = str_replace( '<p class=\"wp-caption\"></p>', '<span class=\"wp-caption-text my_new_class', $caption );\n return $caption;\n}", "public function show()\n\t{\n\t\t\n\t}", "function onAfterShowDescription(&$row)\n {\n\n echo '<h3>onAfterShowDescription</h3>'\n . JText::_('PLG_JEA_OWNER_NAME'). ' : <strong>'\n . $row->owner_name . '</strong>';\n }" ]
[ "0.69546986", "0.6826821", "0.6590315", "0.6435342", "0.6296099", "0.62184167", "0.62076336", "0.61951566", "0.61628914", "0.61320436", "0.61285245", "0.61215365", "0.6100613", "0.6077285", "0.6039066", "0.6033215", "0.60184425", "0.5994269", "0.59500486", "0.5883152", "0.58816785", "0.58743435", "0.5818853", "0.58104014", "0.5804628", "0.5794588", "0.5793", "0.57747805", "0.57522005", "0.5741689", "0.5738076", "0.57259446", "0.5700217", "0.5700217", "0.5700217", "0.5677842", "0.5670488", "0.5663812", "0.56549144", "0.5646828", "0.5625447", "0.56237304", "0.5622931", "0.562222", "0.56128997", "0.56066084", "0.5587884", "0.558534", "0.553758", "0.5532401", "0.5528299", "0.5519761", "0.5515742", "0.5507887", "0.5503924", "0.5503533", "0.5501837", "0.5496327", "0.54782677", "0.5477949", "0.54742014", "0.54645675", "0.54610413", "0.54523176", "0.545036", "0.54497623", "0.54377484", "0.54377484", "0.54377484", "0.54377484", "0.5422458", "0.5422458", "0.5420871", "0.5420717", "0.54197705", "0.5412225", "0.5409171", "0.540535", "0.540535", "0.5394313", "0.5392924", "0.5375269", "0.5372782", "0.5372107", "0.53627515", "0.5360466", "0.5359218", "0.53563195", "0.5352431", "0.5348581", "0.5348203", "0.53392315", "0.53392315", "0.5323176", "0.53127563", "0.53118414", "0.53006124", "0.52959824", "0.5293415", "0.52861226", "0.5280374" ]
0.0
-1
Get Visitors mock data
public static function getMockData() { return [ 'page' => 'http://redumbrella.com.ua', 'ip' => "".mt_rand(0,255).".".mt_rand(0,255).".".mt_rand(0,255).".".mt_rand(0,255), 'open' => time(), 'location' => [], 'close' => time() + mt_rand(0, 1000), 'language' => array_rand(['RU', 'UA', 'DE', 'US'], 1)[0], 'ua' => 'Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/4.0.212.0 Safari/532.0' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getVisitorData() {\n $data = array();\n $customer = Mage::getSingleton('customer/session');\n $customerInfo = $customer->getCustomer();\n $primaryAddress = $customerInfo->getPrimaryShippingAddress();\n if ($customer->getCustomerId()){\n $data['visitorId'] = (string) $customer->getCustomerId();\n $customerEmail = $customerInfo->getEmail();\n $data['hashedEmail'] = hash('sha256', $customerEmail);\n }\n\n $data['visitorLoginState'] = ($customer->isLoggedIn()) ? 'Logged in' : 'Logged out';\n $data['visitorType'] = (string) Mage::getModel('customer/group')->load($customer->getCustomerGroupId())->getCode();\n \n $orders = Mage::getResourceModel('sales/order_collection')->addFieldToSelect('*')->addFieldToFilter('customer_id', $customer->getId());\n $ordersTotal = 0;\n\n foreach ($orders as $order) {\n $ordersTotal += $order->getGrandTotal();\n }\n\n if ($customer->isLoggedIn()) {\n $data['visitorLifetimeValue'] = round($ordersTotal, 2);\n } else {\n $orderData = $this->_getTransactionData();\n if (!empty($orderData) && isset($orderData['transactionTotal'])) {\n $data['visitorLifetimeValue'] = $orderData['transactionTotal'];\n } else {\n $data['visitorLifetimeValue'] = 0;\n }\n }\n \n $data['visitorExistingCustomer'] = ($ordersTotal > 0) ? 'Yes' : 'No';\n \n if (array_key_exists(\"HTTP_X_FORWARDED_FOR\", $_SERVER)){\n $real_customer_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];\n } else {\n $real_customer_ip = Mage::helper('core/http')->getRemoteAddr();\n }\n $data['external_id'] = $this->hashField($real_customer_ip);\n\n $this->createFacebookRequest(\"PageView\");\n\n return $data;\n }", "private function getVisitorData()\n {\n return [\n 'user_id' => 1,\n 'device_id' => 1,\n 'client_ip' => '127.0.0.1',\n 'geoip_id' => 1,\n 'agent_id' => 1,\n 'referrer_id' => 1,\n 'cookie_id' => 1,\n 'language_id' => 1,\n 'is_robot' => true,\n\n // The key user_agent is not present in the sessions table, but it's internally used to check\n // if the user agent changed during a visitor.\n 'user_agent' => '',\n ];\n }", "public function getVisitors(){\n\t\treturn $this->visitors;\n\t}", "public function buildVisitorsGraph(): \\Google_Service_Analytics_GaData\n {\n $startDate = Carbon::now()->subDays(7);\n\n $visitorsData = AnalyticsFacade::performQuery(\n Period::create($startDate, $this->endDate),\n 'ga:sessions,ga:pageviews',\n [\n 'dimensions' => 'ga:date',\n 'sort' => 'ga:date'\n ]\n );\n\n $visitorsGraph = [];\n foreach ($visitorsData->rows as $row) {\n $row[0] = Carbon::createFromFormat('Ymd', $row[0]);\n\n array_push($visitorsGraph, $row);\n }\n $visitorsData->rows = array_reverse($visitorsGraph);\n\n return $visitorsData;\n }", "public function visitorProvider()\n {\n return [\n 'guest' => ['guest', collect()],\n 'user' => ['user', collect(['auth'])],\n 'author' => ['author', collect(['auth', 'author', 'stuff'])],\n 'admin' => ['admin', collect(['auth', 'admin', 'stuff'])],\n ];\n }", "public function getTestData()\n {\n return [\n 'user_id' => 1,\n 'status' => 1,\n 'created_at' => '2016-01-21 15:00:00',\n 'updated_at' => '2016-01-21 18:00:00'\n ];\n }", "private function getTestData()\n {\n return [\n 'url' => 'http://www.mystore.com',\n 'access-token' => 'thisisaccesstoken',\n 'integration-token' => 'thisisintegrationtoken',\n 'method' => \\Magento\\Framework\\HTTP\\ZendClient::POST,\n 'body'=> ['token' => 'thisisintegrationtoken','url' => 'http://www.mystore.com'],\n ];\n }", "function get_visitor() {\n \n // Return currently logged in user\n return $this->visitor;\n \n }", "public function getData() {\r\n $vehicles = Auth::user()->vehicles;\r\n $violations = Auth::user()->violations;\r\n $data = [\r\n 'vehicles' => $vehicles,\r\n 'violations' => $violations,\r\n ];\r\n\r\n return $data;\r\n }", "public function inspect_data()\n {\n $inspect = new Inspect;\n return $inspect->report();\n }", "public function baseVisitorProvider()\n {\n return [\n 'guest' => ['guest', false],\n 'user' => ['user', true],\n ];\n }", "public function getVisits()\n {\n return $this->get('Visits');\n }", "public function getVisitor() {\n\t\tif ($this->scenario == 'search') {\n\t\t\treturn $this->visitor;\n\t\t}\n\t}", "public function visits()\n {\n return $this->hasMany(Visitor::class);\n }", "public function test() {\n $results = [];\n $results[\"testAddUser\"] = $this->testAddUser();\n\n return $results;\n }", "static public function showVisits(){\n $registro = static::leftJoin(\"users\",\"visitors.user_id\",\"=\",\"users.id\")\n ->join('handling_times',\"visitors.handling_time_id\",\"=\",\"handling_times.id\")\n ->join('direction_tickets',\"visitors.direction_ticket_id\",\"=\",\"direction_tickets.id\")\n ->join('directions',\"direction_tickets.direction_id\",\"=\",\"directions.id\")\n ->join('sectors',\"directions.sector_id\",\"=\",\"sectors.id\")\n ->select('visitors.id','first_name','last_name','identification_card','phone','sector','input','output')\n ->orderBy('visitors.id', 'DESC')\n ->get();\n return $registro;\n }", "function getUniqueVisitorsData() {\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n \n $lastmonthStartDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '1', '01', '-');\n $lastmonthEndDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '1', 't', '-');\n \n $currentmonthStartDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '0', '01', '-');\n $currentmonthEndDate=$objClassCommon->calculateMonthDate(date(\"Y-m-d\"), '0', 't', '-');\n \n //echo $lastmonthStartDate.\"==\".$lastmonthEndDate.'<br>'.$currentmonthStartDate.'=='.$currentmonthEndDate;\n //die;\n \n //For Calculating last month data\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR . \" WHERE DATE(Visitor_Date_Added) >='\".$lastmonthStartDate.\"' AND DATE(Visitor_Date_Added) <='\".$lastmonthEndDate.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $arrRes['last']['count']=$arrData[0]['count'];\n \n //For Calculating current month data\n $varQuery = \"SELECT count(DISTINCT VisitorIP) as count FROM \" . TABLE_VISITOR . \" WHERE DATE(Visitor_Date_Added) >='\".$currentmonthStartDate.\"' AND DATE(Visitor_Date_Added) <='\".$currentmonthEndDate.\"'\";\n $arrData = $this->getArrayResult($varQuery);\n $arrRes['current']['count']=$arrData[0]['count'];\n \n \n //pre($arrRes);\n return $arrRes;\n }", "public function jsonViewTestData() {}", "public function index()\n {\n try{\n $visits = Visit::all();\n $data = response(VisitResource::collection($visits));\n }\n catch(HttpException $error){\n $data = $error->getMessage();\n }\n return $data;\n }", "static public function showVisits(){\n\n\t\t$tabla = \"visitspeople\";\n\t\n\t\t$respuesta = VisitsModel::showVisits($tabla);\n\t\t\n\t\treturn $respuesta;\n\t}", "function getVisitorVerify($visitor_id){\n\t\t\t\n\t\t\t$query = \"select member_id from tbl_member where member_id = '\".$visitor_id.\"'\";\n\n\t\t\t$rs = $this->Execute($query);\n\t\t\twhile($row = $rs->FetchRow()) {\n\n\t\t\t\t$sSQL= \"select subscriber_id, mail_street_address, mail_city, mail_state, mail_zip_code \n\t\t\t\tfrom tbl_subscriber where subscriber_id='\".$visitor_id.\"'\";\n\t\t\n\t\t\t\t//echo $sSQL;\n\t\t\t\t$rs = $this->Execute($sSQL);\t\t\t\t\n\t\t\t\treturn $this->_getPageArray($rs, 'Member');\n\t\t\t}\n\t\t\treturn false;\t\t\t\n\t\t}", "public function retrieveVisitorByDate()\n {\n header('Content-Type: application/json');\n\n //query to get the number of clicks of an advertisement\n $query = sprintf(\"SELECT COUNT(recordID) AS visitors,date FROM ad_stats GROUP BY date;\");\n\n //execute query\n $result = $GLOBALS['db']->query($query);\n\n //loop through the returned data\n $data = array();\n foreach ($result as $row) {\n $data[] = $row;\n }\n\n //free memory associated with result\n $result->close();\n\n //return the data\n return $data;\n }", "public function recognize()\n {\n $this->setIsVisitorKnown(false);\n\n $configId = $this->configId;\n\n $idVisitor = $this->request->getVisitorId();\n $isVisitorIdToLookup = !empty($idVisitor);\n\n if ($isVisitorIdToLookup) {\n $this->visitorInfo['idvisitor'] = $idVisitor;\n Common::printDebug(\"Matching visitors with: visitorId=\" . bin2hex($this->visitorInfo['idvisitor']) . \" OR configId=\" . bin2hex($configId));\n } else {\n Common::printDebug(\"Visitor doesn't have the piwik cookie...\");\n }\n\n $selectCustomVariables = '';\n // No custom var were found in the request, so let's copy the previous one in a potential conversion later\n if (!$this->customVariables) {\n $maxCustomVariables = CustomVariables::getMaxCustomVariables();\n\n for ($index = 1; $index <= $maxCustomVariables; $index++) {\n $selectCustomVariables .= ', custom_var_k' . $index . ', custom_var_v' . $index;\n }\n }\n\n $persistedVisitAttributes = self::getVisitFieldsPersist();\n array_unshift($persistedVisitAttributes, 'visit_first_action_time');\n array_unshift($persistedVisitAttributes, 'visit_last_action_time');\n $persistedVisitAttributes = array_unique($persistedVisitAttributes);\n\n $selectFields = implode(\", \", $persistedVisitAttributes);\n\n $select = \"SELECT\n $selectFields\n $selectCustomVariables\n \";\n $from = \"FROM \" . Common::prefixTable('log_visit');\n\n list($timeLookBack, $timeLookAhead) = $this->getWindowLookupThisVisit();\n\n $shouldMatchOneFieldOnly = $this->shouldLookupOneVisitorFieldOnly($isVisitorIdToLookup);\n\n // Two use cases:\n // 1) there is no visitor ID so we try to match only on config_id (heuristics)\n // \t\tPossible causes of no visitor ID: no browser cookie support, direct Tracking API request without visitor ID passed,\n // importing server access logs with import_logs.py, etc.\n // \t\tIn this case we use config_id heuristics to try find the visitor in tahhhe past. There is a risk to assign\n // \t\tthis page view to the wrong visitor, but this is better than creating artificial visits.\n // 2) there is a visitor ID and we trust it (config setting trust_visitors_cookies, OR it was set using &cid= in tracking API),\n // and in these cases, we force to look up this visitor id\n $whereCommon = \"visit_last_action_time >= ? AND visit_last_action_time <= ? AND idsite = ?\";\n $bindSql = array(\n $timeLookBack,\n $timeLookAhead,\n $this->request->getIdSite()\n );\n\n if ($shouldMatchOneFieldOnly) {\n if ($isVisitorIdToLookup) {\n $whereCommon .= ' AND idvisitor = ?';\n $bindSql[] = $this->visitorInfo['idvisitor'];\n } else {\n $whereCommon .= ' AND config_id = ?';\n $bindSql[] = $configId;\n }\n\n $sql = \"$select\n $from\n WHERE \" . $whereCommon . \"\n ORDER BY visit_last_action_time DESC\n LIMIT 1\";\n } // We have a config_id AND a visitor_id. We match on either of these.\n // \t\tWhy do we also match on config_id?\n //\t\twe do not trust the visitor ID only. Indeed, some browsers, or browser addons,\n // \t\tcause the visitor id from the 1st party cookie to be different on each page view!\n // \t\tIt is not acceptable to create a new visit every time such browser does a page view,\n // \t\tso we also backup by searching for matching config_id.\n // We use a UNION here so that each sql query uses its own INDEX\n else {\n // will use INDEX index_idsite_config_datetime (idsite, config_id, visit_last_action_time)\n $where = ' AND config_id = ?\n AND user_id IS NULL ';\n $bindSql[] = $configId;\n $sqlConfigId = \"$select ,\n 0 as priority\n $from\n WHERE $whereCommon $where\n ORDER BY visit_last_action_time DESC\n LIMIT 1\n \";\n // will use INDEX index_idsite_idvisitor (idsite, idvisitor)\n $bindSql[] = $timeLookBack;\n $bindSql[] = $timeLookAhead;\n $bindSql[] = $this->request->getIdSite();\n $where = ' AND idvisitor = ?';\n $bindSql[] = $this->visitorInfo['idvisitor'];\n $sqlVisitorId = \"$select ,\n 1 as priority\n $from\n WHERE $whereCommon $where\n ORDER BY visit_last_action_time DESC\n LIMIT 1\n \";\n\n // We join both queries and favor the one matching the visitor_id if it did match\n $sql = \" ( $sqlConfigId )\n UNION\n ( $sqlVisitorId )\n ORDER BY priority DESC\n LIMIT 1\";\n }\n\n $visitRow = Tracker::getDatabase()->fetch($sql, $bindSql);\n\n $isNewVisitForced = $this->request->getParam('new_visit');\n $isNewVisitForced = !empty($isNewVisitForced);\n $enforceNewVisit = $isNewVisitForced || Config::getInstance()->Debug['tracker_always_new_visitor'];\n\n if (!$enforceNewVisit\n && $visitRow\n && count($visitRow) > 0\n ) {\n\n // These values will be used throughout the request\n foreach($persistedVisitAttributes as $field) {\n $this->visitorInfo[$field] = $visitRow[$field];\n }\n\n $this->visitorInfo['visit_last_action_time'] = strtotime($visitRow['visit_last_action_time']);\n $this->visitorInfo['visit_first_action_time'] = strtotime($visitRow['visit_first_action_time']);\n\n // Custom Variables copied from Visit in potential later conversion\n if (!empty($selectCustomVariables)) {\n $maxCustomVariables = CustomVariables::getMaxCustomVariables();\n for ($i = 1; $i <= $maxCustomVariables; $i++) {\n if (isset($visitRow['custom_var_k' . $i])\n && strlen($visitRow['custom_var_k' . $i])\n ) {\n $this->visitorInfo['custom_var_k' . $i] = $visitRow['custom_var_k' . $i];\n }\n if (isset($visitRow['custom_var_v' . $i])\n && strlen($visitRow['custom_var_v' . $i])\n ) {\n $this->visitorInfo['custom_var_v' . $i] = $visitRow['custom_var_v' . $i];\n }\n }\n }\n\n $this->setIsVisitorKnown(true);\n Common::printDebug(\"The visitor is known (idvisitor = \" . bin2hex($this->visitorInfo['idvisitor']) . \",\n config_id = \" . bin2hex($configId) . \",\n idvisit = {$this->visitorInfo['idvisit']},\n last action = \" . date(\"r\", $this->visitorInfo['visit_last_action_time']) . \",\n first action = \" . date(\"r\", $this->visitorInfo['visit_first_action_time']) . \",\n visit_goal_buyer' = \" . $this->visitorInfo['visit_goal_buyer'] . \")\");\n //Common::printDebug($this->visitorInfo);\n } else {\n Common::printDebug(\"The visitor was not matched with an existing visitor...\");\n }\n }", "private function mockedData()\n {\n $evens = [\n [3,9,10,6,7,8,1,5,2,4],\n [5,5,5,5],\n [4,5,5,3],\n [8,3,1,9,0,4]\n ];\n\n $odds = [\n [9,5,6],\n [0,5,7,8,4],\n [6,3,1,0,8,4,9]\n ];\n\n $invalids = [\n [],\n ['abcd_something_happenned'],\n ['a',5,'c',8],\n ['*','$','€'],\n [3,9,10,6,7,8,1,5,2,'*'],\n ];\n\n return (array) [\n 'evens' => $evens,\n 'odds' => $odds,\n 'invalids' => $invalids\n ];\n }", "public function test_teams_show_authenticated_admin_returns_correct_data(){\n $this->signInAdmin();\n $response = $this->get(route('teams.show', ['team' => 1]));\n $this->assertEquals(Team::find(1), $response['team']);\n $this->assertEquals(Team::find(1)->members()->with('tasks')->get(), $response['members']);\n }", "public function getData()\n {\n return $this->teamMember;\n }", "public function testWebinarRegistrantGet()\n {\n }", "public function test_can_get_all_true()\n {\n $this->seed();\n $user = User::where('email', '=', '[email protected]')->first();\n $token = JWTAuth::fromUser($user);\n $response = $this->json('GET','/api/treatments?token='.$token);\n\n $response->assertStatus(200);\n }", "public function getData() {\r\n //create new mediator instance\r\n $Mediator = new Mediator();\r\n\r\n //get datagraph from mediator\r\n $this->data = $Mediator->getData();\r\n\r\n return $this->data;\r\n }", "final public function onTest()\n {\n // identical to a GET request without the body output.\n // shodul proxy to the get method\n return array(); // MUST NOT return a message-body in the response\n }", "public function index()\n {\n \n $reservations = Reservation::whereDate('date', Carbon::now()->format('Y-m-d'))->get(); //mostrar las reservaciones solo del dia\n //dd($visitors);\n\n if (!empty($reservations)) {\n\n $patients = $reservations->map(function ($item) {\n $patient = Person::where('id', $item->patient_id)->first();\n return $patient;\n });\n\n if ($patients->isNotEmpty()) {\n foreach ($patients as $patient) {\n Visitor::create([\n 'person_id' => $patient->id,\n 'type_visitor' => 'Paciente',\n 'inside' => null,\n 'outside' => null,\n 'branch_id' => 1\n ]);\n }\n }\n\n $visitors = Visitor::with('person.image')->whereDate('created_at', Carbon::now()->format('Y-m-d'))\n ->where('type_visitor', 'Visitante')\n ->orWhere('type_visitor', 'Paciente')->get(); //obtener solo registros creados hoy\n \n return response()->json([\n 'all' => $visitors,\n ]);\n }\n }", "protected function viewsData() {\n $data = parent::viewsData();\n $data['views_test_data']['uid'] = [\n 'title' => 'UID',\n 'help' => 'The test data UID',\n 'relationship' => [\n 'id' => 'standard',\n 'base' => 'users_field_data',\n 'base field' => 'uid',\n ],\n ];\n\n // Create a dummy field with no help text.\n $data['views_test_data']['no_help'] = $data['views_test_data']['name'];\n $data['views_test_data']['no_help']['field']['title'] = 'No help';\n $data['views_test_data']['no_help']['field']['real field'] = 'name';\n unset($data['views_test_data']['no_help']['help']);\n\n return $data;\n }", "public function testClientsPageAsVisitor() {\n\n $this->visit('/clients')\n ->seePageIs('/login');\n\n }", "public function testGetAgenciesData()\n {\n $report = array(\n 'pages' => 10,\n 'params' => array(\n 'type' => 'koop',\n 'zo' => '/amsterdam/tuin/',\n )\n );\n \n $apiCaller = $this->getMockBuilder('Lsw\\ApiCallerBundle\\Caller\\LoggingApiCaller')\n ->disableOriginalConstructor()\n ->getMock(); \n \n // Mock method that does cURL request\n $apiCaller->expects($this->any())\n ->method('call')\n ->will($this->returnValue(\n json_decode(\n '{\"Metadata\":{\"ObjectType\":\"Koopwoningen\",\"Omschrijving\":\"Koopwoningen > Amsterdam | Tuin\",\"Titel\":\"Huizen te koop in Amsterdam\"},\"Objects\":[{\"AangebodenSindsTekst\":\"<span title=\\\"langer dan 6 maanden\\\">6+ maanden<\\/span>\",\"AanmeldDatum\":\"\\/Date(1262300400000+0100)\\/\",\"AantalKamers\":6,\"AantalKavels\":null,\"Adres\":\"Hendrik Bulthuisstraat 16\",\"Afstand\":0,\"BronCode\":\"NVM\",\"ChildrenObjects\":[],\"DatumOndertekeningAkte\":null,\"Foto\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/042\\/729\\/391_klein.jpg\",\"FotoLarge\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/042\\/729\\/391_groot.jpg\",\"FotoLargest\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/042\\/729\\/391_grotere.jpg\",\"FotoMedium\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/042\\/729\\/391_middel.jpg\",\"FotoSecure\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/042\\/729\\/391_klein.jpg\",\"GewijzigdDatum\":null,\"GlobalId\":2433344,\"GroupByObjectType\":\"400b18e1-d7ef-4b95-85b1-83563b41b48c\",\"Heeft360GradenFoto\":false,\"HeeftBrochure\":true,\"HeeftOverbruggingsgrarantie\":false,\"HeeftPlattegrond\":false,\"HeeftTophuis\":true,\"HeeftVeiling\":false,\"HeeftVideo\":false,\"HuurPrijsTot\":null,\"Huurprijs\":null,\"HuurprijsFormaat\":null,\"Id\":\"400b18e1-d7ef-4b95-85b1-83563b41b48c\",\"InUnitsVanaf\":null,\"IndProjectObjectType\":false,\"IndTransactieMakelaarTonen\":\"true\",\"IsSearchable\":true,\"IsVerhuurd\":false,\"IsVerkocht\":false,\"IsVerkochtOfVerhuurd\":false,\"Koopprijs\":365000,\"KoopprijsFormaat\":\"<[KoopPrijs]> <{kosten koper|kort}>\",\"KoopprijsTot\":365000,\"MakelaarId\":12285,\"MakelaarNaam\":\"Makelaarsland\",\"MobileURL\":\"http:\\/\\/m.funda.nl\\/obj.aspx?goi=2433344\",\"OpenHuis\":[\"\\/Date(1396688400000+0200)\\/\"],\"Oppervlakte\":0,\"Perceeloppervlakte\":125,\"Postcode\":\"1067SC\",\"Prijs\":{\"HuurAbbreviation\":\"\",\"Huurprijs\":null,\"HuurprijsOpAanvraag\":\"\",\"HuurprijsTot\":null,\"KoopAbbreviation\":\"k.k.\",\"Koopprijs\":365000,\"KoopprijsOpAanvraag\":\"\",\"KoopprijsTot\":365000,\"OriginelePrijs\":387000,\"VeilingText\":\"\"},\"PrijsGeformatteerdHtml\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;365.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><br\\/><del class=\\\"price-del\\\"><span class=\\\"price\\\">&euro;&nbsp;387.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/del><\\/span>\",\"PrijsGeformatteerdTextHuur\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;365.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><br\\/><del class=\\\"price-del\\\"><span class=\\\"price\\\">&euro;&nbsp;387.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/del><\\/span>\",\"PrijsGeformatteerdTextKoop\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;365.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><br\\/><del class=\\\"price-del\\\"><span class=\\\"price\\\">&euro;&nbsp;387.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/del><\\/span>\",\"Producten\":[\"Top\",\"Brochure\"],\"ProjectNaam\":null,\"PromoLabel\":{\"HasPromotionLabel\":false,\"PromotionPhotos\":[],\"PromotionPhotosSecure\":null,\"PromotionType\":0,\"RibbonColor\":0,\"RibbonText\":null,\"Tagline\":null},\"PublicatieDatum\":\"\\/Date(1377644711000+0200)\\/\",\"Soort-aanbod\":\"woonhuis\",\"SoortAanbod\":10,\"StartOplevering\":null,\"TransactieAfmeldDatum\":null,\"TransactieMakelaarId\":null,\"TransactieMakelaarNaam\":null,\"TypeProject\":0,\"URL\":\"http:\\/\\/www.funda.nl\\/koop\\/amsterdam\\/huis-48888707-hendrik-bulthuisstraat-16\\/\",\"VerkoopStatus\":\"StatusBeschikbaar\",\"WGS84_X\":4.795719,\"WGS84_Y\":52.37387,\"WoonOppervlakteTot\":152,\"Woonoppervlakte\":152,\"Woonplaats\":\"Amsterdam\",\"ZoekType\":[10]},{\"AangebodenSindsTekst\":\"28 maart 2014\",\"AanmeldDatum\":\"\\/Date(1262300400000+0100)\\/\",\"AantalKamers\":4,\"AantalKavels\":null,\"Adres\":\"Blauwvoetstraat 55\",\"Afstand\":0,\"BronCode\":\"NVM\",\"ChildrenObjects\":[],\"DatumOndertekeningAkte\":null,\"Foto\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/043\\/230\\/402_klein.jpg\",\"FotoLarge\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/043\\/230\\/402_groot.jpg\",\"FotoLargest\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/043\\/230\\/402_grotere.jpg\",\"FotoMedium\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/043\\/230\\/402_middel.jpg\",\"FotoSecure\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/043\\/230\\/402_klein.jpg\",\"GewijzigdDatum\":null,\"GlobalId\":2617813,\"GroupByObjectType\":\"1dc99599-64c8-4d6d-a59a-dd4c36bb3c36\",\"Heeft360GradenFoto\":false,\"HeeftBrochure\":true,\"HeeftOverbruggingsgrarantie\":true,\"HeeftPlattegrond\":true,\"HeeftTophuis\":true,\"HeeftVeiling\":false,\"HeeftVideo\":false,\"HuurPrijsTot\":null,\"Huurprijs\":null,\"HuurprijsFormaat\":null,\"Id\":\"1dc99599-64c8-4d6d-a59a-dd4c36bb3c36\",\"InUnitsVanaf\":null,\"IndProjectObjectType\":false,\"IndTransactieMakelaarTonen\":\"true\",\"IsSearchable\":true,\"IsVerhuurd\":false,\"IsVerkocht\":false,\"IsVerkochtOfVerhuurd\":false,\"Koopprijs\":240000,\"KoopprijsFormaat\":\"<[KoopPrijs]> <{kosten koper|kort}>\",\"KoopprijsTot\":240000,\"MakelaarId\":24079,\"MakelaarNaam\":\"Van der Linden\",\"MobileURL\":\"http:\\/\\/m.funda.nl\\/obj.aspx?goi=2617813\",\"OpenHuis\":[\"\\/Date(1396688400000+0200)\\/\"],\"Oppervlakte\":0,\"Perceeloppervlakte\":null,\"Postcode\":\"1061BM\",\"Prijs\":{\"HuurAbbreviation\":\"\",\"Huurprijs\":null,\"HuurprijsOpAanvraag\":\"\",\"HuurprijsTot\":null,\"KoopAbbreviation\":\"k.k.\",\"Koopprijs\":240000,\"KoopprijsOpAanvraag\":\"\",\"KoopprijsTot\":240000,\"OriginelePrijs\":null,\"VeilingText\":\"\"},\"PrijsGeformatteerdHtml\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;240.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"PrijsGeformatteerdTextHuur\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;240.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"PrijsGeformatteerdTextKoop\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;240.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"Producten\":[\"Top\",\"Overbruggingsgarantie\",\"Plattegrond\",\"Brochure\",\"Featured\"],\"ProjectNaam\":null,\"PromoLabel\":{\"HasPromotionLabel\":true,\"PromotionPhotos\":[],\"PromotionPhotosSecure\":null,\"PromotionType\":2,\"RibbonColor\":1,\"RibbonText\":\"NIEUW\",\"Tagline\":\"Nieuw appartementencomplex, met buitenruimte en parkeerplaats.\"},\"PublicatieDatum\":\"\\/Date(1395965111000+0100)\\/\",\"Soort-aanbod\":\"appartement\",\"SoortAanbod\":10,\"StartOplevering\":null,\"TransactieAfmeldDatum\":null,\"TransactieMakelaarId\":null,\"TransactieMakelaarNaam\":null,\"TypeProject\":0,\"URL\":\"http:\\/\\/www.funda.nl\\/koop\\/amsterdam\\/appartement-48062276-blauwvoetstraat-55\\/\",\"VerkoopStatus\":\"StatusBeschikbaar\",\"WGS84_X\":4.838819,\"WGS84_Y\":52.37642,\"WoonOppervlakteTot\":120,\"Woonoppervlakte\":120,\"Woonplaats\":\"Amsterdam\",\"ZoekType\":[10]},{\"AangebodenSindsTekst\":\"2 maanden\",\"AanmeldDatum\":\"\\/Date(1262300400000+0100)\\/\",\"AantalKamers\":3,\"AantalKavels\":null,\"Adres\":\"Rietlandterras 16 Hs+PP\",\"Afstand\":0,\"BronCode\":\"NVM\",\"ChildrenObjects\":[],\"DatumOndertekeningAkte\":null,\"Foto\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/041\\/684\\/605_klein.jpg\",\"FotoLarge\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/041\\/684\\/605_groot.jpg\",\"FotoLargest\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/041\\/684\\/605_grotere.jpg\",\"FotoMedium\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/041\\/684\\/605_middel.jpg\",\"FotoSecure\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/041\\/684\\/605_klein.jpg\",\"GewijzigdDatum\":null,\"GlobalId\":2556344,\"GroupByObjectType\":\"e35e2cd5-e185-4a30-85f6-661c643e5351\",\"Heeft360GradenFoto\":false,\"HeeftBrochure\":false,\"HeeftOverbruggingsgrarantie\":false,\"HeeftPlattegrond\":false,\"HeeftTophuis\":true,\"HeeftVeiling\":false,\"HeeftVideo\":false,\"HuurPrijsTot\":null,\"Huurprijs\":null,\"HuurprijsFormaat\":null,\"Id\":\"e35e2cd5-e185-4a30-85f6-661c643e5351\",\"InUnitsVanaf\":null,\"IndProjectObjectType\":false,\"IndTransactieMakelaarTonen\":\"true\",\"IsSearchable\":true,\"IsVerhuurd\":false,\"IsVerkocht\":false,\"IsVerkochtOfVerhuurd\":false,\"Koopprijs\":349000,\"KoopprijsFormaat\":\"<[KoopPrijs]> <{kosten koper|kort}>\",\"KoopprijsTot\":349000,\"MakelaarId\":24705,\"MakelaarNaam\":\"Eefje Voogd Makelaardij\",\"MobileURL\":\"http:\\/\\/m.funda.nl\\/obj.aspx?goi=2556344\",\"OpenHuis\":[\"\\/Date(1396688400000+0200)\\/\"],\"Oppervlakte\":0,\"Perceeloppervlakte\":null,\"Postcode\":\"1019EW\",\"Prijs\":{\"HuurAbbreviation\":\"\",\"Huurprijs\":null,\"HuurprijsOpAanvraag\":\"\",\"HuurprijsTot\":null,\"KoopAbbreviation\":\"k.k.\",\"Koopprijs\":349000,\"KoopprijsOpAanvraag\":\"\",\"KoopprijsTot\":349000,\"OriginelePrijs\":null,\"VeilingText\":\"\"},\"PrijsGeformatteerdHtml\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;349.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"PrijsGeformatteerdTextHuur\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;349.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"PrijsGeformatteerdTextKoop\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;349.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"Producten\":[\"Top\"],\"ProjectNaam\":null,\"PromoLabel\":{\"HasPromotionLabel\":false,\"PromotionPhotos\":[],\"PromotionPhotosSecure\":null,\"PromotionType\":0,\"RibbonColor\":0,\"RibbonText\":null,\"Tagline\":null},\"PublicatieDatum\":\"\\/Date(1390518000000+0100)\\/\",\"Soort-aanbod\":\"appartement\",\"SoortAanbod\":10,\"StartOplevering\":null,\"TransactieAfmeldDatum\":null,\"TransactieMakelaarId\":null,\"TransactieMakelaarNaam\":null,\"TypeProject\":0,\"URL\":\"http:\\/\\/www.funda.nl\\/koop\\/amsterdam\\/appartement-48901707-rietlandterras-16-hs-pp\\/\",\"VerkoopStatus\":\"StatusBeschikbaar\",\"WGS84_X\":4.935488,\"WGS84_Y\":52.37174,\"WoonOppervlakteTot\":100,\"Woonoppervlakte\":100,\"Woonplaats\":\"Amsterdam\",\"ZoekType\":[10]},{\"AangebodenSindsTekst\":\"28 maart 2014\",\"AanmeldDatum\":\"\\/Date(1262300400000+0100)\\/\",\"AantalKamers\":4,\"AantalKavels\":null,\"Adres\":\"Wijttenbachstraat 54 hs\",\"Afstand\":0,\"BronCode\":\"NVM\",\"ChildrenObjects\":[],\"DatumOndertekeningAkte\":null,\"Foto\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/043\\/234\\/879_klein.jpg\",\"FotoLarge\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/043\\/234\\/879_groot.jpg\",\"FotoLargest\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/043\\/234\\/879_grotere.jpg\",\"FotoMedium\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/043\\/234\\/879_middel.jpg\",\"FotoSecure\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/043\\/234\\/879_klein.jpg\",\"GewijzigdDatum\":null,\"GlobalId\":2617948,\"GroupByObjectType\":\"5a893801-0c2b-42c2-963b-a4311fe061de\",\"Heeft360GradenFoto\":false,\"HeeftBrochure\":true,\"HeeftOverbruggingsgrarantie\":false,\"HeeftPlattegrond\":false,\"HeeftTophuis\":true,\"HeeftVeiling\":false,\"HeeftVideo\":false,\"HuurPrijsTot\":null,\"Huurprijs\":null,\"HuurprijsFormaat\":null,\"Id\":\"5a893801-0c2b-42c2-963b-a4311fe061de\",\"InUnitsVanaf\":null,\"IndProjectObjectType\":false,\"IndTransactieMakelaarTonen\":\"true\",\"IsSearchable\":true,\"IsVerhuurd\":false,\"IsVerkocht\":false,\"IsVerkochtOfVerhuurd\":false,\"Koopprijs\":625000,\"KoopprijsFormaat\":\"<[KoopPrijs]> <{kosten koper|kort}>\",\"KoopprijsTot\":625000,\"MakelaarId\":12285,\"MakelaarNaam\":\"Makelaarsland\",\"MobileURL\":\"http:\\/\\/m.funda.nl\\/obj.aspx?goi=2617948\",\"OpenHuis\":[\"\\/Date(1396688400000+0200)\\/\"],\"Oppervlakte\":0,\"Perceeloppervlakte\":null,\"Postcode\":\"1093JE\",\"Prijs\":{\"HuurAbbreviation\":\"\",\"Huurprijs\":null,\"HuurprijsOpAanvraag\":\"\",\"HuurprijsTot\":null,\"KoopAbbreviation\":\"k.k.\",\"Koopprijs\":625000,\"KoopprijsOpAanvraag\":\"\",\"KoopprijsTot\":625000,\"OriginelePrijs\":null,\"VeilingText\":\"\"},\"PrijsGeformatteerdHtml\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;625.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"PrijsGeformatteerdTextHuur\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;625.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"PrijsGeformatteerdTextKoop\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;625.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"Producten\":[\"Top\",\"Brochure\"],\"ProjectNaam\":null,\"PromoLabel\":{\"HasPromotionLabel\":false,\"PromotionPhotos\":[],\"PromotionPhotosSecure\":null,\"PromotionType\":0,\"RibbonColor\":0,\"RibbonText\":null,\"Tagline\":null},\"PublicatieDatum\":\"\\/Date(1395965111000+0100)\\/\",\"Soort-aanbod\":\"appartement\",\"SoortAanbod\":10,\"StartOplevering\":null,\"TransactieAfmeldDatum\":null,\"TransactieMakelaarId\":null,\"TransactieMakelaarNaam\":null,\"TypeProject\":0,\"URL\":\"http:\\/\\/www.funda.nl\\/koop\\/amsterdam\\/appartement-48062301-wijttenbachstraat-54-hs\\/\",\"VerkoopStatus\":\"StatusBeschikbaar\",\"WGS84_X\":4.92771,\"WGS84_Y\":52.3605,\"WoonOppervlakteTot\":136,\"Woonoppervlakte\":136,\"Woonplaats\":\"Amsterdam\",\"ZoekType\":[10]},{\"AangebodenSindsTekst\":\"7 weken\",\"AanmeldDatum\":\"\\/Date(1262300400000+0100)\\/\",\"AantalKamers\":4,\"AantalKavels\":null,\"Adres\":\"Antwerpenbaan 66\",\"Afstand\":0,\"BronCode\":\"NVM\",\"ChildrenObjects\":[],\"DatumOndertekeningAkte\":null,\"Foto\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/042\\/143\\/311_klein.jpg\",\"FotoLarge\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/042\\/143\\/311_groot.jpg\",\"FotoLargest\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/042\\/143\\/311_grotere.jpg\",\"FotoMedium\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/042\\/143\\/311_middel.jpg\",\"FotoSecure\":\"http:\\/\\/cloud.funda.nl\\/valentina_media\\/042\\/143\\/311_klein.jpg\",\"GewijzigdDatum\":null,\"GlobalId\":2574113,\"GroupByObjectType\":\"25bab054-2b7a-4897-9378-c0655875f6d1\",\"Heeft360GradenFoto\":true,\"HeeftBrochure\":false,\"HeeftOverbruggingsgrarantie\":false,\"HeeftPlattegrond\":true,\"HeeftTophuis\":true,\"HeeftVeiling\":false,\"HeeftVideo\":false,\"HuurPrijsTot\":null,\"Huurprijs\":null,\"HuurprijsFormaat\":null,\"Id\":\"25bab054-2b7a-4897-9378-c0655875f6d1\",\"InUnitsVanaf\":null,\"IndProjectObjectType\":false,\"IndTransactieMakelaarTonen\":\"true\",\"IsSearchable\":true,\"IsVerhuurd\":false,\"IsVerkocht\":false,\"IsVerkochtOfVerhuurd\":false,\"Koopprijs\":250000,\"KoopprijsFormaat\":\"<[KoopPrijs]> <{kosten koper|kort}>\",\"KoopprijsTot\":250000,\"MakelaarId\":24512,\"MakelaarNaam\":\"Moerland makelaardij o.g. b.v.\",\"MobileURL\":\"http:\\/\\/m.funda.nl\\/obj.aspx?goi=2574113\",\"OpenHuis\":[\"\\/Date(1396692000000+0200)\\/\"],\"Oppervlakte\":0,\"Perceeloppervlakte\":113,\"Postcode\":\"1066SJ\",\"Prijs\":{\"HuurAbbreviation\":\"\",\"Huurprijs\":null,\"HuurprijsOpAanvraag\":\"\",\"HuurprijsTot\":null,\"KoopAbbreviation\":\"k.k.\",\"Koopprijs\":250000,\"KoopprijsOpAanvraag\":\"\",\"KoopprijsTot\":250000,\"OriginelePrijs\":null,\"VeilingText\":\"\"},\"PrijsGeformatteerdHtml\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;250.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"PrijsGeformatteerdTextHuur\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;250.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"PrijsGeformatteerdTextKoop\":\"<span class=\\\"price-wrapper\\\"><span class=\\\"price\\\">&euro;&nbsp;250.000<\\/span> <abbr class=\\\"price-ext\\\">k.k.<\\/abbr><\\/span>\",\"Producten\":[\"Top\",\"Plattegrond\",\"360-fotos\"],\"ProjectNaam\":null,\"PromoLabel\":{\"HasPromotionLabel\":false,\"PromotionPhotos\":[],\"PromotionPhotosSecure\":null,\"PromotionType\":0,\"RibbonColor\":0,\"RibbonText\":null,\"Tagline\":null},\"PublicatieDatum\":\"\\/Date(1392077118000+0100)\\/\",\"Soort-aanbod\":\"woonhuis\",\"SoortAanbod\":10,\"StartOplevering\":null,\"TransactieAfmeldDatum\":null,\"TransactieMakelaarId\":null,\"TransactieMakelaarNaam\":null,\"TypeProject\":0,\"URL\":\"http:\\/\\/www.funda.nl\\/koop\\/amsterdam\\/huis-48929576-antwerpenbaan-66\\/\",\"VerkoopStatus\":\"StatusBeschikbaar\",\"WGS84_X\":4.801842,\"WGS84_Y\":52.34495,\"WoonOppervlakteTot\":103,\"Woonoppervlakte\":103,\"Woonplaats\":\"Amsterdam\",\"ZoekType\":[10]}],\"Paging\":{\"AantalPaginas\":281,\"HuidigePagina\":1,\"VolgendeUrl\":\"\\/~\\/koop\\/amsterdam\\/tuin\\/p2\\/\",\"VorigeUrl\":null},\"TotaalAantalObjecten\":1403}'\n )\n ));\n \n $funda = new FundaConnector('apikey', $apiCaller);\n \n $this->assertEquals(\n $funda->getAgenciesData($report['params'], $report['pages']), \n array (\n 12285 => array(\n 'name' => 'Makelaarsland',\n 'count' => 2 * $report['pages'],\n ),\n 24079 => array(\n 'name' => 'Van der Linden',\n 'count' => 1 * $report['pages'],\n ),\n 24705 => array(\n 'name' => 'Eefje Voogd Makelaardij',\n 'count' => 1 * $report['pages'],\n ),\n 24512 => array(\n 'name' => 'Moerland makelaardij o.g. b.v.',\n 'count' => 1 * $report['pages'],\n )\n )\n );\n }", "public function retrieveVisitorByCountry()\n {\n header('Content-Type: application/json');\n\n //query to get the visitors grouped by country - for the current month\n $query = sprintf(\"SELECT ip,COUNT(recordID) AS visitors FROM ad_stats WHERE (MONTH(date) = MONTH(CURRENT_DATE()) AND YEAR(date) = YEAR(CURRENT_DATE())) GROUP BY ip;\");\n\n //execute query\n $result = $GLOBALS['db']->query($query);\n\n //loop through the returned data\n $data = array();\n foreach ($result as $row) {\n $data[] = $row;\n }\n\n //free memory associated with result\n $result->close();\n\n //return the data\n return $data;\n }", "public static function getRegistered(): array {\n return [\n 'labels' => UserSiteAccessStatistics::whereNotNull('amount_registered')->whereBetween('created_at', [Carbon::today()->subDays(7), Carbon::today()])->get()->map(function($statistic) {\n return $statistic->created_at->format('y-m-d g:i A');\n }),\n 'data' => UserSiteAccessStatistics::whereNotNull('amount_registered')->whereBetween('created_at', [Carbon::today()->subDays(7), Carbon::today()])->get()->pluck('amount_registered'),\n ];\n }", "public function __invoke()\n {\n $faker = Factory::create();\n $genders = User::GENDERS;\n $gender = $faker->randomElement($genders);\n\n return [\n 'email' => $faker->email,\n 'password' => $faker->password,\n 'name' => $faker->name($gender),\n 'gender' => $gender,\n 'dateOfBirth' => $faker->dateTimeBetween('-100 years', '-18 years')->format('Y-m-d'),\n 'lat' => $faker->latitude,\n 'lng' => $faker->longitude\n ];\n }", "public function testClientsPaginationAsVisitor() {\n\n $this->visit('/clients/get')\n ->seePageIs('/login');\n\n }", "public function listByVisitor(UserDto $visitor, Pageable $pageable = null);", "public function test_data_source_interface_implementation() {\n\n $client = new GuzzleHttp\\Client();\n $crawler = new InstagramCrawler($client,$this->access_token,['russia','moscow'],[$this->access_token_username,'applemusic']);\n\n $data = $crawler->crawl();\n\n // manually flatten data\n $flatten_data = [];\n foreach($data['users'] as $media_array) {\n $flatten_data = array_merge($flatten_data, $media_array);\n }\n foreach($data['tags'] as $media_array) {\n $flatten_data = array_merge($flatten_data, $media_array);\n }\n\n $this->assertEquals($flatten_data, $crawler->getData());\n }", "private function getData($params = null){\n //for now we append the params to some static test data\n return [ 'meta-data' => $params,\n 'data' => [\n 'Buffalo',\n 'Rochester',\n 'Syracuse',\n 'Capital',\n 'Arizona',\n ]\n ];\n }", "static function adminGetVisitDetails($id)\r\n {\r\n $id = intval($id);\r\n \r\n $res = array();\r\n \r\n if (!$id)\r\n return $res;\r\n \r\n $sql = \"SELECT * FROM metric_visits WHERE id=:id LIMIT 1\";\r\n $visit = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryRow(); \r\n \r\n $sql = \"SELECT * FROM metric_actions WHERE metric_visit_id=:id\";\r\n $details = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryAll();\r\n \r\n if ($details)\r\n foreach ($details as $k=>$v)\r\n {\r\n switch ($v['action'])\r\n {\r\n case 'viewVideo':\r\n $actions['viewVideo'][$v['user_id_to']][] = $v['added'];\r\n break;\r\n \r\n case 'viewPage':\r\n /*if (stristr('/about', $v['action_details']))\r\n $actions['viewPage']['About'][] = $v['added'];\r\n else*/\r\n $actions['viewPage'][] = $v;\r\n \r\n break;\r\n }\r\n \r\n unset($details[$k]);\r\n }\r\n \r\n $visit['actions'] = $actions;\r\n \r\n return $visit;\r\n }", "public function testCreateClientAsVisitor() {\n\n $this->withoutMiddleware();\n\n // Generate client\n $client = factory(App\\Client::class)->make();\n\n $this->post('/clients/create', ['name' => $client->name, 'phone' => $client->phone_number])\n ->seeJson(['success' => false]);\n\n }", "private function testCollect() {\n $custom_data = array();\n\n // Collect all custom data provided by hook_insight_custom_data().\n $collections = \\Drupal::moduleHandler()->invokeAll('acquia_connector_spi_test');\n\n foreach ($collections as $test_name => $test_params) {\n $status = new TestStatusController();\n $result = $status->testValidate(array($test_name => $test_params));\n\n if ($result['result']) {\n $custom_data[$test_name] = $test_params;\n }\n }\n\n return $custom_data;\n }", "public function testDataResponse()\n {\n $driverPassesEndpoint = new DriverPassesEndpoint(getenv('MRP_API_KEY'));\n $data = $driverPassesEndpoint->setClassId(1000)\n ->setScheduleId(5508)\n ->setDataOrder('nameAsc')\n ->setDriverId(1023)\n ->setEndDate('8/21/2016')\n ->setStartDate('8/21/2015')\n ->getRequest();\n\n $this->assertNotEmpty($data);\n $this->assertTrue(is_object($data));\n $this->assertEquals(1, $data->RequestValid);\n }", "public function generateDataForTest()\r\n {\r\n return array(\r\n array(\r\n \"\r\n\t\t\t\t\tUser-Agent: *\r\n\t\t\t\t\",\r\n null,\r\n ),\r\n array(\r\n \"\r\n\t\t\t\t\tUser-Agent: *\r\n\t\t\t\t\tHost: www.example.com\r\n\t\t\t\t\",\r\n 'www.example.com',\r\n ),\r\n array(\r\n \"\r\n\t\t\t\t\tHost: example.com\r\n\t\t\t\t\",\r\n 'example.com',\r\n ),\r\n array(\r\n \"\r\n\t\t\t\tHost: example.com\r\n\t\t\t\tUser-Agent: google\r\n\t\t\t\tHost: www.example.com\r\n\t\t\t\t\",\r\n 'example.com',\r\n 'expected first host value'\r\n ),\r\n array(\r\n \"\r\n\t\t\t\tUser-Agent: google\r\n\t\t\t\tHost: example.com\r\n\t\t\t\tHost: www.example.com\r\n\t\t\t\t\",\r\n 'example.com',\r\n 'expected assign host to * because host is cross-section directive'\r\n ),\r\n );\r\n }", "public function providerTestAccess() {\n $data = [];\n $data[] = [TRUE, TRUE, AccessResult::allowed()];\n $data[] = [FALSE, TRUE, AccessResult::neutral()];\n $data[] = [TRUE, FALSE, AccessResult::neutral()];\n $data[] = [FALSE, FALSE, AccessResult::neutral()];\n\n return $data;\n }", "public function testDataResponse()\n {\n $driversEndpoint = new DriverClassesEndpoint(getenv('MRP_API_KEY'));\n $data = $driversEndpoint->setDriverCount(1)\n ->setOrder('name')\n ->setIncludeStats('true')\n ->setScheduleYear(2016)\n ->setFeaturedOnly('true')\n ->setForcePic('false')\n ->setIncludeDrivers('true')\n ->getRequest();\n\n $this->assertNotEmpty($data);\n $this->assertTrue(is_object($data));\n $this->assertEquals(1, $data->RequestValid);\n }", "function get_statistics_data_hit($params)\r\n {\r\n return $this->get_statistics_data_view($params);\r\n }", "public function test_getAllVehicleTest()\n {\n $response = $this->get('/api/inventory/vehicles/search');\n\n $response->assertStatus(200);\n $response->assertJson ([\n 'data'=>[[\n \"name\"=>$response['data'][0]['name'],\n \"model\"=>$response['data'][0]['model'],\n \"manufacturer\"=> $response['data'][0]['count'],\n \"cost_in_credits\" =>$response['data'][0]['cost_in_credits'],\n \"length\"=>$response['data'][0]['length'],\n \"max_atmosphering_speed\"=> $response['data'][0]['max_atmosphering_speed'],\n \"crew\"=> $response['data'][0]['crew'],\n \"passengers\"=>$response['data'][0]['passengers'],\n \"cargo_capacity\"=>$response['data'][0]['cargo_capacity'],\n \"consumables\"=> $response['data'][0]['consumables'],\n \"vehicle_class\"=>$response['data'][0]['vehicle_class'],\n \"pilots\"=>$response['data'][0]['pilots'],\n \"films\"=>$response['data'][0]['films'],\n \"created\"=> $response['data'][0]['created'],\n \"edited\"=> $response['data'][0]['edited'],\n \"url\"=> $response['data'][0]['url'],\n \"count\"=> $response['data'][0]['count']\n ]]\n\n\n\n ]);\n }", "protected function current_user_info(): array {\n\t\t$response = $this->visit( route( 'browser-testing.user', [], $this->should_use_absolute_route_for_auth() ) );\n\n\t\treturn (array) json_decode( wp_strip_all_tags( $response->driver->getPageSource() ), true );\n\t}", "public function testData() {\n $subscription = $this->mockSubscription('[email protected]', (object) [\n 'fields' => [\n ['name' => 'FIRSTNAME'],\n ['name' => 'LASTNAME'],\n ],\n ]);\n\n // Test new item.\n list($cr, $api) = $this->mockProvider();\n $source1 = new ArraySource([\n 'firstname' => 'test',\n ]);\n $cr->method('getSource')->willReturn($source1);\n list($data, $fingerprint) = $cr->data($subscription, []);\n $this->assertEqual([\n 'FIRSTNAME' => 'test',\n ], $data);\n\n // Test item with existing data.\n list($cr, $api) = $this->mockProvider();\n $source2 = new ArraySource([\n 'lastname' => 'test',\n ]);\n $cr->method('getSource')->willReturn($source2);\n list($data, $fingerprint) = $cr->data($subscription, $data);\n $this->assertEqual([\n 'FIRSTNAME' => 'test',\n 'LASTNAME' => 'test',\n ], $data);\n }", "public function testGetData()\n {\n $this->getWeather->setUrl();\n $result = $this->getWeather->getData();\n\n $this->assertIsArray($result);\n }", "public function testItReturnsUsers()\n {\n $this->user->update([\"firstname\" => \"anthony\"]);\n $user1 = factory(User::class)->create([\n \"firstname\" => \"james\",\n \"tenant_id\" => $this->user->tenant_id,\n ]);\n $tenant2 = factory(Tenant::class)->create();\n $user2 = factory(User::class)->create([\n \"firstname\" => \"benjamin\",\n \"tenant_id\" => $tenant2->id,\n ]);\n\n $this->actingAs($this->user)\n ->getJson(\"api/v1/users\")\n ->assertOk()\n ->assertJson([\n \"data\" => [\n $this->user->only([\"id\", \"firstname\"]),\n $user2->only([\"id\", \"firstname\"]),\n $user1->only([\"id\", \"firstname\"]),\n ],\n ]);\n }", "abstract public function getTestData(): array;", "abstract protected function getTestData() : array;", "protected function getData()\n {\n return [];\n }", "public function all_visitor(CreateVisitorRequest $request)\n {\n $person = Person::create([ //agregar un visitante ya sea un futuro paciente o no\n 'type_dni' => $request->type_dni,\n 'dni' => $request->dni,\n 'name' => $request->name,\n 'lastname' => $request->lastname,\n 'address' => $request->address,\n 'phone' => $request->phone,\n 'email' => $request->email,\n 'branch_id' => 1,\n ]);\n \n $this->create_visitor($person);\n\n return response()->json([\n 'message' => 'Visitante creado',\n ]);\n\n }", "public function getTourInfo()\n {\n return $this->tourInfo;\n }", "public function testListDeviceDataView(): void\n {\n $deviceDataController = new DeviceDataController();\n $result = $deviceDataController->index('1');\n\n $this->assertInstanceOf('Illuminate\\View\\View', $result);\n $this->assertArrayHasKey('deviceName', $result->data);\n $this->assertArrayHasKey('deviceId', $result->data);\n }", "public function visits() {\n return $this->hasMany(Visit::class);\n }", "protected function gatherUserAgentData()\n {\n // User agent container\n $userAgents = ['original' => null, 'nodes_meta' => null];\n\n // Retrieve original user agent\n $originalUserAgent = user_agent();\n if (!empty($originalUserAgent)) {\n $userAgents['original'] = [\n 'browser' => $originalUserAgent->getBrowserWithVersion(),\n 'platform' => $originalUserAgent->getPlatform(),\n 'device' => $originalUserAgent->getDevice(),\n 'isMobile' => $originalUserAgent->isMobile(),\n 'isTablet' => $originalUserAgent->isTablet(),\n ];\n }\n\n // Retrieve nodes user agent\n $nodesUserAgent = nodes_meta();\n if (!empty($nodesUserAgent)) {\n $userAgents['nodes_meta'] = [\n 'version' => $nodesUserAgent->getVersion(),\n 'platform' => $nodesUserAgent->getPlatform(),\n 'device' => $nodesUserAgent->getDevice(),\n ];\n }\n\n return $userAgents;\n }", "public function data()\n {\n return [\n 'name' => 'John Doe',\n 'email' => '[email protected]',\n 'created_at' => now(),\n ];\n }", "public function getData()\n {\n try {\n $data = array(\n 'loginUrl' => $this->getFamilyGraph()->getLoginUrl(),\n 'isUserLoggedIn' => $this->getCommonUtility()->getIsUserLoggedIn(),\n 'currentUserName' => $this->getCommonUtility()->getCurrentUserName(),\n 'individual' => $this->getIndividual(),\n 'rootIndividualsInAllTrees' => $this->getRootIndividualsInAllTrees(),\n 'immediateFamily' => $this->getImmediateFamily(),\n 'personalPhotos' => $this->getPersonalPhotos(),\n );\n } catch (FamilyGraphException $ex) {\n $data = array(\n 'loginUrl' => $this->getFamilyGraph()->getLoginUrl(),\n 'isUserLoggedIn' => $this->getCommonUtility()->getIsUserLoggedIn(),\n 'currentUserName' => $this->getCommonUtility()->getCurrentUserName(),\n 'exception' => $ex,\n );\n }\n \n return $data;\n }", "public function visitor()\n {\n return $this->belongsTo(Visitor::class);\n }", "private function get_data()\n\t{\n\t\treturn $this->member_model->get_data();\n\t}", "public function readTestData()\n {\n return $this->testData->get();\n }", "protected function getData() { }", "public function testAllData()\n {\n Runner::truncate();\n Runner::factory()->count(15)->create();\n\n $headers['Accept'] = 'application/json';\n\n $response = $this->get('/api/v1/runner/1/form-data', $headers);\n\n $response->assertStatus(200)->assertJsonStructure(['success', 'data', 'status']);\n }", "public function getData() {}", "function retrieve_top_profile_visitors(){\n\t\t\n\t\t$this->CI->load->model('model_users_promoters', 'users_promoters', true);\n\t\treturn $this->CI->users_promoters->retrieve_top_profile_visitors($this->promoter->pt_id);\n\t\t\n\t}", "function get_visit_data(Visit $visit, $section)\n {\n switch ($section) {\n case 'treatment':\n return get_treatments($visit);\n case 'investigation':\n return get_investigations($visit);\n case 'meta':\n return get_visit_meta($visit);\n case 'eye':\n return get_eye_exams($visit);\n case 'vital':\n return vitals_for_visit($visit);\n case 'op_notes':\n return get_op_notes($visit);\n }\n flash('Could not find subset data for ' . $section, 'warning');\n return null;\n }", "public function getNodeVisitors()\n {\n if (!$this->extensionInitialized) {\n $this->initExtensions();\n }\n return $this->visitors;\n }", "public function data()\n\t{\n\t\treturn [\n\t\t\t'permissions' => $this->getPermissions(),\n\t\t\t'roles' => $this->getRoles(),\n\t\t];\n\t}", "public function testWebinarRegistrants()\n {\n }", "public function testCalculatesAverageVisitorsNumber()\n {\n $source = new StubDataSource(array(40000, 50000, 100000, 20000, 40000));\n $statistics = new Statistics($source);\n $this->assertEquals(50000, $statistics->getAverage());\n }", "public function provideTestData()\n {\n return [\n // variant one\n ['1197423162', true],\n ['1000000606', true],\n\n // variant one\n ['8137423260', false],\n ['600000606', false],\n ['51234309', false],\n\n // variant two\n ['1000000406', true],\n ['1035791538', true],\n ['1126939724', true],\n ['1197423460', true],\n\n // variant two\n ['1000000405', false],\n ['1035791539', false],\n ['8035791532', false],\n ['535791830', false],\n ['51234901', false],\n ];\n }", "public function getTests();", "public function getVenueVisits()\n {\n return $this->hasMany(VenueVisit::className(), ['venueId' => 'id']);\n }", "public function testWebinarRegistrantsQuestionsGet()\n {\n }", "public static function get_user_data()\n {\n }", "protected static function getDataFixtures()\n {\n return array(\n new LoadTestUser(),\n new LoadSuperUser(),\n );\n }", "public function listaVisitantes(){\n \n }", "public function testIndex(){\n\t\t\n\t\t$this->mock->shouldReceive('all')->once();\n\n\t\t$this->call('GET', 'users'); //get: Method , user: url\n\n\t\t$this->assertResponseOk();\n\t}", "public function middlewareOutputDataProvider(): array\n {\n return [\n 'test1' => [\n 'view' => 'test::view-fav-1',\n 'callback' => function () {\n TagFav::add('<abc>');\n },\n 'expectedContains' =>\n '<title>View 1</title>'.PHP_EOL\n .' <abc>'.PHP_EOL\n .PHP_EOL\n .' </head>'.PHP_EOL,\n ],\n\n 'test2' => [\n 'view' => 'test::view-fav-2',\n 'callback' => function () {\n TagFav::add('<abc>');\n },\n 'expectedContains' =>\n '<title>View 2</title>'.PHP_EOL\n .' <abc>'.PHP_EOL\n .' </head>'.PHP_EOL,\n ],\n ];\n }", "public function provideTestData()\n {\n return [\n // Variant 1\n ['6100272324', true],\n ['6100273479', true],\n\n ['6100272885', false],\n ['6100273377', false],\n ['6100274012', false],\n\n // Variant 2\n ['5700000000', true],\n ['5700000001', true],\n ['5799999998', true],\n ['5799999999', true],\n\n ['5699999999', false],\n ['5800000000', false],\n ];\n }", "public function dataProvider()\n {\n $mockTaxableBuilder = $this->getMockBuilder('CommerceGuys\\Tax\\TaxableInterface');\n $physicalTaxable = $mockTaxableBuilder->getMock();\n $physicalTaxable->expects($this->any())\n ->method('isPhysical')\n ->will($this->returnValue(true));\n $digitalTaxable = $mockTaxableBuilder->getMock();\n\n $mockAddressBuilder = $this->getMockBuilder('CommerceGuys\\Addressing\\Address');\n $serbianAddress = $mockAddressBuilder->getMock();\n $serbianAddress->expects($this->any())\n ->method('getCountryCode')\n ->will($this->returnValue('RS'));\n $frenchAddress = $mockAddressBuilder->getMock();\n $frenchAddress->expects($this->any())\n ->method('getCountryCode')\n ->will($this->returnValue('FR'));\n $germanAddress = $mockAddressBuilder->getMock();\n $germanAddress->expects($this->any())\n ->method('getCountryCode')\n ->will($this->returnValue('DE'));\n $usAddress = $mockAddressBuilder->getMock();\n $usAddress->expects($this->any())\n ->method('getCountryCode')\n ->will($this->returnValue('US'));\n\n $date1 = new \\DateTime('2014-02-24');\n $date2 = new \\DateTime('2015-02-24');\n $notApplicable = EuTaxTypeResolver::NO_APPLICABLE_TAX_TYPE;\n\n return [\n // German customer, French store, VAT number provided.\n [$physicalTaxable, $this->getContext($germanAddress, $frenchAddress, '123'), 'eu_ic_vat'],\n // French customer, French store, VAT number provided.\n [$physicalTaxable, $this->getContext($frenchAddress, $frenchAddress, '123'), 'fr_vat'],\n // German customer, French store, physical product.\n [$physicalTaxable, $this->getContext($germanAddress, $frenchAddress), 'fr_vat'],\n // German customer, French store registered for German VAT, physical product.\n [$physicalTaxable, $this->getContext($germanAddress, $frenchAddress, '', ['DE']), 'de_vat'],\n // German customer, French store, digital product before Jan 1st 2015.\n [$digitalTaxable, $this->getContext($germanAddress, $frenchAddress, '', [], $date1), 'fr_vat'],\n // German customer, French store, digital product.\n [$digitalTaxable, $this->getContext($germanAddress, $frenchAddress, '', [], $date2), 'de_vat'],\n // German customer, US store, digital product\n [$digitalTaxable, $this->getContext($germanAddress, $usAddress, '', [], $date2), []],\n // German customer, US store registered in FR, digital product.\n [$digitalTaxable, $this->getContext($germanAddress, $usAddress, '', ['FR'], $date2), 'de_vat'],\n // German customer with VAT number, US store registered in FR, digital product.\n [$digitalTaxable, $this->getContext($germanAddress, $usAddress, '123', ['FR'], $date2), $notApplicable],\n // Serbian customer, French store, physical product.\n [$physicalTaxable, $this->getContext($serbianAddress, $frenchAddress), []],\n // French customer, Serbian store, physical product.\n [$physicalTaxable, $this->getContext($frenchAddress, $serbianAddress), []],\n ];\n }", "protected static function getData()\n {\n }", "public function test_teams_index_authenticated_admin_returns_correct_data(){\n $this->signInAdmin();\n $response = $this->get(route('teams.index'));\n $this->assertEquals(Team::with('leader')->get(), $response['teams']);\n }", "public function testUserMeGet()\n {\n }", "public function buildTodayVisitors(): string\n {\n $startDate = Carbon::today();\n $endDate = Carbon::now();\n\n $visitorsData = AnalyticsFacade::performQuery(Period::create($startDate, $endDate), 'ga:users');\n\n return $visitorsData->totalsForAllResults['ga:users'];\n }", "public function visits()\n {\n return $this->hasMany('App\\Visit');\n }", "public function getInvestigatorsList() {\n return $this->_get(5);\n }", "public static function getData()\n {\n\n if ( Settings::$testing_data[ self::$route ] )\n {\n\n $testing_vals = Settings::$testing_data\n [ self::$route ];\n\n if ( $_POST['data'] )\n {\n parse_str( $_POST['data'], $returned );\n }\n\n foreach ( $testing_vals as $key => $value )\n {\n if ( $returned[ $key ] ){\n $testing_vals[$key] = $returned[ $key ];\n }\n }\n\n return $testing_vals;\n }\n\n }", "public function testSearchWithFilters()\n {\n $filters = [\n \"from_date\" => \"2011-12-05\",\n \"to_date\" => \"2011-12-05\",\n \"city\" => \"CAI\",\n \"adults_ number\" => 5\n ];\n // Stub a JSON response for api.bestHotels.com/ endpoint.\n Http::fake([\n 'api.topHotels.com/*' => Http::response(['data' => $this->topHotelsDataFactory->getItems()], 200),\n 'api.bestHotels.com/*' => Http::response(['data' => $this->bestHotelsDataFactory->getItems()], 200)\n ]);\n $response = $this->json('get', 'api/search', $filters);\n $response->assertStatus(200);\n $response->assertJsonStructure([\n 'data' => [\n '*' => [\n 'provider',\n 'hotelName',\n 'rate',\n 'discount',\n 'fare',\n 'amenities',\n ]\n ],\n ]);\n }", "public function testInfoUser()\n {\n }", "public function testGetViewingHistory()\n\t{\n\t\t$this->be(User::first());\n\t\t$video_id = Video::first()->id;\n\t\t$response = $this->action('GET', 'ApiViewingHistoryController@getIndex',[],['video_id' => $video_id]);\n\t\t\n\t\t$this->assertInstanceOf('Illuminate\\Http\\JsonResponse', $response);\n\t\t$this->assertResponseOk();\n\t}", "function _getCoverageData() {\n\t\t$coverageData = array();\n\t\t$dump = xdebug_get_code_coverage();\n\n\t\tif ($this->groupTest) {\n\t\t\t$testObjectFile = $this->__testObjectFilesFromGroupFile($this->testCaseFile, $this->appTest);\n\t\t\tforeach ($testObjectFile as $file) {\n\t\t\t\tif (!file_exists($file)) {\n\t\t\t\t\ttrigger_error(sprintf(__('This test object file is invalid: %s', true), $file));\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($testObjectFile as $file) {\n\t\t\t\tif (isset($dump[$file])) {\n\t\t\t\t\t$coverageData[$file] = $dump[$file];\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$testObjectFile = $this->__testObjectFileFromCaseFile($this->testCaseFile, $this->appTest);\n\n\t\t\tif (!file_exists($testObjectFile)) {\n\t\t\t\ttrigger_error(sprintf(__('This test object file is invalid: %s', true), $testObjectFile));\n\t\t\t\treturn ;\n\t\t\t}\n\n\t\t\tif (isset($dump[$testObjectFile])) {\n\t\t\t\t$coverageData = $dump[$testObjectFile];\n\t\t\t}\n\t\t}\n\t\treturn array($coverageData, $testObjectFile);\n\t}", "public function testExample()\n {\n $this->visit(\"http://localhost/laravel/cdp/public/project/1/visitor\");\n $this->seePageIs('http://localhost/laravel/cdp/public/project/1/visitor');\n }", "private function getDataForRegistration()\n {\n $data = [\n 'name' => \"Galactic Empire\",\n 'businessName' => \"L'Empire\",\n 'businessUnitName' => \"Death Star\",\n 'businessUnitCode' => \"DS\",\n 'siret' => \"DS9988776655\",\n 'vatNumber' => \"DS1122334455\",\n 'address' => [\n 'address' => \"La Cantina\",\n 'additionalAddress' => \"Han Shot First\",\n 'zipCode' => \"69521\",\n 'city' => \"Mos Esley\",\n 'state' => \"Bordure Exterieure\",\n 'country' => \"France\",\n ],\n 'shippingAddress' => [\n 'address' => \"La Cantina\",\n 'additionalAddress' => \"Han Shot First\",\n 'zipCode' => \"69521\",\n 'city' => \"Mos Esley\",\n 'state' => \"Bordure Exterieure\",\n 'country' => \"France\",\n ],\n 'administrator' => [\n 'email' => '[email protected]',\n 'firstName' => 'Anakin',\n 'lastName' => 'Skywalker',\n 'password' => 'jedi',\n 'title' => 'mr',\n 'occupation' => 'kill the emperor',\n ],\n ];\n\n return $data;\n }" ]
[ "0.7270008", "0.7167265", "0.6720939", "0.6130239", "0.60254", "0.60190105", "0.58330005", "0.5827498", "0.580613", "0.55762523", "0.55515486", "0.5546295", "0.5541656", "0.55271274", "0.5512764", "0.54855126", "0.54641956", "0.5457979", "0.54552335", "0.54418224", "0.53463954", "0.53440076", "0.53397954", "0.53215235", "0.52925783", "0.5289636", "0.5287085", "0.52839184", "0.5269518", "0.5257202", "0.52464503", "0.52426445", "0.521998", "0.5213232", "0.52113056", "0.51903725", "0.5183095", "0.51809824", "0.51662457", "0.5160975", "0.515188", "0.51518023", "0.5150174", "0.51488644", "0.5140312", "0.5140299", "0.5135275", "0.5125547", "0.51252264", "0.51235026", "0.5123425", "0.5099185", "0.5098443", "0.50701636", "0.50683016", "0.50681007", "0.506715", "0.5053169", "0.50510406", "0.50482404", "0.5044324", "0.5040114", "0.50376916", "0.5023776", "0.5019706", "0.5018425", "0.50120485", "0.5011441", "0.50048447", "0.50040805", "0.5003392", "0.5001384", "0.49988818", "0.49921757", "0.49907407", "0.49741623", "0.4969271", "0.4969161", "0.49639028", "0.49628437", "0.49626297", "0.49588335", "0.49584785", "0.49549425", "0.49448577", "0.49434403", "0.4939678", "0.49339098", "0.4933378", "0.49301526", "0.49276906", "0.49268514", "0.4926752", "0.49264476", "0.49231267", "0.49174488", "0.4917009", "0.4909962", "0.49087828", "0.4905823" ]
0.6528647
3
Get returned result keys
public static function getReturnedResultKeys() { return [ 'ip', 'ua', 'browser', 'language', 'platform', 'mobile', 'tablet', 'pc', 'page', 'open', 'close', 'location' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getKeys();", "public function getKeys() {}", "static function getKeys();", "abstract public function getKeys();", "public function getKeys(): array;", "public function getKeys()\n {\n if ($this->_queryResult === null) {\n return [];\n }\n\n return $this->_queryResult->getKeys();\n }", "public function keys(): array;", "public function keys(): array;", "public function keys(): array;", "public static function keys(): array;", "public function getResultsKeys() {\n return ['lines_after_maximum_allowed_lines',\n 'lines_with_non_matching_values',\n 'lines_with_too_many_values',\n 'lines_with_too_few_values',\n 'lines_with_too_many_characters',\n 'lines_with_non_numeric_values',\n 'lines_with_invalid_labeling',\n 'lines_with_non_unique_label'\n ];\n }", "public function getKeys() {\n\t\treturn $this->getAllKeys();\n\t}", "public function getKeys() {\n return array_keys($this->data);\n }", "public function keys() : array;", "public function keys() : array;", "public function getKeys()\n {\n return $this->getNames();\n }", "public function getAllKey();", "public function keys();", "public function keys();", "public function keys();", "public function keys();", "public function keys();", "public function keys();", "public function getKeys(){\n\t\treturn $this->keys;\n\t}", "public function getKeys() {\n\t\treturn array_keys( $this->array );\n\t}", "public function GetAllKeys()\n {\n return array_keys($this->_keyValPairs);\n }", "public function get_keys() {\n try{\n return array_keys($this->Items);\n }catch(Exception $e){\n throw $e;\n }\n }", "public function getRecordKeys()\n\t{\n\t\t$arKeys = [];\n\t\t$arKey = [];\n\t\tif (Param(\"key_m\") !== NULL) {\n\t\t\t$arKeys = Param(\"key_m\");\n\t\t\t$cnt = count($arKeys);\n\t\t} else {\n\t\t\tif (Param(\"id\") !== NULL)\n\t\t\t\t$arKeys[] = Param(\"id\");\n\t\t\telseif (IsApi() && Key(0) !== NULL)\n\t\t\t\t$arKeys[] = Key(0);\n\t\t\telseif (IsApi() && Route(2) !== NULL)\n\t\t\t\t$arKeys[] = Route(2);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = [];\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "public function getRecordKeys()\n\t{\n\t\t$arKeys = [];\n\t\t$arKey = [];\n\t\tif (Param(\"key_m\") !== NULL) {\n\t\t\t$arKeys = Param(\"key_m\");\n\t\t\t$cnt = count($arKeys);\n\t\t} else {\n\t\t\tif (Param(\"IncomeCode\") !== NULL)\n\t\t\t\t$arKeys[] = Param(\"IncomeCode\");\n\t\t\telseif (IsApi() && Key(0) !== NULL)\n\t\t\t\t$arKeys[] = Key(0);\n\t\t\telseif (IsApi() && Route(2) !== NULL)\n\t\t\t\t$arKeys[] = Route(2);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = [];\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "function keys() {\n\t\treturn array_keys($this->_cache);\n\t}", "public function valueKeys(): array;", "public function getMetaForignKeys(){\n $stmt = $this->query(self::META_FKEYS_SQL);\n if ($stmt === false){\n return array();\n }\n\n $keys = array();\n foreach ($stmt as $row){\n $keys[$row[0] . '.' . $row[1]] = $row[2] . '.' . $row[3];\n }\n\n return $keys;\n }", "public function getKeys()\n\t{\n\t\treturn array_keys($this->_d);\n\t}", "function getKeys() { \n\tglobal $mysqli;\n\t$sql = \"select keyName from keyValue\";\n\t$res = $mysqli->query($sql);\n\tif (!$res) {\n\t\t//if there was an error, log it and then return null.\n\t\terror_log(\"Error on getKeys select \" . $mysqli->error);\n\t\treturn null;\n\t}\n\n\t$keys = array();\n\twhile( $row = mysqli_fetch_assoc($res)) {\n\t\tarray_push($keys,$row['keyName']);\n\t}\n\treturn $keys;\n}", "public function getKeys() {\n $keys = array();\n foreach($this->mapping as $key => $value) {\n array_push($keys, $value);\n }\n return $keys;\n }", "public function getKeys(): array\n {\n return $this->keys;\n }", "public function getKeys()\n {\n return $this->keys;\n }", "public function getKeys()\n {\n return $this->keys;\n }", "public function getKeys()\n {\n return $this->keys;\n }", "public function getKeys()\n {\n return $this->keys;\n }", "public function getKeys()\n {\n return $this->keys;\n }", "public function keys() {\n\t\treturn array_keys($this->toArray());\n\t}", "public function getIndexableMetaKeys(){\n\t\treturn array_keys( $this->keys );\n\t}", "public function keys() {\n return array_keys($this->_hash);\n }", "function keys()\n {\n return array_keys($this->keyTypes());\n }", "function keys()\n {\n return array_keys($this->keyTypes());\n }", "public function getKeys()\n {\n $this->prepare();\n\n return $this->_keys;\n }", "public function keys()\n\t{\n\t\treturn $this->toBase()->keys();\n\t}", "public function keys()\n {\n return static::from($this->keyR);\n }", "public function getKeys(): array\n {\n $keys = [];\n $arr = $this->items;\n foreach ($arr as $key=>$value) {\n $keys[] = $key;\n }\n return $keys;\n }", "public function getAllKeys()\n {\n $data = $this->request('stats items');\n\n if (empty($data)) {\n return false;\n }\n\n preg_match_all('#STAT items:(?<id>\\d+):number (?<number>\\d+)#', $data, $match);\n\n if (empty($match['id'])) {\n return false;\n }\n\n $keys = [];\n\n foreach ($match['id'] as $index => $slab) {\n $numKeys = (int) $match['number'][$index];\n\n if ($numKeys < 1) {\n continue;\n }\n\n $slabKeys = $this->getAllKeysInSlab($slab);\n\n if (is_array($slabKeys)) {\n $keys = array_merge($keys, $slabKeys);\n }\n }\n\n return $keys;\n }", "function getKeys(){\n\t\ttry{\n\t\t\t$db = getConnection();\n\n\t\t\t$sql = \"SELECT * FROM network_keys WHERE name = ?\";\n\t\t\t$stmt = $db->prepare($sql);\n\t\t\t$stmt->execute(array(\"llsec\"));\n\t\t\t$llsec = $stmt->fetch()['network_key'];\n\n\t\t\t$sql = \"SELECT * FROM network_keys WHERE name = ?\";\n\t\t\t$stmt = $db->prepare($sql);\n\t\t\t$stmt->execute(array(\"dtls\"));\n\t\t\t$dtls = $stmt->fetch()['network_key'];\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t echo $e->getMessage();\n\t }\n\t return array($llsec, $dtls);\n\t}", "public function getKeys()\n {\n $keys = array();\n\n foreach ($this->items as $item) {\n $keys[] = $item['key'];\n }\n\n return $keys;\n }", "public function statKeys()\n {\n \treturn $this->statKeys;\n }", "abstract public function keys(): Seq;", "public function getKeys()\n {\n\t\tforeach ($this->_source as $key => $value)\n\t\t{\n\t\t\t$dummy[] = $key;\n\t\t}\n\t\treturn $dummy;\n }", "public function keys()\n {\n return array_keys($this->list);\n }", "public function retrieveKeys()\n {\n return $this->start()->uri(\"/api/key\")\n ->get()\n ->go();\n }", "public function keys()\n {\n return array_keys($this->_data);\n }", "public function keys()\n {\n return array_keys($this->_data);\n }", "function getAllKeys() {\n return $this->memcached->getAllKeys();\n }", "public function keys()\n {\n return array_keys($this->data);\n }", "public function keys() : array\n {\n return array_keys($this->entries);\n }", "public function getKeys () {\n\n return array_keys($this->values);\n\n }", "public function keys()\n {\n return array_keys($this->parameters);\n }", "public function getNames()\n {\n if($this->isKeycacheInvalid())\n {\n $this->regenerateKeyCache();\n }\n if(is_array($this->__keycacheindex))\n {\n return $this->__keycacheindex;\n }\n return array();\n }", "public function keys(): array {\n return array_keys($this->items);\n }", "public function getRowKeys()\n {\n return $this->row_keys;\n }", "public function getKeys()\n {\n $keys = array_keys($this->cache) + array_keys($this->factories);\n return array_unique($keys);\n }", "public static function keys()\n {\n return static::$keys;\n }", "public function metaKeys(): array\n {\n /** @var HasMetadataInterface $this */\n return Meta::metable(static::class, $this->id)\n ->pluck('key')\n ->toArray();\n }", "public function keys(): array\n {\n return array_keys($this->items);\n }", "public function getKeys()\n {\n $catalog = $this->fetch($this->catalog_key);\n $catalog = \\is_array($catalog) ? $catalog : Array();\n \\ksort($catalog);\n return $catalog;\n }", "public function keys() {\n\t\treturn array_keys($this->_value);\n\t}", "function &keys(){\n\t\tif ( isset($this->_cache[__FUNCTION__]) ) return $this->_cache[__FUNCTION__];\n\t\t$tables =& $this->tables();\n\t\t$out = array();\n\t\tforeach ( array_keys($tables) as $tablename){\n\t\t\t$keys =& $tables[$tablename]->keys();\n\t\t\tforeach ( array_keys($keys) as $fieldname){\n\t\t\t\t$out[$fieldname] =& $keys[$fieldname];\n\t\t\t}\n\t\t}\n\t\t$this->_cache[__FUNCTION__] =& $out;\n\t\treturn $out;\n\t\t\n\t}", "public function getKeys(): array\n {\n return array_keys($this->files);\n }", "public function keys(): array\n {\n\t\treturn array_keys($this->values);\n\t}", "function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = $_POST[\"key_m\"];\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = $_GET[\"key_m\"];\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (!empty($_GET) || !empty($_POST)) {\n\t\t\t$isPost = ew_IsPost();\n\t\t\tif ($isPost && isset($_POST[\"rid\"]))\n\t\t\t\t$arKeys[] = $_POST[\"rid\"];\n\t\t\telseif (isset($_GET[\"rid\"]))\n\t\t\t\t$arKeys[] = $_GET[\"rid\"];\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "function GetDBTableKeys()\n\t{\n\t\tglobal $dal_info;\n\t\tif( !array_key_exists($this->infoKey, $dal_info) || !is_array($dal_info[ $this->infoKey ]) )\n\t\t\treturn array();\n\t\t\n\t\t$ret = array();\n\t\tforeach($dal_info[ $this->infoKey ] as $fname=>$f)\n\t\t{\n\t\t\tif( @$f[\"key\"] )\n\t\t\t\t$ret[] = $fname;\n\t\t}\n\t\treturn $ret;\n\t}", "public function keys() : array {\n return array_keys($this->getArrayCopy());\n }", "public function keys()\n {\n return array_keys($this->getArrayCopy());\n }", "public static function listOfKeys()\n {\n return array_keys((new static)->_all);\n }", "public function keys() {\n\t\treturn array_keys($this->store);\n\t}", "function get_keys($tree=false)\n\t{\n\t\tif(ACCESS_MODEL == \"roles\") {\n\t\t\treturn array_keys($GLOBALS['ACCESS_KEYS']);\n\t\t} else if(ACCESS_MODEL == \"discrete\") {\n\t\t\t$ret = array();\n\t\t\tforeach($GLOBALS['ACCESS_KEYS'] as $k=>$v) {\n\t\t\t\tif($tree) {\n\t\t\t\t\t$ret[] = $k;\n\t\t\t\t\tforeach($v as $vv) $ret[] = \"-- $vv\";\n\t\t\t\t} else {\n\t\t\t\t\tforeach($v as $vv) $ret[] = $vv;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $ret;\n\t\t}\n\t}", "function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_POST[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_GET[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (!empty($_GET) || !empty($_POST)) {\n\t\t\t$isPost = ew_IsHttpPost();\n\t\t\tif ($isPost && isset($_POST[\"gjd_id\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_POST[\"gjd_id\"]);\n\t\t\telseif (isset($_GET[\"gjd_id\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_GET[\"gjd_id\"]);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_POST[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_GET[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (!empty($_GET) || !empty($_POST)) {\n\t\t\t$isPost = ew_IsHttpPost();\n\t\t\tif ($isPost && isset($_POST[\"IDXDAFTAR\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_POST[\"IDXDAFTAR\"]);\n\t\t\telseif (isset($_GET[\"IDXDAFTAR\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_GET[\"IDXDAFTAR\"]);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}", "public function getKeys()\n {\n return array_keys($this->elements);\n }", "public function keys()\n {\n return array_keys($this->collection);\n }", "public static function keys()\n {\n return array_keys(static::values());\n }", "final public static function getKeys(): array\n {\n return array_keys(static::getValues());\n }", "private function getAllCacheKeys(){\n $keys = array();\n foreach ($this->storages as $name => $storage){\n $keys[] = $this->getCacheKey($name);\n }\n return $keys;\n }", "public function all() {\n return array_keys($this->list);\n }", "public function getTableKeys()\n\t{\n\t\treturn array_keys($this->tableObjects);\n\t}", "public function keys()\n {\n return array('id');\n }", "public function keys()\n {\n return array('id');\n }", "public function getAllItems(){\n\n\t\treturn $this->redis_client->keys(\"*\");\n\t}", "function keys();", "public static function getKeys(): array\n {\n return array_keys(self::getConstants());\n }", "public function keys() {\n return array_keys($this->values);\n }", "public function keys()\n {\n return array_keys($this->values);\n }" ]
[ "0.77945185", "0.77771175", "0.7681449", "0.76676846", "0.75974745", "0.7347882", "0.729458", "0.729458", "0.729458", "0.7294162", "0.72029704", "0.71652776", "0.7152434", "0.7105446", "0.7105446", "0.7054161", "0.6992623", "0.69894123", "0.69894123", "0.69894123", "0.69894123", "0.69894123", "0.69894123", "0.6970434", "0.6931754", "0.69099915", "0.69030505", "0.6902332", "0.6892809", "0.6887597", "0.6882114", "0.6876271", "0.6856774", "0.6854791", "0.68413556", "0.6838695", "0.68162936", "0.68162936", "0.68162936", "0.68162936", "0.68162936", "0.68106294", "0.6809446", "0.68002427", "0.6792985", "0.6792985", "0.67922854", "0.67686486", "0.67492586", "0.6744355", "0.6739993", "0.67391104", "0.6738876", "0.67358357", "0.6733597", "0.6712036", "0.67054933", "0.6703043", "0.66981184", "0.66981184", "0.6688456", "0.66833967", "0.66794145", "0.66745436", "0.6632774", "0.6611557", "0.6604636", "0.6570122", "0.65625197", "0.65604335", "0.65161043", "0.6469744", "0.6465985", "0.6452036", "0.6440953", "0.6424455", "0.64191806", "0.641626", "0.6410681", "0.640506", "0.63956445", "0.6387308", "0.637648", "0.6375143", "0.63733554", "0.63578176", "0.6348144", "0.6343811", "0.6334615", "0.6325039", "0.62796503", "0.6266003", "0.6265511", "0.6254247", "0.6254247", "0.62537146", "0.62519336", "0.62467116", "0.62408453", "0.6238893" ]
0.7790886
1
Run the database seeds.
public function run() { $faker = Factory::create(); $categories = []; // prepare array kosong // Prepare data dummy syukur for ($i=1; $i<=5; $i++) { $categories = [ [ 'name' => 'Ceritakan diri kamu.', 'description' => $faker->text, 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'), ], [ 'name' => 'Bagaimana orang lain kamu?', 'description' => $faker->text, 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'), ], [ 'name' => 'Bagaimana teman-temanmu memandang Kamu?', 'description' => $faker->text, 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'), ], [ 'name' => 'Bagaimana mahasiswa lain memandang Kamu?', 'description' => $faker->text, 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'), ], [ 'name' => 'Bagaimana dosen memandang Kamu?', 'description' => $faker->text, 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'), ], [ 'name' => 'Perkenalkan anggota keluargamu dan seberapa dekat dengan anggota keluargamu?', 'description' => $faker->text, 'created_at' => Carbon::now()->format('Y-m-d H:i:s'), 'updated_at' => Carbon::now()->format('Y-m-d H:i:s'), ], ]; } // Insert data dummy ke db MyStoryCategory::insert($categories); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Sets up a URL endpoint for incoming HTTP requests This is a temporary implementation
public function endpoint() { global $bp; if ( bp_is_current_component( $bp->api->id ) ) { if ( bp_is_current_action( 'addclient' ) ) { if ( !empty( $_POST ) ) { $this->process_addclient(); } bp_api_load_template( 'api/addclient' ); } else if ( bp_is_current_action( 'request_token' ) ) { $this->process_request_token(); } else if ( bp_is_current_action( 'authorize' ) ) { $this->process_authorize(); } else if ( bp_is_current_action( 'access_token' ) ) { $this->process_access_token(); } require( CIAB_PLUGIN_DIR . 'lib/restler/restler.php' ); require( CIAB_PLUGIN_DIR . 'api/class.bp-restler.php' ); $this->restler = new BP_Restler; do_action( 'bp_api_init' ); /** * @todo Make this non-nonsense * * Be sure you know what you're doing before you disable OAuth! You can * enable admin access to your whole site if you're not careful! * * You can override OAuth by supplying your own BP_API_Auth class. Make sure * it's loaded before we get to this point, so that we don't load OAuth. */ if ( !class_exists( 'BP_API_Auth' ) ) { require( CIAB_PLUGIN_DIR . 'api/class.auth.php' ); } $this->restler->addAuthenticationClass( 'BP_API_Auth' ); require( CIAB_PLUGIN_DIR . 'api/class.api-server-actions.php' ); $this->restler->addAPIClass( 'BP_API_Server_Actions' ); $this->restler->handle(); die(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setEndpoint($url);", "protected function initiateUrl()\n\t{\n\t\t// base url\n\t\tif($this->app->config->has('app.url'))\n\t\t\t$this->setBase($this->app->config->get('app.url'));\n\n\t\t// asset url\n\t\tif($this->app->config->has('asset.url'))\n\t\t\t$this->setAsset($this->app->config->get('asset.url'));\n\t}", "public function setUrl()\n {\n $this->set('url', function() {\n $url = new Url();\n $url->setBaseUri('/');\n return $url;\n });\n }", "private function setUrl()\n {\n curl_setopt($this->curl, CURLOPT_URL, $this->server);\n }", "public function requestUri() {}", "private function __construct(){\n $this->setRequestUri();\n }", "private function setUrl(): void\n {\n $completeUrl = $_SERVER['REQUEST_URI'];\n $explodedUrl = \\explode('?', $completeUrl);\n $this->url = trim($explodedUrl[0], '/'); // Cleaned URL\n }", "public function initialize(){ \n $protocol = 'http';\n $host = 'localhost';\n $path = '';\n $url = '';\n \n if (isset($_SERVER['HTTP_HOST'])) {\n $protocol = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';\n $host = $_SERVER['HTTP_HOST'];\n $path = str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);\n $url = $protocol.'://'.$host.$path;\n }\n \n $url = trim($url, '/');\n\n $request = $_SERVER[\"REQUEST_URI\"];\n $request = trim($request, '/'); \n $request = explode('?', $request); \n \n // Remove the folder segments from the uri if the application is warking in a subfolder.\n $parts = explode('/', $url);\n $this->segments = explode('/', $request[0]);\n foreach($this->segments as $key => $segment){\n if(in_array($segment, $parts)){\n unset($this->segments[$key]);\n }\n else{\n $this->segments[$key] = $this->sanitize($segment);\n }\n }\n // Re-index the segments\n $this->segments = array_values($this->segments);\n \n $this->url = $protocol.'://'.$host.'/'.$_SERVER[\"REQUEST_URI\"];\n \n return $this->url;\n }", "function init(){\n\t\t//$uri = str_replace(BASE_URL,\"\",\"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n\t\t$uri = str_replace(BASE_URL,\"\",\"//\" . HOST . REQUEST);\n\t\t$this->route($uri);\n\t}", "protected function initUrl()\n {\n $this->di->setShared('url', function () {\n /** @var DiInterface $this */\n $config = $this->getShared('config');\n\n $url = new UrlResolver;\n\n if (ENV_PRODUCTION === APPLICATION_ENV) {\n $url->setBaseUri($config->get('application')->production->baseUri);\n $url->setStaticBaseUri($config->get('application')->production->staticBaseUri);\n } else {\n $url->setBaseUri($config->get('application')->development->baseUri);\n $url->setStaticBaseUri($config->get('application')->development->staticBaseUri);\n }\n\n return $url;\n });\n }", "public function add_endpoints() {\n\t\tadd_rewrite_endpoint( self::$endpoint, EP_ROOT | EP_PAGES );\n\t\t//flush_rewrite_rules();\n\t}", "public function __construct()\n {\n $this->buildUrl();\n }", "function add_urls() {\n\tadd_rewrite_rule( '^sso-login/?', 'index.php?sso-login=sso-login', 'top' );\n add_rewrite_endpoint( 'sso-login', EP_PERMALINK);\n\n\t// URLs for step 2 of webserver oauth flow\n\tadd_rewrite_rule( '^sso-callback/?', 'index.php?sso-callback=sso-callback', 'top' );\n add_rewrite_endpoint( 'sso-callback', EP_PERMALINK);\n}", "private function setUrls() {\n\t\t$this->url = ($this->env === 'DEVELOPMENT') ? 'https://test.sagepay.com/gateway/service/direct3dcallback.vsp' : 'https://live.sagepay.com/gateway/service/direct3dcallback.vsp';\n\t}", "public function add_endpoints() {\n\t\tadd_rewrite_endpoint( $this->endpoint, EP_ROOT | EP_PAGES );\n\t}", "public function setRoutes()\n {\n $this->route('/test_extend', function() {\n $this->get(function($request, $response, $params) {\n $array = array_merge($this->foo(), $request->getHeaders());\n $response->write(200, $array);\n\n return $response;\n })->auth(\\Dioxide\\AUTH_BASIC); // require basic auth to use this method\n });\n\n\n // send the request headers back to the user\n $this->route('/headers', function() {\n $this->get(function($request, $response, $params) {\n $rateHeaders = $this->emit('rate.limit.headers', [$request->getRealRemoteAddr()]);\n\n $response->write(200, $request->getHeaders()); // send the request headers back\n $response->headers($rateHeaders);\n\n return $response;\n });\n });\n\n $this->route('/post_test', function() {\n $this->post(function($request, $response, $params) {\n $response->write(200, $request->getContent());\n return $response;\n });\n });\n\n $this->route('/server_vars', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, $_SERVER);\n return $response;\n });\n });\n\n $this->route('/cache_test', function() {\n $this->get(function($request, $response, $params) {\n $response->write(200, ['foo' => 'bar']); // will be a 304 with no response body if cached\n return $response;\n });\n });\n\n }", "public function __construct(){\n\t\t$this->url = YaffmapConfig::get('url').$this->path;\n\t}", "public function route() {\r\n register_rest_route( 'api/v1', '/web-data-endpoint', array(\r\n 'methods' => 'GET',\r\n 'callback' => array( $this, 'callback' )\r\n ) );\r\n }", "public function register_api_endpoints() {\n\n\t\tregister_rest_route( 'nock/v1', '/messages', array(\n\t\t\t'methods' => array( 'POST' ),\n\t\t\t'callback' => array( $this, 'send_message' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/accounts', array(\n\t\t\t'methods' => array( 'GET' ),\n\t\t\t'callback' => array( $this, 'get_accounts' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/groups', array(\n\t\t\t'methods' => array( 'GET' ),\n\t\t\t'callback' => array( $this, 'get_groups' ),\n\t\t) );\n\n\t\tregister_rest_route( 'nock/v1', '/sms', array(\n\t\t\t'methods' => array( 'GET', 'POST' ),\n\t\t\t'callback' => array( $this, 'capture_sms' ),\n\t\t) );\n\n\t}", "public function rest_api_init() {\n register_rest_route('h5p/v1', '/post/(?P<id>\\d+)', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_post'),\n 'args' => array(\n 'id' => array(\n 'validate_callback' => function ($param, $request, $key) {\n return $param == intval($param);\n }\n ),\n ),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n\n register_rest_route('h5p/v1', 'all', array(\n 'methods' => 'GET',\n 'callback' => array($this, 'rest_api_all'),\n 'permission_callback' => array($this, 'rest_api_permission')\n ));\n }", "public function getEndpoint();", "public function getEndpoint();", "public function getEndpoint();", "public function setRequestUrl($url) {}", "protected function prepareUrl()\n {\n return 'http://'.$this->_host.'/service/v'.$this->_apiVersion.'/rest.php';\n }", "public function __construct(){\n\t\t$this->headers = apache_request_headers();\n\t\t// Save the special x-RESTProxy-* headers\n\t\t$this->Host = $this->Host? $this->Host : $this->headers['x-RESTProxy-Host'];\n\t\t$this->Port = $this->headers['x-RESTProxy-Port'] ? ':'.$this->headers['x-RESTProxy-Port'] : \"\";\n\t\t$this->Https = ($this->headers['x-RESTProxy-HTTPS'])? $this->headers['x-RESTProxy-HTTPS'] : false;\n\t\t// Create a temp file in memory\n\t\t$this->fp = fopen('php://temp/maxmemory:256000','w');\n\t\tif (!$this->fp){\n\t\t\t$this->Error(100);\n\t\t}\n\t\t// Write the input into the in-memory tempfile\n\t\t$this->input = file_get_contents(\"php://input\");\n\t\tfwrite($this->fp,$this->input);\n\t\tfseek($this->fp,0);\n\n\t\t//Get the REST Path\n\t\tif(!empty($_SERVER['PATH_INFO'])){\n\t\t $this->_G = substr($_SERVER['PATH_INFO'], 1);\n\t\t //$this->_G = explode('/', $_mGET);\n\t\t }\n\t\t \n\t\t // Get the raw GET request\n\t\t $tmp = explode('?',$_SERVER['REQUEST_URI']);\n\t\t if ($tmp[1]) {\n\t\t \t$this->_RawGET = $tmp[1];\n\t\t } else {\n\t\t \t$this->_RawGET = \"\";\n\t\t }\n\t \n\t}", "public function generateRequests()\n {\n if ($this->ready) {\n foreach ($this->data_requests as $uuid => $request) {\n $request->setFormattedURL($this->endpoint->url);\n }\n \n if (!empty($this->data_requests)) {\n $this->has_requests = true;\n }\n }\n }", "protected function register_rewrite_endpoints() {\n\t\tif ( ! empty( $this->endpoints ) ) {\n\t\t\tforeach ( $this->endpoints as $slug => $arr ) {\n\t\t\t\tadd_rewrite_endpoint( $slug, $arr['type'] );\n\t\t\t}\n\t\t}\n\t}", "public static function setUrl(): void\n\t{\n\n\t\tif (strpos(static::$fullUrl, '?')) {\n\t\t\tstatic::$url = substr(static::$fullUrl, 0, strpos(static::$fullUrl, '?'));\n\t\t} else {\n\t\t\tstatic::$url = static::$fullUrl;\n\t\t}\n\n\t}", "public function getRequestUri() {}", "public function __construct()\r\n {\r\n parent::__construct();\r\n\r\n $this->url = Configure::read('cdr_url') . \":\" . Configure::read('cdr_api.async_port');\r\n }", "public function __construct()\n {\n $this->url = url()->current();\n $this->host = request()->getSchemeAndHttpHost();\n }", "private function setUri(): void\n {\n $this->uri = strtok($_SERVER['REQUEST_URI'],'?');\n }", "public function setUp()\n\t{\n\t\t$this->url = new \\Jstewmc\\Url\\Url('http://localhost:8000');\n\t\t\n\t\treturn;\n\t}", "function __construct($url)\n {\n // Validate and track the client's IP\n $this->ip = $this->getRequestIP();\n\n // The geoip service reaches its limit very fast, premium required\n //$this->ipCountry = $this->traceIP();\n\n // Process the requested URL\n // If the request is empty (servername.com/)\n if ($url == \"/\")\n $this->route = HOMEPAGE; // defined in configure.php\n\n\n else // Not empty\n {\n $url = ltrim($url, \"/\");\n if (strpos($url, '?')) // Check for URL arguments\n $url = strstr($url, '?', true);\n\n // If the end of the string is a slash, discard it\n $this->route = $url;\n while (substr($url, -1) == \"/\")\n $url = rtrim($url, \"/\");\n\n // Check for more than one subdirectory\n $slashCount = substr_count($url, '/');\n if ($slashCount > 1)\n throw new Exception(\"Only one nested subdirectory is supported.\", 0);\n else\n $this->route = $url;\n\n // Incorrectly requested login attempt (potential inactivity log out)\n if (strpos($url, \"login\"))\n $this->route = \"login\";\n }\n\n // Match the requested file within the file system, if the request wasn't nested test it as a string\n if (!is_array($this->route))\n {\n // NOTE: Despite being an outdated practice, a lot of clients still request the favicon.ico directly from\n // the site's root (website.com_favicon.ico), simple map the request to the appropriate location for\n // static content\n // if ($this->route == \"favicon.ico\")\n if (file_exists(CONTROLLERS_DIR.$this->route.\".php\"))\n $this->requestedFile = $this->route.\".php\";\n else\n throw new Exception(\"File: \". $this->route.\".php\" .\" does not exist.\", 404);\n }\n else\n {\n // First item is an empty string, second item is the subfolder\n // third item is the target source file.\n if (count($this->route) > 2)\n throw new Exception(\"URL nesting can't go deeper than 1 directory.\", 0);\n\n if (file_exists(CONTROLLERS_DIR.$this->route[0])) // Check if the subfolder exists\n {\n if ($this->route[1] != \"\" && $this->route[1] != \"/\") // Check for empty or wrongly formatted string\n {\n // Check if the file requested exists\n if (file_exists(CONTROLLERS_DIR.$this->route[0].\"/\".$this->route[1].\".php\"))\n $this->requestedFile = $this->route[0].\"/\".$this->route[1].\".php\";\n else\n throw new Exception(\"Nested file: \". $this->route[1].\".php\" .\" does not exist.\", 404);\n }\n }\n else\n throw new Exception(\"Subfolder: \". $this->route[0].\" does not exist.\", 404);\n\n throw new Exception(\"URL route invalid.\", 0);\n }\n\n // Extra client data\n $this->userAgent = $_SERVER['HTTP_USER_AGENT']??NULL;\n\n // Get the request type and arguments\n if ($_SERVER['REQUEST_METHOD'] == 'GET')\n {\n $this->requestType = 'GET';\n $this->GET = $_GET;\n }\n if ($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n $this->requestType = 'POST';\n $this->GET = $_GET;\n $this->POST = $_POST;\n }\n\n // Check the requests protocol\n if ((!empty($_SERVER['HTTPS'])) && $_SERVER[\"HTTPS\"] != 'off')\n {\n $this->https = true;\n }\n // Check the session status\n if (SESSIONS_ENABLED && isset($_SESSION[\"ID\"]))\n {\n // Check the account login status, if there was a succesful login attempt while the account was already in use by\n // a different system the account will be flagged as offline despite being currently in use, if this is the case\n // then original session should be forcefully expired to reflect the fact that the account is now logged off\n $db = (new SQLiteConnection())->getDB();\n if ($db != NULL)\n {\n $result = $db->prepare(\"SELECT logged_in FROM accounts WHERE email=:email LIMIT 1\");\n $result->bindParam(\":email\", $_SESSION[\"email\"]);\n $result->execute();\n $data = $result->fetchAll();\n if ($data && $data[0][0] == 1)\n {\n //print(\"<br> VALID SESSION\");\n }\n else\n {\n session_destroy();\n header(\"Location: \".PROJECT_URL.\"login\");\n exit();\n\n }\n }\n\n\n $this->sessionStatus = SESSION_STATUS::VALID_SESSION;\n $this->accountID = $_SESSION[\"ID\"];\n $this->accountEmail = $_SESSION[\"email\"];\n $this->accountLastLogin = $_SESSION[\"last_login\"];\n $this->accountType = $_SESSION[\"account_type\"];\n $this->accountSessionTime = $_SESSION[\"session_start_time\"];\n $this->accountLoginIP = $_SESSION[\"login_ip\"];\n $this->accountSessionID = session_id();\n $this->accountUsername = $_SESSION[\"username\"];\n\n // Check if the session is still valid\n if (isset($_SESSION[\"session_start_time\"]) && null != SESSION_MAX_DURATION)\n {\n // Check if the last saved session activity time is bigger than the duration\n if ( (SESSION_MAX_DURATION > 0) && ((time() - (int)$_SESSION['session_inactivity_time']) > SESSION_MAX_DURATION) )\n {\n // The client's session has expired, redirect to the login page\n\n $db = (new SQLiteConnection())->getDB();\n if ($db != NULL)\n {\n $result = $db->prepare(\"UPDATE accounts SET logged_in=0, logout_type='SESSION_MAX_DURATION' WHERE email=:email\");\n $result->bindParam(\":email\", $this->accountEmail);\n $result->execute();\n }\n\n session_destroy();\n header(\"Location: \".PROJECT_URL.\"login\");\n exit();\n }\n\n }\n // Check for inactivity timeouts\n if (isset($_SESSION['session_inactivity_time']) && null != SESSION_INACTIVITY_TOLERANCE)\n {\n // Check if the last saved session activity time is bigger than the duration\n if ( (SESSION_INACTIVITY_TOLERANCE > 0) && (time() - (int)$_SESSION['session_inactivity_time']) > SESSION_INACTIVITY_TOLERANCE)\n {\n // The client's session has expired, redirect to the login page\n $db = (new SQLiteConnection())->getDB();\n if ($db != NULL)\n {\n $result = $db->prepare(\"UPDATE accounts SET logged_in=0, logout_type='SESSION_INACTIVITY' WHERE email=:email\");\n $result->bindParam(\":email\", $this->accountEmail);\n $result->execute();\n }\n\n session_destroy();\n header(\"Location: \".PROJECT_URL.\"login\");\n exit();\n }\n }\n // Update the inactivity timer\n $_SESSION[\"session_inacitivty_time\"] = time();\n }\n else\n $this->sessionStatus= SESSION_STATUS::NO_SESSION;\n\n // Encapsulate all retrieved cookies\n $this->cookies = $_COOKIE;\n }", "public function createRequest($url);", "public function setUrl(string $request)\n {\n $this->isBaseUrlEmpty();\n\n $this->url = $this->baseUrl . $request;\n }", "public function setEndpoint($endpoint = '')\n {\n $endpoint = 'tickets/' . $endpoint;\n\n parent::setEndpoint($endpoint);\n }", "public function __construct()\r\n {\r\n $this->geturl();\r\n }", "public function initializeRedirectUrlHandlers() {}", "private function initialize_routes() {\n // capture request method, url string, and break url string into parts (around '/')\n $this->request_method = $_SERVER['REQUEST_METHOD'];\n $this->url_parts_string = (isset($_GET['p'])) ? rtrim(strtolower($_GET['p']), '/'): '';\n $this->url_parts = explode('/', $this->url_parts_string);\n \n // capture request payload\n $this->payload = array();\n if ($this->request_method == 'POST') { \n // POST data if avaiable\n if (!empty($_POST)) {\n $this->payload = $_POST;\n \n // raw JSON if aviaible\n } else {\n $fp = fopen('php://input', 'r');\n $raw_data = stream_get_contents($fp);\n $posted_json = (array)json_decode($raw_data);\n \n if (!empty($posted_json)) {\n $this->payload = $posted_json;\n }\n }\n }\n \n // type cast all dynamic url parts as INT or FLOAT else leave as STRING\n $preg_pattern = '/[a-zA-Z]/';\n foreach ($this->url_parts as $key=>$value) {\n preg_match($preg_pattern, $value, $matches);\n if (empty($matches)) {\n if ((int)$value != null) $this->url_parts[$key] = (int)$value;\n else if ((float)$value != null) $this->url_parts[$key] = (float)$value; \n }\n }\n \n return true;\n }", "function add_rewrite_endpoint($name, $places, $query_var = \\true)\n {\n }", "public function __construct () {\n $this->router = new \\Skeletal\\Router\\Router();\n $this->session = new Session();\n \n $this->onNotFound = function ( $svc, $req ) {\n return (new Response())->text( '404 - Not Found' )->code(404);\n };\n $this->onException = function ( $svc, $req, $ex ) {\n return (new Response())->serverError()->text( '500 - Server Error' );\n };\n }", "public function __construct()\r\n\t{\r\n\t\t// Primeiro limpamos o caminho informado na URL\r\n\t\t$this->setUrl();\r\n\r\n\t\t// Depois quebramos ela para ajudar no processo\r\n\t\t$this->setExplode();\r\n\r\n\t\t// Retiramos a Controller da URL (caso exista uma)\r\n\t\t$this->setController();\r\n\r\n\t\t// Retiramos a Action da URL (caso exista uma)\r\n\t\t$this->setAction();\r\n\r\n\t\t// Retiramos os Parâmetros da URL (caso eles existam)\r\n\t\t$this->setParams();\r\n\r\n\t\t// Organizamos a Controller e Action para buscar elas dinamicamente\r\n\t\t$this->arrangeControllerAction();\r\n\t}", "public function getServiceEndpoint()\r\n {\r\n // return static::SERVICE_TESTING_URL;\r\n return static::SERVICE_PRODUCTION_URL;\r\n }", "public function setEndpoint($url) \n {\n $this->endpoint = $url;\n\n return $this;\n }", "abstract protected function buildSpecificRequestUri();", "private function setEndpoint($endpoint): void {\r\n $this->endpoint = $endpoint;\r\n }", "public function buildBackendUri() {}", "public function __construct() {\n $this->setRoutes(array(\n 'user' => 'getAllUsers',\n 'user/:userId' => 'getCertainUser',\n 'fixName/:variableName' => 'anotherMethod'\n ));\n }", "public function __construct()\r\n {\r\n $this->constructApiUrl();\r\n }", "public function add_endpoint() {\r\n add_rewrite_rule('^api/films/?(\\w+)?/?','index.php?__api=1&films=$matches[1]','top');\r\n }", "public function __construct()\n {\n $this->addAdditionalRoute('redeemByGet', 'redeem/{reward}/user/{user}', ['GET']);\n $this->addAdditionalRoute('redeemByPost', 'redeem/', ['POST']);\n }", "public function getApiEndpoint();", "private static function get_endpoint() {\n\t\treturn tvd_get_service_endpoint() . '/pdf-from-url';\n\t}", "function register_endpoints(){\n\t$route_base = 'wc/v1';\n\n\tregister_rest_route($route_base, '/posts', array(\n\t\t'methods' => 'GET',\n\t\t'callback' => 'api_get_posts',\n\t\t'permission_callback' => 'helper_authentication_check'\n\t));\n\n\tregister_rest_route($route_base, '/posts/(?P<post_id>\\d+)', array(\n\t\t'methods' => 'GET',\n\t\t'callback' => 'api_get_post',\n\t\t'permission_callback' => 'helper_authentication_check'\n\t));\n}", "public function getRequestUrl() {\n\t}", "public function __construct() {\n\t\t$this->requester = new Gumroad_Requester();\n\t\t$this->sessions = new Gumroad_Sessions_Endpoint($this->requester);\n\t\t$this->products = new Gumroad_Products_Endpoint($this->requester);\n\t}", "private function initUrlProcess() {\n $url = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);\n $urld = urldecode($url);\n $url = trim(str_replace($this->subdir, \"\", $urld), '/');\n\n // Redirect index aliases\n if (in_array($url, ['home', 'index', 'index.php'])) {\n redirect($this->subdir, 301);\n }\n\n $this->url = $url;\n $this->segments = empty($url) ? [] : explode('/', $url);\n }", "public function setEndpoint(string $endpoint) {\n if (!empty($endpoint)) {\n $this->endpoint = $endpoint;\n }\n }", "public function getEndpoint()\n {\n $basePath = $this->app['config']->get('api.base_path', self::DEFAULT_BASE_PATH);\n $basePath = $this->stripTrailingSlash($basePath);\n\n // determine the base URL for the API,\n // i.e. https://api.example.com/v1\n $urlBase = $this->app['config']->get('api.url');\n if ($urlBase) {\n $urlBase = $this->stripTrailingSlash($urlBase);\n } else {\n // no base URL was defined so we're going to generate one\n $urlBase = $this->app['base_url'];\n $urlBase = $this->stripTrailingSlash($urlBase).$basePath;\n }\n\n // get the requested path, strip any trailing '/'\n $path = $this->stripTrailingSlash($this->request->path());\n\n // strip out the base path (i.e. /api/v1) from the\n // requested path\n if ($basePath) {\n $path = str_replace($basePath, '', $path);\n }\n\n return $urlBase.$path;\n }", "private function checkIfEndpointsSet()\n {\n if(empty($this->apiEndpoint)) {\n $this->apiEndpoint = $this->baseApiEndpoint . '/' . $this->apiVersionEndpoint;\n }\n\n if(empty($this->tokenEndpoint)) {\n $this->tokenEndpoint = $this->baseApiEndpoint . '/' . $this->apiOauthEndpoint;\n }\n }", "protected function init(Request $request) {\n\t\tUrlGeneratorUtil::constructInstance($request);\n\t}", "public function initServerUrlHelper()\n {\n /** @var HelperPluginManager $manager */\n $manager = $this->getServiceLocator()->get('ViewHelperManager');\n /** @var ServerUrl $helper */\n $helper = $manager->get('serverUrl');\n $options = $this->getURLOptions();\n\n // configure\n $helper->setPort($options->getPort());\n $helper->setScheme($options->getScheme());\n $helper->setHost($options->getHost());\n }", "public function addEndpoints()\n {\n foreach ($this->endpoints as $endpoint) {\n add_rewrite_endpoint(pll__($endpoint), EP_ROOT | EP_PAGES);\n }\n }", "private function createHttpHandler()\n {\n $this->httpMock = new MockHandler();\n\n $handlerStack = HandlerStack::create($this->httpMock);\n $handlerStack->push(Middleware::history($this->curlHistory));\n\n $this->client = new Client(['handler' => $handlerStack]);\n\n app()->instance(Client::class, $this->client);\n }", "public function __construct()\n {\n $this->uri = $_SERVER['REQUEST_URI'];\n $this->method = $_SERVER['REQUEST_METHOD'];\n\n // Get all parameters from the request depending on request method\n $parameters = match ($this->method) {\n 'GET' => $_GET,\n 'POST' => $_POST,\n };\n // Remove 'path' from Request parameters because we use it in rewrite rule in htaccess for pretty url,\n // and it is handled by the Route later.\n unset($parameters['path']);\n $this->parameters = $parameters;\n }", "function make_urls() {\n $url = '/search/' . $this->id . '/';\n $this->append_urls('self', $url);\n }", "function setUrlGenerator(\\Closure $func)\n {\n $this->urlFunc = $func;\n }", "public static function register_endpoints() {\n // endpoints will be registered here\n register_rest_route( Liang_API_Endpoints::$base_url, '/index', array(\n 'methods' => WP_REST_Server::READABLE,\n 'callback' => array( 'Liang_API_Endpoints', 'get_index' ),\n ) );\n }", "public function setUp()\n {\n // Setting endpoint URL\n $this->endpoint = 'http://chez-syl.fr/yaapi/api/';\n }", "function create_initial_rest_routes()\n {\n }", "function __construct() {\n global $urlpatterns,$errorhandler;\n //Initialize config object\n $this->config=new Config();\n //Get all URLs Routes\n $this->routes=$this->config->urlpatterns;\n //Get all ErrorHandler\n $this->error_routes=$this->config->errorhandler;\n //Check for server error\n $this->server_error();\n //Route URLs\n $this->router($this->config->request_path, $this->routes);\n }", "protected function set_url($location=null)\n\t{\n\n\t\t$this->url = $this->api_host.$location;\n\t\t\n\t}", "public function getEndpoint(): string;", "public function getEndpoint(): string;", "public function getEndpoint(): string;", "public function getEndpoint(): string;", "private function setBaseUrl()\n {\n $this->baseUrl = config('gladepay.endpoint');\n }", "public function setEndpoint($endpoint)\n\t{\n\t\t$this->router->setBasePath($endpoint);\n\t}", "protected function setUp()\r\n {\r\n $this->exampleUri = \"http://www.example.com\";\r\n }", "final private function constructApiUrl()\r\n {\r\n\t\trequire_once 'bset.php';\r\n $this->apiUrl = 'https://api.telegram.org/bot' . BOT_TOKEN;\r\n }", "public static function Route()\n { \n $uri = self::getURI(); // get path\n $uri = self::parseGET($uri); // fill $_GET with params and strip them\n self::$uri = $uri;\n\n self::activateController($uri);\n }", "public function generate_url()\n {\n }", "private function loadEndpoints() {\n $this->endpoints = array(\n '2020-08-06' => array(\n 'base_api_endpoint' => 'https://cloudapi.inflowinventory.com/',\n 'categories' => $this->companyID . '/categories/'\n )\n );\n }", "public function registerExternalEndpoints()\n {\n Route::post('encode/notify', [\n 'as' => 'decoy::encode@notify',\n 'uses' => '\\Bkwld\\Decoy\\Controllers\\Encoder@notify',\n ]);\n }", "function __construct()\n {\n parent::__construct(); //kutsume tööle http konstruktor\n //loome põhilingi\n $this->baseUrl = $this->protocol . HTTP_HOST . SCRIPT_NAME;\n }", "public function __construct() {\r\n header(\"Access-Control-Allow-Orgin: *\");\r\n header(\"Access-Control-Allow-Methods: *\");\r\n header(\"Content-Type: application/json\");\r\n\r\n $this->args = [0,1];\r\n $this->endpoint = array_shift($this->args);\r\n if (array_key_exists(0, $this->args) && !is_numeric($this->args[0])) {\r\n $this->verb = array_shift($this->args);\r\n }\r\n }", "public function setUp():void {\n $_SERVER[\"REQUEST_METHOD\"] = 'GET';\n $this->requestMethod = $_SERVER[\"REQUEST_METHOD\"];\n $this->routeList = [\n 'GET' => [\n 'url' => 'ExampleController@index',\n 'url1/url2' => 'ExampleController@index',\n 'url/url1/{param}' => 'ExampleController@index'\n ]\n ];\n\n // Create Routes Stub\n $this->routesStub = $this->createStub(RouteList::class);\n\n // Configure Routes stub.\n $this->routesStub\n ->method('routes')\n ->willReturn($this->routeList);\n\n\n $this->requestStub = $this->createStub(Request::class);\n $this->requestStub\n ->method('getMethod')\n ->willReturn('GET');\n $this->router = '';\n }", "public function __construct() {\r\n $host = $_SERVER['HTTP_HOST'];\r\n $this->routes['default'] = \"http://$host/index.php\";\r\n $this->routes['login'] = \"http://$host/login.php\";\r\n }", "public function __construct()\n {\n $this->ParseUrl();\n $this->Dispatch();\n }", "protected function get_endpoint_url() {\n\n\t\t$args = http_build_query( array( 'apikey' => $this->api_key ) );\n\t\t$base = $this->route . $this->app_id;\n\t\t$url = \"$base?$args\";\n\n\t\treturn $url;\n\t}", "public function provideUrl(): Generator\n {\n yield [''];\n yield ['/'];\n yield ['/products/123'];\n }", "private function addEndpointToBaseUrl(string $path = null){\n $this->endpoint = (!empty($path)) ? DIRECTORY_SEPARATOR . ltrim($path, DIRECTORY_SEPARATOR) : DIRECTORY_SEPARATOR;\n\n $urlParts = parse_url($this->requestUrl);\n if (empty($urlParts['path'])) {\n $urlParts['path'] = rtrim($this->endpoint, '?');\n } else {\n $urlParts['path'] = rtrim($urlParts['path'], '/') . rtrim($this->endpoint, '?');\n }\n $this->requestUrl = http_build_url($urlParts);\n return $this->requestUrl;\n }", "public function setOpEndpoint($url)\n {\n $this->_opEndpoint = $url;\n }", "public function initUrlKeys();", "public function setUp(string $httpMethod, string $url): void;", "public function buildFrontendUri() {}", "public function endPointAsHTTPURLInstance()\n {\n $endPoint = stubHTTPURL::fromString('http://example.net/');\n $config = new stubSoapClientConfiguration($endPoint, 'urn:foo');\n $test = $config->getEndPoint();\n $this->assertSame($endPoint, $test);\n $this->assertEquals('urn:foo', $config->getUri());\n }", "public function __construct($url = null, $request_method = null, ?array $options = null) {}", "public function register_routes() {\n\t\tregister_rest_route(\n\t\t\t$this->namespace,\n\t\t\t'/' . $this->rest_base,\n\t\t\tarray(\n\t\t\t\tarray(\n\t\t\t\t\t'methods' => WP_REST_Server::READABLE,\n\t\t\t\t\t'callback' => array( $this, 'parse_url_details' ),\n\t\t\t\t\t'args' => array(\n\t\t\t\t\t\t'url' => array(\n\t\t\t\t\t\t\t'required' => true,\n\t\t\t\t\t\t\t'description' => __( 'The URL to process.' ),\n\t\t\t\t\t\t\t'validate_callback' => 'wp_http_validate_url',\n\t\t\t\t\t\t\t'sanitize_callback' => 'sanitize_url',\n\t\t\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t\t\t'format' => 'uri',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'permission_callback' => array( $this, 'permissions_check' ),\n\t\t\t\t\t'schema' => array( $this, 'get_public_item_schema' ),\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\t}" ]
[ "0.6910181", "0.6479029", "0.64210504", "0.621488", "0.6157519", "0.6139891", "0.61287946", "0.61194694", "0.61072344", "0.6061941", "0.5996362", "0.59743464", "0.5924256", "0.5906302", "0.590461", "0.5888739", "0.5888635", "0.5860619", "0.58574474", "0.5851046", "0.58383703", "0.58383703", "0.58383703", "0.58315694", "0.58307993", "0.58210856", "0.58021903", "0.5787699", "0.5786512", "0.57807446", "0.5769967", "0.57592285", "0.57588917", "0.57574344", "0.5730914", "0.5726272", "0.5722555", "0.5720894", "0.57091665", "0.570424", "0.57028025", "0.56800073", "0.5674311", "0.5669483", "0.5666653", "0.56634325", "0.5660807", "0.5656082", "0.5626078", "0.56215924", "0.561257", "0.5610734", "0.55896664", "0.5585605", "0.5583641", "0.5576849", "0.5569813", "0.5567087", "0.55606467", "0.55557543", "0.5555695", "0.55535847", "0.55491847", "0.55458397", "0.55332947", "0.5532783", "0.5522051", "0.55170584", "0.55096763", "0.550903", "0.55081564", "0.55078095", "0.5498633", "0.54913706", "0.5490396", "0.5490396", "0.5490396", "0.5490396", "0.5486809", "0.5480021", "0.54791266", "0.5476783", "0.54757154", "0.54724455", "0.5470773", "0.54683495", "0.5464007", "0.54607606", "0.5449286", "0.54438", "0.5441845", "0.54417974", "0.54415965", "0.5440772", "0.5438166", "0.54379636", "0.543728", "0.54338723", "0.54318726", "0.54317886", "0.5427452" ]
0.0
-1
Run the database seeds.
public function run() { if(DB::table('students')->count() <= 0) { DB::table('students')->insert([ [ 'name' => 'Dang Minh', 'address' => 'My Dinh', 'university' => 'FPT Polytechnic', 'class_id' => 1 ], [ 'name' => 'Duong Manh Hoang', 'address' => 'Hoang Mai', 'university' => 'FPT Polytechnic', 'class_id' => 1 ], [ 'name' => 'Pham Quoc Can', 'address' => 'My Dinh', 'university' => 'FPT Polytechnic', 'class_id' => 1 ], ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.80140394", "0.7980541", "0.79775697", "0.79547316", "0.79514134", "0.79500794", "0.79444957", "0.794259", "0.79382807", "0.7937482", "0.7934376", "0.7892533", "0.7881253", "0.78794724", "0.7879101", "0.7875628", "0.787215", "0.7870168", "0.78515327", "0.7850979", "0.7841958", "0.7834691", "0.78279406", "0.78198457", "0.78093415", "0.78030044", "0.7802443", "0.7801398", "0.7798975", "0.77957946", "0.77905124", "0.7789201", "0.77866685", "0.77786297", "0.7777914", "0.7764813", "0.7762958", "0.7762118", "0.77620417", "0.77614594", "0.7760672", "0.77599436", "0.77577287", "0.7753593", "0.7749794", "0.7749715", "0.77473587", "0.77301705", "0.77296484", "0.77280766", "0.77165425", "0.77143145", "0.7714117", "0.77136046", "0.7712814", "0.7712705", "0.7711485", "0.7711305", "0.77110684", "0.77102643", "0.7705902", "0.77048075", "0.77041686", "0.77038115", "0.7703085", "0.7702133", "0.77009964", "0.7698874", "0.769864", "0.76973957", "0.7696364", "0.7694127", "0.7692633", "0.76910555", "0.7690765", "0.7688756", "0.76879585", "0.76873547", "0.76871854", "0.7685407", "0.7683626", "0.76794547", "0.7678361", "0.7678022", "0.7676884", "0.7672536", "0.76717764", "0.7669418", "0.76692647", "0.76690245", "0.76667875", "0.76628584", "0.76624", "0.76618767", "0.7660002", "0.76567614", "0.76542175", "0.76541024", "0.7652618", "0.76524657", "0.7651689" ]
0.0
-1
Mark order as paid and send notifications
public static function processPayment($id) { $order = self::get($id); if (!$order) { return false; } self::markAsPaid($id); self::notifyAboutPurchase($id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function markPaid()\n {\n $this->order->update(['status' => OrderStatus::PAID]);\n\n $this->notify([\n 'title' => __('Update Status'),\n 'message' => __('This order is marked as paid.'),\n ]);\n }", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "public function notifyPayment()\n {\n }", "public function markAsPaid() {\n $this->status = parent::STATUS_PAID;\n $this->admin_id = Yii::app()->user->getId();\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "function mark_as_paid() {\n if (!$this->active_invoice->isLoaded()) {\n $this->response->notFound();\n } // if\n\n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n try{\n if($this->request->isAsyncCall()) {\n $this->active_invoice->setStatus(INVOICE_STATUS_PAID);\n $this->active_invoice->save();\n $this->response->respondWithData($this->active_invoice, array(\n 'as' => 'invoice',\n 'detailed' => true,\n ));\n } else {\n $this->response->badRequest();\n } //if\n } catch (Exception $e) {\n $this->response->exception($e);\n } //try\n }", "public function setPaid()\n {\n $this->update([\n 'status' => self::STATUS_PAID,\n 'paid_date' => Carbon::now(),\n ]);\n }", "public static function paidOrderFilter(Request $request, $order)\n {\n $subscriber = User::findOrFail( $order->subscriber_id);\n $subscription = Subscription::where('subscription_id', $order->subscription_id)->firstOrFail();\n\n // validate amount\n /*if ($r->mc_gross != $subscription->subscription_price) {\n \\Log::error('On subscription #' . $subscription->id . ' received amount was ' . $r->mc_gross . ' while the cost of subscription is ' . $subscription->subscription_price);\n exit;\n }*/\n\n // update expires\n $subscription->subscription_expires = now()->addMonths(1);\n $subscription->status = 'Active';\n $subscription->save();\n\n // notify creator on site & email\n $creator = $subscription->creator;\n $creator->notify(new NewSubscriberNotification($subscriber));\n\n // update creator balance\n $creator->balance += $subscription->creator_amount;\n $creator->save();\n\n // create invoice to be able to have stats in admin\n $i = new Invoice;\n $i->invoice_id = $subscription->subscription_id;\n $i->user_id = $subscription->subscriber_id;\n $i->subscription_id = $subscription->id;\n $i->amount = $subscription->subscription_price;\n $i->payment_status = 'Paid';\n $i->invoice_url = '#';\n $i->save();\n\n //YourOrderController::saveOrderAsPaid($order);\n\n // Return TRUE if the order is saved as \"paid\" in the database or FALSE if some error occurs.\n // If you return FALSE, then you can repeat the failed paid requests on the unitpay website manually.\n return true;\n }", "protected function sendOrderChangeNotification()\n {\n if ($this->getSendNotificationFlag()) {\n \\XLite\\Core\\Mailer::getInstance()->sendOrderAdvancedChangedCustomer($this->getOrder());\n }\n }", "private function payOrder($order){\r\n $this->log('Paying order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'Pagado con flow');\r\n $order->payment_complete();\r\n }", "function coordinator_mark_as_paid() {\n $this->SearchPagination->setup();\n $this->layout = \"coordinator/index\";\n $deliveryDates = $this->Delivery->getDeliveryDatesList(true); \n $nextDelivery = $this->Delivery->findByNextDelivery(true); \n $this->set('nextDelivery', $nextDelivery);\n $condition = array();\n $condition += array('User.organization_id' => $this->currentUser['User']['organization_id']);\n if (!empty($this->params['url']['id'])) {\n $condition += array('Order.id' => $this->params['url']['id']);\n }\n if (!empty($this->params['url']['user_name'])) {\n $condition += $this->User->findByNameCondition($this->params['url']['user_name']);\n \n }\n if (!empty($this->params['url']['delivery_date'])) {\n if ($this->params['url']['delivery_date'] > 0) {\n $condition += array('Order.delivery_id' => $this->params['url']['delivery_date']);\n } \n } else {\n $condition += array('Order.delivery_id' => $nextDelivery['Delivery']['id']);\n }\n $this->paginate = array(\n 'conditions' => $condition, 'limit' => $this->Order->find('count', array('conditions' => $condition))\n );\n $this->set('delivery_dates', $deliveryDates);\n $this->set('orders', $this->paginate());\t \n }", "public function sendStatusUpdateNotifications(OrderEvent $event)\n {\n $order = $event->getOrder();\n switch ($order->getStatus()) {\n\n case Order::STATUS_AWAITING_SEPA:\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_AWAITING_SEPA,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_NEW:\n // get payment\n $payment = $order->getPayments()->first();\n\n // is transport\n $isTransport = true;\n if (Shipping::TYPE_NOT_SHIPPED === $order->getShippingType()) {\n $isTransport = false;\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'invoiceUrl' => $this->router->generate('order_invoice_download', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $payment->getChargeId(),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'BoolTransport' => $isTransport,\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'expectedDeliveryDate' => null !== $order->getExpectedDeliveryDate() ? $order->getExpectedDeliveryDate()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y') : '',\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'BoolTransport' => $isTransport,\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'shippingLimitDate' => null !== $order->getShouldBeReadyAt() ? $order->getShouldBeReadyAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y') . ' avant 17h' : '',\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CONFIRMATION_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n\n case Order::STATUS_CANCELED:\n // order has been canceled by the customer\n if (OrderEvent::ORIGIN_CUSTOMER === $event->getOrigin()) {\n\n // get order payment id\n $paymentId = 'n/a';\n $payments = $order->getPayments();\n if (0 < count($payments)) {\n /** @var Payment $payment */\n $payment = $payments[0];\n $paymentId = $payment->getChargeId();\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $paymentId,\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountForMakerTaxIncl() / 100), 2)// only display production amount - coupon amount to maker\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_CANCELLATION_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n }\n break;\n\n case Order::STATUS_TRANSIT:\n\n // get shipment\n $shipments = $order->getShipments();\n /** @var Shipment $shipment */\n $shipment = $shipments[0];\n\n // send customer e-mail\n $emailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'trackingUrl' => $shipment->getTrackingUrl(),\n 'trackingNumber' => $shipment->getParcelNumber(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_SHIPPED,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $emailVars\n );\n\n break;\n\n case Order::STATUS_READY_FOR_PICKUP:\n\n // send customer e-mail\n $emailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'shippingType' => Shipping::getReadableShippingType($order->getShippingType()),\n 'shippingAddress' => $order->getShippingAddress()->getFlatAddress(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL),\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_READY_FOR_PICKUP,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $emailVars\n );\n\n break;\n\n case Order::STATUS_REFUNDED:\n\n // get order payment id\n $paymentId = 'n/a';\n $payments = $order->getPayments();\n if (0 < count($payments)) {\n /** @var Payment $payment */\n $payment = $payments[0];\n $paymentId = $payment->getChargeId();\n }\n\n // get order refund id\n $refundId = 'n/a';\n $refunds = $order->getRefunds();\n if (0 < count($refunds)) {\n /** @var Refund $refund */\n $refund = $refunds[0];\n $refundId = $refund->getRefundId();\n }\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'paymentId' => $paymentId,\n 'refundId' => $refundId,\n 'orderTotalAmountTaxIncl' => number_format(($order->getTotalAmountTaxIncl() / 100), 2)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_REFUNDED,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_DELIVERED:\n\n // send customer e-mail\n /* There is no longer any immediate notification sending when the order is delivered. The notification is made on D + 1 via the reminder system\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n //'ratingUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL) . '#rating'\n 'ratingUrl' => $this->router->generate('order_rating', array('token' => $order->getToken()), $this->router::ABSOLUTE_URL) . '#rating'\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_RATING,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n */\n break;\n\n case Order::STATUS_CLOSED:\n\n if ($order->getRating()->getEnabled() == True ) {\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'orderDate' => $order->getCreatedAt()->setTimezone(new \\DateTimeZone('Europe/Paris'))->format('d/m/Y à H:i'),\n 'orderRateValue' => $order->getRating()->getRate(),\n 'orderRateValue' => $order->getRating()->getComment(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_RATE,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n }\n break;\n\n\n\n\n case Order::STATUS_FILE_AVAILABLE:\n\n // send customer e-mail\n $customerEmailVars = array(\n 'customerName' => $order->getCustomer()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'accountUrl' => $this->router->generate('order_customer_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_AVAILABLE_CUSTOMER,\n $order->getCustomer()->getEmail(),\n $order->getCustomer()->getFullname(),\n $customerEmailVars\n );\n\n break;\n\n case Order::STATUS_FILE_REJECTED:\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_REJECTED_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n\n case Order::STATUS_FILE_VALIDATED:\n\n // send maker e-mail\n $makerEmailVars = array(\n 'makerName' => $order->getMaker()->getFullname(),\n 'orderReference' => $order->getReference(),\n 'BoolTransport' => $order->getQuotation()->getProject()->getType()->isShipping(),\n 'accountUrl' => $this->router->generate('order_maker_see', array('reference' => $order->getReference()), $this->router::ABSOLUTE_URL)\n );\n $this->sendinBlue->sendTransactional(\n SendinBlue::TEMPLATE_ID_ORDER_FILE_VALIDATED_MAKER,\n $order->getMaker()->getUser()->getEmail(),\n $order->getMaker()->getFullname(),\n $makerEmailVars\n );\n\n break;\n }\n }", "public function test_it_marks_order_as_processing()\n {\n $event = new OrderPaid(\n $order = factory(Order::class)->create([\n 'user_id' => factory(User::class)->create()\n ])\n );\n\n $listener = new MarkOrderProcessing();\n\n $listener->handle($event);\n\n $this->assertEquals(Order::PROCESSING, $order->fresh()->status);\n }", "public function fulfill()\n {\n $this->status = true;\n\n $this->save();\n\n $this->user->notify(new OrderFulfilled($this));\n }", "public static function paidOrderFilter(Request $request, $order)\n {\n\terror_log(\"ORDER ID: \".$order);\n // Your code should be here:\n if ($order instanceof Order and $order->id) {\n\t $order->status = 2;\n\t\t$order->save();\n\n\t\t$commands = json_decode($order->product->execute);\n\t\tforeach ($commands as $cmd) {\n\t\t\tif ($cmd->type == \"group\") {\n\t\t\t\tif (\\DB::connection('mysql2')->table('players')->where('userName', $order->username)->exists()) {\n\t\t\t\t\t\\DB::connection('mysql2')->table('players')->where('userName', $order->username)->update(array('userGroup' => $cmd->execute));\n\t\t\t\t} else {\n\t\t\t\t\t\\DB::connection('mysql2')->table('players')->insert(['userName' => strtolower($order->username), 'userGroup' => $cmd->execute, 'permissions' => \"\"]);\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($cmd->type == \"money\") {\n\t\t\t\tif(\\DB::connection('mysql3')->table('user_money')->where('username', $order->username)->exists()) {\n\t\t\t\t\t\\DB::connection('mysql3')->table('user_money')->increment('money', $cmd->execute);\n\t\t\t\t} else {\n\t\t\t\t\t\\DB::connection('mysql3')->table('user_money')->insert(['username' => strtolower($order->username), 'money' => $cmd->execute]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}\n\n // Return TRUE if the order is saved as \"paid\" in the database or FALSE if some error occurs.\n // If you return FALSE, then you can repeat the failed paid requests on the unitpay website manually.\n return false;\n }", "public function onPlaceOrder()\n {\n $gateway = Checkout::get($this->owner)->getSelectedPaymentMethod();\n if (OrderProcessor::config()->bank_deposit_send_confirmation && GatewayInfo::isManual($gateway) && $this->owner->Status == \"Unpaid\") {\n OrderProcessor::config()->send_confirmation = true;\n } else {\n OrderProcessor::config()->send_confirmation = false;\n }\n }", "function acadp_order_completed( $order ) {\n\n\t// update order details\n\tupdate_post_meta( $order['id'], 'payment_status', 'completed' );\n\tupdate_post_meta( $order['id'], 'transaction_id', $order['transaction_id'] );\n\n\t// If the order has featured\n\t$featured = get_post_meta( $order['id'], 'featured', true );\n\n\tif( ! empty( $featured ) ) {\n\t\t$post_id = get_post_meta( $order['id'], 'listing_id', true );\n\t\tupdate_post_meta( $post_id, 'featured', 1 );\n\t}\n\n\t// Hook for developers\n\tdo_action( 'acadp_order_completed', $order['id'] );\n\n\t// send emails\n\tacadp_email_listing_owner_order_completed( $order['id'] );\n\tacadp_email_admin_payment_received( $order['id'] );\n\n}", "public function paid($id)\n\t{\n\t\t\n\t}", "private function setOrderAsPending($order){\r\n $this->log('Setting as pending order #'.$order->get_order_number());\r\n //Since the default status of the order is pending, we only add a note here.\r\n $this->addOrderNote($order, 'La orden se encuentra pendiente.');\r\n }", "function store_order_paid(Order $order)\n {\n if ($order->order_owing < 0) {\n return '<span class=\"store_order_paid_over\">'.lang('store.overpaid').'</span>';\n } elseif ($order->order_owing == 0) {\n return '<span class=\"store_order_paid_yes\">'.lang('yes').'</span>';\n } elseif ($order->order_paid > 0) {\n return store_currency($order->order_paid);\n } else {\n return lang('no');\n }\n }", "public function salesOrderSaveAfter($observer)\n\t{\n\t\t// Get the settings\n\t\t$settings = Mage::helper('smsnotifications/data')->getSettings();\n\n\t\t// Get the new order object\n\t\t$order = $observer->getEvent()->getOrder();\n\n\t\t// Get the old order data\n\t\t$oldOrder = $order->getOrigData();\n\n\t\t// If the order status hasn't changed, don't do anything\n\t\tif($oldOrder['status'] === $order->getStatus()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the order status has changed, check if a notification should be sent\n\t\t// for the new status. If not, don't do anything\n\t\tif($order->getStatus() !== $settings['order_notification_status']) {\n\t\t\treturn;\n\t\t}\n\n\t\tMage::log('sending', null, 'm.txt');\n\n\t\t// Generate the body for the notification\n\t\t$store_name = Mage::app()->getStore()->getFrontendName();\n\t\t$customer_name = $order->getCustomerFirstname();\n\t\t$customer_name .= ' ' . $order->getCustomerLastname();\n\t\t$order_amount = $order->getBaseCurrencyCode();\n\t\t$order_amount .= ' ' . $order->getBaseGrandTotal();\n\n\t\t$body = sprintf('%s: %s has just placed an order for %s', $store_name, $customer_name, $order_amount);\n\n\t\t// If no recipients have been set, we can't do anything\n\t\tif(!count($settings['order_noficication_recipients'])) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Send the order notification by SMS\n\t\t$result = Mage::helper('smsnotifications/data')->sendSms($body, $settings['order_noficication_recipients']);\n\n\t\t// Check if the sending was successful\n\t\tif(!$result) {\n\t\t\t// If an error occured, notify the administrator\n\t\t\tMage::helper('smsnotifications/data')->sendAdminEmail(sprintf('%s was unable to send one or more order notifications to the specified number(s). Please check your configuration to make sure that your Twilio API settings are correct!', Mage::helper('smsnotifications/data')->app_name));\n\t\t}\n\t}", "public function visit($order) {\n\n\t\t$order->setPhase('paid');\n\t\treturn 0;\n\t}", "public function process_payment($order_id){\r\n\r\n $order = wc_get_order( $order_id );\r\n // Mark as on-hold (we're awaiting the cheque)\r\n $order->update_status( 'on-hold', _x( 'Awaiting check payment', 'Check payment method', 'azericard' ) );\r\n\r\n // Reduce stock levels\r\n wc_reduce_stock_levels( $order_id );\r\n\r\n // Remove cart\r\n WC()->cart->empty_cart();\r\n\r\n // Return thankyou redirect\r\n return array(\r\n 'result' => 'success',\r\n 'redirect' => $this->get_return_url( $order ),\r\n );\r\n\r\n }", "public function markAsPaid( MarkAsPaidRequest $request ) {\n\t\t$transId = $request->get('trans_id'); // Get the decrypted Id from the request\n\t\t$result = [];\n\t\t$buyerInvoiceIsAvailable = DB::table(TABLE_PAY_BUYER_INVOICES)\n\t\t ->where('trans_id', '=', $transId)\n\t\t ->count('trans_id');\n\n\t\t$sellerInvoiceIsAvailable = DB::table(TABLE_PAY_SELLER_INVOICES)\n\t\t ->where('trans_id', '=', $transId)\n\t\t ->count('trans_id');\n\n\t\tif ( ! empty($buyerInvoiceIsAvailable) && ! empty($sellerInvoiceIsAvailable) ) {\n\n\t\t\ttry {\n\t\t\t\t$updateBuyerInvoice = DB::table(TABLE_PAY_BUYER_INVOICES)\n\t\t\t\t ->where('trans_id', '=', $transId)\n\t\t\t\t ->update(['is_paid_seller' => 1]);\n\t\t\t\t$updateSellerInvoice = DB::table(TABLE_PAY_SELLER_INVOICES)\n\t\t\t\t ->where('trans_id', '=', $transId)\n\t\t\t\t ->update(['is_paid_seller' => 1]);\n\n\t\t\t\tif ( isset($updateBuyerInvoice) && isset($updateSellerInvoice) ) {\n\t\t\t\t\t$result['status'] = 1;\n\n\t\t\t\t\t// make log for user and time\n\t\t\t\t\tDBLog::save(LOG_MODULE_COURSE_ORDER_SUMMARY, $transId, 'mark_as_paid', $request->getRequestUri(), Session::get('user_id'), $result);\n\t\t\t\t}\n\n\t\t\t\treturn $this->sendResponse($result, 200);\n\t\t\t} catch ( ClientException $e ) {\n\t\t\t\tLog::error($e->getResponse()->getBody(), $e->getTrace());\n\n\t\t\t\treturn $this->sendResponse(GuzzleHttp\\json_decode($e->getResponse()->getBody()), $e->getResponse()\n\t\t\t\t ->getStatusCode());\n\t\t\t}\n\t\t}\n\n\t\t// Default error response\n\t\treturn $this->sendResponse(['message' => trans('shared::message.error.something_wrong'), 'status' => 0], 400);\n\t}", "private function ThanksForYourOrder()\n\t\t{\n\t\t\t// Reload all fo the information about the order as there's a good chance\n\t\t\t// a fair bit of it has changed now\n\t\t\t$this->SetOrderData();\n\n\t\t\t$GLOBALS['ISC_CLASS_CART'] = GetClass('ISC_CART');\n\t\t\t$GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');\n\n\t\t\t$GLOBALS['HideError'] = \"none\";\n\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = '';\n\t\t\t$GLOBALS['HideAwaitingPayment'] = \"none\";\n\n\t\t\t$GLOBALS['HideStoreCreditUse'] = 'none';\n\n\t\t\tif($this->pendingData['storecreditamount'] > 0) {\n\t\t\t\t$GLOBALS['HideStoreCreditUse'] = '';\n\t\t\t\t$GLOBALS['StoreCreditUsed'] = CurrencyConvertFormatPrice($this->pendingData['storecreditamount']);\n\n\t\t\t\t$GLOBALS['StoreCreditBalance'] = CurrencyConvertFormatPrice($GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerStoreCredit($this->pendingData['customerid']));\n\t\t\t\t$GLOBALS['ISC_LANG']['OrderCreditDeducted'] = sprintf(GetLang('OrderCreditDeducted'), GetConfig('CurrencyToken') . $GLOBALS['StoreCreditUsed']);\n\t\t\t}\n\n\t\t\t// If it was an offline payment method, show the post-purchase message and hide other messages\n\t\t\tif(is_object($this->paymentProvider) && $this->paymentProvider->GetPaymentType() == PAYMENT_PROVIDER_OFFLINE && method_exists($this->paymentProvider, 'GetOfflinePaymentMessage')) {\n\t\t\t\t$defaultCurrency = GetDefaultCurrency();\n\t\t\t\t$GLOBALS['OrderTotal'] = FormatPrice($this->pendingData['gatewayamount'], false, true, false, $defaultCurrency, true);\n\n\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t$GLOBALS['PaymentMessage'] = $this->paymentProvider->GetOfflinePaymentMessage();\n\t\t\t\t$GLOBALS['SNIPPETS']['OfflinePaymentMessage'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"OfflinePaymentMessage\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Was the order declined?\n\t\t\t\tif($this->pendingData['status'] == 6) {\n\t\t\t\t\t$GLOBALS['HideError'] = '';\n\t\t\t\t\t$GLOBALS['ErrorMessage'] = sprintf(GetLang('ErroOrderDeclined'), GetConfig('OrderEmail'), GetConfig('OrderEmail'));\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = 'none';\n\t\t\t\t\t$GLOBALS['ISC_LANG']['ThanksForYourOrder'] = GetLang('YourPaymentWasDeclined');\n\t\t\t\t}\n\t\t\t\t// Order is still awaiting payment\n\t\t\t\telse if($this->pendingData['status'] == 7) {\n\t\t\t\t\t$GLOBALS['HidePaidOrderConfirmation'] = \"none\";\n\t\t\t\t\t$GLOBALS['HideAwaitingPayment'] = \"\";\n\t\t\t\t}\n\t\t\t\t// Otherwise, order was successful\n\t\t\t\telse {\n\t\t\t\t\t// Is it a physical or digital order?\n\t\t\t\t\tif($this->pendingData['isdigital'] == 100) {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no download link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['DigitalOrderConfirmation'] = GetLang('DigitalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HidePhysicalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\t// If this order has no customer ID associated with it (guest checkout with no account creation) then display an alternative text with no view order link\n\t\t\t\t\t\tif (!isId($this->pendingData['customerid'])) {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmationGuestCheckout');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = 'none';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Otherwise display nthe normal text with the download link in it\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$GLOBALS['PhysicalOrderConfirmation'] = GetLang('PhysicalOrderConfirmation');\n\t\t\t\t\t\t\t$GLOBALS['HidePhysicalViewOrderLink'] = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderConfirmation'] = \"none\";\n\t\t\t\t\t\t$GLOBALS['HideDigitalOrderDownloadLink'] = \"none\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->CreateCupons();\n\t\t\t\n\t\t\t// Include the conversion code for each analytics module\n\t\t\t$GLOBALS['ConversionCode'] = '';\n\t\t\t$analyticsModules = GetAvailableModules('analytics', true, true);\n\t\t\tforeach($analyticsModules as $module) {\n\t\t\t\t$module['object']->SetOrderData($this->pendingData);\n\t\t\t\t$trackingCode = $module['object']->GetConversionCode();\n\t\t\t\tif($trackingCode != '') {\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= \"\n\t\t\t\t\t\t<!-- Start conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\t\".$trackingCode.\"\n\t\t\t\t\t\t<!-- End conversion code for \".$module['id'].\" -->\n\t\t\t\t\t\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Include the conversion tracking code for affiliates\n\t\t\tforeach($this->pendingData['orders'] as $order) {\n\t\t\t\tif(strlen(GetConfig('AffiliateConversionTrackingCode')) > 0) {\n\t\t\t\t\t$converted_code = GetConfig('AffiliateConversionTrackingCode');\n\t\t\t\t\t$subTotalColumn = 'subtotal_ex_tax';\n\t\t\t\t\t$totalColumn = 'total_inc_tax';\n\t\t\t\t\tif(getConfig('taxDefaultTaxDisplayOrders') == TAX_PRICES_DISPLAY_INCLUSIVE) {\n\t\t\t\t\t\t$subTotalColumn = 'subtotal_inc_tax';\n\t\t\t\t\t}\n\n\t\t\t\t\t$discountedSubTotal = $_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL'];\n\t\t\t\t\tunset($_SESSION['LAST_ORDER_DISCOUNTED_SUBTOTAL']);\n\n\t\t\t\t\t$replacements = array(\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL%%' => $order[$subTotalColumn] / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_IN_CENTS%%' => ($order[$subTotalColumn] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED%%' => $discountedSubTotal / 1,\n\t\t\t\t\t\t'%%ORDER_SUBTOTAL_DISCOUNTED_IN_CENTS%%' => ($discountedSubTotal / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_AMOUNT%%' => $order['total_inc_tax'] / 1,\n\t\t\t\t\t\t'%%ORDER_AMOUNT_IN_CENTS%%' => ($order['total_inc_tax'] / 1) * 100,\n\t\t\t\t\t\t'%%ORDER_ID%%' => $order['orderid'],\n\t\t\t\t\t);\n\t\t\t\t\t$converted_code = str_ireplace(array_keys($replacements), $replacements, $converted_code);\n\t\t\t\t\t$GLOBALS['ConversionCode'] .= $converted_code;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// leave this in for outdated templates: hide the product updates div\n\t\t\t$GLOBALS['HideProductUpdates'] = \"none\";\n\n\t\t\tif(method_exists($this->paymentProvider, 'ShowOrderConfirmation')) {\n\t\t\t\t$GLOBALS['OrderConfirmationDetails'] = $this->paymentProvider->ShowOrderConfirmation($this->pendingData);\n\t\t\t}\n\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Show the order confirmation screen\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetLang('ThanksForYourOrder'));\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"order\");\n\t\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t\t}", "public function orderDeliver(Request $request, $orderID){\n $order = Order::select(['user_id', 'user_type', 'order_id', 'store_id', 'delivery_type'])\n ->where('customer_order_id', $orderID)\n ->first();\n\n if($order)\n {\n $isDelivered = 0;\n\n // Get the payment if exist and not captured\n $payment = Payment::select(['transaction_id', 'status'])\n ->where(['order_id' => $order->order_id])->first();\n\n if($payment)\n {\n if($payment->status != '0')\n {\n // Get the Stripe Account\n $companySubscriptionDetail = CompanySubscriptionDetail::from('company_subscription_detail AS CSD')\n ->select('CSD.stripe_user_id')\n ->join('company AS C', 'C.company_id', '=', 'CSD.company_id')\n ->join('store AS S', 'S.u_id', '=', 'C.u_id')\n ->where('S.store_id', $order->store_id)->first();\n\n if($companySubscriptionDetail)\n {\n $stripeAccount = $companySubscriptionDetail->stripe_user_id;\n\n // Initilize Stripe\n \\Stripe\\Stripe::setApiKey(env('STRIPE_SECRET_KEY'));\n\n try {\n // capture-later\n $payment_intent = \\Stripe\\PaymentIntent::retrieve($payment->transaction_id, ['stripe_account' => $stripeAccount]);\n\n if($payment_intent->status == 'requires_capture')\n {\n $payment_intent->capture();\n }\n\n if($payment_intent->status == 'succeeded')\n {\n $isDelivered = 1;\n\n // Update payment as captured\n Payment::where(['order_id' => $order->order_id])\n ->update(['status' => '1']);\n }\n } catch (\\Stripe\\Error\\Base $e) {\n # Display error on client\n $response = array('error' => $e->getMessage());\n\n return \\Redirect::back()->with($response);\n }\n }\n }\n }\n else\n {\n $isDelivered = 1;\n }\n\n // Check if order can get delivered\n if($isDelivered)\n {\n // Update order as delivered\n DB::table('orders')->where('customer_order_id', $orderID)->update([\n 'paid' => 1,\n ]);\n\n // \n if($order->delivery_type == '3')\n {\n $helper = new Helper();\n try {\n $message = 'orderDeliver';\n \n if($order->user_id != 0){ \n $recipients = [];\n if($order->user_type == 'customer'){\n $adminDetail = User::where('id' , $order->user_id)->first();\n\n if(isset($adminDetail->phone_number_prifix) && isset($adminDetail->phone_number)){\n $recipients = ['+'.$adminDetail->phone_number_prifix.$adminDetail->phone_number]; \n }\n }else{\n $adminDetail = Admin::where('id' , $order->user_id)->first();\n $recipients = ['+'.$adminDetail->mobile_phone];\n }\n\n if(isset($adminDetail->browser)){\n $pieces = explode(\" \", $adminDetail->browser);\n }else{\n $pieces[0] = ''; \n }\n\n if($pieces[0] == 'Safari'){\n //dd($recipients);\n $url = \"https://gatewayapi.com/rest/mtsms\";\n $api_token = \"BP4nmP86TGS102YYUxMrD_h8bL1Q2KilCzw0frq8TsOx4IsyxKmHuTY9zZaU17dL\";\n\n $message = \"Your order deliver please click on link \\n\".env('APP_URL').'deliver-notification/'.$orderID;\n\n $json = [\n 'sender' => 'Dastjar',\n 'message' => ''.$message.'',\n 'recipients' => [],\n ];\n foreach ($recipients as $msisdn) {\n $json['recipients'][] = ['msisdn' => $msisdn];}\n\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch,CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\"));\n curl_setopt($ch,CURLOPT_USERPWD, $api_token.\":\");\n curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($json));\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n }else{\n $result = $this->sendNotifaction($orderID , $message);\n }\n }\n } catch (Exception $e) {}\n }\n }\n }\n \n // \n return redirect()->action('AdminController@index');\n }", "public function process_paid_order( $order_id ) {\n\n\t\t$order = wc_get_order( $order_id );\n\n\t\tif ( ! $order ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Clear any calculated taxes from the session\n\t\tunset( WC()->session->avatax_result );\n\n\t\t// If tax was never calculated for the order (manually or at checkout), bail\n\t\tif ( ! SV_WC_Order_Compatibility::get_meta( $order, '_wc_avatax_tax_calculated' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Calculate the order taxes and send a document to Avalara\n\t\t$this->process_order( $order );\n\t}", "function wcfm_dokan_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n } else {\r\n \t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n }\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}", "public function markAsUnpaid() {\n $this->status = parent::STATUS_APPROVED_BY_USER;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }", "public function order_paid_callback()\n {\n\n $query = $this->db->get('paid_orders_cache');\n if ($query->num_rows() == 0)\n return FALSE;\n\n $paid = $query->result_array();\n $coin = $this->bw_config->currencies[0];\n\n $this->load->model('transaction_cache_model');\n $this->load->model('accounts_model');\n\n foreach ($paid as $record) {\n $order = $this->get($record['order_id']);\n $vendor_address = $order['vendor_payout'];\n $admin_address = BitcoinLib::public_key_to_address($order['public_keys']['admin']['public_key'], $coin['crypto_magic_byte']);\n\n // Create the transaction outputs\n $tx_outs = array($admin_address => (string)number_format(($order['fees'] + $order['extra_fees'] - 0.0001), 8),\n $vendor_address => (string)number_format(($order['price'] + $order['shipping_costs'] - $order['extra_fees']), 8));\n\n $create_spend_transaction = $this->create_spend_transaction($order['address'], $tx_outs, $order['redeemScript']);\n if ($create_spend_transaction == TRUE) {\n $next_progress = ($order['vendor_selected_escrow'] == '1') ? '4' : '3';\n $this->progress_order($order['id'], '2', $next_progress, array('paid_time' => time()));\n } else {\n //$this->log_model->\n }\n $this->transaction_cache_model->delete_finalized_record($order['id']);\n }\n }", "function wcfm_wcpvendors_order_mark_fulfilled() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}", "public function lockDeliveredOrder() {\n\n // auto debit unconfirmed order list if it has been delivered for over an hour\n $unconfirmedOrderList = Order::byStatus(Order::STATUS_DELIVERED)\n ->where(\n DB::raw(\"DATE_ADD(updated_at, INTERVAL 1 HOUR)\"),\n \"<=\",\n date(\"Y-m-d H:i:s\")\n )\n ->get();\n\n $affectedTravels = [];\n foreach ($unconfirmedOrderList as $order) {\n\n $order->status = Order::STATUS_RECEIVED;\n $order->save();\n\n $affectedTravels[$order->travel->id] = CourierTravelRecord::find($order->travel_id);\n\n Event::fire(new OrderReceived($order, User::find($order->user_id)));\n }\n\n foreach ($affectedTravels as $travel) {\n Event::fire(new TravelProfitChanged($travel));\n }\n\n $this->info(\"Order changed from delivered to received: \".\n count($unconfirmedOrderList) .\" item(s)\");\n\n }", "public function setPaid()\n {\n return $this->setMarkedAs($this->getPaidValue());\n }", "public function markOrderReceived() {\r\n global $wpdb;\r\n \r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n $postData = $_POST['data'];\r\n \r\n $decoded = json_decode($postData, true);\r\n \r\n if (isset($postData) && $postData) {\r\n $strRep = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \"\", stripslashes($postData));\r\n $data = json_decode($strRep, true);\r\n }\r\n \r\n //check if item exists\r\n try {\r\n $order = $client->get('orders/'.$data['order_id']);\r\n } catch (HttpClientException $e) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n if (!$order) {\r\n return new WP_REST_Response(['message' => \"No order found for such query!\"]);\r\n }\r\n \r\n $result = $wpdb->update(\r\n $wpdb->prefix . \"posts\", \r\n [ 'profaktura_status' => $data['profaktura_status'] ],\r\n [ 'ID' => $data['order_id'] ]\r\n );\r\n \r\n if (!$result) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n return new WP_REST_Response(['message' => \"Status succesfully updated!\"]);\r\n }", "function wcfm_mark_as_recived() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderitemid'] ) ) {\r\n $order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n //$comment_id = $order->add_order_note( sprintf( __( 'Item(s) <b>%s</b> received by customer.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) ), '1');\r\n \r\n // Keep Tracking URL as Order Item Meta\r\n\t\t\t$sql = \"INSERT INTO {$wpdb->prefix}woocommerce_order_itemmeta\";\r\n\t\t\t$sql .= ' ( `meta_key`, `meta_value`, `order_item_id` )';\r\n\t\t\t$sql .= ' VALUES ( %s, %s, %s )';\r\n\t\t\t\r\n\t\t\t$confirm_message = __( 'YES', 'wc-frontend-manager-ultimate' );\r\n\t\r\n\t\t\t$wpdb->get_var( $wpdb->prepare( $sql, 'wcfm_mark_as_recived', $confirm_message, $order_item_id ) );\r\n\t\t\t\r\n\t\t\t$vendor_id = $WCFM->wcfm_vendor_support->wcfm_get_vendor_id_from_product( $product_id );\r\n\t\t\t\r\n\t\t\t// WCfM Marketplace Table Update\r\n\t\t\tif( $vendor_id && (wcfm_is_marketplace() == 'wcfmmarketplace') ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET shipping_status = 'completed' WHERE order_id = $order_id and vendor_id = $vendor_id and item_id = $order_item_id\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Notification\r\n\t\t\t$wcfm_messages = sprintf( __( 'Customer marked <b>%s</b> received.', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ) );\r\n\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -1, 0, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t\r\n\t\t\t// Vendor Notification\r\n\t\t\tif( $vendor_id ) {\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( -2, $vendor_id, 0, 1, $wcfm_messages, 'shipment_received' );\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// WC Order Note\r\n\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_received', $order_id, $order_item_id, $product_id );\r\n }\r\n die;\r\n\t}", "function confirm(&$order)\n\t\t{\n\t\t\tif(pmpro_isLevelRecurring($order->membership_level))\n\t\t\t{\n\t\t\t\t$order->ProfileStartDate = date_i18n(\"Y-m-d\", strtotime(\"+ \" . $order->BillingFrequency . \" \" . $order->BillingPeriod, current_time(\"timestamp\"))) . \"T0:0:0\";\n\t\t\t\t$order->ProfileStartDate = apply_filters(\"pmpro_profile_start_date\", $order->ProfileStartDate, $order);\n\t\t\t\treturn $this->subscribe($order);\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn $this->charge($order);\n\t\t}", "public function checkout_done($order_id, $payment)\n {\n $order = Order::findOrFail($order_id);\n $order->payment_status = 'paid';\n $order->payment_details = $payment;\n $order->save();\n\n if (\\App\\Addon::where('unique_identifier', 'affiliate_system')->first() != null && \\App\\Addon::where('unique_identifier', 'affiliate_system')->first()->activated) {\n $affiliateController = new AffiliateController;\n $affiliateController->processAffiliatePoints($order);\n }\n\n if (\\App\\Addon::where('unique_identifier', 'club_point')->first() != null && \\App\\Addon::where('unique_identifier', 'club_point')->first()->activated) {\n $clubpointController = new ClubPointController;\n $clubpointController->processClubPoints($order);\n }\n if (\\App\\Addon::where('unique_identifier', 'seller_subscription')->first() == null || !\\App\\Addon::where('unique_identifier', 'seller_subscription')->first()->activated) {\n if (BusinessSetting::where('type', 'category_wise_commission')->first()->value != 1) {\n $commission_percentage = BusinessSetting::where('type', 'vendor_commission')->first()->value;\n foreach ($order->orderDetails as $key => $orderDetail) {\n $orderDetail->payment_status = 'paid';\n $orderDetail->save();\n if ($orderDetail->product->user->user_type == 'seller') {\n $seller = $orderDetail->product->user->seller;\n $seller->admin_to_pay = $seller->admin_to_pay + ($orderDetail->price * (100 - $commission_percentage)) / 100 + $orderDetail->tax + $orderDetail->shipping_cost;\n $seller->save();\n }\n }\n } else {\n foreach ($order->orderDetails as $key => $orderDetail) {\n $orderDetail->payment_status = 'paid';\n $orderDetail->save();\n if ($orderDetail->product->user->user_type == 'seller') {\n $commission_percentage = $orderDetail->product->category->commision_rate;\n $seller = $orderDetail->product->user->seller;\n $seller->admin_to_pay = $seller->admin_to_pay + ($orderDetail->price * (100 - $commission_percentage)) / 100 + $orderDetail->tax + $orderDetail->shipping_cost;\n $seller->save();\n }\n }\n }\n } else {\n foreach ($order->orderDetails as $key => $orderDetail) {\n $orderDetail->payment_status = 'paid';\n $orderDetail->save();\n if ($orderDetail->product->user->user_type == 'seller') {\n $seller = $orderDetail->product->user->seller;\n $seller->admin_to_pay = $seller->admin_to_pay + $orderDetail->price + $orderDetail->tax + $orderDetail->shipping_cost;\n $seller->save();\n }\n }\n }\n\n $order->commission_calculated = 1;\n $order->save();\n\n Session::put('cart', collect([]));\n // Session::forget('order_id');\n Session::forget('payment_type');\n Session::forget('delivery_info');\n Session::forget('coupon_id');\n Session::forget('coupon_discount');\n\n\n flash(translate('Payment completed'))->success();\n return view('frontend.order_confirmed', compact('order'));\n }", "public function updateOrderPaidTotal(Commerce_OrderModel $order)\n {\n $totalPaid = craft()->commerce_payments->getTotalPaidForOrder($order);\n\n $order->totalPaid = $totalPaid;\n\n if ($order->isPaid()) {\n if ($order->datePaid == null) {\n $order->datePaid = DateTimeHelper::currentTimeForDb();\n }\n }\n\n $this->saveOrder($order);\n\n if (!$order->dateOrdered) {\n if ($order->isPaid()) {\n craft()->commerce_orders->completeOrder($order);\n } else {\n // maybe not paid in full, but authorized enough to complete order.\n $totalAuthorized = craft()->commerce_payments->getTotalAuthorizedForOrder($order);\n if ($totalAuthorized >= $order->totalPrice) {\n craft()->commerce_orders->completeOrder($order);\n }\n }\n }\n }", "public function setupPayment($order){\r\n $response = array(\r\n 'success'=> false,\r\n 'msg'=> __('Payment failed!', ET_DOMAIN)\r\n );\r\n // write session\r\n et_write_session('order_id', $order->ID);\r\n et_write_session('processType', 'buy');\r\n $arg = apply_filters('ae_payment_links', array(\r\n 'return' => et_get_page_link('process-payment') ,\r\n 'cancel' => et_get_page_link('process-payment')\r\n ));\r\n /**\r\n * process payment\r\n */\r\n $paymentType_raw = $order->payment_type;\r\n $paymentType = strtoupper($order->payment_type);\r\n /**\r\n * factory create payment visitor\r\n */\r\n $order_data = array(\r\n 'payer' => $order->post_author,\r\n 'total' => '',\r\n 'status' => 'draft',\r\n 'payment' => $paymentType,\r\n 'paid_date' => '',\r\n 'post_parent' => $order->post_parent,\r\n 'ID'=> $order->ID,\r\n 'amount'=> $order->amount\r\n );\r\n $order_temp = new mJobOrder($order_data);\r\n $order_temp->add_product($order);\r\n $order = $order_temp;\r\n $visitor = AE_Payment_Factory::createPaymentVisitor($paymentType, $order, $paymentType_raw);\r\n // setup visitor setting\r\n $visitor->set_settings($arg);\r\n // accept visitor process payment\r\n $nvp = $order->accept($visitor);\r\n if ($nvp['ACK']) {\r\n $response = array(\r\n 'success' => $nvp['ACK'],\r\n 'data' => $nvp,\r\n 'paymentType' => $paymentType\r\n );\r\n } else {\r\n $response = array(\r\n 'success' => false,\r\n 'paymentType' => $paymentType,\r\n 'msg' => __(\"Invalid payment gateway!\", ET_DOMAIN)\r\n );\r\n }\r\n /**\r\n * filter $response send to client after process payment\r\n *\r\n * @param Array $response\r\n * @param String $paymentType The payment gateway user select\r\n * @param Array $order The order data\r\n *\r\n * @package AE Payment\r\n * @category payment\r\n *\r\n * @since 1.0\r\n * @author Dakachi\r\n */\r\n $response = apply_filters('mjob_setup_payment', $response, $paymentType, $order);\r\n return $response;\r\n }", "function payment_complete( $order ){\n\n if( $order->status == 'processing' ){\n\n $order->update_status( 'completed' );\n\n add_post_meta( $order->id, '_paid_date', current_time('mysql'), true );\n\n $this_order = array(\n 'ID' => $order->id,\n 'post_date' => current_time( 'mysql', 0 ),\n 'post_date_gmt' => current_time( 'mysql', 1 )\n );\n wp_update_post( $this_order );\n \n if ( apply_filters( 'woocommerce_payment_complete_reduce_order_stock', true, $order->id ) ) {\n $order->reduce_order_stock(); // Payment is complete so reduce stock levels\n }\n\n do_action( 'woocommerce_payment_complete', $order->id );\n }\n }", "function toPay()\r\n {\r\n try {\r\n $this->mKart->setPaidKart();\r\n }catch(Exception $e){\r\n $this->error->throwException('310', 'No s`ha pogut realitzar el pagament.', $e);\r\n }\r\n }", "protected function _registerPaymentSuccess()\n {\n $payment = $this->_order->getPayment();\n $payment->setTransactionId($this->getRequestData('transaction_id'))\n ->setPreparedMessage($this->_createNotifyComment(''))\n ->registerCaptureNotification($this->getRequestData('paid'));\n $this->_order->save();\n\n // notify customer\n $invoice = $payment->getCreatedInvoice();\n if ($invoice && !$this->_order->getEmailSent()) {\n $this->_order->sendNewOrderEmail()->addStatusHistoryComment(\n Mage::helper('payssion')->__('Notified customer about invoice #%s.', $invoice->getIncrementId())\n )\n ->setIsCustomerNotified(true)\n ->save();\n }\n }", "public function paymentSuccess()\n {\n $pay = Payment::latest()->first();\n $mollie = Mollie::api()->payments()->get($pay->molley_payment_id);\n\n if ($mollie->isPaid()) {\n $pay->status = 'paid'; \n $pay->save();\n \n $status = RegistrationManager::updateOrder($pay->order_id);\n \n Mail::to(auth()->user()->email)->send(new PaymentConfirmation($status)); \n \n session()->flash('success', 'Payment saved successfully.');\n \n return view('payments.status');\n } else {\n echo 'Payment Error';\n }\n }", "public function pay($order)\n {\n $order=Order::findOrFail($order);\n $totalValue=$order->order_price+$order->delivery_price;\n\n //GET THE KEY\n //System setup \n $access_token=config('mercadopago.access_token',\"\");\n\n //Setup based on vendor\n if(config('mercadopago.useVendor')){\n $access_token=$order->restorant->getConfig('mercadopago_access_token','');\n }\n\n // Agrega credenciales\n SDK::setAccessToken($access_token);\n\n \n \n // Crea un objeto de preferencia\n $preference = new Preference();\n\n // Crea un ítem en la preferencia\n $item = new Item();\n $item->title = 'Pedido #'.$order->id;\n $item->quantity = 1;\n $item->unit_price = $totalValue;\n $preference->items = array($item);\n $preference->external_reference=$order->id;\n\n $preference->back_urls = array(\n \"success\" => route('mercadopago.execute','success'),\n \"failure\" => route('mercadopago.execute','failure'),\n \"pending\" => route('mercadopago.execute','pending')\n );\n $preference->auto_return = \"approved\";\n\n\n $preference->save();\n\n //OR\n return redirect($preference->init_point);\n\n //OR\n // return view('mercadopago::pay',['preference_id'=>$preference->id,'order'=>$order]);\n }", "public function onCheckoutSubmitAllAfter(Varien_Event_Observer $observer)\n {\n /** @var Mage_Sales_Model_Order $order */\n $order = $observer->getEvent()->getOrder();\n\n if ($order->getPayment()->getMethodInstance() instanceof Quickpay_Payment_Model_Method_Abstract) {\n $payment = Mage::getSingleton('quickpaypayment/payment');\n\n $parameters = array(\n \"agreement_id\" => $payment->getConfigData(\"agreementid\"),\n \"amount\" => $order->getTotalDue() * 100,\n \"continueurl\" => $this->getSuccessUrl($order->getStore()),\n \"cancelurl\" => $this->getCancelUrl($order->getStore()),\n \"callbackurl\" => $this->getCallbackUrl($order->getStore()),\n \"language\" => $payment->calcLanguage(Mage::app()->getLocale()->getLocaleCode()),\n \"autocapture\" => 0,\n \"autofee\" => $payment->getConfigData('transactionfee'),\n \"payment_methods\" => $order->getPayment()->getMethodInstance()->getPaymentMethods(),\n \"google_analytics_tracking_id\" => $payment->getConfigData('googleanalyticstracking'),\n \"google_analytics_client_id\" => $payment->getConfigData('googleanalyticsclientid'),\n \"customer_email\" => $order->getCustomerEmail() ?: '',\n );\n\n $result = Mage::helper('quickpaypayment')->qpCreatePayment($order);\n $result = Mage::helper('quickpaypayment')->qpCreatePaymentLink($result->id, $parameters);\n\n $paymentUrl = $result->url;\n\n //Send payment link email to customer\n\n /** @var Mage_Core_Model_Email_Template $mailTemplate */\n $mailTemplate = Mage::getModel('core/email_template');\n\n $emailVars = array(\n 'increment_id' => $order->getIncrementId(),\n 'paymentlink' => $paymentUrl,\n );\n\n $mailTemplate->setDesignConfig(array(\n 'area' => 'frontend',\n 'store' => $order->getStoreId(),\n ));\n\n $mailTemplate->sendTransactional(\n 'quickpay_payment_link',\n 'sales',\n $order->getBillingAddress()->getEmail(),\n $order->getBillingAddress()->getFirstname() . ' ' . $order->getBillingAddress()->getLastname(),\n $emailVars,\n $order->getStoreId()\n );\n }\n\n }", "public function onCharge($order)\n {\n $this->statusCode = 'pending';\n $this->detail = 'pending response, token:' . $this->token;\n return parent::onCharge($order);\n }", "public function created(Order $order)\n {\n // get the service points cost\n// $serviceCost = $order->service->on_sale ? $order->service->sale_points : $order->service->points;\n // check if the current balance > service points cost\n// $userBalance = $order->client->balance->points;\n// if ($userBalance > $serviceCost && ($userBalance - $serviceCost > 0)) {\n $client = $order->client()->first();\n// $finalBalance = $userBalance - $serviceCost;\n// $client->balance()->first()->update(['points' => $finalBalance]);\n $order->update(['is_paid' => true]);\n // automatically create a job once order is paid\n $order->job()->create();\n $settings = Setting::first();\n return Mail::to($client->email)->cc($settings->info_email)->cc($settings->sales_email)->send(new OrderComplete($order, $client));\n\n// } else {\n// $order->update(['is_paid' => false, 'active' => false]);\n// }\n }", "function wcfm_wcfmmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET commission_status = 'shipped', shipping_status = 'shipped' WHERE order_id = $order_id and vendor_id = $user_id and item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}", "public static function send_renewal_order_email( $order_id ) {\n\t\tWC()->mailer();\n\n\t\tif ( wcs_order_contains_renewal( $order_id ) ) {\n\t\t\tdo_action( current_filter() . '_renewal_notification', $order_id );\n\t\t}\n\t}", "function action_woocommerce_send_sms_order_pending($order_id) {\n // $log = new WC_Logger();\n // if(get_qt_options( 'enable_sms_completed_order' ) && get_qt_options( 'enable_sms_completed_order' ) == \"on\") {\n // $sms = new SMS_Sender();\n // $message = $sms->generateMessage( get_qt_options('sms_completed_order_pattern'), 'order', $order_id );\n // $response = $sms->sendSMS( $message );\n // $log->log( 'action_woocommerce_send_sms_order_pending', print_r( $response, true ) );\n // }\n}", "private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }", "function email_instructions( $order, $sent_to_admin ) {\n\n\t\t\tif ( $sent_to_admin ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( $order->status !== 'on-hold' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( $order->payment_method !== 'esewa' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( $description = $this->get_description() ) {\n\t\t\t\techo wpautop( wptexturize( $description ) );\n\t\t\t}\n\t\t}", "function setOrderPaid($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function payAction()\n {\n $session = Mage::getSingleton('checkout/session');\n $session->setSinapayPaymentQuoteId($session->getQuoteId());\n\n $order = $this->getOrder();\n\n if (!$order->getId())\n {\n $this->norouteAction();\n return;\n }\n\n $order->addStatusToHistory(\n $order->getStatus(),\n Mage::helper('sinapay')->__('Customer was redirected to payment center')\n );\n $order->save();\n\n \n $this->loadLayout();\n $this->renderLayout();\n }", "public function trigger( $order ) {\n\n\t\tif ( ! $order instanceof WC_Order ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->object = $order;\n\t\t$this->recipient = $this->object->get_billing_email();\n\n\t\tif ( ! $this->is_enabled() || ! $this->get_recipient() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );\n\n\t}", "private function PayForOrder()\n\t{\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn() && !isset($_SESSION['CHECKOUT']['CREATE_ACCOUNT'])) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".GetConfig('ShopPath').'/checkout.php');\n\t\t\texit;\n\t\t}\n\n\t\tif (GetConfig('EnableOrderTermsAndConditions')==1 && !isset($_POST['AgreeTermsAndConditions'])) {\n\t\t\t@ob_end_clean();\n\t\t\t$_SESSION['REDIRECT_TO_CONFIRMATION_MSG'] = GetLang('TickArgeeTermsAndConditions');\n\t\t\theader(\"Location: \".$GLOBALS['ShopPath'].\"/checkout.php?action=confirm_order\");\n\t\t\texit;\n\t\t}\n\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t// Customer actually chose to apply a gift certificate or coupon code to this order so\n\t\t// we actually show the confirm order page again which does all of the magic.\n\t\tif (isset($_REQUEST['apply_code'])) {\n\t\t\t$this->ConfirmOrder();\n\t\t\treturn;\n\t\t}\n\n\t\t// Attempt to create the pending order with the selected details\n\t\t$pendingResult = $this->SavePendingOrder();\n\n\t\t// There was a problem creating the pending order\n\t\tif(!is_array($pendingResult)) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPath'].\"/checkout.php?action=confirm_order\");\n\t\t\texit;\n\t\t}\n\n\t\t// There was a problem creating the pending order but we have an actual error message\n\t\tif(isset($pendingResult['error'])) {\n\t\t\tif(isset($pendingResult['errorDetails'])) {\n\t\t\t\t$this->BadOrder('', $pendingResult['error'], $pendingResult['errorDetails']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->BadOrder('', $pendingResult['error']);\n\t\t\t}\n\t\t}\n\n\t\t// We've been told all we need to do is redirect to the finish order page, so do that\n\t\tif(isset($pendingResult['redirectToFinishOrder']) && $pendingResult['redirectToFinishOrder']) {\n\t\t\t@ob_end_clean();\n\t\t\theader(\"Location: \".$GLOBALS['ShopPath'].\"/finishorder.php\");\n\t\t\tdie();\n\t\t}\n\n\t\t// Otherwise, the gateway want's to do something\n\t\tif(!empty($pendingResult['provider']) && ($pendingResult['provider']->GetPaymentType() == PAYMENT_PROVIDER_ONLINE || method_exists($pendingResult['provider'], \"ShowPaymentForm\"))) {\n\t\t\t// ProviderListHTML is stored in the session when the provider requires that it can only be the only payment provider during checkout, disable the other checkout method.\n\t\t\tif(isset($_SESSION['CHECKOUT']['ProviderListHTML']) && method_exists($pendingResult['provider'], 'DoExpressCheckoutPayment')) {\n\t\t\t\t$pendingResult['provider']->DoExpressCheckoutPayment();\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\t// If we have a payment form to show then show that\n\t\t\tif(isset($pendingResult['showPaymentForm']) && $pendingResult['showPaymentForm']) {\n\t\t\t\t$this->ShowPaymentForm($pendingResult['provider']);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$pendingResult['provider']->TransferToProvider();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// It's an offline payment method, no need to accept payment now\n\t\t\tif(!empty($pendingResult['provider']))\n\t\t\t\t$providerId = $pendingResult['provider']->GetId();\n\t\t\telse\n\t\t\t\t$providerId = '';\n\n\t\t\t@ob_end_clean();\n\t\t\theader(sprintf(\"Location:%s/finishorder.php?provider=%s\", $GLOBALS['ShopPath'], $providerId));\n\t\t\tdie();\n\t\t}\n\t}", "public function asPaid()\n {\n return $this->markAs($this->getPaidValue());\n }", "public function process_payment( $order_id ) {\n $order = wc_get_order( $order_id );\n\n // Mark as on-hold (we're awaiting the payment)\n $order->update_status( $this->order_status, $this->status_text );\n\n // Reduce stock levels\n wc_reduce_stock_levels( $order->get_id() );\n\n // Remove cart\n WC()->cart->empty_cart();\n\n // Return thankyou redirect\n return array(\n 'result' => 'success',\n 'redirect' => $this->get_return_url( $order )\n );\n }", "private function isPaidInStore($orderStatus){\r\n return $orderStatus == 'completed';\r\n }", "public function processPayment($order)\n {\n $shipping = sprintf('%0.2f', 0);\n // Add any tax amount if you want to apply any tax rule\n $tax = sprintf('%0.2f', 0);\n\n // Create a new instance of Payer class\n $payer = new Payer();\n $payer->setPaymentMethod(\"paypal\");\n\n // Adding items to the list\n $items = array();\n foreach ($order->items as $item) {\n $orderItems[$item->order_item_id] = new Item();\n $orderItems[$item->order_item_id]->setName($item->film->film_name)\n ->setCurrency(config('settings.currency_code'))\n ->setQuantity($item->order_item_quantity)\n ->setPrice(sprintf('%0.2f', $item->order_item_price));\n\n array_push($items, $orderItems[$item->order_item_id]);\n }\n\n $itemList = new ItemList();\n $itemList->setItems($items);\n\n // Setting Shipping Details\n $details = new Details();\n $details->setShipping($shipping)\n ->setTax($tax)\n ->setSubtotal(sprintf('%0.2f', $order->order_grand_total));\n\n // Setup currency payment\n // Create chargeable amout\n $amount = new Amount();\n $amount->setCurrency(config('settings.currency_code'))\n ->setTotal(sprintf('%0.2f', $order->order_grand_total))\n ->setDetails($details);\n\n\n // Creating a transaction\n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($itemList)\n ->setDescription($order->user->full_name)\n ->setInvoiceNumber($order->order_number);\n\n // This class takes two values, return URL (after successful completion where PayPal will redirect the user) and the cancel URL (if the user cancels the payment where he should be redirected).\n // Setting up redirection urls\n $redirectUrls = new RedirectUrls();\n $redirectUrls->setReturnUrl(route('checkout.payment.complete'))\n ->setCancelUrl(route('booking.book_tickets_post'));\n\n // Creating payment instance\n $payment = new Payment();\n $payment->setIntent(\"sale\")\n ->setPayer($payer)\n ->setRedirectUrls($redirectUrls)\n ->setTransactions(array($transaction));\n\n try {\n\n $payment->create($this->payPal);\n } catch (PayPalConnectionException $exception) {\n echo $exception->getCode(); // Prints the Error Code\n echo $exception->getData(); // Prints the detailed error message\n exit(1);\n } catch (Exception $e) {\n echo $e->getMessage();\n exit(1);\n }\n\n $approvalUrl = $payment->getApprovalLink();\n\n header(\"Location: {$approvalUrl}\");\n exit;\n }", "function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}", "public function store(Request $request)\n { \n $order = Order::findorfail($request->order);\n if ($order->payment!=null) {\n return response()->json(['msg'=>'Order seems to have a pending payment'],404);\n }\n $amount=$request->amount;\n $pnb = ltrim(auth()->user()->phone_number, '0');\n $msisdn='254'.$pnb; \n $TransactionDesc='OrderPayment';\n $initiate_transaction = new Mpesa;\n $response = $initiate_transaction->sendSTKPush($amount, $msisdn, $TransactionDesc, auth()->user()->phone_number);\n\n\n $order->payment()->create([\n 'code' => $order->id.'_'.$request->amount.'_'.auth()->user()->phone_number,\n 'amount' => $order->totalPrice,\n ]); \n\n $order->update([\n 'amount_received' => $request->amount,\n 'status'=>'Paid, Awaiting Confirmation'\n ]);\n\n //send the customer an email notification\n\n return $response;\n }", "public function isPaid()\n {\n return $this->status === self::STATUS_APPROVED;\n }", "public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n /** @var \\Magento\\Sales\\Model\\Order $order */\n $order = $observer->getEvent()->getOrder();\n $payment = $order->getPayment();\n if ($payment->getMethod() == Directpost::METHOD_CODE) {\n $order->setState('pending');\n $order->setStatus('pending');\n }\n }", "public function updateOrder($order)\n { \n event(new UpdateOrderNotification([\n 'id' => $order->id,\n 'status' => $order->status,\n ]));\n }", "public function onBeforeWrite() {\n parent::onBeforeWrite();\n\n // See if this order was just marked paid, if so reduce quantities for\n // items.\n if($this->isChanged(\"Status\") && $this->Status == \"paid\") {\n foreach($this->Items() as $item) {\n $product = $item->MatchProduct;\n\n if($product->ID && $product->Quantity) {\n $new_qty = $product->Quantity - $item->Quantity;\n $product->Quantity = ($new_qty > 0) ? $new_qty : 0;\n $product->write();\n }\n }\n }\n }", "public function isPaid(){\n return $this->status == \"SUCCESS\";\n }", "public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }", "function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}", "public function salesOrderInvoiceSaveAfter($observer)\n {\n\n // Get the settings\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $arr = $settings['order_status'];\n $a = explode(',', $settings['order_status']);\n $b = explode(',', $settings['order_status']);\n $final_array = array_combine($a, $b);\n\n $text = Mage::getStoreConfig('smsnotifications/invoice_notification/message');\n // If no invoice notification has been specified, no notification can be sent\n if (!$text) {\n return;\n }\n\n $order = $observer->getEvent()->getInvoice()->getOrder();\n $order_id = $order->getIncrementId();\n\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $invoiceId = $invoice->getIncrementId();\n\n $store_name = Mage::app()->getStore()->getFrontendName();\n\n $billingAdress = $order->getBillingAddress();\n $shippingAdress = $order->getShippingAddress();\n\n if ($order->getCustomerFirstname()) {\n $customer_name = $order->getCustomerFirstname();\n $customer_name .= ' '.$order->getCustomerLastname();\n } elseif ($billingAdress->getFirstname()) {\n $customer_name = $billingAdress->getFirstname();\n $customer_name .= ' '.$billingAdress->getLastname();\n } else {\n $customer_name = $shippingAdress->getFirstname();\n $customer_name .= ' '.$shippingAdress->getLastname();\n }\n\n $order_amount = $order->getBaseCurrencyCode();\n $order_amount .= ' '.$order->getBaseGrandTotal();\n\n $telephoneNumber = trim($shippingAdress->getTelephone());\n\n // Check if a telephone number has been specified\n if(in_array('invoice', $final_array)){\n if ($telephoneNumber) {\n $text = Mage::getStoreConfig('smsnotifications/invoice_notification/message');\n $text = $settings['invoice_notification_message'];\n $text = str_replace('{{name}}', $customer_name, $text);\n $text = str_replace('{{order}}', $order_id, $text);\n $text = str_replace('{{amount}}', $order_amount, $text);\n $text = str_replace('{{invoiceno}}', $invoiceId, $text);\n\n array_push($settings['order_noficication_recipients'], $telephoneNumber );\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n if ($result) {\n $recipients_string = implode(',', $settings['order_noficication_recipients']);\n Mage::getSingleton('adminhtml/session')->addSuccess(sprintf('The invoice notification has been sent via SMS to: %s', $recipients_string));\n } else {\n Mage::getSingleton('adminhtml/session')->addError('There has been an error sending the invoice notification SMS.');\n }\n }\n }\n}", "public function payOrder($order_id, $success)\n\t{\n\t\t$order = $this\n\t\t\t->orderRepository\n\t\t\t->find($order_id);\n\n\t\t$url = $this->router->generate('best365_store_order_list_error');\n\t\t$valid = 0;\n\n\t\tif (!empty($order)) {\n\t\t\tif ($order->getPaymentStateLineStack()->getLastStateLine()->getName() == \"unpaid\" && $success) {\n\t\t\t\t// update payment status\n\t\t\t\t$stateLineStack = $this\n\t\t\t\t\t->machineManager\n\t\t\t\t\t->transition(\n\t\t\t\t\t\t$order,\n\t\t\t\t\t\t$order->getPaymentStateLineStack(),\n\t\t\t\t\t\t\"pay\",\n\t\t\t\t\t\t''\n\t\t\t\t\t);\n\t\t\t\t$order->setPaymentStateLineStack($stateLineStack);\n\n\t\t\t\t$this->orderObjectManager->persist($order);\n\t\t\t\t$this->orderObjectManager->flush();\n\n\t\t\t\t// set order valid\n\t\t\t\t$valid = 1;\n\n\t\t\t\t// add points\n\t\t\t\t$currency = $this\n\t\t\t\t\t->currencyWrapper\n\t\t\t\t\t->get();\n\t\t\t\t$nzd = $this\n\t\t\t\t\t->currencyConverter\n\t\t\t\t\t->convertMoney(\n\t\t\t\t\t\t$order->getPurchasableAmount(),\n\t\t\t\t\t\t$currency\n\t\t\t\t\t);\n\t\t\t\t$points = floor($nzd->getAmount() / 100 * 10);\n\n\t\t\t\t// add points to customer\n\t\t\t\t$this->best365CustomerManager->updatePoints($order->getCustomer(), $points);\n\t\t\t\t$url = $this->router->generate('best365_store_order_thanks', array('id' => $order_id));\n\t\t\t} elseif ($order->getPaymentStateLineStack()->getLastStateLine()->getName() == \"paid\") {\n\t\t\t\t$url = $this->router->generate('best365_store_order_thanks', array('id' => $order_id));\n\t\t\t}\n\t\t}\n\t\t$this->updateExtRecord($order, '', $valid);\n\n\t\treturn $url;\n\t}", "function bill_transition_placed_pending($billorid) {\n global $CFG, $SITE, $USER, $DB, $OUTPUT;\n\n $config = get_config('local_shop');\n\n /*\n * Scenario :\n * - the order is being payed offline.\n * - the operator needs to sold out manually the bill and realize all billitems production.\n */\n\n if (is_object($billorid)) {\n $bill = $billorid;\n } else {\n $bill = new Bill($billid);\n }\n\n if ($bill) {\n\n include_once($CFG->dirroot.'/local/shop/datahandling/production.php');\n\n $productiondata = produce_prepay($bill);\n shop_aggregate_production($bill, $productiondata, true);\n\n echo $OUTPUT->box_start();\n echo $productiondata->salesadmin;\n echo $OUTPUT->box_end();\n\n // Now notify user the order and all products have been activated.\n if (!empty($productiondata->private)) {\n\n // Notify end user.\n $billurl = new moodle_url('/local/shop/front/order.popup.php', array('billid' => $bill->id, 'transid' => $bill->transactionid));\n $customeruser = $DB->get_record('user', array('id' => $bill->customer->hasaccount));\n $ticket = ticket_generate($customeruser, 'delegated access', $billurl);\n\n // Feedback customer with mail confirmation.\n $vars = array('SERVER' => $SITE->shortname,\n 'SERVER_URL' => $CFG->wwwroot,\n 'SELLER' => $config->sellername,\n 'FIRSTNAME' => $bill->customer->firstname,\n 'LASTNAME' => $bill->customer->lastname,\n 'MAIL' => $bill->customer->email,\n 'CITY' => $bill->customer->city,\n 'COUNTRY' => $bill->customer->country,\n 'ITEMS' => count($bill->billItems),\n 'PAYMODE' => get_string($bill->paymode, 'local_shop'),\n 'AMOUNT' => $bill->amount,\n 'TICKET' => $ticket);\n $notification = shop_compile_mail_template('sales_feedback', $vars, '');\n $params = array('shopid' => $bill->shopid, 'view' => 'bill', 'billid' => $bill->id, 'transid' => $bill->transactionid);\n $customerbillviewurl = new moodle_url('/local/shop/front/view.php', $params);\n $seller = new StdClass;\n $seller->firstname = $config->sellername;\n $seller->lastname = '';\n $seller->email = $config->sellermail;\n $seller->maildisplay = 1;\n $title = $SITE->shortname.' : '.get_string('yourorder', 'local_shop');\n $sentnotification = str_replace('<%%PRODUCTION_DATA%%>', $productiondata->private, $notification);\n ticket_notify($customeruser, $seller, $title, $sentnotification, $sentnotification, $customerbillviewurl);\n }\n\n $message = \"[{$bill->transactionid}] Bill Controller :\";\n $message .= \" Delayed Transaction Activating Operations on seller behalf by $USER->username\";\n shop_trace($message);\n $bill->status = 'PENDING';\n $bill->save(true);\n } else {\n shop_trace(\"[ERROR] Transition error : Bad bill ID $billid\");\n }\n}", "public function paid() : bool\n {\n if (!Di::getDefault()->get('app')->subscriptionBased()) {\n return true;\n }\n\n return (bool) $this->paid;\n }", "public function sendOrder(Mage_Sales_Model_Order $order)\n {\n try{\n\t\t\t$this->_eventType = 'placeOrder';\n\t\t\t$amount\t\t= number_format($order->getGrandTotal(),2);\n\t\t\t$samount\t= number_format($order->getSubtotal(),2);\n\t\t\t$tax \t\t= number_format($order->getBaseTaxAmount(),2);\n\t\t\t$shipping \t= number_format($order->getBaseShippingAmount(),2);\n\t\t\t$discounts \t= number_format($order->getDiscountAmount(),2);\n\t\t\t$shippingAddressData \t= $order->getShippingAddress()->getData();\n\t\t\t$billingAddressData \t= $order->getBillingAddress()->getData();\n\t\t\t$shippingMethod \t \t= $order->_data[\"shipping_description\"];\n\t\t\t$paymentMethod \t \t \t= $order->getPayment()->getMethodInstance()->getTitle();\n\t\t\t$customerId \t\t\t= $order->getCustomerId();\n\t\t\t$websiteId \t\t\t\t= 1;\n\t\t\t$balanceModel \t\t\t= Mage::getModel('enterprise_customerbalance/balance')\n\t\t \t\t\t\t \t->setCustomerId($customerId)\n\t\t \t\t\t\t \t->setWebsiteId($websiteId)\n\t\t \t\t\t\t\t->loadByCustomer();\t\n\t\t $storeCredit\t\t\t= ($balanceModel->getId())? number_format($balanceModel->getAmount(),2) :'0' ; \t\t\t\t\t\t\n $data = array(\n 'email' => $order->getCustomerEmail(),\n 'items' => $this->_getItems($order->getAllVisibleItems()),\n 'adjustments' => $this->_getAdjustments($order),\n 'message_id' => $this->getMessageId(),\n 'send_template' => 'Purchase Receipt',\n 'tenders' => $this->_getTenders($order),\n 'vars'\t=> array ( 'order#'=> $order->getIncrementId(),\n\t\t\t\t\t\t\t\t\t'subtotal'=> $samount,\n\t\t\t\t\t\t\t\t\t'shipping_and_handling'=> $shipping,\n\t\t\t\t\t\t\t\t\t'sale_tax'=> $tax,\n\t\t\t\t\t\t\t\t\t'billing_address'=> $shippingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_address'=> $billingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_method'=> $shippingMethod,\n\t\t\t\t\t\t\t\t\t'payment_method'=> $paymentMethod,\n\t\t\t\t\t\t\t\t\t'store_credit' => $storeCredit\n\t\t\t ),\n \t);\n /**\n * Send order data to purchase API\n */\n $responsePurchase = $this->apiPost('purchase', $data);\n\t\t\t\n\t\t\t/****Update product sku in following items for price alert****/\n $productSku = array();\n\t\t\tforeach ($order->getAllVisibleItems() as $item) {\n\t\t\t\tif($item->getProductType() == 'configurable') {\n\t\t\t\t\t$productSku[] = $item->getProduct()->getData('sku');\n\t\t\t\t}\n\t\t\t}\n $sailthru_userdata = $this->apiGet('user', array('id' => $order->getCustomerEmail()));\n\t\t\tif(isset($sailthru_userdata['vars']['following_items']) && $productSku) {\n\t\t\t\t$sailthru_followingItems = $sailthru_userdata['vars']['following_items'];\n\t\t\t\t$sailthru_followingItems = array_values($sailthru_followingItems);\n\t\t\t\t$sailthru_followingItems = array_diff($sailthru_followingItems,$productSku);\n\t\t\t\t$sailthru_followingItems = array_unique($sailthru_followingItems);\n\t\t\t\t$data = array(\n\t\t\t\t\t\t\"id\" => $order->getCustomerEmail(),\n\t\t\t\t\t\t\"vars\" => array(\"following_items\" => $sailthru_followingItems)\n\t\t\t\t\t\t);\n\t\t\t\t$response = $this->apiPost('user', $data);\n\t\t\t}\n /*************************************************/\n\t\t\t\n /**\n * Send customer data to user API\n */\n //$responseUser = Mage::getModel('sailthruemail/client_user')->sendCustomerData($customer);\n }catch (Exception $e) {\n Mage::logException($e);\n return false;\n }\n }", "public function postMarkPaymentReceived(Request $request, $order_id)\n {\n $order = Order::scope()->findOrFail($order_id);\n\n $order->is_payment_received = 1;\n $order->order_status_id = 1;\n\n $order->save();\n\n session()->flash('message', trans(\"Controllers.order_payment_status_successfully_updated\"));\n\n return response()->json([\n 'status' => 'success',\n ]);\n }", "public function isPaid()\n {\n return $this->getStatus() === OpenNode_Bitcoin_Model_Bitcoin::OPENNODE_STATUS_PAID;\n }", "public function creating(Order $order): void\n\t{\n\t\tif (auth()->check()) {\n\t\t\t$order->client_id = auth()->id();\n\t\t}\n\t\t// If a booster has been selected for the order, set its status to progress, otherwise pending\n\t\t(bool) $order->booster_id ? $order->status = 'progress' : 'pending';\n\t}", "public function display_order_paid()\n\t{\n\t\tif ($this->checkLogin('A') == '') {\n\t\t\tredirect('admin');\n\t\t} else {\n\t\t\t$this->data['heading'] = 'Successful payment list';\n\t\t\t$rep_code = ltrim($this->session->userdata('fc_session_admin_rep_code'), '0');\n\t\t\tif ($rep_code != '') {\n\t\t\t\t$condition = ' and h.rep_code=\"' . $rep_code . '\"';\n\t\t\t} else {\n\t\t\t\t$condition = '';\n\t\t\t}\n\t\t\t$this->data['orderList'] = $this->order_model->view_order_details('Paid', $condition, $rep_code);\n\t\t\t$this->load->view('admin/order/display_orders', $this->data);\n\t\t}\n\t}", "function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }", "function paid_sendEmail_owner($details) {\n\t\t\t\t$currencycode = $details->currCode;\n\t\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\n\t\t\t\t$sendto = $this->ownerEmail($details->module, $details->itemid);\n\t\t\t\t$sitetitle = \"\";\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"<h4><b>Booking Paid Successfully</b></h4>\";\n\t\t\t\t$message .= \"Invoice No.: \" . $invoiceid . \".<br>\";\n\t\t\t\t//$message .= \"Payment Method: \" . $paymethod . \".<br><br>\";\n\t\t\t\t$message .= \"Deposit Amount: \" . $currencycode . \" \" . $currencysign . $deposit . \"<br>\";\n\t\t\t\t$message .= \"Total Amount: \" . $currencycode . \" \" . $currencysign . $totalamount . \"<br><br>\";\n\t\t\t\t$message .= \"<h4><b>Customer Information</b></h4>\";\n\t\t\t\t$message .= \"Customer ID: \" . $custid . \"<br>\";\n\t\t\t\t$message .= \"Name : \" . $name . \"<br>\";\n\t\t\t\t$message .= \"Email : \" . $custemail . \"<br>\";\n\t\t\t\t$message .= \"Country : \" . $country . \"<br>\";\n\t\t\t\t$message .= \"Phone : \" . $phone . \"<br>\";\n\t\t\t\t$message .= \"<br> To view Invoice <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public static function wc_pos_woo_on_thankyou($order_id)\n {\n $register = get_post_meta($order_id,'wc_pos_id_register', true);\n if(!empty($register))\n $register = WC_Pos_Registers::instance()->get_data($register);\n\n if(!is_array($register)){\n self::instance()->wc_pos_print_web_order_summary($order_id);\n return;\n }\n\n $receipt = WC_Pos_Receipts::instance()->get_data(isset($register[0]['detail']['receipt_template']) ? $register[0]['detail']['receipt_template'] : \"\");\n $is_html = $receipt[0]['print_by_pos_printer'] == \"html\";\n\n $selectedPrinter = isset($register[0]['settings']['receipt_printer']) ? $register[0]['settings']['receipt_printer'] : \"\";\n if(empty($selectedPrinter)){\n $printerList = WC_POS_CPI()->star_cloudprnt_get_printer_list();\n if (!empty($printerList))\n {\n foreach ($printerList as $printer)\n {\n if (get_option('wc_pos_selected_printer') == $printer['printerMAC'])\n {\n $selectedPrinter = $printer['printerMAC'];\n break;\n }\n }\n if ($selectedPrinter === \"\" && count($printerList) === 1) $selectedPrinter = $printer['printerMAC'];\n }\n }\n\n if ($selectedPrinter !== \"\"){\n if($is_html){\n self::instance()->wc_pos_print_html_order_summary($selectedPrinter, $order_id, $register);\n }else{\n $file = STAR_CLOUDPRNT_PRINTER_PENDING_SAVE_PATH.WC_POS_CPI()->star_cloudprnt_get_os_path(\"/order_\".$order_id.\"_\".time().\".bin\");\n self::instance()->wc_pos_print_order_summary($selectedPrinter, $file, $order_id, $register);\n }\n };\n }", "public function sellerConfirm() {\n\t\tLog::info ( 'Seller has confirmed the payment:' . $this->user_pk, array (\n\t\t\t\t'c' => '1' \n\t\t) );\n\t\tif (isset ( $_POST ['time'] ) && $_POST ['time'] != '') {\n\t\t\t$timePeriod = $_POST ['time'];\n\t\t\t$subscriptionStartsAt = date ( 'Y-m-d H:i:s' );\n\t\t\t$subscriptionEndsAt = '';\n\t\t\t\n\t\t\tif ($timePeriod == 'quarterPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+3 months' ) );\n\t\t\t} else if ($timePeriod == 'halfannualPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+6 months' ) );\n\t\t\t} else if ($timePeriod == 'annualPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+1 years' ) );\n\t\t\t} else if ($timePeriod == 'phantomPeriod') {\n\t\t\t\t$subscriptionEndsAt = date ( 'Y-m-d H:i:s', strtotime ( '+5 years' ) );\n\t\t\t} else if ($timePeriod == 'freeTrail') {\n\t\t\t\t$subscriptionEndsAt = date(\"2016-12-31 00:00:00\");\n\t\t\t}\n\t\t\t\n\t\t\t$userRecord = \\DB::table ( 'users' )->where ( 'id', '=', $this->user_pk )->first ();\n\t\t\t$is_business = $userRecord->is_business;\n\t\t\t\n\t\t\t// add subscription start and end date to seller\n\t\t\t$subscription = ThankyouController::addSubscription ( $subscriptionStartsAt, $subscriptionEndsAt, $is_business );\n\t\tif($subscription==1){\n\t\t\tCommonComponent::activityLog ( \"SELLER_CONFIRM_PAYMENT\", SELLER_CONFIRM_PAYMENT, 0, HTTP_REFERRER, CURRENT_URL );\n\t\t\t$stored_uid = $this->user_pk;\n\t\t\t\t\n\t\t\ttry{\n\t\t\t\tif(isset(Auth::User()->lkp_role_id) && (Auth::User()->lkp_role_id == '1')){\n\t\t\t\t\t\n\t\t\t\t\tDB::table ( 'users' )->where ( 'id', $this->user_pk )->update ( array (\n\t\t\t\t\t'is_active' => 1,\n\t\t\t\t\t'is_confirmed' => 1,\n\t\t\t\t\t'is_approved' => 1,\n\t\t\t\t\t'secondary_role_id'=>'2',\n\t\t\t\t\t'is_buyer_paid'=>1,\n\t\t\t\t\t'mail_sent' => 1\n\t\t\t\t\t) );\n\t\t\t\t\tSession::put('last_login_role_id','2');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\tDB::table ( 'users' )->where ( 'id', $this->user_pk )->update ( array (\n\t\t\t'lkp_role_id' => 2,\n\t\t\t'is_active' => 1,\n\t\t\t'is_confirmed' => 1,\n\t\t\t'is_approved' => 1,\n\t\t\t'is_buyer_paid'=>1,\n\t\t\t'mail_sent' => 1\n\t\t\t) );\n\t\t\t\t}\n\t\t\t}catch(Exception $ex){\n\t\t\t}\n\t\t\t// Information email to seller after payment\n\t\t\t\t\n\t\t\t$userData = DB::table ( 'users' )->where ( 'id', $this->user_pk )->select ( 'users.*' )->get ();\n\t\t\t\t\n\t\t\tCommonComponent::send_email ( SELLER_PAYMENT_INFO_MAIL, $userData );\n\t\t\t\n\t\t}\n\t\t\t\n\t\t}\n\t}", "function afterPaypalNotification($txnId){\r\n //for example, you could now mark an order as paid, a subscription, or give the user premium access.\r\n //retrieve the transaction using the txnId passed and apply whatever logic your site needs.\r\n \r\n $transaction = ClassRegistry::init('PaypalIpn.InstantPaymentNotification')->findById($txnId);\r\n $this->log(\"transsaction: \" . $transaction['InstantPaymentNotification']['id'] . \r\n \" Order ID: \" . $transaction['InstantPaymentNotification']['custom'], 'paypal');\r\n\r\n //Tip: be sure to check the payment_status is complete because failure transactions \r\n // are also saved to your database for review.\r\n\r\n if($transaction['InstantPaymentNotification']['payment_status'] == 'Completed'){\r\n App::import('Model', 'Order');\r\n $thisOrder = new Order;\r\n $thisOrder->read(null, $transaction['InstantPaymentNotification']['custom']);\r\n\t\t\t$thisOrder->set(array('is_paid' => 1, 'status_id' =>TYPE_ORDER_PAID));\r\n\t\t\t$thisOrder->save();\r\n\r\n $thisOrder->unbindModel(array('belongsTo' => array('Status', 'Invoice')));\r\n\t\t$thisOrder->User->unbindModel(array(\r\n\t\t\t'hasAndBelongsToMany' => array('Group'),\r\n\t\t\t'hasMany' => array('Contact', 'Order'),\r\n\t\t\t'hasOne' => array('Supplier')\r\n\t\t));\r\n\t\t$thisOrder->hasAndBelongsToMany['Product']['fields'] = array('id', 'name', 'serial_no');\r\n\t\t$thisOrder->Product->unbindModel(array(\r\n\t\t\t\t'hasMany' => array('Media', 'Document', 'Feature'),\r\n\t\t\t\t'hasAndBelongsToMany' => array('Category', 'Type')\r\n\t\t));\r\n\t\t$thisOrder->Product->hasMany['Image']['conditions']['is_default'] = 1;\r\n\r\n\t\t$params = array(\r\n\t\t\t\t'conditions' => array(\r\n\t\t\t\t\t'Order.id' => $transaction['InstantPaymentNotification']['custom'],\r\n\t\t\t\t\t'Order.status_id' => TYPE_ORDER_PAID\r\n\t\t\t\t),\r\n\t\t\t\t'recursive' => 2\r\n\t\t);\r\n\t\tif ($order = $thisOrder->find('first', $params)) {\r\n\t\t\t$this->sendPaymentEmail($order);\r\n\t\t}\r\n }\r\n else {\r\n //Oh no, better look at this transaction to determine what to do; like email a decline letter.\r\n }\r\n }", "public function sendInvoice(Mage_Sales_Model_Order $order)\n {\n if($this->_logging){\n Mage::log('in sendInvoice', null, $this->_logfile);\n }\n $payment = $order->getPayment();\n $paymentInstance = $payment->getMethodInstance();\n $order->setActionFlag(Mage_Sales_Model_Order::ACTION_FLAG_INVOICE, true);\n // check if it is possible to invoice!\n if ($order->canInvoice()){\n if($this->_logging){\n Mage::log('sendInvoice sending invoice for '.$paymentInstance->getCode(), null, $this->_logfile);\n }\n try {\n // Initialize new magento invoice\n $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();\n // Set magento transaction id which returned from capayable\n $invoice->setTransactionId($payment->getLastTransId());\n // Allow payment capture and register new magento transaction\n $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);\n\n // TODO: get following to work\n //$invoice->addComment('U betaald via Achteraf betalen.', true, true);\n //$invoice->getOrder()->setCustomerNoteNotify(true);\n\n // Register invoice and apply it to order, order items etc.\n $invoice->register();\n\n $transaction = Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder());\n\n // Commit changes or rollback if error has occurred\n $transaction->save();\n\n /**\n * Register invoice with Capayable\n */\n $isApiInvoiceAccepted = $paymentInstance->processApiInvoice($invoice);\n if($this->_logging) {\n Mage::log('sendInvoice isApiInvoiceAccepted:', null, $this->_logfile);\n Mage::log($isApiInvoiceAccepted, null, $this->_logfile);\n }\n //if ($isApiInvoiceAccepted) {\n $invoice->getOrder()->setIsInProcess(true);\n $invoice->getOrder()->addStatusHistoryComment(\n 'Invoice created and email send', true\n );\n $invoice->sendEmail(true, '');\n $order->save();\n// } else {\n// $this->_getSession()->addError(Mage::helper('capayable')->__('Failed to send the invoice.'));\n// }\n } catch (Exception $e) {\n $this->_getSession()->addError($e->getMessage());\n Mage::logException($e);\n }\n } else {\n Mage::log('sendInvoice: could not send invoice, invoice already sent.', null, $this->_logfile);\n }\n }", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "public function update(Request $request, Order $order)\n {\n // dd($order);\n $order->status = $request->status;\n $order->save();\n\n if ($request->status == 1) {\n $details = [\n 'title' => 'Order Confirmed',\n 'customer_name' => $order->user->name,\n 'voucher_no' => $order->voucherno,\n 'order_date' => $order->orderdate,\n 'total' => $order->total,\n 'items' => $order->items\n ];\n } else {\n $details = [\n 'title' => 'Order Cancelled',\n 'customer_name' => $order->user->name\n ];\n }\n\n\n $receiver_email = $order->user->email;\n \\Mail::to($receiver_email)->send(new \\App\\Mail\\MyMail($details));\n\n return redirect()->route('order.index');\n }", "public static function clientBidRequestadmindnotice(User $user,Order $order)\n {\n\n $notification = new Notification;\n $notification->user_id = $user->id;\n $notification->order_id = $order->order_id;\n $notification->type = 'writer_bid_request';\n $notification->message ='New Client Bid request on order '.$order->order_no;\n\n $notification->save();\n\n Mail::queue('emails.bid_request',['user'=>$user, 'order'=>$order], function($m)use ($user, $order)\n {\n $m->from('[email protected]', 'ARA');\n\n $m->to($user->email, $user->first_name)->subject('You have a new Bid request on Order '.$order->order_no);\n\n });\n }", "public function process_payment( $order_id ) {\n\n $order = wc_get_order( $order_id );\n $order->update_meta_data( '_barter_price', $this->minterControll->getBarterPrice($order->get_total()) );\n $order->update_meta_data( '_barter_token', MinterController::getBarterTokenName());\n // Mark as on-hold (we're awaiting the payment)\n $order->update_status( MinterController::getUnpaidStatus(), __( 'Awaiting Barter', 'wc-gateway-barter' ) );\n //$order->add_meta_data('MinterPaySum',);\n // Reduce stock levels\n wc_reduce_stock_levels($order_id);\n\n // Remove cart\n WC()->cart->empty_cart();\n\n // Return thankyou redirect\n return array(\n 'result' \t=> 'success',\n 'redirect'\t=> $this->get_return_url( $order )\n );\n }", "public function payMaker(OrderEvent $event)\n {\n $order = $event->getOrder();\n\n // return here if maker has already been paid\n if ($order->isMakerPaid()) {\n return;\n }\n\n // pay if order has been shipped or is ready for pickup, or is delivered (useful for digital design orders)\n switch ($order->getStatus()) {\n case Order::STATUS_TRANSIT:\n case Order::STATUS_READY_FOR_PICKUP:\n case Order::STATUS_DELIVERED:\n $this->orderManager->payMaker($order);\n break;\n case Order::STATUS_MODEL_PAID:\n $this->orderManager->payMaker($order);\n break;\n }\n }", "public function testPaid()\n {\n $this->browse(function (Browser $browser) {\n $balance = Balance::factory()->create([\n 'tenant_id' => $this->tenant->id,\n 'type' => Balance::TYPE_DEBIT,\n 'status' => Balance::STATUS_DONE,\n 'amount' => 9000\n ]);\n\n $bill = Bill::factory()->create([\n 'contract_id' => $this->contract->id,\n 'requisite_id' => $this->requisite->id,\n 'tenant_id' => $this->tenant->id,\n ]);\n $service = $bill->services()->save(Service::factory()->make([\n 'name' => 'Rent',\n 'quantity' => '2',\n 'measure' => 'pc',\n 'price' => '1234'\n ]));\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'?tab=bills#tab')\n ->press('Оплатить')\n ->assertSee('Оплачен')\n ->visit('/tenants/'.$this->tenant->id.'?tab=balances#tab')\n ->assertSee('Кредит');\n });\n }", "public function onPayment()\n {\n $this->extend('onPayment');\n }", "public function setAsPaid($data) {\n if ( array_has($data, 'groupID') && array_has($data, 'pay-group') ) {\n foreach ( json_decode($data['pay-group']) as $pivot ) {\n $customer = (new GroupPivot)\n ->where('customerID', $pivot->id)\n ->where('groupID', $data['groupID'])\n ->first();\n $customer->status = 1;\n $customer->save();\n }\n // $group = Group::findOrFail($data['groupID']);\n // $group->pivot;\n // foreach ($group->pivot as $pivot) {\n // $this->sendReservationEmail($pivot->id, $data['groupID']);\n // }\n }\n }", "public function email($order, $type) {\r\n\r\n switch ($type) {\r\n case 'shipping_confirmation':\r\n if ($order['status'] == 'shipped' && !empty($order['shipping_tracking_number'])) {\r\n // Send Shipping Confirmation email to customer\r\n $templateId = config('custom.emails.templates.shipping_confirmation');\r\n\r\n if (!empty($order['user_id'])) {\r\n $user = $order->user;\r\n }\r\n\r\n $sub = [\r\n 'customer_name' => !empty($order['user_id']) ? $user['first_name'] : $order['billing_name'],\r\n 'order_number' => $order['order_number'],\r\n 'shipping_carrier' => !empty($order['shipping_carrier']) ? config('custom.checkout.shipping.carriers.' . $order['shipping_carrier'] . '.name') : '',\r\n 'shipping_plan' => !empty($order['shipping_plan']) ? config('custom.checkout.shipping.carriers.' . $order['shipping_carrier'] . '.plans.' . $order['shipping_plan'] . '.plan') : '',\r\n 'tracking_url' => 'https://tools.usps.com/go/TrackConfirmAction?tLabels=' . $order['shipping_tracking_number'],\r\n 'tracking_number' => $order['shipping_tracking_number'],\r\n 'delivery_address' => [\r\n 'name' => $order['delivery_name'],\r\n 'phone' => $order['delivery_phone'],\r\n 'address_1' => $order['delivery_address_1'],\r\n 'address_2' => $order['delivery_address_2'],\r\n 'city' => $order['delivery_city'],\r\n 'state' => $order['delivery_state'],\r\n 'zipcode' => $order['delivery_zipcode']\r\n ]\r\n ];\r\n\r\n foreach ($order->inventoryItems as $item) {\r\n $tmp = [\r\n 'name' => $item->product['name'],\r\n 'url' => route('shop.product', [$item->product['uri'], $item->product['id']]),\r\n 'unit_price' => number_format($item->pivot['price'], 2),\r\n 'quantity' => $item->pivot['quantity'],\r\n 'price' => number_format($item->pivot['price'] * $item->pivot['quantity'], 2)\r\n ];\r\n\r\n if ($item->options()->count() > 0) {\r\n $tmp['options'] = [];\r\n\r\n foreach ($item->options()->get() as $option) {\r\n $tmp['options'][] = [\r\n 'attribute' => $option->attribute['name'],\r\n 'value' => $option['name']\r\n ];\r\n }\r\n }\r\n\r\n if ($item->product->defaultPhoto()->count() > 0) {\r\n $tmp['image'] = CustomHelper::image($item->product->defaultPhoto['name'], true);\r\n }\r\n\r\n $sub['items'][] = $tmp;\r\n }\r\n\r\n $recipients = [\r\n [\r\n 'address' => !empty($order['contact_email']) ? $order['contact_email'] : $user['email'],\r\n 'name' => $sub['customer_name'],\r\n 'substitution_data' => $sub\r\n ]\r\n ];\r\n\r\n SparkPostHelper::sendTemplate($templateId, $recipients);\r\n\r\n return back()->with('alert-success', 'You have successfully sent a Shipping Confirmation email to the customer.');\r\n } else {\r\n return back()->with('alert-danger', 'You need to change the status to Shipped and add a Tracking Number first in order to send this Shipping Confirmation email to the customer.');\r\n }\r\n\r\n break;\r\n }\r\n }", "public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }", "public function update(Order $order)\n {\n if ($this->sgOrder->getUpdatePayment()) {\n $order->setIsPaid($this->sgOrder->getIsPaid());\n }\n\n if ($this->sgOrder->getUpdateShipping()) {\n $order->setIsShippingBlocked($this->sgOrder->getIsShippingBlocked());\n }\n }", "function action_woocommerce_send_sms_order_hold($order_id) {\n # code...\n}", "function receipt_page( $order ) {\n\t\techo '<p>'.__( 'Thank you for your order, please click the button below to pay with Veritrans.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_veritrans_form( $order );\n\t}", "function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "public function processPayment();", "public static function set_vendor_product_commission_paid( $vendor_id, $product_id, $order_id )\n\t{\n\t\tglobal $wpdb;\n\n\t\t$table_name = $wpdb->prefix . \"pv_commission\";\n\n\t\t$query = \"UPDATE `{$table_name}` SET `status` = 'paid' WHERE vendor_id = $vendor_id AND order_id = $order_id AND product_id = $product_id\";\n\t\t$result = $wpdb->query( $query );\n\n\t\treturn $result;\n\t}", "public function payments()\n {\n $users = User::where([['total_paid', '<', '110'],['active','1']])->get();\n foreach ($users as $user){\n Mail::to($user->email)->cc(['[email protected]','[email protected]'])->send(new OutStandingPayment($user));\n }\n\n }", "function setNewPaymentStatus($payment_status){\n\t\t$order = $this->getOrder();\n\t\t$payment_method = $order->getPaymentMethod();\n\t\t$current_order_status = $order->getOrderStatus();\n\t\t$current_status = $this->getPaymentStatus();\n\n\t\tmyAssert(is_null($current_status) || $current_status->getId()!=$payment_status->getId());\n\n\t\t$code = $payment_status->getCode(); // \"pending\", \"paid\"...\n\t\t\n\t\t$tr = [\n\t\t\t\"pending\" => \"waiting_for_online_payment\",\n\t\t\t\"paid\" => \"payment_accepted\",\n\t\t\t\"cancelled\" => \"payment_failed\",\n\t\t];\n\n\t\tif(isset($tr[$code]) && $payment_method->isOnlineMethod() && in_array($current_order_status->getCode(),['waiting_for_online_payment','payment_failed'])){\n\t\t\t// zmena stavu online platby meni i stav objednavky, ale pouze za urcitych okolnosti\n\t\t\t$order->setNewOrderStatus($tr[$code]);\n\t\t\tif(!is_null($order->g(\"updated_by_user_id\"))){\n\t\t\t\t// we don't want to store logged-in user in updated_by_user_id\n\t\t\t\t$order->s([\n\t\t\t\t\t\"updated_by_user_id\" => null,\n\t\t\t\t\t\"updated_at\" => $order->g(\"updated_at\"),\n\t\t\t\t]);\n\t\t\t}\n\t\t\tif($code === \"paid\"){\n\t\t\t\t// Protoze je metoda Order::increasePricePaid() multi-threaded safe,\n\t\t\t\t// je tady pojistka, ktera brani ve vicenasobnem navyseni zaplacene castky.\n\t\t\t\t$current_price_paid = (float)$order->getPricePaid();\n\t\t\t\tmyAssert($current_price_paid === 0.0);\n\t\t\t\t$order->increasePricePaid($this->getPriceToPay());\n\t\t\t\tmyAssert(round($order->getPricePaid(),INTERNAL_PRICE_DECIMALS)===round(($current_price_paid + $this->getPriceToPay()),INTERNAL_PRICE_DECIMALS));\n\t\t\t}\n\t\t}\n\n\t\t$this->s([\n\t\t\t\"payment_status_id\" => $payment_status,\n\t\t\t\"payment_status_updated_at\" => now(),\n\t\t\t\"payment_status_checked_at\" => now(),\n\t\t]);\n\t}" ]
[ "0.841011", "0.71405697", "0.7136052", "0.7108029", "0.7041382", "0.69036543", "0.68814504", "0.66102445", "0.6604549", "0.6562205", "0.6502775", "0.6489142", "0.6480585", "0.6467929", "0.6438515", "0.6420829", "0.6418595", "0.6304264", "0.62944794", "0.6294462", "0.6264376", "0.6257786", "0.6227073", "0.6214722", "0.6197797", "0.61735505", "0.6147969", "0.61354804", "0.61140907", "0.6110833", "0.6089822", "0.60882205", "0.6084864", "0.60779214", "0.6071844", "0.6050103", "0.60376376", "0.60150504", "0.6008235", "0.5972749", "0.5959842", "0.59528404", "0.5948902", "0.5946583", "0.5941566", "0.59400153", "0.5938745", "0.5934096", "0.5931181", "0.59272397", "0.5920768", "0.5915447", "0.5904413", "0.5900123", "0.5885612", "0.5882427", "0.5872004", "0.58665484", "0.58647686", "0.58620644", "0.5853999", "0.5846929", "0.58435196", "0.5838177", "0.58358204", "0.58354056", "0.5833379", "0.5832736", "0.5832349", "0.58320457", "0.5829051", "0.58227956", "0.5804716", "0.58028495", "0.5801379", "0.579422", "0.57864946", "0.57773215", "0.5774603", "0.5773566", "0.5769826", "0.57686305", "0.57609385", "0.5757947", "0.57575077", "0.57535475", "0.57522", "0.57516915", "0.57496095", "0.5747918", "0.57446945", "0.5744568", "0.5743659", "0.5732561", "0.57321423", "0.57286566", "0.5720809", "0.5711989", "0.57107484", "0.57012403", "0.5694213" ]
0.0
-1
Returns $dat encoded to UTF8
protected static function utf8Encode($dat) { if (is_string($dat)) { if (mb_check_encoding($dat, 'UTF-8')) { return $dat; } else { return utf8_encode($dat); } } if (is_array($dat)) { $answer = array(); foreach ($dat as $i => $d) { $answer[$i] = self::utf8Encode($d); } return $answer; } return $dat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function utf8Encode($dat)\n {\n if (is_string($dat)){\n return utf8_encode($dat);\n }\n if (!is_array($dat)){\n return $dat;\n }\n $ret = array();\n foreach ($dat as $i => $d){\n $ret[$i] = $this->utf8Encode($d);\n }\n return $ret;\n }", "function utf8_encode($data)\n{\n}", "private function utf8Encode($data)\n {\n return $data;\n /*\n * if (is_array ( $data )) {\n * foreach ( $data as $key => $value ) {\n * $data [$key] = $this->utf8Encode ( $value );\n * }\n * } else {\n * $data = utf8_encode ( $data );\n * }\n * return $data;\n */\n }", "function win1252_to_utf8($data){\r\n\treturn iconv(\"Windows-1252\", \"UTF-8\", $data);\r\n}", "function html_to_utf8 ($data)\r\n {\r\n return preg_replace(\"/\\\\&\\\\#([0-9]{3,10})\\\\;/e\", '_html_to_utf8(\"\\\\1\")', $data);\r\n }", "public function convertDatabaseToUTF8();", "function convert_data_encodings($known_utf8 = false)\n{\n global $VALID_ENCODING, $CONVERTED_ENCODING;\n $VALID_ENCODING = true;\n\n if ($CONVERTED_ENCODING) {\n return; // Already done it\n }\n\n if (preg_match('#^[\\x00-\\x7F]*$#', serialize($_POST) . serialize($_GET) . serialize($_FILES)) != 0) { // Simple case, all is ASCII\n $CONVERTED_ENCODING = true;\n return;\n }\n\n require_code('character_sets');\n _convert_data_encodings($known_utf8);\n}", "function uni2utf8($uniescape)\n\t{\n\t\t$c = \"\";\n\t\t\n\t\t$n = intval(substr($uniescape, -4), 16);\n\t\tif ($n < 0x7F) {// 0000-007F\n\t\t\t$c .= chr($n);\n\t\t} elseif ($n < 0x800) {// 0080-0800\n\t\t\t$c .= chr(0xC0 | ($n / 64));\n\t\t\t$c .= chr(0x80 | ($n % 64));\n\t\t} else {\t\t\t\t// 0800-FFFF\n\t\t\t$c .= chr(0xE0 | (($n / 64) / 64));\n\t\t\t$c .= chr(0x80 | (($n / 64) % 64));\n\t\t\t$c .= chr(0x80 | ($n % 64));\n\t\t}\n\t\treturn $c;\n\t}", "public static function toDataUS($data){\n\t\t$tmp = explode('/', $data);\n\t\treturn $tmp[2].'-'.$tmp[1].'-'.$tmp[0];\n\t}", "function encodeData($data)\n {\n if (is_array($data)) {\n /*\n * Traitement des tableaux\n */\n foreach ($data as $key => $value) {\n $data[$key] = $this->encodeData($value);\n }\n } else {\n /*\n * Traitement des chaines individuelles\n */\n if ($this->typeDatabase == 'pgsql') {\n if ($this->UTF8 && mb_detect_encoding($data) != \"UTF-8\") {\n $data = mb_convert_encoding($data, 'UTF-8');\n }\n $data = pg_escape_string($data);\n } else {\n $data = addslashes($data);\n }\n }\n return $data;\n }", "protected function utf8Values(&$data)\n {\n foreach ($data as $key => $value)\n {\n // Convert atomic values to UTF-8\n if (!is_array($value))\n {\n $data[$key] = utf8_encode($value);\n }\n\n // Handle nested arrays\n if (is_array($value))\n {\n $this->utf8Values($data[$key]);\n }\n }\n }", "function convert_to_utf8($data, $encoding) {\n if (function_exists('iconv')) {\n $out = @iconv($encoding, 'utf-8', $data);\n }\n else if (function_exists('mb_convert_encoding')) {\n $out = @mb_convert_encoding($data, 'utf-8', $encoding);\n }\n else if (function_exists('recode_string')) {\n $out = @recode_string($encoding .'..utf-8', $data);\n }\n else {\n /* watchdog('php', t(\"Unsupported encoding '%s'. Please install iconv, GNU\nrecode or mbstring for PHP.\", array('%s' => $encoding)), WATCHDOG_ERROR); */\n return FALSE;\n }\n return $out;\n}", "public function convertToUTF8(array|string $data): array|string\n {\n if (is_array($data)) {\n /** @var array|string|null $v */\n foreach ($data as $k => $v) {\n if ($v !== null) {\n $data[$k] = $this->convertToUTF8($v);\n }\n }\n } else {\n $data = Encoding::toUTF8($data);\n }\n return $data;\n }", "function utf8_to_win1252($data){\r\n\treturn iconv(\"UTF-8\", \"Windows-1252\", $data);\r\n}", "abstract public static function encode($data): string;", "public static function encode($data)\n {\n if (is_array($data)) {\n foreach ($data as $key => $value) {\n $data[$key] = self::encode($value);\n }\n } elseif (is_object($data)) {\n foreach ($data as $key => $value) {\n $data->{$key} = self::encode($value);\n }\n } elseif (is_string($data)) {\n if (PHP_VERSION_ID >= 80200) {\n return iconv('windows-1252', 'UTF-8', $data);\n }\n return utf8_encode($data);\n }\n return $data;\n }", "public static function encodeData($data)\n {\n if (preg_match('/[<>&]/', $data)) {\n $data = '<![CDATA[' . $data . ']]>';\n }\n\n $data = preg_replace('/\"/', '\\\"', $data);\n\n return $data;\n }", "public function encode($data);", "public function encode($data);", "public function encode($data);", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "function win2utf($val,$always=false) { #trace();\r\n global $ezer_mysql_cp;\r\n if ( $always || !$ezer_mysql_cp || $ezer_mysql_cp=='cp1250' ) {\r\n $val= strtr($val, \"\\x9E\\x9A\\x9D\\x8E\\x8A\\x8D\", \"\\xBE\\xB9\\xBB\\xAE\\xA9\\xAB\");\r\n $val= mb_convert_encoding($val,'UTF-8','ISO-8859-2');\r\n }\r\n return $val;\r\n}", "public function encode($data) {\n return serialize($data);\n }", "private function uniConvert ()\n\t\t{\n\t\t\t return preg_replace(\"/\\\\\\\\u([a-f0-9]{4})/e\",\n \"iconv('UCS-4LE','UTF-8',pack('V', hexdec('U$1')))\",\n json_encode($this->result));\n\t\t}", "protected final function _encodeUnsynchronisation(&$data)\n {\n $result = \"\";\n for ($i = 0, $j = 0; $i < strlen($data) - 1; $i++)\n if (ord($data[$i]) == 0xff &&\n ((($tmp = ord($data[$i + 1])) & 0xe0) == 0xe0 || $tmp == 0x0)) {\n $result .= substr($data, $j, $i + 1 - $j) . \"\\0\";\n $j = $i + 1;\n }\n return $result . substr($data, $j);\n }", "private static function sample_convert($data) {\n return implode(\"\\x1f\", $data);\n }", "abstract function encode($data);", "protected function _getToUnicode() {}", "abstract public function encode($data);", "public function dataToUS($data) {\n\n $transformado = substr($data, 6, 4) . \"-\" . substr($data, 3, 2) . \"-\" . substr($data, 0, 2);\n $transformado = ($transformado == \"--\") ? \"\" : $transformado;\n\n return $transformado;\n }", "public static function toUTF8($obj, $data_codepage = null)\n\t{\n\t\t// Array || object\n\t\tif(is_array($obj) || is_object($obj)){\n\t\t\tforeach($obj as $key => &$val){\n\t\t\t\t$val = self::toUTF8($val, $data_codepage);\n\t\t\t}\n\t\t\tunset($key, $val);\n\t\t\t\n\t\t\t//String\n\t\t}else{\n\t\t\tif(!preg_match('//u', $obj) && function_exists('mb_detect_encoding') && function_exists('mb_convert_encoding')){\n\t\t\t\t$encoding = mb_detect_encoding($obj);\n\t\t\t\t$encoding = $encoding ? $encoding : $data_codepage;\n\t\t\t\tif($encoding)\n\t\t\t\t\t$obj = mb_convert_encoding($obj, 'UTF-8', $encoding);\n\t\t\t}\n\t\t}\n\t\treturn $obj;\n\t}", "function escape_data($data) {\n\n\tif (ini_get('magic_quotes_gpc')) {\t# Controllo se è attivata la modaltà Magic Quotes (che immette dei caratteri \"|\" prima di eventuali apici\n\t\t$data=stripslashes($data);\t# Tolgo i caratteri \"|\" inseriti da Magic Quotes con la funzione stripslashes\n\t\t}\n\treturn $data; # Ritorno la stringa formattata correttamente\n\t}", "function convert_to_utf8($obj)\n{\n global $config;\n $ret = $obj;\n // wenn die Verbindung zur Datenbank nicht auf utf8 steht, dann muessen die Rückgaben in utf8 gewandelt werden,\n // da die Webseite utf8-kodiert ist\n if (!isset($config['mysql_can_change_encoding'])) {\n get_sql_encodings();\n }\n\n if ($config['mysql_can_change_encoding'] == false && $config['mysql_standard_character_set'] != 'utf8') {\n if (is_array($obj)) {\n foreach ($obj as $key => $val) {\n //echo \"<br> Wandle \" . $val . \" nach \";\n $obj[$key] = utf8_encode($val);\n //echo $obj[$key];\n }\n }\n if (is_string($obj)) {\n $obj = utf8_encode($obj);\n }\n $ret = $obj;\n }\n\n return $ret;\n}", "protected function pack($data): string\n {\n return \\serialize($data);\n }", "protected function sanitizeUTF8(&$data) {\n if (!isset($this->iconvAvailable)) {\n $this->iconvAvailable = function_exists('iconv');\n }\n\n if ($this->iconvAvailable) {\n array_walk_recursive(\n $data,\n function(&$value) {\n if (is_string($value)) {\n $value = iconv('UTF-8', 'UTF-8//IGNORE', $value);\n }\n }\n );\n }\n }", "function & _wp_iso8859_2_to_utf8(&$string) {\n $decode=array(\n \"\\xA1\" => \"\\xC4\\x84\",\n \"\\xB1\" => \"\\xC4\\x85\",\n \"\\xC6\" => \"\\xC4\\x86\",\n \"\\xE6\" => \"\\xC4\\x87\",\n \"\\xCA\" => \"\\xC4\\x98\",\n \"\\xEA\" => \"\\xC4\\x99\",\n \"\\xA3\" => \"\\xC5\\x81\",\n \"\\xB3\" => \"\\xC5\\x82\",\n \"\\xD1\" => \"\\xC5\\x83\",\n \"\\xF1\" => \"\\xC5\\x84\",\n \"\\xD3\" => \"\\xC3\\x93\",\n \"\\xF3\" => \"\\xC3\\xB3\",\n \"\\xA6\" => \"\\xC5\\x9A\",\n \"\\xB6\" => \"\\xC5\\x9B\",\n \"\\xAC\" => \"\\xC5\\xB9\",\n \"\\xBC\" => \"\\xC5\\xBA\",\n \"\\xAF\" => \"\\xC5\\xBB\",\n \"\\xBF\" => \"\\xC5\\xBC\",\n );\n $string = strtr(\"$string\",$decode);\n return $string;\n }", "public static function encode($data) {\n\t\treturn \"<?php\\n\\n\\$data = \" . var_export($data, true) . \";\\n\\n?>\\n\";\n\t}", "function utf8ize($d) {\n if (is_array($d)) {\n foreach ($d as $k => $v) {\n $d[$k] = utf8ize($v);\n }\n } else if (is_string ($d)) {\n return utf8_encode($d);\n }\n return $d;\n}", "function readUTF();", "function escByteA($binData) {\n\t\t/**\n\t\t* \\134 = 92 = backslash, \\000 = 00 = NULL, \\047 = 39 = Single Quote\n\t\t*\n\t\t* str_replace() replaces the searches array in order.\n\t\t* Therefore, we must\n\t\t* process the 'backslash' character first. If we process it last, it'll\n\t\t* replace all the escaped backslashes from the other searches that came\n\t\t* before. tomATminnesota.com\n\t\t*/\n\t\t$search = array(chr(92), chr(0), chr(39));\n\t\t$replace = array('\\\\\\134', '\\\\\\000', '\\\\\\047');\n\t\t$binData = str_replace($search, $replace, $binData);\n\t\treturn $binData;\n\t}", "function utf8init()\n{\n mb_internal_encoding('UTF-8');\n\n // Tell PHP that we'll be outputting UTF-8 to the browser\n mb_http_output('UTF-8');\n\n //$str = json_encode($arr, JSON_UNESCAPED_UNICODE); //这样我们存进去的是就是中文了,那么取出的也就是中文了\n\n}", "public function array2json($data) {\n\t\tif(function_exists('json_encode')) return json_encode($data); //Lastest versions of PHP already has this functionality.\n\t\tif( is_array($data) || is_object($data) ) {\n $islist = is_array($data) && ( empty($data) || array_keys($data) === range(0,count($data)-1) );\n\n if( $islist ) {\n $json = '[' . implode(',', array_map('array2json', $data) ) . ']';\n } else {\n $items = Array();\n foreach( $data as $key => $value ) {\n $items[] = $this->array2json(\"$key\") . ':' . $this->array2json($value);\n }\n $json = '{' . implode(',', $items) . '}';\n }\n } elseif( is_string($data) ) {\n # Escape non-printable or Non-ASCII characters.\n # I also put the \\\\ character first, as suggested in comments on the 'addclashes' page.\n $string = '\"' . addcslashes($data, \"\\\\\\\"\\n\\r\\t/\" . chr(8) . chr(12)) . '\"';\n $json = '';\n $len = strlen($string);\n # Convert UTF-8 to Hexadecimal Codepoints.\n for( $i = 0; $i < $len; $i++ ) {\n\n $char = $string[$i];\n $c1 = ord($char);\n\n # Single byte;\n if( $c1 <128 ) {\n $json .= ($c1 > 31) ? $char : sprintf(\"\\\\u%04x\", $c1);\n continue;\n }\n\n # Double byte\n $c2 = ord($string[++$i]);\n if ( ($c1 & 32) === 0 ) {\n $json .= sprintf(\"\\\\u%04x\", ($c1 - 192) * 64 + $c2 - 128);\n continue;\n }\n\n # Triple\n $c3 = ord($string[++$i]);\n if( ($c1 & 16) === 0 ) {\n $json .= sprintf(\"\\\\u%04x\", (($c1 - 224) <<12) + (($c2 - 128) << 6) + ($c3 - 128));\n continue;\n }\n\n # Quadruple\n $c4 = ord($string[++$i]);\n if( ($c1 & 8 ) === 0 ) {\n $u = (($c1 & 15) << 2) + (($c2>>4) & 3) - 1;\n\n $w1 = (54<<10) + ($u<<6) + (($c2 & 15) << 2) + (($c3>>4) & 3);\n $w2 = (55<<10) + (($c3 & 15)<<6) + ($c4-128);\n $json .= sprintf(\"\\\\u%04x\\\\u%04x\", $w1, $w2);\n }\n }\n } else {\n # int, floats, bools, null\n $json = strtolower(var_export( $data, true ));\n }\n return $json;\n\t}", "function db_driver_unescape($data)\n{\n global $_db;\n\n $data = regexp_replace('(^\\'|\\'$)', '', $data);\n $data = str_replace('\\'\\'', '\\'', $data);\n\n return $data;\n}", "function win_utf8($s) {\n $utf = \"\";\n for ($i = 0; $i < strlen($s); $i++) {\n $donotrecode = false;\n $c = ord(substr($s, $i, 1));\n if ($c == 0xA8) {\n $res = 0xD081;\n } elseif ($c == 0xB8) {\n $res = 0xD191;\n } elseif ($c < 0xC0) {\n $donotrecode = true;\n } elseif ($c < 0xF0) {\n $res = $c + 0xCFD0;\n } else {\n $res = $c + 0xD090;\n }\n $c = ($donotrecode) ? chr($c) : (chr($res >> 8) . chr($res & 0xff));\n $utf .= $c;\n }\n return $utf;\n }", "public function getEncoded();", "function utf8_to_iso_8859_1() {\r\n\t\t$result = preg_match('/<meta http\\-equiv=\"[Cc]ontent\\-[Tt]ype\" content=\"text\\/html;\\s*charset\\s*=\\s*utf\\-8\"/is', $this->code, $encoding_matches);\r\n\t\tif($result) {\r\n\t\t\t$this->code = iconv(\"UTF-8\", \"CP1252\" . \"//TRANSLIT\", $this->code);\r\n\t\t\t$this->code = htmlspecialchars($this->code);\r\n\t\t\t$this->code = htmlentities($this->code);\r\n\t\t\t$this->code = htmlspecialchars_decode($this->code);\r\n\t\t\t$this->code = htmlspecialchars_decode($this->code);\r\n\t\t\t$this->code = preg_replace('/<meta http\\-equiv=\"[Cc]ontent\\-[Tt]ype\" content=\"text\\/html;\\s*charset\\s*=\\s*utf\\-8\"/is', '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"', $this->code);\r\n\t\t}\r\n\t}", "function utf8($x){\n\t#return is_string($x)?utf8_encode($x):$x;\n\treturn $x;\n}", "private function _dump($data)\n\t{\n\t\tfor ($i = 0; $i < strlen($data); $i++) {\n\t\t\techo sprintf('%02X', ord($data[$i])) . ' ';\n\t\t}\n\t}", "function js_thai_encode($data)\n{\n if (is_array($data))\n {\n foreach($data as $a => $b)\n {\n if (is_array($data[$a]))\n {\n $data[$a] = js_thai_encode($data[$a]);\n }\n else\n {\n $data[$a] = iconv(\"tis-620\",\"utf-8\",$b);\n }\n }\n }\n else\n {\n $data =iconv(\"tis-620\",\"utf-8\",$data);\n }\n return $data;\n}", "function __toString(){\n\t\treturn \"UTF-8\";\n\t}", "function seguridad_utf8($entrada){\n\t\tglobal $mysqli;\n\t\treturn addslashes($mysqli -> real_escape_string(nl2br(trim($entrada))));\n\t}", "static function altJsonEncode($data)\n {\n return str_replace(\"'\", \"&#39;\", json_encode($data));\n }", "public function format_data_from_csv($data, $enc) {\n return ( $enc == 'UTF-8' ) ? $data : utf8_encode($data);\n }", "protected function _from_cdata($data)\n\t{\n\t\t// Get the HTML translation table and reverse it\n\t\t$trans_tbl = array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES));\n\n\t\t// Translate all the entities out.\n\t\t$data = preg_replace_callback('~&#(\\d{1,4});~', function ($match) {\n\t\t\treturn $this->_from_cdata_callback($match);\n\t\t}, $data);\n\t\t$data = strtr($data, $trans_tbl);\n\n\t\treturn $this->trim ? trim($data) : $data;\n\t}", "function _encoding($val)\n{\n\tif ( is_string($val) )\n\t\t$val = iconv('cp1251', 'utf-8', $val);\n\t\n\tif ( is_array($val) )\n\t\tforeach ($val as $k => $v)\n\t\t\t\t$val[$k] = _encoding($v);\n\t\t\t\t\n\treturn $val;\n}", "function echo8($txt) {\n\techo $txt;\n\t//echo utf8_decode($txt);\n}", "function file_get_contents_utf8($fn) {\r\n $content = file_get_contents($fn);\r\n return mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\r\n // return iconv(mb_detect_encoding($content, 'UTF-8, ISO-8859-2, ISO-8859-1, ASCII'), true), \"UTF-8\", $content);\r\n}", "public function getEncoding();", "function enc($data)\n {\n return base64_encode($data);\n }", "function seems_utf8($str)\n {\n }", "private function writeUTF8filename($fn,$c){\n $f=fopen($this->dirs.$fn,\"w+\");\n # Now UTF-8 - Add byte order mark\n fwrite($f, pack(\"CCC\",0xef,0xbb,0xbf));\n fwrite($f,$c);\n fclose($f);\n }", "function filterSpecials($data){\n\n if(!$this->isUTF8($data))\n $data = utf8_encode($data);\n $data = htmlspecialchars($data, ENT_QUOTES);\n\n return $data;\n }", "public function encode(array $data): string;", "public function convCharset(array $data): array\n {\n $dbCharset = 'utf-8';\n if ($dbCharset != $this->indata['charset']) {\n $converter = GeneralUtility::makeInstance(CharsetConverter::class);\n foreach ($data as $k => $v) {\n $data[$k] = $converter->conv($v, strtolower($this->indata['charset']), $dbCharset);\n }\n }\n return $data;\n }", "public function aim_encode($data)\r\n\t{\r\n\t\treturn '\"' . preg_replace(\"/([\\\\\\}\\{\\(\\)\\[\\]\\$\\\"])/\", \"\\\\\\\\\\\\1\", $data) . '\"';\r\n\t}", "function caractere_utf_8($num) {\n\tif($num<128)\n\t\treturn chr($num);\n\tif($num<2048)\n\t\treturn chr(($num>>6)+192).chr(($num&63)+128);\n\tif($num<65536)\n\t\treturn chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128);\n\tif($num<1114112)\n\t\treturn chr($num>>18+240).chr((($num>>12)&63)+128).chr(($num>>6)&63+128). chr($num&63+128);\n\treturn '';\n}", "abstract public function setUTF();", "public function getData(): string\n\t{\n\t\treturn $this->sData;\n\t}", "function to_json($data): string\n {\n return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);\n }", "public static function removeNonUTF8($data)\n\t{\n\t\t// Array || object\n\t\tif(is_array($data) || is_object($data)){\n\t\t\tforeach($data as $key => &$val){\n\t\t\t\t$val = self::removeNonUTF8($val);\n\t\t\t}\n\t\t\tunset($key, $val);\n\t\t\t\n\t\t\t//String\n\t\t}else{\n\t\t\tif(!preg_match('//u', $data))\n\t\t\t\t$data = 'Nulled. Not UTF8 encoded or malformed.';\n\t\t}\n\t\treturn $data;\n\t}", "function testData(string $data): string\n {\n return htmlspecialchars(stripcslashes(trim($data)));\n }", "function xml_special_char($t_data){\n\n if(preg_match(\"/\\\"/\", $t_data)) str_replace(\"\\\"\", \"&quot\", $t_data);\n elseif(preg_match(\"/'/\", $t_data)) str_replace(\"\\'\", \"&quot\", $t_data);\n elseif(preg_match(\"/&/\", $t_data)) str_replace(\"&\", \"&amp\", $t_data);\n elseif(preg_match(\"/</\", $t_data)) str_replace(\"<\", \"&lt\", $t_data);\n elseif(preg_match(\"/>/\", $t_data)) str_replace(\">\", \"&gt\", $t_data);\n\n return $t_data;\n }", "function convert_to_utf8(string $str): string\n {\n return preg_replace_callback(\n '/\\\\\\\\u([0-9a-fA-F]{4})/',\n static function (array $match): string {\n return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');\n },\n $str\n );\n }", "function php_compat_pg_escape_bytea($data)\n{\n return str_replace(\n array(chr(92), chr(0), chr(39)),\n array('\\\\\\134', '\\\\\\000', '\\\\\\047'),\n $data);\n}", "public static function toDataBR($data){\n\t\t$tmp = explode('-', $data);\n\t\treturn $tmp[2].'/'.$tmp[1].'/'.$tmp[0];\n\t}", "public static function utf8ize($mixed)\n {\n if (is_array($mixed)) {\n foreach ($mixed as $key => $value) {\n $mixed[$key] = self::utf8ize($value);\n }\n } else {\n if (is_string($mixed)) {\n return utf8_encode($mixed);\n }\n }\n return $mixed;\n }", "function convert_to_utf8($str)\n{\n\t$old_charset = $_SESSION['old_charset'];\n\t\n\tif ($str === null || $str == '' || $old_charset == 'UTF-8')\n\t\treturn $str;\n\n\t$save = $str;\n\n\t// Replace literal entities (for non-UTF-8 compliant html_entity_encode)\n\tif (version_compare(PHP_VERSION, '5.0.0', '<') && $old_charset == 'ISO-8859-1' || $old_charset == 'ISO-8859-15')\n\t\t$str = html_entity_decode($str, ENT_QUOTES, $old_charset);\n\n\tif ($old_charset != 'UTF-8' && !seems_utf8($str))\n\t{\n\t\tif (function_exists('iconv'))\n\t\t\t$str = iconv($old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : $old_charset, 'UTF-8', $str);\n\t\telse if (function_exists('mb_convert_encoding'))\n\t\t\t$str = mb_convert_encoding($str, 'UTF-8', $old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : 'ISO-8859-1');\n\t\telse if ($old_charset == 'ISO-8859-1')\n\t\t\t$str = utf8_encode($str);\n\t}\n\n\t// Replace literal entities (for UTF-8 compliant html_entity_encode)\n\tif (version_compare(PHP_VERSION, '5.0.0', '>='))\n\t\t$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');\n\n\t// Replace numeric entities\n\t$str = preg_replace_callback('/&#([0-9]+);/', 'utf8_callback_1', $str);\n\t$str = preg_replace_callback('/&#x([a-f0-9]+);/i', 'utf8_callback_2', $str);\n\n\t// Remove \"bad\" characters\n\t$str = remove_bad_characters($str);\n\n\treturn $str;//($save != $str);\n}", "public function convPOSTCharset() {}", "public function packData($data) {\n return json_encode($data);\n }", "public function getEncoding(): string;", "public function packerThreeUnpack(string $data): string\n {\n // Separa em dois pedaços\n $partOne = mb_substr($data, 0, 15, \"utf-8\");\n $partTwo = mb_substr($data, 17, null, \"utf-8\");\n return base64_decode($partOne . $partTwo);\n }", "public static function stringify($data)\n\t{\n\t\treturn base64_encode(serialize($data));\n\t}", "private function hex2bin($data){\n $encoded = '';\n $data_arr = str_split($data, 2);\n\n foreach($data_arr as $val){\n $binary = base_convert($val, 16, 2);\n $encoded .= str_pad($binary, 8, '0', STR_PAD_LEFT);\n }\n return $encoded;\n }", "public static function utf7_to_utf8($str)\n {\n $Index_64 = array(\n 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,\n 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,\n 0,0,0,0, 0,0,0,0, 0,0,0,1, 0,0,0,0,\n 1,1,1,1, 1,1,1,1, 1,1,0,0, 0,0,0,0,\n 0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1,\n 1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,0,\n 0,1,1,1, 1,1,1,1, 1,1,1,1, 1,1,1,1,\n 1,1,1,1, 1,1,1,1, 1,1,1,0, 0,0,0,0,\n );\n\n $u7len = strlen($str);\n $str = strval($str);\n $res = '';\n\n for ($i=0; $u7len > 0; $i++, $u7len--) {\n $u7 = $str[$i];\n if ($u7 == '+') {\n $i++;\n $u7len--;\n $ch = '';\n\n for (; $u7len > 0; $i++, $u7len--) {\n $u7 = $str[$i];\n\n if (!$Index_64[ord($u7)]) {\n break;\n }\n\n $ch .= $u7;\n }\n\n if ($ch == '') {\n if ($u7 == '-') {\n $res .= '+';\n }\n\n continue;\n }\n\n $res .= self::utf16_to_utf8(base64_decode($ch));\n }\n else {\n $res .= $u7;\n }\n }\n\n return $res;\n }", "public static function change_encoding($data, $input, $output)\n {\n }", "protected function encodeData($data)\n {\n if ($this->base64encode) {\n $data = base64_encode(serialize($data));\n }\n return $data;\n }", "function array_iconv(&$val, $key, $userdata)\n{\n\t$val = mb_convert_encoding($val,$userdata[1],$userdata[0]);\n\t//audit(serialize($userdata),'error');\n}", "public function json_encode_utf8($array)\n {\n $array = json_encode($array);\n\n //normalize $info to utf-8 character\n $array = preg_replace_callback('/\\\\\\\\u([0-9a-f]{4})/i',\n function ($matches){\n $s = mb_convert_encoding(pack('H*',$matches[1]), 'UTF-8', 'UTF-16');\n return $s;\n }, $array);\n\n return $array;\n }", "private function reformatData($data)\n\t{\n\t\t$data = str_replace('<?xml version=\"1.0\" encoding=\"UTF-8\"?>', '', $data);\n\t\t$data = str_replace(array('<', '>'), array('[', ']'), $data);\n\n\t\treturn $data;\n\t}", "public function getData()\n {\n $data = $this->data;\n if ($this->cursor > 0) {\n $data .= $this->workingByte->getData();\n }\n return $data;\n }", "protected function _getData()\n {\n $data = Transform::toUInt8($this->_format);\n foreach ($this->_events as $timestamp => $type)\n $data .= Transform::toUInt8($type) . Transform::toUInt32BE($timestamp);\n return $data;\n }", "function escapeRtf($data) {\n\tif (empty($data)) return $data;\n if (is_array($data)) {\n\t\tforeach($data as $k => $v) $data[$k] = escapeRtf($v);\n } else {\n \t$data = mb_convert_encoding($data,\"UTF-16\",\"UTF-8\");\n\t\t$data = str_split($data,2);\n\t\t$tmp = \"\";\n\t\tforeach($data as $k => $v) $tmp .= '\\u'.(ord($v[0])*256 + ord($v[1])).'?';\n\t\t$data = $tmp;\n \t}\n \treturn $data;\n}", "public static function xml_encoding($data, $registry)\n {\n }", "function & _wp_utf8_to_8859_2(&$string) {\n $decode=array(\n \"\\xC4\\x84\"=>\"\\xA1\",\n \"\\xC4\\x85\"=>\"\\xB1\",\n \"\\xC4\\x86\"=>\"\\xC6\",\n \"\\xC4\\x87\"=>\"\\xE6\",\n \"\\xC4\\x98\"=>\"\\xCA\",\n \"\\xC4\\x99\"=>\"\\xEA\",\n \"\\xC5\\x81\"=>\"\\xA3\",\n \"\\xC5\\x82\"=>\"\\xB3\",\n \"\\xC5\\x83\"=>\"\\xD1\",\n \"\\xC5\\x84\"=>\"\\xF1\",\n \"\\xC3\\x93\"=>\"\\xD3\",\n \"\\xC3\\xB3\"=>\"\\xF3\",\n \"\\xC5\\x9A\"=>\"\\xA6\",\n \"\\xC5\\x9B\"=>\"\\xB6\",\n \"\\xC5\\xB9\"=>\"\\xAC\",\n \"\\xC5\\xBA\"=>\"\\xBC\",\n \"\\xC5\\xBB\"=>\"\\xAF\",\n \"\\xC5\\xBC\"=>\"\\xBF\"\n );\n\n $string = strtr(\"$string\",$decode);\n return $string;\n }", "public function encodeData(array $data)\n\t{\n\t\t$output = array();\n\t\tforeach($data as $key => $value)\n\t\t{\n\t\t\t$output[] = $key . '[' . strlen($value) . ']=' . $value;\n\t\t}\n\n\t\treturn implode('&', $output);\n\t}", "public function encode($data, $leaveEOD = false) {}" ]
[ "0.70902044", "0.6691718", "0.6488349", "0.6484774", "0.63320524", "0.61628664", "0.6086392", "0.60392594", "0.60084146", "0.6004522", "0.5980297", "0.5915582", "0.59041953", "0.5881356", "0.5802224", "0.5793196", "0.575121", "0.573841", "0.573841", "0.573841", "0.5726693", "0.57239455", "0.57239455", "0.57239455", "0.57239455", "0.56644744", "0.56490344", "0.5639338", "0.5603455", "0.5587454", "0.55837613", "0.55702204", "0.55626655", "0.55568457", "0.5548197", "0.55420333", "0.55391103", "0.55339855", "0.5526688", "0.55068994", "0.55063915", "0.5492978", "0.5466971", "0.5443027", "0.5436804", "0.54283756", "0.542366", "0.5411063", "0.53997445", "0.5397026", "0.5384645", "0.5374742", "0.537351", "0.5353963", "0.534726", "0.5333644", "0.5327164", "0.530691", "0.5278486", "0.52687275", "0.5252907", "0.5251046", "0.52479255", "0.5240849", "0.5240141", "0.5235869", "0.5230456", "0.5223432", "0.5219019", "0.5187749", "0.5183028", "0.51740444", "0.51732737", "0.5172529", "0.5172493", "0.5167572", "0.516019", "0.5147112", "0.51425445", "0.51416886", "0.5132334", "0.5128047", "0.51270676", "0.5122872", "0.51188964", "0.51173216", "0.51083136", "0.5102331", "0.5096713", "0.5094297", "0.5089466", "0.5088994", "0.50877196", "0.5074959", "0.5070242", "0.5069596", "0.50594264", "0.50591147", "0.50513756", "0.50468266" ]
0.7488785
0
Get the books list
public function books() { return $this->get('/books'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBookList()\n {\n return $this->bookDao->getBookList();\n }", "public function listBooks()\n {\n //list all books in database\n $sql2 = \"SELECT * from book\";\n $userBooks = mysql_fetch_array(mysql_query($sql2));\n return $userBooks; \n }", "public function getAllBooks(){\n $query = \"SELECT * FROM Book;\";\n return $this->getBookDetail($query);\n }", "public function getBooks()\n\t{\n\t\treturn $this->books;\n\t}", "public function getBookList() {\n\n $booklist = array();\n\n foreach ($this->db-> query(\"SELECT * FROM book\") as $row) {\n \n array_push($booklist, new Book($row['title'], $row['author'], $row['description'], $row['id']));\n }\n\n return $booklist;\n }", "public function getBooks(){\n $sql = \"SELECT * FROM book;\";\n $res = mysqli_query($this->link, $sql);\n $books = mysqli_fetch_all($res);\n return $books;\n }", "public function getAllBooks() {\n \n $allBooks = Libro::all();\n\n return $allBooks;\n }", "public function getAllBooks(){\n return $this->libros;\n }", "public function getBookList()\n\t{\n\t\treturn array(\n\t\t\t\"1\" => new Book(\"Être et Temps\", \"9782070707393\", 1, 1, 1),\n\t\t\t\"2\" => new Book(\"Finnegans Wake\", \"9782070402250\", 2, 2, 2),\n\t\t\t\"3\" => new Book(\"Critique de la raison pure\", \"9782070325757\", 3, 3, 3)\n\t\t);\n\t}", "public function getBooks()\n {\n $page = isset($_GET['page']) ? $_GET['page'] : 1;\n $this->limit = isset($_GET['limit']) ? $_GET['limit'] : $this->limit;\n $offset = $this->limit * ($page - 1);\n\n\n if (USE_ONE_TABLE) {\n $this->table = 'books_authors';\n $sql = \"SELECT * FROM $this->table WHERE `deleted` is NULL LIMIT :limit OFFSET :offset\";\n } else {\n $this->table = 'relations';\n $sql = \"SELECT books.id, book_name, GROUP_CONCAT(name_author SEPARATOR ', ') as 'author' , year, num_pages, about_book, deleted, views, clicks, image\n FROM books \n JOIN relations ON book_id = books.id\n JOIN authors ON authors.id = author_id\n WHERE deleted is NULL \n GROUP BY id\n LIMIT :limit OFFSET :offset\";\n }\n\n $params = [\n [\":limit\", $this->limit, \\PDO::PARAM_INT],\n [\":offset\", $offset, \\PDO::PARAM_INT]\n ];\n return $this->bindAndQuery($sql, $params);\n }", "public function getBookList() \n {\n return array( \n \"Balagurusamy\" => new Book(\"Balagurusamy\", \"Balagurusamy\", \"C programming\"), \n \"CMM in Practice\" => new Book(\"CMM in Practice\", \"Pankaj Jalote\", \"\"), \n \"PHP for Dummies\" => new Book(\"PHP for Dummies\", \"Some Smart Guy\", \"\") \n ); \n }", "public function getBooks()\n {\n $sql = 'SELECT bookshop_books.id,\n bookshop_books.description,\n bookshop_books.booksName,\n bookshop_books.pubyear,\n bookshop_discounts.id AS discountsId,\n bookshop_discounts.discountsName,\n bookshop_discounts.percent,\n bookshop_books.price,\n bookshop_authors.id AS idAuthors,\n bookshop_authors.authorsName,\n bookshop_genres.id AS idGenres,\n bookshop_genres.genresName\n FROM bookshop_books_to_authors\n INNER JOIN bookshop_books\n ON bookshop_books_to_authors.id_book = bookshop_books.id\n INNER JOIN bookshop_books_to_genres\n ON bookshop_books_to_genres.id_book = bookshop_books.id\n INNER JOIN bookshop_authors\n ON bookshop_books_to_authors.id_author = bookshop_authors.id\n INNER JOIN bookshop_genres\n ON bookshop_books_to_genres.id_genre = bookshop_genres.id\n INNER JOIN bookshop_discounts\n ON bookshop_books.id_discount = bookshop_discounts.id';\n \n $result = $this->db->execute($sql);\n\n if (!$result)\n return $this->error();\n\n return $this->formingBooks($result);\n }", "public function booklist()\n {\n $book = Post::where('key', 'book')->get();\n return view('backends.booklist')->with('book', $book);\n }", "public function getallBooks()\r\n {\r\n $sql = \"SELECT id, name, publisher, year,description FROM book\";\r\n $query = $this->db->prepare($sql);\r\n $query->execute();\r\n\r\n return $query->fetchAll();\r\n }", "public function getListingBooks()\n {\n return $this->listingBooks;\n }", "public function get_book();", "public function bookIndex(): array\n {\n return $this->bookRepository->findAllUserBooks(\\Auth::user()->getUid());\n }", "public function showAllBooks()\n {\n return response()->json(Book::all());\n }", "public function index()\n {\n return BookResources::collection(Book::with(['user','categories','authors'])->get());\n }", "public function getBooks()\r\n {\r\n $bookNodes = $this->dom->getElementsByTagName('book');\r\n $books = [];\r\n\r\n foreach($bookNodes as $domNode) {\r\n $book = [];\r\n\r\n foreach($domNode->childNodes as $dn) {\r\n if ($dn->nodeName === 'author') {\r\n $book['author'] = $dn->nodeValue;\r\n }\r\n\r\n if ($dn->nodeName === 'pages') {\r\n $book['pages'] = $dn->nodeValue;\r\n }\r\n\r\n if ($dn->nodeName === 'title') {\r\n $book['title'] = $dn->nodeValue;\r\n }\r\n\r\n if ($dn->nodeName === 'code') {\r\n $book['code'] = $dn->nodeValue;\r\n }\r\n }\r\n\r\n $books[] = $book;\r\n }\r\n\r\n return $books;\r\n }", "public function index()\n {\n return books::orderBy('created_at')->get();\n }", "public static function get_all_books() {\n\t\t$books = BooksQModel::get_all_books();\n\n\t\tforeach ($books as $book) {\n\t\t\t//shorted description\n\t\t\tif (strlen($book->description) >= 122)\n\t\t\t\t$book->description = mb_substr($book->description, 0, 120).'...';\n\t\t\t//get uploader\n\t\t\t$uploader = UsersQModel::get_user_by_id($book->id_uploader);\n\t\t\tif ($uploader != null)\n\t\t\t\t$book->uploader = $uploader->name;\n\t\t\telse\n\t\t\t\t$book->uploader = 'Đang cập nhật';\n\t\t}\n\n\t\treturn $books;\n\t}", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function getallbooks(){\n\t\t\t$this->db->select('id, name, price, author, category, language, ISBN, publish_date')\n\t\t\t\t\t ->from('tbl_books');\n\t\t\t$this->db->order_by('id', 'desc');\n\n\t\t\t$query = $this->db->get();\n\n\t\t\tif($query->num_rows() > 0){\n\t\t\t\treturn $query->result_array();\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t}", "public function index()\n\t{\n\n\t\t$book_list = Books::select('book_id', 'title', 'author', 'description', 'book_categories.category')\n\t\t\t->join('book_categories', 'book_categories.id', '=', 'books.category_id')\n\t\t\t->orderBy('book_id')->get();\n\t\t// dd($book_list);\n\t\t// $this->filterQuery($book_list);\n\n\t\t// $book_list = $book_list->get();\n\n\t\tfor ($i = 0; $i < count($book_list); $i++) {\n\n\t\t\t$id = $book_list[$i]['book_id'];\n\t\t\t$conditions = array(\n\t\t\t\t'book_id'\t\t\t=> $id,\n\t\t\t\t'available_status'\t=> 1\n\t\t\t);\n\n\t\t\t$book_list[$i]['total_books'] = Issue::select()\n\t\t\t\t->where('book_id', '=', $id)\n\t\t\t\t->count();\n\n\t\t\t$book_list[$i]['avaliable'] = Issue::select()\n\t\t\t\t->where($conditions)\n\t\t\t\t->count();\n\t\t}\n\n\t\treturn $book_list;\n\t}", "public function allBooks ()\n {\n $books = $this->book->findAll();\n $this->show('admin/allbooks', ['books' => $books]);\n }", "public function getBooks()\n {\n return $this->hasMany(Book::className(), ['author_id' => 'id']);\n }", "public function books()\n {\n return $this->morphedByMany('App\\Book', 'source_genre');\n }", "public function returnBookList ($order = 'order') {\n $bookService = new bookService();\n $bookArray = $bookService->getAllBooks();\n return response()->json($bookArray);\n }", "public function getAddressBooks();", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function showmybooks()\n {\n $user = Auth::user();\n return response()->json(BookResource::collection($user->books), 200);\n }", "public function listBooks ($session) {\n\n // get dummy data if books don't exist\n if (!$session->has('books')) {\n $this->dummyData($session);\n }\n\n return $session->get('books');\n\n }", "public function get_books()\n {\n $this->load->database();\n // print_r($this->db->get(\"books\"));\n $query = $this->db->query(\"select * from books\");\n return $query->result();\n }", "function getAllBooks( ) {\n global $db;\n $stmt = mysqli_prepare(\n $db,\n 'SELECT\n books.bid,\n books.title,\n books.description,\n bookauthors.name,\n genres.name,\n books.coverimage\n FROM\n books CROSS\n JOIN bookgenres ON bookgenres.bid = books.bid CROSS\n JOIN genres ON genres.id = bookgenres.genreid CROSS\n JOIN bookauthors ON bookauthors.bid = books.bid CROSS\n JOIN bcopies ON bcopies.bid = books.bid\n WHERE\n bcopies.deleted = 0 AND\n bcopies.given = 0\n ORDER BY\n books.title ASC\n ');\n mysqli_stmt_execute( $stmt );\n mysqli_stmt_store_result( $stmt );\n mysqli_stmt_bind_result( $stmt,$id, $title, $description, $author, $genre, $image );\n while ( mysqli_stmt_fetch( $stmt ) ) {\n $book[ 'title' ] = $title;\n $book[ 'img' ] = $image;\n $book[ 'description' ] = $description;\n $book[ 'authors' ][ $author ] = true;\n $book[ 'genres' ][ $genre ] = true;\n $book[ 'bid' ] = $id;\n $books[ $id ] = $book;\n }\n return $books;\n }", "public function findAllBooks()\n {\n MyLogger::info(\"Entering OwnedBookBusinessService.findAllBooks\");\n //creates a connection\n $db = new Connection();\n $conn = $db->open();\n \n //creates an array of education\n $books = Array();\n \n //calls the data service\n $service = new OwnedBookDataService($conn);\n \n //calls the find all method in the data service\n $books = $service->findAllBooks();\n \n //closes the connection\n $conn = null;\n \n //return the array\n return $books;\n \n MyLogger::info(\"Exiting OwnedBookBusinessService.findAllBooks\");\n }", "public function index()\n {\n $books = book::all();\n return view('backend.book.book_list',compact('books'));\n }", "public function getBorrowedbooks()\n {\n return $this->hasMany(Borrowedbooks::className(), ['bookId' => 'bookId']);\n }", "public function books()\n {\n return $this->morphedByMany('App\\Book', 'taggable');\n }", "public function getBooks($id) {\n }", "static public function getAll()\r\n {\r\n\r\n //connect with DB\r\n $db = Database::getConnect();\r\n $sql = \"SELECT `book_id`,`name`, `author`, `published_date` FROM `books` WHERE `deleted_at` IS NULL ORDER BY `book_id`\";\r\n $result = $db->query($sql);\r\n $result->execute();\r\n return $result->fetchAll();\r\n }", "public function getBook()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t\n\t\t\t$book = D('Book_species');\n\t\t\t$sql = \"SELECT * FROM lib_book_species as a, \n\t\t\t (SELECT COUNT(*) as number, isbn as isbn2 FROM lib_book_unique \n\t\t\t\t\twhere book_id not in(select book_id from lib_remove) GROUP BY isbn) AS b \n\t\t\t where a.isbn = b.isbn2 and number!=0 ORDER BY species_id DESC LIMIT 0,20;\";\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Nothing, please add book!'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function listLentBooks()\n {\n if (!$this->isLogged()) {\n header('Location: index.php');\n }\n\n $idUser = $this->user['id_user'];\n\n if (isset($_GET['page']) AND !empty($_GET['page'])) {\n $currentPage = (int) $this->cleanParam($_GET['page']);\n }\n else {\n $currentPage = 1;\n }\n\n $lentBookCount = $this->bookManager->lentBookCount($idUser);\n\n $perPage = 12;\n\n $pages = ceil($lentBookCount / $perPage);\n\n $first = ($currentPage * $perPage) - $perPage;\n\n if (isset($_GET['f']) AND !empty($_GET['f'])) {\n $filter = $this->cleanParam($_GET['f']);\n if($filter === \"title\") {\n $sortKey = \"title_book\";\n } else if ($filter === \"author\") {\n $sortKey = \"author_book\";\n } else if ($filter === \"all\") {\n $sortKey = \"date_add_book\";\n } else {\n $sortKey = \"date_add_book\";\n }\n }\n else {\n $sortKey = \"date_add_book\";\n }\n\n if(isset($_POST['button_search_engine'])) {\n if(isset($_POST['content_search']) && !empty($_POST['content_search'])) {\n $wishBook = 0;\n $lendBook = 1;\n $content = $this->cleanParam($_POST['content_search']);\n\n $searchBooks = $this->bookManager->listSearchBooks($idUser, $wishBook, $lendBook, $content);\n $countedBooksSearch = count($searchBooks);\n } \n } \n\n $listLentBooks = $this->bookManager->listLentBooks($idUser, $sortKey, $first, $perPage);\n\n if ($listLentBooks === false) {\n header('Location: index.php?action=error404');\n }\n\n require('App/View/listLentBooks.php');\n }", "public function liste()\n {\n $books = DB::select('select * from book');\n return view('get_list', ['book' => $books]);\n }", "public function index()\n {\n $books= DB::table('books') \n ->where('available',true)\n ->get();\n return $books; \n }", "public function index()\n {\n return $this->successResponse($this->client->getBooks());\n }", "public function books(): Collection;", "public function index()\n {\n return BookResource::collection(Book::orderByDesc(\"id\")->get());\n }", "public function get_book()\n {\n $sql = DB::select('select * from books');\n return $sql;\n }", "public function index()\n {\n $this->booklist();\n }", "public function getBooksAttribute()\n {\n return $this->getBible()->getArrayOfBooks();\n }", "public function index()\n {\n $books = Book::where('isApproved', true)->paginate(25);\n return BookResource::collection($books);\n }", "public function index()\n {\n $b = newbook::\n orderBy('id', 'desc')\n //take(10)\n ->get();\n\n return $b->toJson();\n \n }", "public function getBooks($params)\n {\n try {\n $books = $this->book->getAllBooks($params);\n\n if (!empty($books['data'])) {\n\n //Generate paginator using Laravel paginator class\n $paginator = new LengthAwarePaginator($books['data'], $books['total'], $books['per_page'],\n $params['page'], ['path' => '/admin/books']);\n $paginator = $paginator->appends($params);\n $books['paginator'] = $paginator;\n }\n\n return view('admin/books/list', $books);\n } catch (\\Exception $e) {\n return Response::json(['error' => true]);\n }\n }", "function get_all_booksinn($params = array())\n {\n $this->db->select(\"booksinn.*, books.name as bookname\");\n $this->db->join('books','books.id=booksinn.books_id','inner');\n $this->db->order_by('id', 'desc');\n if(isset($params) && !empty($params))\n {\n $this->db->limit($params['limit'], $params['offset']);\n }\n return $this->db->get('booksinn')->result_array();\n }", "public function index()\n { //select all books\n return Book::all();\n }", "public function index()\n {\n $books = Book::orderBy('id', 'desc')->paginate(10);\n return view('admin.Book.list',compact('books'));\n }", "public function getBooks($language)\n\t{\n\t\t$sql = sprintf(\"\n\t\t\tSELECT book, short_name, long_name\n\t\t\tFROM books b INNER JOIN languages l ON (b.language_id=l.id)\n\t\t\tWHERE l.name='%s'\n\t\t\tORDER BY book ASC\", $language);\n\n\t\t$result = mysqli_query($this->db, $sql);\n\n\t\t$books = array();\n\t\twhile ($row = mysqli_fetch_assoc($result))\n\t\t{\n\t\t\t$books[] = $row;\n\t\t}\n\n\t\treturn $books;\n\t}", "public function listall()\r\n {\r\n $this->db->select('*');\r\n $this->db->from('books');\r\n $this->db->join('author', 'books.author_ID=author.Author_ID');\r\n\r\n $q = $this->db->get();\r\n return $q->result();\r\n \r\n\r\n }", "public function getBorrowList()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t// sql\n\t\t\t$book = D('Borrow');\n\t\t\t$sql = \"SELECT * FROM lib_borrow left join lib_book_unique using(book_id) join lib_book_species using (isbn) join lib_user using (user_id);\";\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\tfor($k=0;$k<count($return);$k++){\n\t\t\t\t\t$return[$k]['book_id'] = substr($return[$k]['book_id']+100000,1,5);\n\t\t\t\t}\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'query error'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function getownerBooks($ownerid)\n {\n $sql2 = \"SELECT * from book JOIN item on book.itemid= item.itemid where bUserid= '\".$ownerid.\"'\";\n $bookdetails = mysql_fetch_array(mysql_query($sql2));\n return $bookdetails;\n \n }", "function outputBooks() {\n $db = connectDB();\n $books = new BooksGateway($db);\n $sql = $books->getSelectStatement();\n // Subcategory filter\n if (!empty($_GET['subcategory']) && empty($_GET['imprint'])) {\n $sql .= 'where SubcategoryName = \"'. $_GET['subcategory'] .'\"';\n }\n // Imprint filter\n elseif(empty($_GET['subcategory']) && !empty($_GET['imprint'])) {\n $sql .= 'where Imprint =\"' . $_GET['imprint']. '\"';\n }\n // Both filter\n elseif(!empty($_GET['subcategory']) && !empty($_GET['imprint'])) {\n $sql .= 'where SubcategoryName = \"'. $_GET['subcategory'] .'\"' . 'AND'.'Imprint =\"' . $_GET['imprint']. '\"';\n }\n // No filter\n else {\n // Print all books.\n }\n $sql .= ' group by Title order by Title ASC limit 0,20';\n $result = $books->getStatement($sql);\n //var_dump($result);\n foreach($result as $key => $value) {\n $img= '<img src=\"book-images/thumb/'.$result[$key]['ISBN10']. '.jpg\" alt=\"book\">';\n echo constructBookLink($result[$key]['ISBN10'], $img) .'<br/>';\n echo '<a href=\"single-book.php?ISBN10=' . $result[$key]['ISBN10'] . '\" class=\"';\n if (isset($_GET['ISBN10']) && $_GET['ISBN10'] == $result[$key]['ISBN10']) echo 'active';\n echo 'item\">';\n echo $result[$key]['Title'] . '</a><br/>'; \n echo '<p>';\n echo \"<span>Year: </span>\". $result[$key]['CopyrightYear'] . \"<br/>\";\n echo \"<span>Subcategory Name: </span>\". $result[$key]['SubcategoryName'] . \"<br/>\";\n echo \"<span>Imprint Name: </span>\". $result[$key]['Imprint']. \"<br/>\";\n echo '</P><br/>';\n }\n }", "public function index()\n {\n try {\n $o=array();\n $books = $this->model->with(['book_clubs','genres','product_prices','users'])->where('status',1)->orderBy('title','ASC')->paginate(100);\n foreach($books as $book){\n $user=User::findOrFail($book->user_id);\n if($user->status==1){\n array_push($o,$book);\n }\n }\n if(count($o) != 0) {\n return (new BookCollection($o));\n }\n else {\n return ApiHelper::apiResult(true,HttpResponse::HTTP_OK,\"No Books Found\");\n }\n }\n catch(\\Exception $e) {\n return ApiHelper::apiResult(false,HttpResponse::HTTP_UNAUTHORIZED,$e->getMessage());\n }\n }", "public function index()\n {\n $bookings = Booking::all()->sortByDesc('created_at')->forPage(0, 20);\n return $bookings;\n }", "public function getBook($isbn);", "public function index()\n {\n $bookRecord = BookRecord::with(['borrower','book']);\n return BookRecordResource::collection($bookRecord->paginate(20))->response();\n }", "public function index()\n {\n // return collection of all book's reviews\n return ReviewBookIndexResource::collection(ReviewBook::info()->get());\n }", "public function getBook()\n {\n return $this->_book;\n }", "public function getBooks(\n\t\t$from = 0, $limit = 12, $orderBy = 'id',\n\t\t$cena_od = 0,\t$cena_do = NULL, $hladaj = NULL, $autor = NULL\n\t\t) {\n\t\t$whereSql = ' price >= :cena_od AND price <= :cena_do ';\t\t\n\t\t$whereHodnoty = [\t\t\t\t\n\t\t\t\t'cena_od' => $cena_od,\n\t\t\t\t'cena_do' => ($cena_do === NULL) ? '99999' : $cena_do, \n\t\t\t];\n\t\t\t// 99999 get max price\n\n\t\t\tif($hladaj != NULL) {\n\t\t\t\t$whereSql .= ' AND MATCH (title, description, excerpt) AGAINST (:hladaj) ';\n\t\t\t\t$whereHodnoty['hladaj'] = $hladaj;\n\t\t\t}\n\n\t\t\tif($autor != NULL) {\n\t\t\t\t$whereSql .= ' AND author = :autor ';\n\t\t\t\t$whereHodnoty['autor'] = $autor;\n\t\t\t}\n/*\n \t\t\tif($hladaj != NULL) {\n \t\t\t\t$whereSql .= ' OR authors.name LIKE :hladaj_autora ' ;\t\n \t\t\t\t$whereHodnoty['hladaj_autora'] = '%'.$hladaj.'%';\n \t\t\t\t\t\t\t\n \t\t\t}\n*/\n\n\n\t\t$this->db;\t\t\n\t\t$sth = $this->db->prepare(' SELECT * FROM ' . self::TABLE_NAME . ' \n \n\t\tWHERE '.$whereSql.'\n\n\t\tORDER BY ' . $orderBy . '\n\n\t\tLIMIT ' . $from . ', '. $limit . ' ' \n\n\t\t);\n\n\n\t\t$sth->execute( $whereHodnoty );\n\t\t\n\n\n $books = [];\n\t\twhile($book = $sth->fetchObject(__CLASS__)) {\n\n\t\t $books[] = $book;\t\n\t\t\n\t }\n\n\t\t$this->count = $this->getCount($whereSql , $whereHodnoty);\n\n\t\treturn $books;\n\n\t\t//var_dump($books);\n\t\t\n }", "public function index() {\n $books = Book::orderBy('created_at', 'desc')->get()->toArray();\n\n $books = array_map(function ($book) {\n $review_author = Book::find($book['id'])->user()->first()->name;\n $book['review_author'] = $review_author;\n return $book;\n }, $books);\n\n return $books;\n }", "public function latest_books()\n {\n //thiet lap rieng\n $this->paginate = array(\n 'fields' => array('id', 'title', 'slug', 'image', 'sale_price'),\n 'order' => array('created' => 'desc'),\n 'limit' => 8,\n 'contain'=> array(\n 'Writer' => array('name', 'slug')\n ),\n 'conditions' => array('published'=>1),\n 'paramType'=> 'querystring', //thay đổi đường dẫn xuất hiện\n );\n $books = $this->paginate(); //mac dinh la 20 quyen sach va k co thiet lap dieu kien muon thiet lap dieu kien thi dung bien public paginate\n \n $this->set('books', $books);\n $this->set('title_for_layout', 'Sach moi Chiken');\n }", "public function customerBooks()\n {\n if (!empty($this->books)) {\n //return $this->books;\n }\n\n $this->books = $this->customerService->customerBooks();\n\n return $this->books;\n }", "public function index()\n {\n $books = $this->bookRepository->getAll();\n\n return response()->json($books);\n }", "public static function get_iterator() {\n global $DB;\n\n $books = $DB->get_records('book');\n return $books;\n }", "function booksList($offset, $total_records_per_page, $order, $ascdesc)\n{\n $booksManager = new ListManager();\n\n\n\n if (isset($_GET['search']) && $_GET['search']!='') {\n $search = input(addcslashes($_GET['search'], '_'));\n $search=\"%\".$search.\"%\";\n $books = $booksManager->get_search($offset, $total_records_per_page, $order, $ascdesc, $search);\n } elseif (isset($_GET['cat']) && $_GET['cat']!='') {\n $cat = input($_GET['cat']);\n $books = $booksManager-> get_cat($offset, $total_records_per_page, $order, $ascdesc, $cat);\n } else {\n $books = $booksManager->selectAll($offset, $total_records_per_page, $order, $ascdesc); // Appel la fonction qui renvoie toutes les données sur les livres en bdd\n }\n // require('view/listView.php');\n return $books;\n echo selectAll();\n}", "public function BooksLS($id){\n\t\t$url = 'http://192.168.1.5:8000/query/bookid/' . $id;\n\t\t$page = file_get_contents($url);\n\t\treturn response()->json(json_decode($page));\n\t}", "public static function get_catalog_books($catalogID = false) {\n $all = BookVolume::get();\n $results = new ArrayList();\n\n if ($catalogID) {\n foreach ($all as $volume) {\n if ($volume->inCatalog($catalogID)) {\n $results->push($volume);\n }\n }\n\n return $results;\n } else {\n return $all;\n }\n }", "public function books()\n {\n\t \t return $this->belongsToMany(Book::class);\n }", "public function index()\n {\n $books = Book::all();\n return view('Admins.books.books',compact('books'));\n }", "public function index()\n {\n $books = Book::where('status','=','borrowed')->get();\n return view('page.book.index',['books'=>$books]);\n }", "public function findAll() {\n $sql = \"select * from book order by book_id desc\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $livres = array();\n foreach ($result as $row) {\n $livreId = $row['book_id'];\n $livres[$livreId] = $this->buildDomainObject($row);\n }\n return $livres;\n }", "public function getBook()\n\t{\n\t\treturn $this->getKeyValue('book'); \n\n\t}", "public function index()\n {\n $books = Book::with('category')->where(['deleted' => 0])->orderBy('name')->paginate(5);\n return $this->successResponse($books);\n }", "public function findbooks()\n\t{\n\n\t\t// baca key dari form cari data\n\t\t$key = $_POST['key'];\n\n\t\t// ambil session fullname untuk ditampilkan ke header\n\t\t$data['fullname'] = $_SESSION['fullname'];\n\n\t\t// panggil method findBook() dari model book_model untuk menjalankan query cari data\n\t\t$data['book'] = $this->book_model->findBook($key);\n\n\t\t// tampilkan hasil pencarian di view 'dashboard/books'\n\t\t$this->load->view('dashboard/header', $data);\n\t\t$this->load->view('dashboard/sidebar');\n\t\t$this->load->view('dashboard/books', $data);\n\t\t$this->load->view('dashboard/footer');\n\t}", "function books_list()\n\t{\n global $wpdb;\n\n \t$this->check_dir();\n \t$this->check_db();\n\n $list = '';\n $list .= \"<table class=\\\"form-table\\\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>ID</h3></th>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>Preview</h3></th>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>Creation Date</h3></th>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>Operation</h3></th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody> \";\n\n\t $sql = \"select `id`, `name`, `date` from `\".$this->table_name.\"` order by `id`\";\n\t $piecemakers = $wpdb->get_results($sql, ARRAY_A);\n\n\t if(count($piecemakers) == \"0\") \n\t\t\t$list\t.= \"<tr class=\\\"alternate author-self status-publish\\\" valign=\\\"top\\\">\"\n\t\t\t\t\t.\"<td colspan=\\\"5\\\" style=\\\"text-align: center;\\\"><strong>There are currently no Piecemakers defined</strong></td></tr>\";\n\n else foreach($piecemakers as $piecemaker) {\n\t\t\t\t$creationDate = date(\"d/m/Y\", $piecemaker['date']);\n\t\t\t\t$piecemakerXml = $this->get_xml($piecemaker['id']);\n\t\t\t\t$piecemakerTable = $this->xml_to_table($piecemaker['id']);\n\n\t\t\t\t$list\t.=\"<tr class=\\\"alternate author-self status-publish\\\" valign=\\\"top\\\">\"\n\t\t\t\t\t\t.\"<td width=\\\"10%\\\" style=\\\"text-align: center;\\\"><strong>\".$piecemaker['id'].\"</strong></td>\" \n\t\t\t\t\t\t.\"<td width=\\\"20%\\\" style=\\\"text-align: center;\\\">\".$this->printImg($piecemakerTable['allPages']['src'][0]).\"</td>\"\n\t\t\t\t\t\t.\"<td width=\\\"15%\\\" style=\\\"text-align: center;\\\">\n\t\t\t\t\t\t\t\t\".$creationDate.\"\n\t\t\t\t\t\t\t </td>\n\t\t\t\t\t\t\t <td width=\\\"35%\\\" style=\\\"text-align: center;\\\">\n\t\t\t\t\t\t\t\t\t <form name=\\\"operations\\\" id=\\\"operations\\\" method=\\\"post\\\" action=\\\"\\\">\n\t\t\t\t\t\t\t\t\t <input name=\\\"id\\\" value=\\\"\".$piecemaker['id'].\"\\\" type=\\\"hidden\\\"/>\";\n\n\t\t\t\tif($piecemakerXml)\n\t\t\t\t\t$list \t.= \"<input class=\\\"add_page\\\" name=\\\"do\\\" value=\\\"Add Slide\\\" type=\\\"submit\\\" title=\\\"Add Slide\\\"/>\"\n\t\t\t\t\t\t.\"<input class=\\\"piecemaker_properties\\\" name=\\\"do\\\" value=\\\"Book Properties\\\" type=\\\"submit\\\" title=\\\"Piecemaker Properties\\\"/>\"\n\t\t\t\t\t\t.\"<input class=\\\"view_pages\\\" name=\\\"do\\\" value=\\\"View pages\\\" type=\\\"submit\\\" title=\\\"View Pages\\\" />\"\n\t\t\t\t\t\t.\"<input class=\\\"add_transition\\\" name=\\\"do\\\" value=\\\"Add Transition\\\" type=\\\"submit\\\" title=\\\"Add Transition\\\" />\"\n\t\t\t\t\t\t.\"<input class=\\\"view_transitions\\\" name=\\\"do\\\" value=\\\"View Transitions\\\" type=\\\"submit\\\" title=\\\"View Transitions\\\" />\"\n\t\t\t\t\t\t.\"<input class=\\\"delete\\\" name=\\\"do\\\" value=\\\"Delete Book\\\" type=\\\"submit\\\" onClick=\\\"return confirm('Delete this book?')\\\"/ title=\\\"Delete\\\">\"\n\t\t\t\t\t\t.\"</form> </td> </tr>\";\n\n\t\t\t}\n $list .= \"</tbody></table>\";\n echo $list;\n\t}", "public function getBooks(ConnectionInterface $con = null)\n {\n if ($this->aBooks === null && ($this->_forbook !== null)) {\n $this->aBooks = ChildBooksQuery::create()->findPk($this->_forbook, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aBooks->addIssuess($this);\n */\n }\n\n return $this->aBooks;\n }", "public function getEx11() {\n $books = \\App\\Book::orderBy('title','asc')->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` order by `title` asc\n }", "public function index()\n {\n $books = Book::orderby('created_at','desc')->get();\n return view('book.index');\n }", "public function index()\n {\n $data['languages'] = Language::getLanguages();\n $data['books'] = Book::getAll(3);\n return view('admin.books.index', $data);\n\n }", "public function listBooksToReturn($sid){\n $sql = \"SELECT b.bname, b.authorname, b.edition, r.bookId, r.returndate, r.reservationdate, r.renewBook FROM books b, reservedbooks r WHERE b.bid = r.bookid AND r.studentId = :sid AND returnedbook = 0\";\n $query = $this->db->pdo->prepare($sql);\n $query-> bindValue(\":sid\", $sid);\n $query->execute();\n $result = $query->fetchAll(PDO::FETCH_OBJ);\n return $result;\n }", "public function index()\n {\n return response()->json(Book::orderBy(request('column') ? request('column') : 'updated_at', request('direction') ? request('direction') : 'desc')\n ->search(request('search'))\n ->with('category', 'author')\n ->paginate());\n }", "public static function index()\r\n\t{\r\n\t\t$title = 'Book List';\r\n\t\t$model = new Books();\r\n\t\t$books = $model->all();\r\n\t\t/*\r\n\t\t// compact do this (down):\r\n\t\t$data['title'] = 'Book List';\r\n\t\t$data['books'] = [];\r\n\t\t*/\r\n\t\tView::show('/books/index', compact('title','books'));\r\n\t}", "public function index()\n {\n // return Bookable::all();\n\n return BookableIndexResource::collection(Bookable::paginate(10));\n }", "public function getEx12() {\n $books = \\App\\Book::orderBy('published','desc')->get();\n $this->printBooks($books);\n # Underlying SQL: select * from `books` order by `published` desc\n\t}", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function getBooksByKeyword($keyword) {\n\t\t$this->xpp = new \\XMLReader();\n\t\t$books = array();\n\t\t\n\t\tif ($this->xpp->open('http://books.google.com/books/feeds/volumes?q=' . urlencode($keyword))) {\n\t\t\t$this->moveToEntry();\n\t\t\t$books = array();\n\t\t\t\n\t\t\twhile ($this->xpp->name == \"entry\") {\n\t\t\t\t$books[] = $this->parseBook();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $books;\n\t}", "public function index()\n {\n return BookReviewResource::collection($this->bookReviewRepo->get());\n }", "public function index()\n {\n //\n return BookResource::collection(Book::with('ratings')->paginate(25));\n }", "public function show() // 단어장 목록 보여주기\n\n {\n $books = wbook::where('m_id', 1)->select('wbook_pk AS id', 'wbook_tt AS title')->get();\n $books = json_encode($books, JSON_UNESCAPED_UNICODE);\n return $books;\n //아이디랑 제목 같이 넘김\n }", "static function findBookList($id1, $id2) {\n $search_book_list = $GLOBALS['DB']->query(\"SELECT * FROM book_list WHERE author_id = {$id1} AND book_id = {$id2}\");\n $found_books = array();\n $found_book = $search_book_list->fetchAll(PDO::FETCH_ASSOC);\n foreach ($found_book as $book){\n $author_id = $book['author_id'];\n $book_id = $book['book_id'];\n $due_date = $book['due_date'];\n $checkout_patron_id = $book['checkout_patron_id'];\n $id = $book['id'];\n $new_book = new BookList($author_id, $book_id, $due_date, $checkout_patron_id, $id);\n array_push($found_books, $new_book);\n }\n return $found_books;\n }" ]
[ "0.85837394", "0.8120957", "0.81092685", "0.80654854", "0.8033083", "0.79663676", "0.7898337", "0.78913563", "0.7886133", "0.7874153", "0.7852792", "0.7781598", "0.7758843", "0.77148515", "0.7558639", "0.7542248", "0.74196696", "0.7380187", "0.73245835", "0.7269912", "0.7264397", "0.72211033", "0.7217308", "0.71721244", "0.71494794", "0.71398187", "0.71212536", "0.7101134", "0.70988274", "0.7077529", "0.7057923", "0.70439404", "0.70335484", "0.7010946", "0.7004849", "0.6991855", "0.6991619", "0.69911873", "0.69890696", "0.6965401", "0.69477457", "0.69070745", "0.68967605", "0.6896514", "0.68948233", "0.6887834", "0.6887486", "0.6880965", "0.68785393", "0.6843541", "0.68304753", "0.681467", "0.67885995", "0.67673945", "0.66861534", "0.66607165", "0.6654363", "0.66300076", "0.66130817", "0.6606315", "0.65969515", "0.65816724", "0.6578819", "0.65776575", "0.6572741", "0.65696555", "0.6563676", "0.65528166", "0.6541809", "0.65201515", "0.6514271", "0.6508944", "0.65032285", "0.650319", "0.6486064", "0.64310366", "0.6428753", "0.6407807", "0.6406871", "0.6403784", "0.6399611", "0.6398333", "0.63979024", "0.63519555", "0.6351704", "0.63507223", "0.6343293", "0.63354814", "0.6334261", "0.6332357", "0.6332328", "0.63292855", "0.6322941", "0.6301414", "0.62979084", "0.6280097", "0.6267223", "0.6264232", "0.6264129", "0.6261228" ]
0.78711903
10
Get the books by id
public function book($id) { return $this->get("/books/{$id}"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBooks($id) {\n }", "public function getBookById($id) {\n\t\t$book = null;\n\n foreach ($this->db-> query(\"SELECT * FROM book WHERE id=$id\") as $row){\n \n $book = new Book($row['title'], $row['author'], $row['description'], $row['id']);\n }\n\n return $book;\n }", "public function getbookById($id)\n {\n return $this->bookDao->getbookById($id);\n }", "public function getBook($id) {\n // the database using eloquent to return the record with matching id in JSON with 200 as the response code.\n \n if (Book::where('id', $id)->exists()) {\n $book = Book::where('id', $id)->get()->toJson(JSON_PRETTY_PRINT);\n return response($book, 200);\n } else {\n return response()->json([\n \"message\" => \"book not found\"\n ], 404);\n }\n }", "public function show($id)\n {\n //\n return book::where('id', '=', $id)->get();\n }", "public function BooksLS($id){\n\t\t$url = 'http://192.168.1.5:8000/query/bookid/' . $id;\n\t\t$page = file_get_contents($url);\n\t\treturn response()->json(json_decode($page));\n\t}", "public function find(int $id)\n {\n return $this->bookRepo->find($id);\n }", "public function getBookById($id) {\n\n $book = Libro::findOrFail($id);\n\n return $book;\n }", "public function getbookbyId($id){\n\n\t\t\t$this->db->select('id,name, price, author, category, language, ISBN, publish_date')\n\t\t\t\t\t->from('tbl_books')\n\t\t\t\t\t->where('id', $id);\n\n\t\t\t$query = $this->db->get();\n\n\t\t\tif($query->num_rows() == 1){\n\t\t\t\treturn $query->row();\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn 0;\t\n\t\t\t}\n\t\t\t\n\t\t}", "public function fetchFindBook($id){\n \tif (!$data = $this->_cache->load('bibliobook' . (int)$id)) {\n $refs = $this->getAdapter();\n $select = $refs->select()\n ->from($this->_name, array('pages_plates','reference','pubID'))\n ->joinLeft('publications','publications.secuid = bibliography.pubID',\n array('publicationtitle' => 'title', 'authors'))\n ->joinLeft('finds','finds.secuid = bibliography.findID', array('id'))\n ->where($this->_name . '.id = ?', $id);\n $data = $refs->fetchAll($select);\n \t$this->_cache->save($data, 'bibliobook' . (int)$id);\n \t}\n return $data;\n }", "public function show($id)\n {\n return $this->book->find($id);\n }", "public function show($id)\n {\n return Book::find($id);\n }", "function get_booksinn($id)\n {\n return $this->db->get_where('booksinn',array('id'=>$id))->row_array();\n }", "function get_book( $id ) {\r\n\t$options = get_option('nowReadingOptions');\r\n\t\r\n\t$id = intval($id);\r\n\t\r\n\t$books = get_books('include=' . $id);\r\n\t\r\n\treturn $books[0];\r\n}", "public function show($id)\n {\n return $this->authorService->findAuthor($id, ['books']);\n }", "public function showbook($id)\n {\n $books = Book::find($id);\n return response(array(\n 'success' => true,\n 'books' =>$books,\n ),200);\n }", "public static function bookDetail($id) {\n\n $detail_book = \"SELECT \"\n . \"c.category_name, \"\n . \"a.book_title, \"\n . \"a.id_book, \"\n . \"b.author_name, \"\n . \"a.book_image, \"\n . \"a.book_subject, \"\n . \"a.book_ISBN, \"\n . \"a.book_price, \"\n . \"a.book_discount \"\n . \"FROM books a \"\n . \"JOIN authors b ON a.id_author=b.id_author \"\n . \"JOIN categories c ON a.id_category=c.id_category \"\n . \"WHERE a.id_book='\" . $id . \"';\";\n\n if ($result = DB::getInstance()->query($detail_book)) {\n if ($result->num_rows > 0) {\n return $result->fetch_array(MYSQLI_ASSOC);\n } else {\n return false;\n }\n } else {\n return false;\n } \n }", "public function publisherBooks($id)\n {\n $publisher = Publisher::where('id', $id)->first();\n\n $books = DB::table('books')\n ->join('categories', 'books.category_id', '=', 'categories.id')\n ->join('authors', 'books.author_id', '=', 'authors.id')\n ->select('books.*', 'categories.name as category', 'authors.name as author')\n ->where('books.publisher_id', $id)\n ->paginate(20);\n\n\n return response()->json(['success' => true, 'publisher' => $publisher, 'books' => $books]);\n }", "public static function getBooksByGenre($id) {\n $query = Book::find()->innerJoin('book_genre', '`book_genre`.`book_id` = `book`.`id`')->innerJoin('genre', '`book_genre`.`genre_id` = `genre`.`id`')->where(['genre_id'=> $id]);\n\n\n // get the total number of articles (but do not fetch the article data yet)\n $count = $query->count();\n\n // create a pagination object with the total count\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 2]);\n\n // limit the query using the pagination and retrieve the articles\n $books = $query->offset($pagination->offset)\n ->limit($pagination->limit)\n ->all();\n\n $data['books'] = $books;\n $data['pagination'] = $pagination;\n\n return $data;\n }", "public function show(int $id)\n {\n return new BookResources(Book::with(['user','categories','authors'])->findOrFail($id));\n }", "public function show($id)\n {\n $book = DB::table('books')\n ->join('categories', 'books.category_id', '=', 'categories.id')\n ->select(DB::raw('books.id, books.name, books.author, books.category_id, books.published, books.available, books.user_id'))\n ->where('books.id', $id)\n ->get();\n return response()->json(['status'=>'ok','data'=>$book], 200);\n }", "public function getLivreById($id)\n {\n // En guise de test on passe à cette fonction l'id d'un bouquin qu'on a déjà et si la fonction renvoi rien, c'est qu'elle est bugguée\n $em = $this->getDoctrine()->getManager();\n $livre = $em->getRepository(book::class)->find($id);\n return $livre;\n }", "public function getDataBook($id)\n {\n $books = Book::find($id);\n\n return response()->json($books);\n }", "public function findByBookId($bookId);", "public function get($id)\n {\n return new BookResource(Book::find($id));\n }", "public function getBook ($session, $id) {\n\n // get dummy data if books don't exist\n if (!$session->has('books')) {\n $this->dummyData($session);\n }\n\n return $session->get('books')[$id];\n\n }", "public function getBookId($id)\n {\n return $this->db->get_where($this->table, array('id_book' => $id))->row_array();\n }", "function getById($id)\n\t{\n\t\t$json = @file_get_contents(\"http://api.douban.com/v2/book/\".$id);\n\t\tif($json == null) $json = '{\"msg\":\"book_not_found\",\"code\":6000,\"request\":\"GET \\/v2\\/book\\/'.$id.'\"}';\n\t\t// echo $json;\n\t\t$array = json_decode($json, true);\n\t\treturn $array;\n\t}", "public function getBooks()\n {\n $sql = 'SELECT bookshop_books.id,\n bookshop_books.description,\n bookshop_books.booksName,\n bookshop_books.pubyear,\n bookshop_discounts.id AS discountsId,\n bookshop_discounts.discountsName,\n bookshop_discounts.percent,\n bookshop_books.price,\n bookshop_authors.id AS idAuthors,\n bookshop_authors.authorsName,\n bookshop_genres.id AS idGenres,\n bookshop_genres.genresName\n FROM bookshop_books_to_authors\n INNER JOIN bookshop_books\n ON bookshop_books_to_authors.id_book = bookshop_books.id\n INNER JOIN bookshop_books_to_genres\n ON bookshop_books_to_genres.id_book = bookshop_books.id\n INNER JOIN bookshop_authors\n ON bookshop_books_to_authors.id_author = bookshop_authors.id\n INNER JOIN bookshop_genres\n ON bookshop_books_to_genres.id_genre = bookshop_genres.id\n INNER JOIN bookshop_discounts\n ON bookshop_books.id_discount = bookshop_discounts.id';\n \n $result = $this->db->execute($sql);\n\n if (!$result)\n return $this->error();\n\n return $this->formingBooks($result);\n }", "public function getDataByID($id){\n $query = $this->db->query('select from books where ID');\n }", "public function showOneBook($id)\n {\n // Return list of books\n $book = Book::find($id);\n\n // Return related rating and round it to the nearest whole number\n $rating = round(Book::find($id)->rating->avg('value'));\n\n return response()->json(['books' => $book, 'rating' => $rating]);\n }", "public function getBooks()\n {\n $page = isset($_GET['page']) ? $_GET['page'] : 1;\n $this->limit = isset($_GET['limit']) ? $_GET['limit'] : $this->limit;\n $offset = $this->limit * ($page - 1);\n\n\n if (USE_ONE_TABLE) {\n $this->table = 'books_authors';\n $sql = \"SELECT * FROM $this->table WHERE `deleted` is NULL LIMIT :limit OFFSET :offset\";\n } else {\n $this->table = 'relations';\n $sql = \"SELECT books.id, book_name, GROUP_CONCAT(name_author SEPARATOR ', ') as 'author' , year, num_pages, about_book, deleted, views, clicks, image\n FROM books \n JOIN relations ON book_id = books.id\n JOIN authors ON authors.id = author_id\n WHERE deleted is NULL \n GROUP BY id\n LIMIT :limit OFFSET :offset\";\n }\n\n $params = [\n [\":limit\", $this->limit, \\PDO::PARAM_INT],\n [\":offset\", $offset, \\PDO::PARAM_INT]\n ];\n return $this->bindAndQuery($sql, $params);\n }", "function get_product_pricebooks($id)\n\t{\n\t\tglobal $log,$singlepane_view;\n\t\t$log->debug(\"Entering get_product_pricebooks(\".$id.\") method ...\");\n\t\tglobal $mod_strings;\n\t\trequire_once('modules/PriceBooks/PriceBooks.php');\n\t\t$focus = new PriceBooks();\n\t\t$button = '';\n\t\tif($singlepane_view == 'true')\n\t\t\t$returnset = '&return_module=Products&return_action=DetailView&return_id='.$id;\n\t\telse\n\t\t\t$returnset = '&return_module=Products&return_action=CallRelatedList&return_id='.$id;\n\n\n\t\t$query = \"SELECT ec_pricebook.pricebookid as crmid,\n\t\t\tec_pricebook.*,\n\t\t\tec_pricebookproductrel.productid as prodid\n\t\t\tFROM ec_pricebook\n\t\t\tINNER JOIN ec_pricebookproductrel\n\t\t\t\tON ec_pricebookproductrel.pricebookid = ec_pricebook.pricebookid\n\t\t\tWHERE ec_pricebook.deleted = 0\n\t\t\tAND ec_pricebookproductrel.productid = \".$id;\n\t\t$log->debug(\"Exiting get_product_pricebooks method ...\");\n\t\treturn GetRelatedList('Products','PriceBooks',$focus,$query,$button,$returnset);\n\t}", "public function show($id)\n {\n $books = $this->bookRepository->show($id);\n\n return response()->json($books);\n }", "public function getAllBooks(){\n $query = \"SELECT * FROM Book;\";\n return $this->getBookDetail($query);\n }", "public function livre($id){\n\t\t$book = DB::select('select * from book where id = ?', [$id]);\n\t\treturn view('get_list', ['book' => $book]);\n\t}", "public function find($id) {\n $sql = \"select * from book where book_id=?\";\n $row = $this->getDb()->fetchAssoc($sql, array($id));\n\n if ($row)\n return $this->buildDomainObject($row);\n else\n throw new \\Exception(\"No book matching id \" . $id);\n }", "public function getByTag($id)\n\t{\n\t\t$tags = Tag::with('books')->get()->find($id);\n\t\t$this->layout->content = View::make('books.index', array('books'=>$tags->books));\n\t}", "public function getBookid($book_id){\n $db = new DbConnect();\n $con =$db->connect();\n $books_id = mysqli_real_escape_string($con,$book_id);\n $result = mysqli_query($con,\"SELECT * from book inner join genre ON book.genre_id = genre.genre_id where book.book_id = '$books_id'\");\n $books = mysqli_fetch_array($result,MYSQLI_ASSOC);\n return $books;\n\n }", "public function editBook($id)\n {\n $result = $this->book->find($id);\n\n return $result;\n }", "public function show($id)\n {\n try {\n $book = Book::find($id);\n $this->statusCode = 200;\n $this->statusText = 'success';\n } catch (Exception $e) {\n Log::alert(\"Something went wrong. \" . $e->getMessage());\n }\n\n return response()->json([\n 'status_code' => $this->statusCode,\n 'status' => $this->statusText,\n 'data' => $book == null ?[]:$book // If book is null return empty array\n ]);\n }", "public function userbooks($id)\n {\n try{\n $user = User::find($id);\n $code = 200;\n\n if (empty($user)) {\n $message = 'User was not found';\n } else {\n $message = $user->books()->paginate();\n }\n }catch (\\Exception $e){\n $code = 500;\n $message = 'Error with API: ' . $e->getMessage();\n }finally{\n return Response::json($message, $code);\n }\n }", "public function get_book();", "public function show($id)\n {\n $book = DB::select('SELECT tblbooks.id,tblbooks.name,author_id,\n year_of_publish,\n amount,\n isbn,\n medium,\n image,\n users.name as userName,\n tblcatagories.name as catName\n FROM tblbooks,users,tblcatagories\n WHERE tblbooks.author_id=users.id \n AND cat_id=tblcatagories.id AND tblbooks.id='.$id);\n\n if (sizeof($book) > 0 )\n {\n return view('book.show')->with('book',$book);\n }\n else\n {\n return redirect('/book')->with('error','Book Does not exist!');\n }\n\n }", "public function show($id)\n {\n try {\n $book = Book::with(['category:id,category'])->where('id', $id)->firstOrFail();\n return response()->json($book);\n } catch (ModelNotFoundException $exception) {\n return response()->json(['message' => 'Book not found'], 404);\n }\n }", "public function get($id)\n {\n return DB::table('bukus')->find($id);\n }", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function show($id)\n {\n $book = Book::where('id', $id)->with('user')->first();\n return response()->json($book, 200);\n }", "public function books()\n {\n return $this->get('/books');\n }", "public function show($id) {\n if ($book = Book::find($id)) {\n $review_author = $book->user()->first()->name;\n $book->review_author = $review_author;\n\n // REMOVING USER_ID FROM BOOK FOR SECURITY REASONS\n // unset($book->user_id);\n\n return ['status' => 'found', 'book' => $book];\n };\n return ['status' => 404, \"msg\" => \"Book Not Found\"];\n\n }", "public function show($id) {\n\t\t$book = Book::findOrFail($id);\n\n\t\treturn $this->successResponse($book);\n\t}", "public function getallBooks()\r\n {\r\n $sql = \"SELECT id, name, publisher, year,description FROM book\";\r\n $query = $this->db->prepare($sql);\r\n $query->execute();\r\n\r\n return $query->fetchAll();\r\n }", "public function shows($id)\n {\n $data = Book::find($id);\n return response()->json($data);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function show($id)\n {\n return view('books::show');\n }", "public function show($id)\n {\n return $this->bookingRepository->find($id);\n }", "public function get_by_id($id)\r\n\t{\r\n\t\treturn $this->findByPoperty(array($this->id_field => $id));\r\n\t}", "static function findBookList($id1, $id2) {\n $search_book_list = $GLOBALS['DB']->query(\"SELECT * FROM book_list WHERE author_id = {$id1} AND book_id = {$id2}\");\n $found_books = array();\n $found_book = $search_book_list->fetchAll(PDO::FETCH_ASSOC);\n foreach ($found_book as $book){\n $author_id = $book['author_id'];\n $book_id = $book['book_id'];\n $due_date = $book['due_date'];\n $checkout_patron_id = $book['checkout_patron_id'];\n $id = $book['id'];\n $new_book = new BookList($author_id, $book_id, $due_date, $checkout_patron_id, $id);\n array_push($found_books, $new_book);\n }\n return $found_books;\n }", "public function getBook($isbn);", "public function getBooks(){\n $sql = \"SELECT * FROM book;\";\n $res = mysqli_query($this->link, $sql);\n $books = mysqli_fetch_all($res);\n return $books;\n }", "public function show($id){\n //variabel a digunakan untuk menampilkan hasil\n $a = Booking::find($id);\n return $this->responseHasil(200,true,$a);\n \n }", "public function get( $id );", "function get_by_id($id) {\r\n $this->db->where('id', $id);\r\n return $this->db->get($this->tbl);\r\n }", "public function getBooksByParams($params)\n {\n list($arrParams['idBooks'],\n $arrParams['idAuthors'],\n $arrParams['idGenres']\n ) = explode('/', $params['params'], 4);\n\n $sql = 'SELECT bookshop_books.id,\n bookshop_books.description,\n bookshop_books.booksName,\n bookshop_books.pubyear,\n bookshop_discounts.id AS discountsId,\n bookshop_discounts.discountsName,\n bookshop_discounts.percent,\n bookshop_books.price,\n bookshop_authors.id AS idAuthors,\n bookshop_authors.authorsName,\n bookshop_genres.id AS idGenres,\n bookshop_genres.genresName\n FROM bookshop_books_to_authors\n INNER JOIN bookshop_books\n ON bookshop_books_to_authors.id_book = bookshop_books.id\n INNER JOIN bookshop_books_to_genres\n ON bookshop_books_to_genres.id_book = bookshop_books.id\n INNER JOIN bookshop_authors\n ON bookshop_books_to_authors.id_author = bookshop_authors.id\n INNER JOIN bookshop_genres\n ON bookshop_books_to_genres.id_genre = bookshop_genres.id\n INNER JOIN bookshop_discounts\n ON bookshop_books.id_discount = bookshop_discounts.id';\n\n if ( !$condition = $this->conditionSwitch($sql, $arrParams) )\n return $this->error(404, 63);\n\n $result = $this->db->execute($condition['sql'], ['id' => $condition['id']]);\n\n if (!$result)\n return $this->error();\n\n return $this->formingBooks($result);\n }", "public function getallbooks(){\n\t\t\t$this->db->select('id, name, price, author, category, language, ISBN, publish_date')\n\t\t\t\t\t ->from('tbl_books');\n\t\t\t$this->db->order_by('id', 'desc');\n\n\t\t\t$query = $this->db->get();\n\n\t\t\tif($query->num_rows() > 0){\n\t\t\t\treturn $query->result_array();\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t}", "public function get(string $id);", "public function book($id){\n try{\n $id = Crypt::decryptString($id);\n } catch (DecryptException $e) {\n return 'UPD-E0002';\n }\n \n $book = Book::find($id);\n $authors = Author::all()->where('status', NULL);\n return view('bahai.forms.update.book', compact('book', 'authors'));\n }", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);" ]
[ "0.8623019", "0.81779176", "0.8146076", "0.7855995", "0.7847217", "0.7789382", "0.7778965", "0.77668166", "0.7707386", "0.7695172", "0.76458347", "0.7565044", "0.75385535", "0.7455013", "0.7394145", "0.73688716", "0.733261", "0.7307886", "0.73040533", "0.7281313", "0.7171885", "0.7147463", "0.71332455", "0.7120282", "0.7108873", "0.7072395", "0.7053352", "0.70312744", "0.7013689", "0.6985829", "0.6977262", "0.6958457", "0.6949308", "0.6938539", "0.69276094", "0.6897103", "0.6894146", "0.68491817", "0.6846511", "0.6792409", "0.6750256", "0.6747259", "0.67238414", "0.6708314", "0.66669303", "0.66482097", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66427016", "0.66297424", "0.65996957", "0.6595558", "0.6582838", "0.6569163", "0.65499437", "0.6543798", "0.6536632", "0.6531954", "0.6518791", "0.64989454", "0.64947915", "0.6463317", "0.64591026", "0.6450181", "0.6417295", "0.6414838", "0.6403118", "0.64005417", "0.63912255", "0.6378757", "0.6378757", "0.6378757", "0.6378757", "0.6378757", "0.6378757", "0.6378757", "0.6378757", "0.6378757", "0.6378757", "0.6378757", "0.6378757", "0.6378757", "0.6378757" ]
0.8379085
1
Insert into the database
public function insert(): bool { // Set a return value $return_value = TRUE; // The SQL statement $sql_info = "INSERT INTO employee_info (id,name_first,name_mid,name_last,address,email,city,zip,designation,gender,entry_epoch) VALUE (:id,:first,:mid,:last,:addr,:email,:city,:zip,:des,:sex,now())"; $sql_pass_usr = "INSERT INTO login_info (user_name,user_password,user_id) VALUE(:user_name,:user_password,:user_id)"; // Access the PDO and prepare the statement try { $prep_state1 = $this->db->prepare($sql_info); $prep_state2 = $this->db->prepare($sql_pass_usr); $prep_state1->execute([ ':id' => $this->emp['id'], ':first' => $this->emp['firstname'], ':mid' => $this->emp['middlename'], ':last' => $this->emp['lastname'], ':addr' => $this->emp['address'], ':email' => $this->emp['email'], ':city' => $this->emp['city'], ':zip' => $this->emp['zip'], ':des' => $this->emp['designation'], ':sex' => $this->emp['gender'] ]); $prep_state2->execute([ ':user_name' => $this->emp['emp_username'], ':user_password' => $this->emp['emp_password'], ':user_id' => $this->emp['id'] ]); } catch (\PDOException $PDOException) { $return_value = FALSE; } return $return_value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }", "public function insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }", "public function insert() {\n $conexion = StorianDB::connectDB();\n $insercion = \"INSERT INTO cuento (titulo, contenido, autor) VALUES (\\\"\".$this->titulo.\"\\\", \\\"\".$this->contenido.\"\\\", \\\"\".$this->autor.\"\\\")\";\n $conexion->exec($insercion);\n }", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$insertCols .= \"lp_userid, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$insertCols .= \"lp_random, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$insertCols .= \"lp_deadline, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\t\t\t\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the id property\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\t\t\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "function insert() {\n\t\t$sql = \"INSERT INTO lessons\n\t\t\t\tVALUES (?, ?, ?, ?, ?)\";\n\t\t\n\t\t$this->db->query($sql, array($this->lessons_id, $this->name, $this->date, $this->active, $this->rank));\n\t\t$this->last_insert_id = $this->db->insert_id();\t\t\n\t\t\n\t}", "protected function _insert()\n\t{\n\t\t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->date_modified = $this->date_added;\n\t\t$this->last_online = $this->date_modified;\n\t\t$this->activity_open = $this->date_modified;\n\t\t$this->language_id = \\Core\\Base\\Action::getModule('Language')->getLanguageId();\n\t}", "public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}", "public function insertDatabase();", "public function insert($data);", "protected function insert() {\n $dbh = $this->getDbh();\n $table = $this->tableName;\n $data = [];\n\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n\n $query = 'INSERT INTO `' . $table . '` VALUES (NULL,';\n $first = true;\n foreach ($data AS $k => $value) {\n if (!$first)\n $query .= ', ';\n else\n $first = false;\n $query .= ':'.$k;\n }\n $query .= ')';\n\n $msc = microtime(true);\n\n $sth = $dbh->prepare($query);\n $sth->execute($data);\n\n $msc = microtime(true) - $msc;\n $line = \"insert() => \" . $query . \" with \" . implode(\"', '\", $data);\n $this->writeRequestLog($line, $msc);\n\n return true;\n }", "public function insert() {\n \n }", "protected function saveInsert()\n {\n }", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }", "protected function _insert()\n\t{\n\t}", "public function insert() {\n\t\t$this->insert_user();\n\t}", "public function insert()\n {\n $this->id = insert($this);\n }", "public function insert()\n {\n }", "public function insert()\n {\n }", "public static function insert()\n {\n }", "public function Insert(){\n //Instancia conexao com o PDO\n $pdo = Conecta::getPdo();\n //Cria o sql passa os parametros e etc\n $sql = \"INSERT INTO $this->table (idcidade, cidade) VALUES (?, ?)\";\n $consulta = $pdo->prepare($sql);\n $consulta ->bindValue(1, $this->getIdCidade());\n $consulta ->bindValue(2, $this->getCidade());\n $consulta ->execute();\n $last = $pdo->lastInsertId();\n }", "public function insert()\n {\n \n }", "function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_amphur (amph_name, amph_name_en, amph_pv_id, amph_active)\n\t\t\t\tVALUES(?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array( $this->amph_name, $this->amph_name_en, $this->amph_pv_id, $this->amph_active));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}", "public function insert() {\n\t\t\t\n\t\t\t$insert_array = $this->buildInsertFields();\n\t\t\t$query = \"INSERT INTO \" . $this->table_name . \" (\" . $insert_array['insert_statement'] . \") VALUES (\" . \n\t\t\t\t\t\t\t\t\t$insert_array['values_statement'] . \")\";\n\t\t\treturn $this->query($query, $insert_array['bind_params']);\n\n\t\t}", "public abstract function Insert();", "public function insert() {\n\t\t$db = self::getDB();\n\t\t$sql = \"INSERT INTO posts\n\t\t\t\t\t(nome, conteudo, fk_idUsuario, fk_idTopico)\n\t\t\t\tVALUES\n\t\t\t\t\t(:nome, :conteudo, :fk_idUsuario, :fk_idTopico)\";\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute([\n\t\t\t':nome' => $this->getNome(),\n\t\t\t':conteudo' => $this->getConteudo(),\n\t\t\t':fk_idUsuario' => $this->getFkIdUsuario(),\n\t\t\t':fk_idTopico' => $this->getFkIdTopico()\n\t\t]);\n\t\t$this->idPost = $db->lastInsertId();\n\t}", "abstract public function insert();", "public abstract function insert();", "function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_identification (idf_identification_detail_en, idf_identification_detail_th, idf_pos_id, idf_ctg_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id));\n\t\n\t }", "public function insert(){\n\n global $db;\n\n /** Insert sql query */\n $sql = \"INSERT INTO tbl_calculator (num1, num2, oper, answer)\n VALUES (\" . $this->num1 .\", \" . $this->num2 . \", '\" .$this->oper. \"', \" .$this->answer. \" )\";\n\n /** insert result maintain in log file */ \n error_log($sql);\n\n if ($db->query($sql) === TRUE) {\n error_log(\"New record created successfully\");\n } else {\n error_log(\"Error: \" . $sql . \"<br>\" . $db->error);\n }\n return;\n }", "public function insert()\n {\n # code...\n }", "public function insert(){\n $bd = Database::getInstance();\n $bd->query(\"INSERT INTO canciones(artista, ncancion, idGen, album) VALUES (:art, :nca, :gen, :alb);\",\n [\":art\"=>$this->artista,\n \":gen\"=>$this->idGen,\n \":alb\"=>$this->album,\n \":nca\"=>$this->ncancion]);\n }", "public function insert()\n {\n $sql = new Sql();\n $result = $sql->select(\"CALL sp_usuario_insert(:LOGIN, :PASSWORD)\", array(\n \":LOGIN\"=>$this->getDeslogin(),\n \":PASSWORD\"=>$this->getDessenha()\n ));\n\n if(count($result) > 0){\n $row = $result[0];\n $this->setIdusuario($row['idusuario']);\n $this->setDeslogin($row['deslogin']);\n $this->setDessenha($row['dessenha']);\n $this->setDataCadastro(new DateTime($row['dataCadastro']));\n }\n }", "public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "protected function insert()\n {\n $insert = 'INSERT INTO users (first_name, last_name, email, password)\n VALUES (:first_name, :last_name, :email, :password)';\n $statement = self::$dbc->prepare($insert);\n unset($this->attributes['id']);\n foreach ($this->attributes as $key => $value) {\n $statement->bindValue(\":$key\", $value, PDO::PARAM_STR);\n }\n $statement->execute();\n $this->attributes['id'] = self::$dbc->lastInsertId();\n }", "function insert() {\n if(!$this->valid):\n return;\n endif;\n \n $this->name = mysql_real_escape_string($this->name);\n $this->brief = mysql_real_escape_string($this->brief);\n $this->description = mysql_real_escape_string($this->description);\n $this->games = mysql_real_escape_string($this->games);\n $this->headquarter = mysql_real_escape_string($this->headquarter);\n \n $sql = \"INSERT INTO companies\n (name, brief, description, date_founded, headquarter, website, imageURL, games, num_likes)\n VALUES\n ('$this->name', '$this->brief', '$this->description', '$this->date_founded', '$this->headquarter', '$this->website', '$this->imageURL', '$this->games', '$this->num_likes')\";\n \n if(!mysqli_query($this->con, $sql)) {\n die('Error: ' . mysqli_error($this->con));\n }\n \n //mysqli_close($con);\n \n echo \"<br>Insertion Successful!<br>\";\n }", "function insert($sql){\n\n\t\tglobal $way;\n\t\t$way -> query($sql);\n\n\t}", "public static function Insert(){\r\n }", "protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }", "public function insert() {\n $sql = \"INSERT INTO contratos (numero_contrato, objeto_contrato, presupuesto, fecha_estimada_finalizacion)\n VALUES (:numero_contrato, :objeto_contrato, :presupuesto, :fecha_estimada_finalizacion)\";\n $args = array(\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n if ($stmt) {\n $this->id = $this->getConnection()->lastInsertId();\n }\n\n return !$stmt ? false : true;\n }", "public function insert(){\n\t\tif(!mysql_query(\"INSERT INTO $this->tabla (nombre) VALUES ('$this->nombre')\")){\n\t\t\tthrow new Exception('Error insertando renglón');\n\t\t}\n\t}", "public function insert_into_table(){\n // VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->activity', '$this->date_time')\";\n $query = \"INSERT INTO $this->table_name (item_id, user_id, project_id, user2_id, post_id, post_type, date_time) \n VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->date_time')\";\n $result = mysql_query($query);\n\n $err = mysql_error();\n if($err){\n $file = 'errors.txt';\n file_put_contents($file, $err, FILE_APPEND | LOCK_EX);\n }\n }", "public function insertRequestToDb()\n\t\t{\n\t\t\t$this->columnsInfo->data_seek(0);\n\t\t\t$columns = \"\";\n\t\t\t$values = \"\";\n\t\t\twhile($rowColumn = $this->columnsInfo->fetch_assoc())//$info->fetch_row\n\t\t\t{\n\t\t\t\tif($rowColumn[\"EXTRA\"] == \"auto_increment\")\n\t\t\t\t\tcontinue;\n\t\t\t\t$columns = $columns.\", \".$rowColumn[\"COLUMN_NAME\"];\n\t\t\t\t$val = \"\";\n\t\t\t\tif($rowColumn[\"COLUMN_NAME\"] == \"sid_a\")\n\t\t\t\t\t$val = $_SESSION[\"sid\"];\n\t\t\t\telse if($rowColumn[\"COLUMN_NAME\"] == \"date_a\")\n\t\t\t\t\t$val = \"now()\";\n\t\t\t\telse $val = $this->insertColumnValue($_REQUEST[$rowColumn[\"COLUMN_NAME\"]], $rowColumn[\"IS_NULLABLE\"], $rowColumn[\"DATA_TYPE\"], $rowColumn[\"CHARACTER_MAXIMUM_LENGTH\"]);\n\t\t\t\t$values = \"$values, $val\";\n\t\t\t}\n\t\t\t$columns = substr($columns, 2, strlen($columns));\n\t\t\t$values = substr($values, 2, strlen($values));\n\n\t\t\t$query = \"INSERT INTO $this->table ($columns) values($values);\";\n\t\t\t$GLOBALS[\"db\"]->query($query);\n\t\t\t//$info->free();\n\t\t}", "public function insert() {\n\t$stmt = $this->_database->prepare('INSERT INTO planetterrains (planetid, terrainid, x, y) VALUES (?, ?, ?, ?)');\n\t$stmt->bind_param('iiii', $this->planetid, $this->terrainid, $this->x, $this->y);\n\t$stmt->execute();\n\t$this->refid = $this->_database->insert_id;\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->terrainid = $this->refid;\n\t $this->deposit[$this->refid]->commit();\n\t}\n\telse if (!\\is_array($this->deposit)) {\n\t $this->deposit->terrainid = $this->refid;\n\t $this->deposit->commit();\n\t}\n }", "public function insert($data)\r\n {\r\n \r\n }", "public function insert() {\r\n // Rôle : insérer l'objet courant dans la base de données\r\n // Retour : true / false\r\n // Paramètre : aucun\r\n \r\n // Vérification de l'id\r\n if (!empty($this->getId())) {\r\n debug(get_class($this).\"->insert() : l'objet courant a déjà un id\");\r\n return false;\r\n }\r\n \r\n // Construction de la requête\r\n $sql = \"INSERT INTO `\".$this->getTable().\"` SET \";\r\n $param = [];\r\n $start = true;\r\n \r\n foreach ($this->getChamps() as $nom => $champs) {\r\n if ($nom === $this->getPrimaryKey() or !$champs->getAttribut(\"inBdd\")) {\r\n continue;\r\n }\r\n if ($start) {\r\n $sql .= \"`$nom` = :$nom\";\r\n $start = false;\r\n } else {\r\n $sql .= \", `$nom` = :$nom\";\r\n }\r\n \r\n $param[\":$nom\"] = $champs->getValue();\r\n }\r\n \r\n $sql .= \";\";\r\n \r\n // Préparation de la requête\r\n $req = self::getBdd()->prepare($sql);\r\n \r\n // Exécution de la requête\r\n if (!$req->execute($param)) {\r\n debug(get_class($this).\"->insert() : échec de la requête $sql\");\r\n return false;\r\n }\r\n \r\n // Assignation de l'id\r\n if ($req->rowCount() === 1) {\r\n $this->set($this->getPrimaryKey(), self::getBdd()->lastInsertId());\r\n return true;\r\n } else {\r\n debug(get_class($this).\"->insert() : aucune entrée, ou bien plus d'une entrée, créée\");\r\n return false;\r\n }\r\n }", "function insert($data)\n {\n $this->db->insert($this->table, $data);\n }", "public function _insert($data)\n {\n $this->insert($data);\n }", "function insert() {\n\t \t$sql = \"INSERT INTO evs_database.evs_key_component (kcp_key_component_detail_en, kcp_key_component_detail_th, kcp_cpn_id)\n\t \t\t\tVALUES(?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->kcp_key_component_detail_en, $this->kcp_key_component_detail_th, $this->kcp_cpn_id));\n\t\n\t }", "public function insert(){\n\n }", "public function Do_insert_Example1(){\n\n\t}", "function insert() {\n\t\t$sql = \"INSERT INTO cost_detail (cd_fr_id, cd_seq, cd_start_time, cd_end_time, cd_hour, cd_minute, cd_cost, cd_update, cd_user_update)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq, $this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update));\n\t\t$this->last_insert_id = $this->ffm->insert_id();\n\t}", "protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }", "function insert() {\n\t \n\t \t$sql = \"INSERT INTO evs_database.evs_group (gru_id, gru_name, gru_head_dept,gru_company_id)\n\t \tVALUES(?, ?, ?,?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->gru_id, $this->gru_name, $this->gru_head_dept ,$this->gru_company_id));\n\t }", "public function insert() {\r\n\r\n\t\t// Does the Genre object already have an ID?\r\n\t\tif ( !is_null( $this->id ) ) trigger_error ( \"Genre::insert(): Attempt to insert an Genre object that already has its ID property set (to $this->id).\", E_USER_ERROR );\r\n\r\n\t\t// Insert the Genre\r\n\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t$sql = \"INSERT INTO :table ( id, name ) VALUES ( :id, :name )\";\r\n\t\t$st = $conn->prepare ( $sql );\r\n\t\t$st->bindValue( \":table\", DB_TBL_GENRE, PDO::PARAM_STR );\r\n\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t$st->bindValue( \":name\", $this->name, PDO::PARAM_STR );\r\n\t\t$st->execute();\r\n\t\t$this->id = $conn->lastInsertId();\r\n\t\t$conn = null;\r\n\t}", "public function insertIntoDB($_db){\n\n }", "public function insert(){\n\t\t$parametro = func_get_args();\n\t\t$resultado = $this->execSql($this->INSERT,$parametro);\n//\t\t\tdie();\n\t\tif(!$resultado){\n\t\t\t$this->onError(\"COD_INSERT\",$this->INSERT);\n\t\t}\n\t\treturn $resultado;\n\t}", "public final function insert()\n {\n // Run beforeCreate event methods and stop when one of them return bool false\n if ($this->runBefore('create') === false)\n return false;\n\n // Create tablename\n $tbl = '{db_prefix}' . $this->tbl;\n\n // Prepare query and content arrays\n $fields = array();\n $values = array();\n $keys = array();\n\n // Build insert fields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n // Regardless of all further actions, check and cleanup the value\n $val = $this->checkFieldvalue($fld, $val);\n\n // Put fieldname and the fieldtype to the fields array\n $fields[$fld] = $this->getFieldtype($fld);\n\n // Object or array values are stored serialized to db\n $values[] = is_array($val) || is_object($val) ? serialize($val) : $val;\n }\n\n // Add name of primary key field\n $keys[0] = $this->pk;\n\n // Run query and store insert id as pk value\n $this->data->{$this->pk} = $this->db->insert('insert', $tbl, $fields, $values, $keys);\n\n return $this->data->{$this->pk};\n }", "public function insert($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"INSERT \";\n\t\t$p = $this->clean($params);\t\n\t\t$statement = $prefix.\" \".$params['tables'][0].\" \".$this->genSet($p['set']);\t\n\t\t$DB->exec($statement);\t\n\t}", "public function insert()\n {\n $sql = \"INSERT INTO \" . self::TABLE_NAME . \"(news_name,\n news_slug,\n news_content,\n news_seo_title,\n news_seo_description,\n news_publish_date,\n news_add_date,\n news_update_date,\n user_id,\n status)\n VALUES (?,?,?,?,?,?,?,?,?,?)\";\n $stmt = $this->prepare($sql);\n $stmt->bind_param(\"ssssssssii\",\n $this->getNewsName(),\n $this->getNewsSlug(),\n $this->getNewsContent(),\n $this->getNewsSeoTitle(),\n $this->getNewsSeoDescription(),\n $this->getNewsPublishDate(),\n $this->getNewsAddDate(),\n $this->getNewsUpdateDate(),\n $this->getUserId(),\n $this->getStatus()\n );\n $result = $stmt->execute();\n $stmt->close();\n return $result;\n }", "public function insert() {\n $query = \"INSERT INTO {$this->Table} SET \";\n if($this->Fields) {\n foreach ($this->Fields as $key => $item) {\n if($item['ignore'] != true && $this->$key != \"\" && $this->$key !== null) {\n if($first === false) $query .= \", \";\n $query .= $key.\" = '\".$this->escape($this->$key).\"'\";\n $first = false;\n }\n }\n }\n $result = $this->query($query);\n $this->clear();\n return $result;\n }", "public function insert(){\r\n\t\tif (!$this->new){\r\n\t\t\tMessages::msg(\"Cannot insert {$this->getFullTableName()} record: already exists.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\t$vals[\"`$name`\"] = $value->getSQLValue();\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$sql = 'INSERT INTO '.$this->getFullTableName().' ('.implode(', ',array_keys($vals)).') VALUES ('.implode(', ',$vals).')';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to insert record into '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t// Get this here, because getPrimaryKey can call other SQL queries and thus override this value\r\n\t\t$auto_id = SQL::getInsertId();\r\n\t\t\r\n\t\t$table = $this->getTable();\r\n\t\t// Load the AUTO_INCREMENT value, if any, before marking record as not new (at which point primary fields cannot be changed)\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\tif ($table->getColumn($name)->isAutoIncrement()){\r\n\t\t\t\t$this->$name = $auto_id;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->new = false;\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function insert($mambot);", "public function inserir()\n {\n }", "public function insert($gunBbl);", "public function insert() {\n\n // Does the Course object already have an ID?\n if ( !is_null( $this->courseId ) ) trigger_error ( \"Course::insert(): Attempt to insert course object that already has its ID property set (to $this->courseId).\", E_USER_ERROR );\n\n // Insert the course\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"INSERT INTO course ( courseCode, courseName, description, headTeacher )\n VALUES (:courseCode,:courseName,:description,:headTeacher)\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":courseCode\", $this->courseCode, PDO::PARAM_STR );\n $st->bindValue( \":courseName\", $this->courseName, PDO::PARAM_STR );\n $st->bindValue( \":description\", $this->description, PDO::PARAM_STR );\n $st->bindValue( \":headTeacher\", $this->headTeacher, PDO::PARAM_STR );\n\n $st->execute();\n $this->courseId = $conn->lastInsertId();\n $conn = null;\n }", "public function insert(array $params);", "public function insert()\n\t{\n\t\t$sql_array = array();\n\t\tforeach ($this->object_config as $name => $null)\n\t\t{\n\t\t\t$sql_array[$name] = $this->validate_property($this->$name, $this->object_config[$name]);\n\t\t}\n\n\t\t$sql = 'INSERT INTO ' . $this->sql_table . ' ' . $this->db->sql_build_array('INSERT', $sql_array);\n\t\t$this->db->sql_query($sql);\n\n\t\tif ($id = $this->db->sql_nextid())\n\t\t{\n\t\t\t$this->{$this->sql_id_field} = $id;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function execInsert($database, $data)\r\n {\r\n $this->db->insert($database, $data);\r\n }", "public function insert(){\n $sql = \"INSERT INTO author(\n name,\n job,\n created_at\n )\n VALUES(\n 'tgedf', 'sdvsdv', NOW())\";\n return $this->pdo->exec($sql);\n\n }", "public function insert($post);", "function insert() {\n\t\tglobal $_DB_DATAOBJECT; //Indicate to PHP that we want to use the already-defined global, as opposed to declaring a local var\n\t\t//Grab the database connection that has already been made by the parent's constructor:\n\t\t$__DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];\n\t\tif ($this->reg_type != null) {\n\t\t\t$this->badge_number = $__DB->nextId('badge_number'); //Fetch the next id in the sequence. To set the sequence to a specifc value, use phpMyAdmin to tweak the value in the badge_number_seq table\n\t\t}\n\t\treturn DB_DataObject::insert();\n\t}", "public function insert($tableName, $data);", "function insert() {\n\t\t$sql = \"INSERT INTO umgroup (GpID, GpNameT, GpNameE, GpDesc, GpStID)\n\t\t\t\tVALUES(?, ?, ?, ?, ?)\";\n\t\t\n\t\t \n\t\t$this->ums->query($sql, array($this->GpID, $this->GpNameT, $this->GpNameE, $this->GpDesc, $this->GpStID));\n\t\t$this->last_insert_id = $this->ums->insert_id();\n\t\t$this->last_insert_GpNameT = $this->GpNameT;\n\t\t//echo $this->last_insert_GpNameT;\n\t}", "function insert($data)\n {\n $this->db->insert($this->table, $data);\n }", "abstract protected function doInsert($subject, Statement $insertStatement);", "public function save(){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Find the columns from the model\n\t\t$columns = static::$columns;\n\n\t\t//because ID is AI we dont want to put a value in it\n\t\tunset($columns[array_search('id', $columns)]);\n\t\t//Same with timestamp\n\t\tunset($columns[array_search('timestamp', $columns)]);\n\n\t\t//Create an insert query which gets linked to the database\n\t\t$query = \"INSERT INTO \" . static::$tableName . \" (\". implode(\",\", $columns) . \") VALUES (\";\n\n\t\t//create a variable called insesrtcols. This is where we put the values\n\t\t$insertcols = [];\n\t\t//For each of the columns in the columns array, add that column into the insert cols array, and seperate it with a :\n\t\tforeach ($columns as $column) {\n\t\t\tarray_push($insertcols, \":\" . $column);\n\t\t}\n\t\t//turn the insertcols array into 1 string and put a , between each entry\n\t\t$query .= implode(\",\", $insertcols);\n\t\t//close the query\n\t\t$query .= \")\";\n\n\t\t//Prepare the query\n\t\t$statement = $db->prepare($query);\n\n\t\t//Foreach of the columns run this function\n\t\tforeach ($columns as $column) {\n\t\t\t//Attach the value to each of the columns\n\t\t\t//Hash the password\n\t\t\tif($column === 'password'){\n\t\t\t\t$this->$column = password_hash($this->$column, PASSWORD_DEFAULT);\n\t\t\t}\n\t\t\t$statement->bindValue(\":\" . $column , $this->$column);\n\t\t}\n\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Get the id of the query which was just added\n\t\t$this->id = $db->lastInsertID();\n\t}", "public function insert(DataObject $insertObject, Database_Config $databaseConfig = NULL);", "public function insert($insertConnection,$title,$description,$dueDate,$addDate,$editDate,$isDone){\n try {\n $query =\"INSERT INTO $this->tableName (title,description,dueDate,addDate,editDate,isDone)\n VALUES ('$title','$description','$dueDate','$addDate','$editDate','$isDone')\";\n $insertConnection->exec($query);\n echo json_encode(\"New record created successfully\");\n $insertConnection = null;\n } catch (PDOException $e) {\n echo json_encode(\"Execute failed: \".$e->getMessage());\n }\n }", "protected function insert() {\n // get firat line and use it as title\n $this->title = $this->getFileTitle();\n\n $insertDoc = $this->dbConn->prepare(\"\n INSERT INTO docs(file_name, title, content, count_of_terms) \n VALUES (:fileName, :title, :content, :count_of_terms)\");\n $result = $insertDoc->execute(array(\n ':fileName' => $this->fileName,\n ':title' => $this->title,\n ':content' => $this->content,\n ':count_of_terms' => count($this->uniqueMatchesStatus)\n ));\n\n if ($result) {\n $this->id = $this->dbConn->lastInsertId();\n } else {\n throw new Exception('Error on insert document in database.', 500);\n }\n }", "public function testInsert()\n {\n // todo create this in other database or maybe create mockup\n \n /*\n $arr = array (\n 'head' => 'Hello World!!',\n 'body' => 'Hello this is my world..',\n 'created' => date('Y-m-d H:i:s')\n );\n\n $this->noteTable->insert($arr);\n */\n }", "public function insertSql()\n {\n $sql = \"INSERT INTO \" . $this->dbName . '.' . $this->table\n . \" (\" . implode($this->fields, \", \") . \")\n VALUES (:\" . implode($this->fields, \", :\") . \");\";\n\n $this->query = $sql;\n }", "public function insert($table, array $data);", "public function insertRecord ($sqlString);", "public function insert($table);", "public function insert(){\n\t\t// $post->title = 'A post from the insert method';\n\t\t// $post->body = 'Some random ghibberrish';\n\t\t// $post->save();\n\n\t\t$data = array(\n\t\t\t'title' => 'A post from the insert method, using the data array',\n\t\t\t'body' => 'Some random ghibberrish, using the data array',\n\t\t\t'user_id' => 1\n\t\t);\n\n\t\tPost::create($data);\n\n\t\tdd('post inserted');\n\t}", "public function insert($loyPrg);", "protected function insert()\n\t{\n\t\t//prepare placeholders for SQL query\n\t\t$placeholders = implode(\",\", array_fill(0, count($this->attributes), \"?\"));\n\t\t//prepare columns names for SQL query\n\t\t$columns = implode( \"`,`\", array_keys($this->attributes) );\n\t\t\n\t\t$methodAttributes = array_values($this->attributes);\n\t\t// add first method attribute - query\n\t\tarray_unshift($methodAttributes, \"INSERT INTO `\" . static::$table . \"` (`$columns`) VALUES ($placeholders)\");\n\t\t\n\t\t// inserting\n\t\t$result = call_user_func_array(\"Database::insert\", $methodAttributes);\n\t\tif( $result )\n\t\t{\n\t\t\t$this->isExist = true;\n\t\t\t// set PK\n\t\t\t$this->attributes[static::$primaryKey] = Database::lastInsertId();\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function insertIntoDatabase(PDO $db) {\n\t\tif (null===$this->getId()) {\n\t\t\t$stmt=self::prepareStatement($db,self::SQL_INSERT_AUTOINCREMENT);\n\t\t\t$stmt->bindValue(1,$this->getGenre());\n\t\t\t$stmt->bindValue(2,$this->getJaar());\n\t\t\t$stmt->bindValue(3,$this->getMaand());\n\t\t\t$stmt->bindValue(4,$this->getNummer());\n\t\t\t$stmt->bindValue(5,$this->getMutualiteit());\n\t\t\t$stmt->bindValue(6,$this->getFactuurdatum());\n\t\t\t$stmt->bindValue(7,$this->getFactuurFile());\n\t\t\t$stmt->bindValue(8,$this->getCreditActief());\n\t\t\t$stmt->bindValue(9,$this->getVervangt());\n\t\t} else {\n\t\t\t$stmt=self::prepareStatement($db,self::SQL_INSERT);\n\t\t\t$this->bindValues($stmt);\n\t\t}\n\t\t$affected=$stmt->execute();\n\t\tif (false===$affected) {\n\t\t\t$stmt->closeCursor();\n\t\t\tthrow new Exception($stmt->errorCode() . ':' . var_export($stmt->errorInfo(), true), 0);\n\t\t}\n\t\t$lastInsertId=$db->lastInsertId();\n\t\tif (false!==$lastInsertId) {\n\t\t\t$this->setId($lastInsertId);\n\t\t}\n\t\t$stmt->closeCursor();\n\t\t$this->notifyPristine();\n\t\treturn $affected;\n\t}", "public function insert() {\n\n // Does the program object already have an ID?\n if ( !is_null( $this->programID ) ) trigger_error ( \"program::insert(): Attempt to insert an program object that already has its ID property set (to $this->id).\", E_USER_ERROR );\n\n // Insert the program\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $sql = \"INSERT INTO programs ( programName, programStart, programFrequency ) VALUES ( :programName, :programStart, :programFrequency )\";\n $st = $conn->prepare ( $sql );\n $st->bindValue( \":programName\", $this->programName, PDO::PARAM_STR );\n $st->bindValue( \":programStart\", $this->programStart, PDO::PARAM_STR );\n\t$st->bindValue( \":programFrequency\", $this->programFrequency, PDO::PARAM_STR );\n $st->execute();\n $this->programID = $conn->lastInsertId();\n $conn = null;\n }", "public function insert()\n\t{\n\t\treturn $this->getModel()->insert($this);\n\t}", "protected function _insert() {\n $def = $this->_getDef();\n if(!isset($def) || !$def){\n return false;\n }\n \n foreach ($this->_tableData as $field) {\n $fields[] = $field['field_name'];\n $value_holder[] = '?';\n $sql_fields[] = '`' . $field['field_name'] . '`';\n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n $$field_name = $this->$field_name;\n \n if($$field_name instanceof \\DateTime){\n $$field_name = $$field_name->format('Y-m-d H:i:s');\n }\n \n if(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n }\n \n $values[] = $$field_name;\n }\n \n $this->setLastError(NULL);\n \n $sql = \"INSERT INTO `{$this->_table}` (\" . implode(',', $sql_fields) . \") VALUES (\" . implode(',', $value_holder) . \")\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $success = true;\n if ($stmt->error !== '') {\n $this->setLastError($stmt->error);\n $success = false;\n }\n \n $id = $stmt->insert_id;\n \n $stmt->close();\n \n $primaryKey = $this->_getPrimaryKey();\n \n $this->{$primaryKey} = $id;\n \n return $success;\n }", "public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\t\r\n\t\t\tif (isset ( $this->title )) {\r\n\t\t\t\t$insertCols .= \"dsh_title, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->title;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->desc )) {\r\n\t\t\t\t$insertCols .= \"dsh_desc, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->desc;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->portlet )) {\r\n\t\t\t\t$insertCols .= \"dsh_portlet, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->portlet;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->hide )) {\r\n\t\t\t\t$insertCols .= \"dsh_hide, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->hide;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdDate;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedDate;\r\n\t\t\t}\r\n\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the auto-increment property, only if the primary column is auto-increment\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "public function insert($contenido);", "public function insert(...$field_values);", "public function insert() {\n\t\t$insert_array = $this->toDbArray(true, true);\n\t\tif (array_key_exists('_id', $insert_array)) { unset($insert_array['_id']); }\n\t\t$ret_val = $this->getCollection()->save($insert_array);\n\t\tif (isset($insert_array['_id'])) {\n\t\t\t$this->setId($insert_array['_id']);\n\t\t}\n\t\treturn $this->getId();\n\t}" ]
[ "0.7634987", "0.7632747", "0.7568848", "0.75107706", "0.7501519", "0.7456342", "0.7438138", "0.7431855", "0.74303544", "0.74060726", "0.7393575", "0.73646456", "0.7344687", "0.7340661", "0.7336584", "0.7336584", "0.73359144", "0.73348355", "0.72817194", "0.7276749", "0.7250012", "0.7250012", "0.7240839", "0.72213066", "0.72111154", "0.72049475", "0.72016644", "0.7201201", "0.7185898", "0.7183621", "0.7183427", "0.7183193", "0.7182728", "0.7153307", "0.7121248", "0.71152997", "0.7113445", "0.7107582", "0.70897496", "0.7076951", "0.7071552", "0.7068796", "0.7024074", "0.70228326", "0.7015075", "0.70061535", "0.6987165", "0.6983874", "0.69634354", "0.69375134", "0.6915716", "0.6892563", "0.68899846", "0.6889739", "0.68873984", "0.68739897", "0.68505514", "0.68355566", "0.6822534", "0.68160236", "0.68123823", "0.67981654", "0.679521", "0.679045", "0.6777485", "0.67748034", "0.6768424", "0.6768033", "0.67664266", "0.6764485", "0.67633843", "0.67624533", "0.67609596", "0.67516536", "0.67494035", "0.6739014", "0.6721561", "0.6707991", "0.6707628", "0.6696671", "0.6695213", "0.66941625", "0.66880184", "0.66840124", "0.66792554", "0.66792154", "0.66767836", "0.66755056", "0.6672879", "0.66709626", "0.666962", "0.6668438", "0.66406", "0.6640338", "0.6639031", "0.66280985", "0.6622852", "0.66215944", "0.6608143", "0.6601697", "0.6600487" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Show the application dashboard.
public function index() { $plans = Plan::all()->sortByDesc("created_at"); return view('admin.plans.index', compact('plans')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $mainmodules = MainModule::orderBy('position','ASC')->get(); return view('admin.plans.create',compact('mainmodules')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }" ]
[ "0.75934863", "0.75934863", "0.7587591", "0.75782615", "0.75711566", "0.74992937", "0.74349296", "0.7432467", "0.7387912", "0.7351958", "0.73380226", "0.73111826", "0.72957826", "0.72812104", "0.72734547", "0.7242778", "0.72294843", "0.7225723", "0.718609", "0.71780044", "0.7173978", "0.71492267", "0.71434265", "0.7143343", "0.71356934", "0.7127626", "0.7122704", "0.71151215", "0.71151215", "0.71151215", "0.711137", "0.7093674", "0.708441", "0.70805633", "0.7079313", "0.70560336", "0.70560336", "0.705535", "0.7038748", "0.7038717", "0.70355713", "0.7033314", "0.70298624", "0.70262384", "0.7025372", "0.70192045", "0.7017566", "0.70037806", "0.70029014", "0.69999987", "0.6995955", "0.6994461", "0.69932437", "0.698907", "0.6985915", "0.69654584", "0.69652516", "0.6956021", "0.6951258", "0.6950627", "0.69471824", "0.69432425", "0.6941303", "0.69406337", "0.6937103", "0.6937103", "0.69363457", "0.6934366", "0.6931313", "0.6927307", "0.6926027", "0.6922591", "0.69176334", "0.69158953", "0.6911744", "0.6910005", "0.6909594", "0.6907657", "0.6902698", "0.6900764", "0.69007087", "0.6900391", "0.68942374", "0.68933", "0.68929493", "0.68912417", "0.68912417", "0.68911326", "0.6888626", "0.6887399", "0.68857414", "0.6884495", "0.6881287", "0.6878567", "0.6875623", "0.687334", "0.68722713", "0.6870009", "0.68697596", "0.6869062", "0.6868769" ]
0.0
-1
Display the specified resource.
public function show($id) { $plan = Plan::find($id); return view('admin.plans.show', compact('plan')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $plan = Plan::findOrFail($id); $mainmodules = MainModule::orderBy('position','ASC')->get(); foreach($mainmodules as $module){ $collect = DB::table('plan_has_modules')->where('plan_id',$id)->where('module_id',$module->id)->pluck('enabled')->first(); $module->value = $collect; } return view('admin.plans.edit', compact('plan','mainmodules')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }" ]
[ "0.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6834711", "0.6810601", "0.680613", "0.6804975", "0.68015367", "0.6795471", "0.6791821", "0.6791821", "0.6787303", "0.6783644", "0.67790574", "0.67766285", "0.6767741", "0.67610145", "0.67455536", "0.67455536", "0.6744367", "0.6743159", "0.6739656", "0.67351145", "0.67246765", "0.67128825", "0.6692859", "0.66916454", "0.6687554", "0.66875297", "0.6687494", "0.6684443", "0.668203", "0.66689324", "0.66680384", "0.6664605", "0.6664605", "0.66621166", "0.66604865", "0.66589504", "0.6655767", "0.66542184", "0.665213", "0.66422516", "0.6631665", "0.663077", "0.6627607", "0.6627607", "0.66193914", "0.6618503", "0.66160196", "0.66146857", "0.6609641", "0.6608315", "0.6605284", "0.6595882", "0.65947276", "0.6594626", "0.65895563", "0.6589339", "0.6587281", "0.65805006", "0.6579201", "0.6579166", "0.657641", "0.6576111", "0.65740323", "0.65692765", "0.6568046", "0.6567221", "0.6565346", "0.6560687", "0.6560687", "0.6560384", "0.65577257", "0.65569293", "0.65558636", "0.6555392", "0.65553015", "0.65542984", "0.655418", "0.6554106", "0.6547678", "0.65473104", "0.6543329" ]
0.0
-1
Update the specified resource in storage.
public function update($id, Request $request) { $customMessages = [ 'name' => 'The Plan Name field is required.', 'description' => 'The description field is required.', ]; $this->validate($request, [ 'name' => 'required|unique:plans,name,'.$request->id.',id', 'description' => 'required', ], $customMessages); $plan = Plan::findOrFail($id); $plan->name = $request->get('name'); $plan->description = $request->get('description'); if($request->has('status')) $plan->status = $request->get('status'); $plan->save(); $mainmodules = MainModule::all(); try{ $datetime = date('Y-m-d H:i:s'); $has_tally_integration = $request->has('tally'); DB::beginTransaction(); $plans_has_modules = DB::table('plan_has_modules')->where('plan_id', $plan->id)->first(); if($plans_has_modules) DB::table('plan_has_modules')->where('plan_id', $plan->id)->delete(); $insertData = array(); $clientSettingUpdatedArray = array(); foreach($mainmodules as $module){ $field = $module->field; $enabled = $request->$field ? 1 : 0; $clientSettingUpdatedArray[$field] = $enabled; $data = array( 'plan_id'=>$plan->id, 'module_id'=>$module->id, 'enabled'=>$enabled ); array_push($insertData, $data); } if(!empty($insertData)) DB::table('plan_has_modules')->insert($insertData); $companiesIDs = DB::table('company_plan')->where('plan_id',$plan->id)->pluck('company_id'); if(!empty($companiesIDs)){ $clientSettings = ClientSetting::whereIn('company_id',$companiesIDs)->get(); foreach($clientSettings as $clientSetting){ $clientSetting->update($clientSettingUpdatedArray); $company_id = $clientSetting->company_id; // AssignFullAccessPermission::dispatch($company_id, $clientSetting); // $limited_access_assign_permission_name = array('PartyVisit-view', 'PartyVisit-create'); // AssignLimitedAccessPermission::dispatch($company_id, $limited_access_assign_permission_name); $tallyInt = DB::table('tally_schedule')->where('company_id', $company_id)->first(); $companyname = Company::find($company_id); $domain = $companyname ? $companyname->domain : NULL; if($domain){ if (!$has_tally_integration && !empty($tallyInt)) { $affected = DB::table('tally_schedule') ->where('company_id', $company_id) ->update(['updated_at' => $datetime, 'deleted_at' => $datetime]); } elseif ($has_tally_integration) { if($tallyInt) $affected = DB::table('tally_schedule')->where('company_id', $company_id)->update(['updated_at' => $datetime, 'deleted_at' => NULL]); else $affected = DB::table('tally_schedule')->insert([ 'company_id' => $company_id, 'company_name' => $domain, 'created_at' => $datetime]); } } } } DB::commit(); if(isset($clientSettings)){ foreach($clientSettings as $clientSetting){ $fbIDs = DB::table('employees')->where(array(array('company_id', $clientSetting->company_id), array('status', 'Active')))->whereNotNull('firebase_token')->pluck('firebase_token'); $dataPayload = array("data_type" => "company_setting", "company_setting" => json_encode($clientSetting), "action" => "update"); sendPushNotification_($fbIDs, 12, null, $dataPayload); } } return redirect()->route('app.plan')->with('success', 'Information has been Updated'); }catch(\Exception $e){ DB::rollback(); dd($e->getMessage()); Log::error($e->getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7424884", "0.7062319", "0.70572054", "0.6897199", "0.658233", "0.6450576", "0.6347209", "0.6211253", "0.6146092", "0.6121878", "0.6114851", "0.61005586", "0.608833", "0.60537165", "0.60196865", "0.60068345", "0.5972924", "0.594671", "0.5940615", "0.5938648", "0.58927333", "0.58618903", "0.5855116", "0.5855116", "0.58517504", "0.5816175", "0.5807103", "0.5753658", "0.5753658", "0.57354003", "0.5724066", "0.5714874", "0.56957984", "0.5692136", "0.5688278", "0.5670771", "0.5656715", "0.5651525", "0.5647887", "0.563695", "0.5635239", "0.5633743", "0.5633203", "0.56296664", "0.5622203", "0.56089646", "0.5602395", "0.55937296", "0.55837464", "0.5582684", "0.55814886", "0.5575469", "0.5572433", "0.55668694", "0.556366", "0.5562336", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.55611396", "0.5560869", "0.55574787", "0.55562645", "0.5554329", "0.5553793", "0.5553788", "0.55448633", "0.55448294", "0.5541889", "0.55402213", "0.5537772", "0.55359083", "0.55358595", "0.55248064", "0.5520229", "0.5517453", "0.5513332", "0.5511126", "0.55085385", "0.5508433", "0.5503835", "0.5502763", "0.5501662", "0.5500294", "0.5498694", "0.5496697", "0.5496697", "0.5495247", "0.5494445", "0.5494331", "0.549349", "0.5492967", "0.5484066", "0.5480196", "0.5479421", "0.54788667", "0.546669", "0.5464114", "0.54621613", "0.5458347" ]
0.0
-1
lets get the taken surveys first
public function getAllUserAvailableSurveys(){ // $takenSurveys = \App\TakenSurvey::where('user_id', \Auth::user()->id); $result = \DB::table('surveys')-> whereRaw('id not in (select distinct survey_id from taken_surveys where user_id = ?)', [\Auth::user()->id])->get(); // $surveys = \App\Survey:: // dd($result); echo $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_AllSurveys(){\r\n $sql = $this->db->prepare(\"SELECT DISTINCT s.SurveyID, s.SurveyTitle, s.DatePosted FROM SURVEYLOOKUP L LEFT JOIN SURVEY s ON s.SurveyID = L.SurveyID\r\n WHERE :chamberid = L.ChamberID or :chamberid = L.RelatedChamber ORDER BY s.DatePosted DESC;\");\r\n $result = $sql->execute(array(\r\n \"chamberid\" => $_SESSION['chamber']\r\n ));\r\n if ($result)\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n else\r\n return false;\r\n }", "function get_surveys_by_creator($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated surveys\r\n $sql = \"SELECT id\r\n FROM surveys\r\n WHERE is_active = '1' AND created_by = '$user_id';\";\r\n\r\n $surveys_data = array();\r\n $surveys = array();\r\n\r\n foreach ($db->query($sql) as $key => $value) {\r\n $surveys_data[$key] = $value;\r\n foreach ($surveys_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $surveys[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $surveys;\r\n}", "public function getSurveys() {\n return $this->_request(\n \"surveys/\"\n );\n }", "public function getSurveys() {\n\n \n $this->db->select('sur_id, sur_title');\n $this->db->from('msv_surveys');\n \n $query = $this->db->get();\n \n $res = $query->result();\n \n return $res;\n }", "function get_Surveys(){\r\n $sql = $this->db->prepare(\"CALL SPgetSurvey2(:userid,:chamberID,:businessID);\");\r\n $result = $sql->execute(array(\r\n \"userid\" => $_SESSION['userid'],\r\n \"chamberID\" => $_SESSION['chamber'],\r\n \"businessID\" => $_SESSION['businessid'],\r\n ));\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false; // was array(); HL 10/10/17\r\n }\r\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 }", "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}", "function get_popular_surveys($limit=10)\n\t{\n\t\tif (!is_numeric($limit)){\n\t\t\t$limit=10;\n\t\t}\n\t\t\n\t\t$fields='s.id as id,\n\t\t\t\ts.idno as idno, \n\t\t\t\ts.title as title,\n\t\t\t\ts.authoring_entity,\n\t\t\t\ts.nation,\n\t\t\t\ts.total_views as visits';\n\t\t\t\t\t\t\t\t\n\t\t$this->db->select($fields);\n\t\t$this->db->limit($limit);\n\t\t$this->db->where('s.published',1);\t\t\n\t\t$query=$this->db->get('surveys s');\n\t\t\t\t\n\t\tif ($query){\n\t\t\treturn $query->result_array();\n\t\t}\n\n\t\treturn FALSE;\n\t}", "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}", "function lecturesWithoutKritter($survey, $daysInFuture=1) {\n\t\tif ($daysInFuture>0) {\n\t\t\t$dateLimit = time() + $daysInFuture*24*60*60;\n\t\t\t$dateLimitWhere = ' AND eval_date_fixed < '.$dateLimit.' ';\n\t\t}\n\t\telse $dateLimitWhere = '';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->sql_query('SELECT *\n\t\t\t\t\t\t\t\t\t\t\t\tFROM tx_fsmivkrit_lecture\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE deleted=0 AND hidden=0\n\t\t\t\t\t\t\t\t\t\t\t\t AND survey='.$survey.'\n\t\t\t\t\t\t\t\t\t\t\t\t AND (kritter_feuser_1=0 OR kritter_feuser_1 IS NULL)\n\t\t\t\t\t\t\t\t\t\t\t\t AND (kritter_feuser_2=0 OR kritter_feuser_2 IS NULL)\n\t\t\t\t\t\t\t\t\t\t\t\t AND (kritter_feuser_3=0 OR kritter_feuser_3 IS NULL)\n\t\t\t\t\t\t\t\t\t\t\t\t AND (kritter_feuser_4=0 OR kritter_feuser_4 IS NULL) '.\n\t\t\t\t\t\t\t\t\t\t\t\t $dateLimitWhere.'\n\t\t\t\t\t\t\t\t\t\t\t\t AND eval_date_fixed > '.time().'\n\t\t\t\t\t\t\t\t\t\t\t\t ORDER BY eval_date_fixed');\n\n\t\t$lectures = array ();\n\t\twhile ($res && $row = mysql_fetch_assoc($res))\n\t\t\t$lectures[] = $row['uid'];\n\n\t\treturn $lectures;\n\t}", "public function index()\n\t{\n\t\t//User based filtering\n\t\t$user = $this->apiKey->guestUser;\n\t\t$survey_ids_taken = TrackSurvey::where('users_id', $user->id)->groupBy('surveys_id')->lists('surveys_id');\n\n\t\t//Question count\n\t\t// return $survey_ids_taken;\n\t\t\n\t\ttry {\n\t\t\t//inserting custom key-val\n\t\t\t$surveys = Survey::all();\n\t\t\tforeach($surveys as $survey){\n\t\t\t\t$survey->is_taken = in_array($survey->id, $survey_ids_taken) ? '1':'0';\n\t\t\t\t$survey->mcq_count = Question::where('surveys_id', $survey->id)->where('type', 'mcq')->count();\n\t\t\t\t$survey->wr_count = Question::where('surveys_id', $survey->id)->where('type', 'written')->count();\n\t\t\t\t$survey->taken_by = TrackSurvey::where('surveys_id', $survey->id)->groupBy('users_id')->lists('users_id');\t\t\t\n\t\t\t}\n\n\t\t\t// return $surveys;\n\t\t\treturn Fractal::collection($surveys, new SurveyTransformer);\n\t\t\n\t\t} catch (Exception $e) {\n \n \treturn $this->response->errorGone();\n\t\t\t\n\t\t}\n\t}", "function &_getGlobalSurveyData($obj_id)\n\t{\n\t\t$survey = new ilObjSurvey($obj_id, false);\n\t\t$survey->loadFromDb();\n\t\t$result = array();\n\t\tif (($survey->getTitle()) and ($survey->author) and (count($survey->questions)))\n\t\t{\n\t\t\t$result[\"complete\"] = true;\n\t\t} \n\t\t\telse \n\t\t{\n\t\t\t$result[\"complete\"] = false;\n\t\t}\n\t\t$result[\"evaluation_access\"] = $survey->getEvaluationAccess();\n\t\treturn $result;\n\t}", "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_survey()\n {\n // check the primary key value\n $primary_key_name = static::get_primary_key_name();\n if( is_null( $this->$primary_key_name ) )\n {\n log::warning( 'Tried to delete record with no id.' );\n return;\n }\n \n return new limesurvey\\surveys( $this->sid );\n }", "function get_available_by_time_surveys() {\r\n // set connection var\r\n global $db;\r\n\r\n // get current time\r\n $time = date(\"Y-m-d H:i:s\");\r\n\r\n // query to get all vote survey_ids for session user\r\n $sql = \"SELECT id\r\n FROM surveys\r\n WHERE is_active = '1' AND status = '1' AND available_from < '$time' AND available_due > '$time';\";\r\n $surveys_data = array();\r\n $surveys = array();\r\n foreach ($db->query($sql) as $key => $value) {\r\n $surveys_data[$key] = $value;\r\n foreach ($surveys_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $surveys[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $surveys;\r\n}", "public function testGetSurveys0()\n {\n }", "public function testGetSurveys0()\n {\n }", "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 recycle_surveys()\n\t{\n\t\tif ($this->course->has_resources(RESOURCE_SURVEY))\n\t\t{\n\t\t\t$table_survey = Database :: get_course_table(TABLE_SURVEY);\n\t\t\t$table_survey_q = Database :: get_course_table(TABLE_SURVEY_QUESTION);\n\t\t\t$table_survey_q_o = Database :: get_course_table(TABLE_SURVEY_QUESTION_OPTION);\n\t\t\t$table_survey_a = Database :: get_course_Table(TABLE_SURVEY_ANSWER);\n\t\t\t$table_survey_i = Database :: get_course_table(TABLE_SURVEY_INVITATION);\n\t\t\t$ids = implode(',', (array_keys($this->course->resources[RESOURCE_SURVEY])));\n\t\t\t$sql = \"DELETE FROM \".$table_survey_i.\" \";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_a.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q_o.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey_q.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t\t$sql = \"DELETE FROM \".$table_survey.\" WHERE survey_id IN(\".$ids.\")\";\n\t\t\tapi_sql_query($sql,__FILE__,__LINE__);\n\t\t}\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}", "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}", "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_SurveyQuestions($surveyID){\r\n $sql = $this->db->prepare(\"SELECT * FROM SURVEYQUESTION WHERE SurveyID = :surveyid;\");\r\n $result = $sql->execute(array(\r\n \"surveyid\" => $surveyID\r\n ));\r\n if ($result){\r\n return $sql->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "function get_survey_questions($survey_id)\n {\n $this->db->join('survey_survey_questions', 'survey_survey_questions.question_id = ' . $this->get_table_name() . '.question_id', 'LEFT');\n\n $this->db->where('survey_survey_questions.survey_id', $survey_id);\n \n return $this->db->get($this->get_table_name());\n }", "private function json_allSurveys()\n {\n $query = \"SELECT * FROM Surveys ORDER BY surveyID DESC LIMIT 1;\";\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 }", "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}", "function getSpeakersListForResolution($num) {\n $speakerOrder = getSpeakersListOrder();\n $resSpeakerOrder = array();\n foreach ($speakerOrder as $speaker) {\n $amendmentRow = getAmendmentRow($speaker['id'],$num);\n if ($amendmentRow != null) {\n if ($amendmentRow['status'] == 'approved') {\n array_push($resSpeakerOrder,$amendmentRow['country_id']);\n }\n }\n }\n return $resSpeakerOrder;\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 }", "public function survey()\n {\n \treturn $this->hasOne('Asabanovic\\Surveys\\Model\\Survey');\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 filledSurveys(){\n return $this->hasMany(FilledSurvey::class);\n }", "public function surveys(){\n return $this->belongsToMany('App\\surveys');\n }", "public function createOfficialsSurvey()\n {\n return $this->mailer->createOfficialsSurvey($this->data);\n }", "public function take(){\n // Id of the selected quiz\n $get = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);\n if(isset($get['id'])){\n $quiz_id = intval($get['id']);\n // echo $quiz_id;\n } else {\n Messages::setMsg('Quiz not found', 'error');\n // Redirect\n header('Location: '.ROOT_URL.'quizzes');\n }\n // Retrieve the quiz\n $this->query('SELECT questions.content, options.content, options.is_answer FROM quizzes JOIN questions ON questions.quiz_id = quizzes.id JOIN options ON options.question_id = questions.id WHERE quizzes.id = :quiz_id');\n $this-> bind(':quiz_id', $quiz_id);\n $rows = $this->resultSetGroup();\n // echo '<pre>';\n // print_r($rows);\n // echo '</pre>';\n if(!$rows){\n Messages::setMsg('No quiz yet', 'error');\n } else {\n return $rows;\n }\n // return $rows;\n }", "public function run()\n {\n Survey::with('questions')\n ->get()\n ->each(function (Survey $survey) {\n $survey->questions->each(function (Question $question, int $key) use ($survey) {\n $nextQuestionIdInQuestion = (bool)mt_rand(0, 1);\n $nextKey = $key + 1;\n /** @var Question $nextQuestion */\n if ($nextQuestion = $survey->questions->get($nextKey, false)) {\n if ($nextQuestionIdInQuestion) {\n $question->next_question_id = $nextQuestion->id;\n $question->save();\n } else {\n $question->answers()->update(['next_question_id' => $nextQuestion->id]);\n }\n }\n });\n });\n }", "function get_question_random_simple() {\n global $default_terms_array;\n $session = new Session();\n $questions = get_questions($default_terms_array);\n\n for ($i = 0; $i < sizeof($questions); $i++) {\n\n $question = $questions[array_rand($questions) ];\n\n // if the question hasn't already been asked recently OR we're not remembering things in the session, return it\n if ((!$session->get('random_questions_asked') || ($session->get('random_questions_asked') && !in_array($question->get_ID(), $session->get('random_questions_asked'))))) {\n return $question;\n }\n }\n\n return $questions[array_rand($questions) ];\n}", "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 get_groups_by_creator($user_id) {\r\n // set connection var\r\n global $db;\r\n\r\n //query to get all associated surveys\r\n $sql = \"SELECT id\r\n FROM groups\r\n WHERE is_active = '1' AND local = '1' AND created_by = '$user_id';\";\r\n\r\n $groups_data = array();\r\n $groups = array();\r\n\r\n foreach ($db->query($sql) as $key => $value) {\r\n $groups_data[$key] = $value;\r\n foreach ($groups_data[$key] as $subkey => $subvalue) {\r\n if (is_int($subkey)) {\r\n $groups[] = $subvalue;\r\n }\r\n }\r\n }\r\n\r\n return $groups;\r\n}", "function lecturesInNextDays($survey, $daysInFuture=1,$kritter=0) {\n\t\tif ($daysInFuture>0) {\n\t\t\t$dateLimit = time() + $daysInFuture*24*60*60;\n\t\t\t$dateLimitWhere = ' AND eval_date_fixed<'.$dateLimit.' ';\n\t\t}\n\t\telse $dateLimitWhere = '';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->sql_query('SELECT *\n\t\t\t\t\t\t\t\t\t\t\t\tFROM tx_fsmivkrit_lecture\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE deleted=0 AND hidden=0\n\t\t\t\t\t\t\t\t\t\t\t\t AND survey='.$survey.\n\t\t\t\t\t\t\t\t\t\t\t\t $dateLimitWhere.'\n\t\t\t\t\t\t\t\t\t\t\t\t AND eval_date_fixed > '.time().'\n\t\t\t\t\t\t\t\t\t\t\t\t ORDER BY eval_date_fixed');\n\n\t\t$lectures = array ();\n\t\twhile ($res && $row = mysql_fetch_assoc($res))\n\t\t\t$lectures[] = $row['uid'];\n\n\t\treturn $lectures;\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 actionsurvey()\n {\n $model = new Troubleticket;\n $this->LoginCheck();\n if (isset($_POST['submit'])) {\n $model->Save($_POST['Troubleticket']);\n }\n $pickList_sealed = $model->getpickList('sealed');\n $pickList_category = $model->getpickList('ticketcategories');\n $pickList_damagetype = $model->getpickList('damagetype');\n $pickList_damagepostion = $model->getpickList('damageposition');\n $picklist_drivercauseddamage = $model->getpickList('drivercauseddamage');\n $picklist_reportdamage = $model->getpickList('reportdamage');\n $picklist_ticketstatus = $model->getpickList('ticketstatus');\n $Asset_List = $model->findAssets('Assets');\n $postdata = @$_POST['Troubleticket'];\n $this->render('survey', array('model' => $model,\n 'Sealed' => $pickList_sealed,\n 'category' => $pickList_category,\n 'damagetype' => $pickList_damagetype,\n 'damagepos' => $pickList_damagepostion,\n 'drivercauseddamageList' => $picklist_drivercauseddamage,\n 'reportdamage' => $picklist_reportdamage,\n 'Assets' => $Asset_List,\n 'ticketstatus' => $picklist_ticketstatus,\n 'postdata' => $postdata)\n );\n }", "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}", "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}", "public function takeSurvey(){\n $this->load->database();\n\n $test['title'] = 'Survey';\n\n $test['survey'] = $this -> Survey_model -> get_survey();\n\n $data['title'] = 'Add a response to Survey';\n\n \t$this->form_validation ->set_rules('Student_Answer', 'Student_Answer', 'required');\n $this->form_validation ->set_rules('Q_ID', 'Q_ID', 'required');\n $this->form_validation ->set_rules('Surv_ID', 'Surv_ID', 'required');\n $this->form_validation ->set_rules('S_ID', 'S_ID', 'required');\n \n \n \n if($this->form_validation->run()=== FALSE){\n $this -> load-> view('templates/header');\n $this -> load-> view('Survey/index', $data);\n $this -> load-> view('templates/footer');\n\n }else{\n\n $this -> Survey_model -> takeSurvey(); \n $this -> load-> view('templates/header');\n $this -> load-> view('Survey/index', $data);\n $this -> load-> view('templates/footer');\n }\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 get_survey_list($session_key, $suser='')\n\t{\n if ($this->_checkSessionKey($session_key))\n {\n\t\t $current_user = Yii::app()->session['user'];\n\t\t if( Yii::app()->session['USER_RIGHT_SUPERADMIN'] == 1 and $suser !='')\n\t\t\t\t$current_user = $suser;\n\n\t\t $aUserData = User::model()->findByAttributes(array('users_name' => $current_user));\t\t \n\t\t if (!isset($aUserData))\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('Invalid user', 38);\t\t \n\t \t \t\t \n\t\t $user_surveys = Survey::model()->findAllByAttributes(array(\"owner_id\"=>$aUserData->attributes['uid'])); \t\t \n\t\t if(count($user_surveys)==0)\n\t\t\t\tthrow new Zend_XmlRpc_Server_Exception('No Surveys found', 30);\n\t\t\t\n\t\t\tforeach ($user_surveys as $asurvey)\n\t\t\t\t{\n\t\t\t\t$asurvey_ls = Surveys_languagesettings::model()->findByAttributes(array('surveyls_survey_id' => $asurvey->primaryKey, 'surveyls_language' => $asurvey->language));\n\t\t\t\tif (!isset($asurvey_ls))\n\t\t\t\t\t$asurvey_title = '';\n\t\t\t\telse\n\t\t\t\t\t$asurvey_title = $asurvey_ls->attributes['surveyls_title'];\n\t\t\t\t$aData[]= array('sid'=>$asurvey->primaryKey,'surveyls_title'=>$asurvey_title,'startdate'=>$asurvey->attributes['startdate'],'expires'=>$asurvey->attributes['expires'],'active'=>$asurvey->attributes['active']);\n\t\t\t\t}\n\t\t\treturn $aData;\n }\t\t\t\t\n\t}", "private function getAnyQuestion()\n {\n $count = Question::count();\n $offset = mt_rand(0, $count-1);\n\n $questions = Question::find(\n [\n \"limit\" => [\"offset\" => $offset, \"number\" => 1] \n ]\n );\n \n //find() will only return 1 record because of the limit, but it returns it in a ResultSet so we need to extract the result\n return $questions->getFirst();\n }", "function get_survey_requests_by_user($user_id=NULL,$survey_id=NULL)\n\t{\n\t\t\t$this->db->select('lic_requests.id,expiry,status');\n\t\t\t$this->db->where('userid',$user_id);\n\t\t\t$this->db->where('lic_requests.surveyid',$survey_id);\n\t\t\t$this->db->where('lic_requests.status !=','DENIED');\n\t\t\t$this->db->join('lic_file_downloads', 'lic_requests.id = lic_file_downloads.requestid','left');\n\t\t\t$query=$this->db->get(\"lic_requests\");\n\t\t\t//echo mktime(0,0,0,9,9,2010);\n\t\t\tif (!$query)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t\n\t\t\treturn $query->result_array();\n\t}", "function get_recent_exam_ID($taking_id) {\r\n global $wpdb;\r\n $watuStr0 = \"SELECT * FROM wp_watupro_taken_exams WHERE ID=$taking_id\";\r\n\r\n $watuStr2 = $wpdb->get_row($watuStr0); //list of objects depending on amount of certificates\r\n return $watuStr2;\r\n}", "public function testCreateSurvey0()\n {\n }", "public function testCreateSurvey0()\n {\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}", "function get_rad_surveys($conn, $sup_restriction = NULL, $start_restriction = NULL, $end_restriction = NULL) {\n\t$query_rad = \"SELECT * FROM rad_survey_comment, rad_header WHERE \" .\n\t\t \"rad_survey_comment.header_id = rad_header.header_id \" . \n\t\t ($sup_restriction !== NULL ? (' AND ' . get_sup_filter($sup_restriction, \"rad_header\")) : \"\") . \n\t\t ($start_restriction !== NULL ? (' AND (rad_header.date_start >= \"' . $start_restriction . \n\t\t '\" OR rad_header.date_end >= \"' . $start_restriction . '\") ') : \"\") . \n\t\t ($end_restriction !== NULL ? (' AND (rad_header.date_start <= \"' . $end_restriction . \n\t\t '\" OR rad_header.date_end <= \"' . $end_restriction . '\") ') : \"\");\n\treturn exec_query($conn, $query_rad);\n}", "function ipal_who_sofar($ipal_id){\r\nglobal $DB;\r\n\r\n$records=$DB->get_records('ipal_answered',array('ipal_id'=>$ipal_id));\r\n\r\nforeach($records as $records){\r\n$answer[]=$records->user_id;\r\n}\r\nreturn(array_unique($answer));\r\n}", "function get_all_studies () {\n global $dbconnect;\n $query = \"SELECT * FROM studies ORDER BY study_id ASC;\";\n $result = mysql_query($query, $dbconnect);\n confirm_query($result);\n return $result;\n}", "public function getAttendedQuestions($userId, $surveyKey) {\n $data = $this->find ( \"all\", array (\n 'joins' => array (\n array (\n 'table' => 'survey_questions',\n 'alias' => 'Survey_question',\n 'type' => 'LEFT',\n 'conditions' => 'Survey_question.survey_id = Survey.id' \n ),\n array (\n\t\t\t\t\t\t\t\t'table' => 'survey_results',\n\t\t\t\t\t\t\t\t'alias' => 'Survey_result',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'conditions' => 'Survey_result.question_id = Survey_question.id' \n )\n ),\n 'conditions' => array(\n 'Survey.survey_key' => $surveyKey, 'Survey_result.user_id' => $userId \n ),\n 'fields' => array('Survey.id','Survey.name','Survey.description','Survey_question.id', 'Survey_question.question_text', 'Survey_result.id', 'Survey_result.selected_answers'),\n 'order' => array('Survey_question.id'),\n )\n );\n return $data;\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 activateOfficialsSurvey()\n {\n return $this->mailer->activateOfficialsSurvey($this->data);\n }", "function loadQuestionsFromDb() \n\t{\n\t\tglobal $ilDB;\n\t\t$this->questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy_qst WHERE survey_fi = %s ORDER BY sequence\",\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\t$this->questions[$data[\"sequence\"]] = $data[\"question_fi\"];\n\t\t}\n\t}", "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}", "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 getGroupSurveys($user_id)\r\n {\r\n\r\n $LakeHosts = array();\r\n\r\n\r\n $mysqli = new mysqli(\"localhost\", \"root\", \"\", \"nhvbsr\");\r\n $surveyResult = array('surveyID' => array(), 'inputTime' => array(), 'launchStatus' => array(), 'registrationState' => array(), 'boatType' => array());\r\n\r\n if (mysqli_connect_errno()) {\r\n printf(\"Connection failed: %s<br />\", mysqli_connect_error());\r\n exit();\r\n }\r\n\r\n $stmt = $mysqli->prepare(\"select GroupID from users where UserID=?\");\r\n\r\n if (!$stmt) {\r\n printf(\"prepare( ) failed: (%s) %s\", $mysqli->errno, $mysqli->error);\r\n } else {\r\n //$nickName = \"UNH\";\r\n $stmt->bind_param(\"i\", $user_id);\r\n $stmt->execute();\r\n //$stmt->bind_param(\"UNH\");\r\n\r\n $stmt->bind_result($GroupID);\r\n\r\n $stmt->fetch();\r\n /* close statement */\r\n $stmt->close();\r\n }\r\n\r\n\r\n $stmt = $mysqli->prepare(\"select lakeHostID from lakehostmembers where LakeHostGroupID=?\");\r\n\r\n if (!$stmt) {\r\n printf(\"prepare( ) failed: (%s) %s\", $mysqli->errno, $mysqli->error);\r\n } else {\r\n //$nickName = \"UNH\";\r\n $stmt->bind_param(\"i\", $GroupID);\r\n $stmt->execute();\r\n //$stmt->bind_param(\"UNH\");\r\n\r\n $stmt->bind_result($LakeHostID);\r\n\r\n while ($stmt->fetch()) {\r\n $LakeHosts[] = $LakeHostID;\r\n }\r\n /* close statement */\r\n $stmt->close();\r\n }\r\n\r\n $today = getdate();\r\n $year = $today['year'];\r\n $day = $today['mday'];\r\n $month = $today['mon'];\r\n $date = \"$year\" . \"-\" . \"$month\" . \"-\" . \"$day\";\r\n\r\n $date = \"2013-01-03\";\r\n $numberOfLakeHosts = count($LakeHosts);\r\n\r\n\r\n for ($i = 1; $i < $numberOfLakeHosts; $i++) {\r\n $LakeHostID = $LakeHosts[$i - 1];\r\n $stmt = $mysqli->prepare(\"select SurveyID,InspectionTime,LaunchStatus,RegistrationState,BoatType from surveys where LakeHostID=? and InputDate=?\");\r\n\r\n if (!$stmt) {\r\n printf(\"prepare( ) failed: (%s) %s\", $mysqli->errno, $mysqli->error);\r\n } else {\r\n //$nickName = \"UNH\";\r\n $stmt->bind_param(\"is\", $LakeHostID, $date);\r\n $stmt->execute();\r\n //$stmt->bind_param(\"UNH\");\r\n\r\n $stmt->bind_result($surveyID, $inputTime, $launchStatus, $registrationState, $boatType);\r\n\r\n while ($stmt->fetch()) {\r\n\r\n array_push($surveyResult['surveyID'], $surveyID);\r\n array_push($surveyResult['inputTime'], $inputTime);\r\n array_push($surveyResult['launchStatus'], $launchStatus);\r\n array_push($surveyResult['registrationState'], $registrationState);\r\n array_push($surveyResult['boatType'], $boatType);\r\n\r\n }\r\n /* close statement */\r\n $stmt->close();\r\n }\r\n }\r\n return $surveyResult;\r\n\r\n }", "protected function createSurveyEntries(): array\n {\n $result = [];\n $query = $this->SurveyResults->find();\n $count = 0;\n\n $this->out((string)__d('Qobo/Survey', 'Found [{0}] survey_result records', $query->count()));\n\n if (empty($query->count())) {\n return $result;\n }\n\n foreach ($query as $item) {\n $survey = $this->Surveys->find()\n ->where(['id' => $item->get('survey_id')]);\n\n if (!$survey->count()) {\n $this->warn((string)__d('Qobo/Survey', 'Survey [{0}] is not found. Moving on', $item->get('survey_id')));\n\n continue;\n }\n\n $entry = $this->SurveyEntries->find()\n ->where([\n 'id' => $item->get('submit_id'),\n ])\n ->first();\n\n if (empty($entry)) {\n if (empty($item->get('submit_id'))) {\n continue;\n }\n\n $entry = $this->SurveyEntries->newEntity();\n $entry->set('id', $item->get('submit_id'));\n $entry->set('submit_date', $item->get('submit_date'));\n $entry->set('survey_id', $item->get('survey_id'));\n $entry->set('status', 'in_review');\n $entry->set('score', 0);\n\n $saved = $this->SurveyEntries->save($entry);\n\n if ($saved) {\n $result[] = $saved->get('id');\n $count++;\n } else {\n $this->out((string)__d('Qobo/Survey', 'Survey Result with Submit ID [{0}] cannot be saved. Next', $item->get('submit_id')));\n }\n } else {\n // saving existing survey_entries,\n // to double check if anything is missing as well.\n $result[] = $entry->get('id');\n }\n }\n\n $this->out((string)__d('Qobo/Survey', 'Saved [{0}] survey_entries', $count));\n\n //keeping only unique entry ids, to avoid excessive iterations.\n $result = array_values(array_unique($result));\n\n return $result;\n }", "function unfinished_rounds() {\n global $db;\n $stmt = $db->query('SELECT roundid, classid FROM Rounds'\n .' WHERE NOT EXISTS(SELECT 1 FROM RaceChart'\n .' WHERE RaceChart.roundid = Rounds.roundid)'\n .' OR EXISTS(SELECT 1 FROM RaceChart'\n .' WHERE RaceChart.roundid = Rounds.roundid'\n .' AND finishtime IS NULL AND finishplace IS NULL)');\n $result = array();\n foreach ($stmt as $row) {\n $result[$row[0]] = $row[1];\n }\n return $result;\n}", "function &getSurveyPages()\n\t{\n\t\tglobal $ilDB;\n\t\t$obligatory_states =& $this->getObligatoryStates();\n\t\t// get questionblocks\n\t\t$all_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT svy_question.*, svy_qtype.type_tag, svy_svy_qst.heading FROM \" . \n\t\t\t\"svy_question, svy_qtype, svy_svy_qst WHERE svy_svy_qst.survey_fi = %s AND \" .\n\t\t\t\"svy_svy_qst.question_fi = svy_question.question_id AND svy_question.questiontype_fi = svy_qtype.questiontype_id \".\n\t\t\t\"ORDER BY svy_svy_qst.sequence\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t{\n\t\t\t$all_questions[$row[\"question_id\"]] = $row;\n\t\t}\n\t\t// get all questionblocks\n\t\t$questionblocks = array();\n\t\tif (count($all_questions))\n\t\t{\n\t\t\t$result = $ilDB->queryF(\"SELECT svy_qblk.*, svy_qblk_qst.question_fi FROM svy_qblk, svy_qblk_qst \".\n\t\t\t\t\"WHERE svy_qblk.questionblock_id = svy_qblk_qst.questionblock_fi AND svy_qblk_qst.survey_fi = %s \".\n\t\t\t\t\"AND \" . $ilDB->in('svy_qblk_qst.question_fi', array_keys($all_questions), false, 'integer'),\n\t\t\t\tarray('integer'),\n\t\t\t\tarray($this->getSurveyId())\n\t\t\t);\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$questionblocks[$row['question_fi']] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$all_pages = array();\n\t\t$pageindex = -1;\n\t\t$currentblock = \"\";\n\t\tforeach ($all_questions as $question_id => $row)\n\t\t{\n\t\t\tif (array_key_exists($question_id, $obligatory_states))\n\t\t\t{\n\t\t\t\t$all_questions[$question_id][\"obligatory\"] = $obligatory_states[$question_id];\n\t\t\t}\n\t\t\t$constraints = array();\n\t\t\tif (isset($questionblocks[$question_id]))\n\t\t\t{\n\t\t\t\tif (!$currentblock or ($currentblock != $questionblocks[$question_id]['questionblock_id']))\n\t\t\t\t{\n\t\t\t\t\t$pageindex++;\n\t\t\t\t}\n\t\t\t\t$all_questions[$question_id]['page'] = $pageindex;\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = $questionblocks[$question_id]['title'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = $questionblocks[$question_id]['questionblock_id'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_questiontext\"] = $questionblocks[$question_id]['show_questiontext'];\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_blocktitle\"] = $questionblocks[$question_id]['show_blocktitle'];\n\t\t\t\t$currentblock = $questionblocks[$question_id]['questionblock_id'];\n\t\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pageindex++;\n\t\t\t\t$all_questions[$question_id]['page'] = $pageindex;\n\t\t\t\t$all_questions[$question_id][\"questionblock_title\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"questionblock_id\"] = \"\";\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_questiontext\"] = 1;\n\t\t\t\t$all_questions[$question_id][\"questionblock_show_blocktitle\"] = 1;\n\t\t\t\t$currentblock = \"\";\n\t\t\t\t$constraints = $this->getConstraints($question_id);\n\t\t\t\t$all_questions[$question_id][\"constraints\"] = $constraints;\n\t\t\t}\n\t\t\tif (!isset($all_pages[$pageindex]))\n\t\t\t{\n\t\t\t\t$all_pages[$pageindex] = array();\n\t\t\t}\n\t\t\tarray_push($all_pages[$pageindex], $all_questions[$question_id]);\n\t\t}\n\t\t// calculate position percentage for every page\n\t\t$max = count($all_pages);\n\t\t$counter = 1;\n\t\tforeach ($all_pages as $index => $block)\n\t\t{\n\t\t\tforeach ($block as $blockindex => $question)\n\t\t\t{\n\t\t\t\t$all_pages[$index][$blockindex][\"position\"] = $counter / $max;\n\t\t\t}\n\t\t\t$counter++;\n\t\t}\n\t\treturn $all_pages;\n\t}", "public function GetSurveys($ownerid = 0,$pageid=1,$perpage=20,$search_info = false,$sort_details = array(),$count_only = false)\n\t{\n\t\t$prefix = $this->Db->TablePrefix;\n\t\t$ownerid = (int)$ownerid;\n\n\t\t$sortby = (isset($sort_details['SortBy'])) ? $sort_details['SortBy'] : '';\n\t\t$sortdirection = (isset($sort_details['Direction'])) ? strtolower($sort_details['Direction']) : '';\n\n\t\tif (!in_array($sortby, self::$validSorts)) {\n\t\t\t$sortby = self::$validSorts[0];\n\t\t}\n\n\t\tif (!in_array($sortdirection,array('asc','desc'))) {\n\t\t\t$sortdirection = 'asc';\n\t\t}\n\n\t\tif ($perpage == 'all') {\n\t\t\t$perpage = 0;\n\t\t\t$offset = 0;\n\t\t} else {\n\t\t\t$perpage = (int)$perpage;\n\t\t\t$offset = ($pageid - 1) * $perpage;\n\t\t}\n\n\t\t$user = GetUser($ownerid);\n\t\t$query_user = \"\";\n\t\tif (empty($user->group->systemadmin)) {\n\t\t\t$query_user = \" s.userid = $ownerid AND\";\n\t\t}\n\n\t\tif ($count_only) {\n\t\t\t$query = \"SELECT COUNT(*) FROM {$prefix}surveys s WHERE s.userid = $ownerid\";\n\t\t} else {\n\t\t\t$query = \"SELECT s.*,u.username as username, (SELECT count(id) FROM {$prefix}surveys_response WHERE {$prefix}surveys_response.surveys_id = s.id) as responseCount\n\t\t\t\t\t\tFROM {$prefix}surveys s, {$prefix}users u\n\t\t\t\t\t\tWHERE {$query_user} u.userid = s.userid\n\t\t\t\t\t\tORDER BY $sortby $sortdirection\";\n\n\t\t\tif ($perpage) {\n\t\t\t\t$query .= \" LIMIT $perpage\";\n\t\t\t}\n\t\t\tif ($offset) {\n\t\t\t\t$query .= \" OFFSET $offset\";\n\t\t\t}\n\t\t}\n\n\n\t\t$result = $this->Db->Query($query);\n\n\t\tif ($count_only) {\n\t\t\t$count = $this->Db->FetchOne($result);\n\t\t\treturn $count;\n\t\t}\n\n\t\t$return = array();\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$return[] = $row;\n\t\t}\n\n\t\treturn $return;\n\t}", "function getSurveyId()\n\t{\n\t\treturn $this->survey_id;\n\t}", "public function testDuplicateSurvey()\n {\n $year = 2018;\n $currentYear = current_year();\n $origSurvey = Survey::factory()->create(['year' => $year, 'title' => \"$year Survey Title\"]);\n $origGroup = SurveyGroup::factory()->create(['survey_id' => $origSurvey->id]);\n $origQuestion = SurveyQuestion::factory()->create(['survey_id' => $origSurvey->id, 'survey_group_id' => $origGroup->id]);\n\n $response = $this->json('POST', \"survey/{$origSurvey->id}/duplicate\");\n $response->assertStatus(200);\n $newId = $response->json('survey_id');\n\n $this->assertDatabaseHas('survey', ['id' => $newId, 'title' => \"$currentYear Survey Title\"]);\n $this->assertDatabaseHas('survey_group', ['survey_id' => $newId, 'title' => $origGroup->title]);\n $this->assertDatabaseHas('survey_question', ['survey_id' => $newId, 'description' => $origQuestion->description]);\n }", "function _getFilteredSubmissions($journalId) {\r\n \r\n\t\t$sectionId = Request::getUserVar('decisionCommittee');\r\n\t\t$decisionType = Request::getUserVar('decisionType');\r\n\t\t$decisionStatus = Request::getUserVar('decisionStatus');\r\n\t\t$decisionAfter = Request::getUserVar('decisionAfter');\r\n\t\t$decisionBefore = Request::getUserVar('decisionBefore');\r\n \r\n\t\t$studentResearch = Request::getUserVar('studentInitiatedResearch');\r\n\t\t$startAfter = Request::getUserVar('startAfter');\r\n\t\t$startBefore = Request::getUserVar('startBefore');\r\n\t\t$endAfter = Request::getUserVar('endAfter');\r\n\t\t$endBefore = Request::getUserVar('endBefore');\r\n\t\t$kiiField = Request::getUserVar('KII');\r\n\t\t$multiCountry = Request::getUserVar('multicountry');\r\n\t\t$countries = Request::getUserVar('countries');\r\n\t\t$geoAreas = Request::getUserVar('geoAreas');\r\n\t\t$researchDomains = Request::getUserVar('researchDomains');\r\n $researchFields = Request::getUserVar('researchFields');\r\n\t\t$withHumanSubjects = Request::getUserVar('withHumanSubjects');\r\n\t\t$proposalTypes = Request::getUserVar('proposalTypes');\r\n\t\t$dataCollection = Request::getUserVar('dataCollection');\r\n\r\n $budgetOption = Request::getUserVar('budgetOption');\r\n\t\t$budget = Request::getUserVar('budget');\r\n\t\t$sources = Request::getUserVar('sources');\r\n \r\n\t\t$identityRevealed = Request::getUserVar('identityRevealed');\r\n\t\t$unableToConsent = Request::getUserVar('unableToConsent');\r\n\t\t$under18 = Request::getUserVar('under18');\r\n\t\t$dependentRelationship = Request::getUserVar('dependentRelationship');\r\n\t\t$ethnicMinority = Request::getUserVar('ethnicMinority');\r\n\t\t$impairment = Request::getUserVar('impairment');\r\n\t\t$pregnant = Request::getUserVar('pregnant');\r\n\t\t$newTreatment = Request::getUserVar('newTreatment');\r\n\t\t$bioSamples = Request::getUserVar('bioSamples');\r\n\t\t$exportHumanTissue = Request::getUserVar('exportHumanTissue');\r\n\t\t$exportReason = Request::getUserVar('exportReason');\r\n $radiation = Request::getUserVar('radiation');\r\n\t\t$distress = Request::getUserVar('distress');\r\n\t\t$inducements = Request::getUserVar('inducements');\r\n\t\t$sensitiveInfo = Request::getUserVar('sensitiveInfo');\r\n\t\t$reproTechnology = Request::getUserVar('reproTechnology');\r\n\t\t$genetic = Request::getUserVar('genetic');\r\n\t\t$stemCell = Request::getUserVar('stemCell');\r\n\t\t$biosafety = Request::getUserVar('biosafety');\r\n \r\n\r\n $editorSubmissionDao =& DAORegistry::getDAO('EditorSubmissionDAO');\r\n\r\n $submissions =& $editorSubmissionDao->getEditorSubmissionsReport(\r\n $journalId, $sectionId, $decisionType, $decisionStatus, $decisionAfter, $decisionBefore,\r\n $studentResearch, $startAfter, $startBefore, $endAfter, $endBefore, $kiiField, $multiCountry, \r\n $countries, $geoAreas, $researchDomains, $researchFields, $withHumanSubjects, $proposalTypes, $dataCollection,\r\n $budgetOption, $budget, $sources,\r\n $identityRevealed, $unableToConsent, $under18, $dependentRelationship, $ethnicMinority, $impairment, \r\n $pregnant, $newTreatment, $bioSamples, $exportHumanTissue, $exportReason, $radiation, $distress, $inducements, \r\n $sensitiveInfo, $reproTechnology, $genetic, $stemCell, $biosafety);\r\n \r\n $criterias = $this->_getCriterias(\r\n $sectionId, $decisionType, $decisionStatus, $decisionAfter, $decisionBefore,\r\n $studentResearch, $startAfter, $startBefore, $endAfter, $endBefore, $kiiField, $multiCountry, \r\n $countries, $geoAreas, $researchDomains, $researchFields, $withHumanSubjects, $proposalTypes, $dataCollection,\r\n $budgetOption, $budget, $sources,\r\n $identityRevealed, $unableToConsent, $under18, $dependentRelationship, $ethnicMinority, $impairment, \r\n $pregnant, $newTreatment, $bioSamples, $exportHumanTissue, $exportReason, $radiation, $distress, $inducements, \r\n $sensitiveInfo, $reproTechnology, $genetic, $stemCell, $biosafety \r\n );\r\n \r\n\t\treturn array( 0 => $submissions->toArray(), 1 => $criterias); \r\n }", "function match_survey()\n {\n $type_array = $this->input->post('company_type');\n $pace_array = $this->input->post('company_pace');\n $lifecycle_array = $this->input->post('lifecycle');\n $corp_citizenship = $this->input->post('corp_citizenship');\n\n //put the values from those arrays into strings so they can be added to the query\n $imploded_type = implode(\" OR \", $type_array);\n $imploded_pace = implode(\" OR \", $pace_array);\n $imploded_lifecycle = implode(\" OR \", $lifecycle_array);\n\n $sql = 'SELECT id,company_name FROM company where (type_id = '.$imploded_type.')\n AND (pace_id = '.$imploded_pace.')\n AND (lifecycle_id = '.$imploded_lifecycle.')';\n //run the query\n $query = $this->db->query($sql);\n //return $query->result(); \n if ($query->num_rows() > 0)\n {\n //build array of company ids that came from the last query...so we can use them in the upcoming query\n foreach ($query->result_array() as $row) {\n //$companyid_array[]=$row;\n $companyid_array[]=$row['id'];\n }\n $queried_comp_ids = implode(',', $companyid_array);\n \n //get the user submitted benefits ranking\n $user_benefits_array = $this->input->post('users_benefits'); \n \n //$this->output->enable_profiler(TRUE);\n \n //get all the companies (that meet the previous criteria) and their associated benefits\n $sql2 = 'SELECT company_id,benefits_id FROM company_benefits WHERE company_id IN ('.$queried_comp_ids.')';\n $query2 = $this->db->query($sql2);\n \n //build an array with a specific format to be used in the upcoming scoring process\n $company_set = array();\n foreach ($query2->result_array() as $row) {\n $company_set[$row['company_id']][]=$row['benefits_id'];\n }\n \n $scores = array();\n // For every company, we will assign it a score based on what benefits it has\n // and how the user ranked that benefit. Higher ranks are more valuable, so the highest\n // total score wins.\n foreach($company_set as $company_id => $array_row)\n { \n $score = 0;\n foreach ($array_row as $key=>$benefit_id)\n {\n //this line grabs the user's ranking for the benefit_id that this particular company has\n //and assigns it to the score variable. this will be added to the scores matrix\n //and a tally will be kept for each company. \n //KEY POINT: The benefit that is most desired has the highest rank value. For example,\n // if there are 10 options, the user's most desired benefit has a rank of 10. The least\n // desired has a rank of 1.\n \n $score += $user_benefits_array[$benefit_id]['rank'];\n }\n $scores[$company_id] = $score;\n\n }\n \n arsort($scores);\n /* echo \"scores: <br>\";\n print_r($scores);*/\n //reset($scores);\n //$first_key = key($scores);\n //echo \"Best score is company id: \".$first_key;\n //Array ( [1] => 88 [3] => 67 [4] => 65 )\n $ranked_comps = array_keys($scores);\n //return $ranked_comps;\n return $scores;\n\n } else {\n //echo \"<br>from the model: there were no results.\";\n }\n \n }", "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 }", "public function view_survey_data($id)\n\t{\n\t\ttry{\n\t\t\t// Surrvey::findORfail($id);\n\t\t\t$sdata = Surrvey::with(['group'=>function($query){\n\t\t\t\t$query->orderBy('group_order');\n\t\t\t}])->find($id);\t\n\t\t\t$survey['id'] \t\t\t= \t$sdata->id;\n\t\t\t$survey['survey_name'] \t= \t$sdata->name;\n\t \t\t$survey['created_by']\t= \t$sdata->created_by;\n\t \t\t//$survey['user_name']\t= \t$sdata->creat_by->name;\n\t \t\t$survey['description'] \t=\t$sdata->description;\n\t \t\t$survey['status'] \t\t= \t$sdata->status;\n\t \t\tif(count($sdata->group)>0){\n\t\t\t\tforeach ($sdata->group as $key => $grp) {\n\t\t\t\t\t$survey['group'][$key]['group_id'] \t\t\t= $grp->id;\n\t\t\t\t\t$survey['group'][$key]['survey_id'] \t\t= $grp->survey_id;\n\t\t\t\t\t$survey['group'][$key]['group_name'] \t\t= $grp->title;\n\t\t \t\t$survey['group'][$key]['group_description'] = $grp->description;\t\t\t\n\t\t \t\t$survey['group'][$key]['group_order'] \t\t= $grp->group_order;\t\t\t\n\t\t\t\t\tforeach ($grp->question as $qkey => $ques) {\n\t\t\t\t\t\t$answer = json_decode($ques->answer,true);\n\t\t\t\t\t\tforeach ($answer as $anskey => $ansVal) {\n\t\t\t\t\t\t\t$survey['group'][$key]['group_questions'][$qkey][$anskey] =$ansVal;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$survey['group'][$key]['group_questions'][$qkey]['survey_id'] \t= $ques->survey_id;\n\t\t \t\t$survey['group'][$key]['group_questions'][$qkey]['question'] \t= $ques->question;\n\t\t \t\t$survey['group'][$key]['group_questions'][$qkey]['group_id'] \t= $ques->group_id;\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t}else{\n\n\t\t\t\t$survey['group'] \t=[];\n\t\t\t\t$survey['question']\t=[];\n\t\t\t}\n\n\t\t\treturn ['status'=>'success','response'=>$survey];\t\n\t\t}catch(\\Exception $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t\treturn ['status'=>'error','message'=>\"Something goes wrong\"];\t\n\t\t}\t\n\t}", "public function listSurvey() {\n $surveys = \\App\\Survey::where('deleted', '=', 0)->get();\n return view('User/listSurvey', ['surveys' => $surveys]);\n }", "public function get_research_questions()\n\t{\n\t\treturn $this->research_questions;\n\t}", "function fillSurveyForUser($user_id = ANONYMOUS_USER_ID)\n\t{\n\t\tglobal $ilDB;\n\t\t// create an anonymous key\n\t\t$anonymous_id = $this->createNewAccessCode();\n\t\t$this->saveUserAccessCode($user_id, $anonymous_id);\n\t\t// create the survey_finished dataset and set the survey finished already\n\t\t$active_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) \".\n\t\t\t\"VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\tarray('integer','integer','integer','text','text','integer'),\n\t\t\tarray($active_id, $this->getSurveyId(), $user_id, $anonymous_id, 1, time())\n\t\t);\n\t\t// fill the questions randomly\n\t\t$pages =& $this->getSurveyPages();\n\t\tforeach ($pages as $key => $question_array)\n\t\t{\n\t\t\tforeach ($question_array as $question)\n\t\t\t{\n\t\t\t\t// instanciate question\n\t\t\t\trequire_once \"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php\";\n\t\t\t\t$question =& SurveyQuestion::_instanciateQuestion($question[\"question_id\"]);\n\t\t\t\t$question->saveRandomData($active_id);\n\t\t\t}\n\t\t}\t\t\n\t}", "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}", "public function showSurveyResult($survey)\n\t{\n\t\t$data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->get();\n\n\t\t//Lets figure out the results from the answers\n\t\t$data['rediness'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 4)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t//Get my goals\n\t\t$data['goals'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 5)\n\t\t\t\t\t\t\t\t->first();\n\n\t\t$data['goals'] = json_decode($data['goals']->answer);\n\n\t\t//Figure out the rediness score\n\t\t$data['rediness_percentage'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', '>', 6)\n\t\t\t\t\t\t\t\t->where('answers.q_id','<' , 12)\n\t\t\t\t\t\t\t\t->get();\n\t\t//Calculate the readiness\n\t\t$myscore = 0;\n\t\t$total = count($data['rediness_percentage']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$cr = $data['rediness_percentage'][$i];\n\n\t\t\t$myscore += $cr->answer;\n\t\t}\n\n\t\t$data['rediness_percentage'] = ($myscore/50) * 100;\n\n\t\t//Figure out the matching programs\n\t\t$data['strengths'] = $data['answers'] = DB::table('answers')\n\t\t\t\t\t\t\t\t->leftJoin('questions', 'answers.q_id', '=', 'questions.id')\n\t\t\t\t\t\t\t\t->where('lead_id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t\t->where('answers.form_id', 1)\n\t\t\t\t\t\t\t\t->where('answers.q_id', 11)\n\t\t\t\t\t\t\t\t->first();\n\t\t//Parse out the strenghts\n\t\t$data['strengths'] = json_decode($data['strengths']->answer);\n\t\t$program_codes = '';\n\t\t$total = count($data['strengths']);\n\t\tfor ($i=0; $i < $total; $i++) {\n\t\t\t$matching_programs = DB::table('matching_programs')\n\t\t\t\t\t\t\t\t\t\t->where('answer', $data['strengths'][$i])\n\t\t\t\t\t\t\t\t\t\t->first();\n\t\t\tif($program_codes == '') {\n\t\t\t\t$program_codes = $matching_programs->program_codes;\n\t\t\t}else {\n\t\t\t\t$program_codes .= ','.$matching_programs->program_codes;\n\t\t\t}\n\t\t}\n\n\t\t$program_codes = explode(',', $program_codes);\n\t\t$program_codes = array_unique($program_codes);\n\t\tforeach ($program_codes as $key => $value) {\n\t\t\t$program_codes[$key] = trim($program_codes[$key]);\n\t\t}\n\n\n\t\t$data['programs'] = DB::table('programs')\n\t\t\t\t\t\t\t->whereIn('program_code', $program_codes)\n\t\t\t\t\t\t\t->get();\n\n\t\t//Get the user information\n\t\t$data['lead'] = DB::table('leads')\n\t\t\t\t\t\t\t->where('id', base64_decode(Request::segment(2)))\n\t\t\t\t\t\t\t->first();\n\n\t\t//Get the articles that we are going to display\n $data['articles'] = Tools::getBlogPosts();\n\n\n\t\t//Create the view\n\t\t$this->layout->content = View::make('survey-result.content', $data);\n\n\t\t$this->layout->header = View::make('includes.header');\n\t}", "public function surveyReportMakerForProfessional(Request $request){\n\n $survey = nsurvey::get();\n $survey_id = $request->get('survey');\n $profession_id = $request->get('profession');\n $type = surveyPerformerProfession::find($profession_id);\n\n $profession = surveyPerformerProfession::get();\n\n\n $optionID = Que_option::where('survey_auto_id',$survey_id)->get();\n if($survey_id == 0){\n $optionID = Que_option::get();\n }\n\n\n $optionArray = [];\n\n foreach($optionID as $optionID){\n $o = new Object_();\n $o->ansID = $optionID;\n $o->que = Survey_question::where('id',$optionID->que_auto_id)->first();\n // print_r($o->que->id); exit();\n $o->Occurence = Survey_table::where('ans',$optionID->id)->get();\n $o->OccurenceOutOf = Survey_table::where('que_ans_auto_id',$optionID->que_auto_id)->get();\n $o->type = Survey_table::where('ans',$optionID->id)->where('survey_performer_profession',$profession_id)->get();\n array_push($optionArray,$o);\n }\n\n return view('surveyReportMaker.surveyReportMakerForProfessional',compact(['optionArray','profession','profession_id','type','survey','survey_id']));\n\n // $profession = SurveyPerformerProfession::get();\n // $optionID = Que_option::get();\n // $dataPussingArray = [];\n\n // foreach($optionID as $optionID){\n // $d = Survey_table::where('ans',$optionID->id)->get();\n // print_r(count($d)); echo \"\\n\";\n // } exit();\n // return view('surveyReportMaker.surveyReportMakerForProfessional',compact(['profession']));\n }", "function get_rad_survey_labs($conn, $survey_id) {\n\t$query_labs = \"SELECT building, room FROM rad_survey_labs WHERE survey_id = \" . $survey_id;\n\treturn exec_query($conn, $query_labs);\n}", "function submitted_events_get_pending_submissions() {\n\tglobal $wpdb;\n\t// Get all submissions that have not had events generated for them\n\t$table_name = $wpdb->prefix . \"submitted_events\";\n\treturn $wpdb->get_results ( \"SELECT * FROM \" . $table_name . \" WHERE eventgenerated = 0\" );\n}", "function submitoswestrysurvey()\n {\n $userdetails = $this->userInfo();\n \n $therapistid = $this->fetch_all_rows($this->execute_query(\"select therapist_id from therapist_patient where patient_id = '{$userdetails['user_id']}' and status = 1\"));\n \n $oswestrydata = $this->jsondecode($_REQUEST['oswestrydata'], true);\n \n $score = 0;\n $count = 0;\n foreach($oswestrydata as $key => $value)\n {\n if($key == 'painscale')\n continue;\n $score += ($value - 1);\n $count++;\n }\n \n /*\n * algorithm for calculating the score\n */\n $score = round(($score / (5 * $count)) * 100);\n $painscale = ($oswestrydata['painscale']) * 10;\n \n //determine which oswestry survey is taken\n \n /*\n * The Oswestry Outcome Measure (i.e. survey) will be assigned at the \n * following intervals automatically. Day 1, Day 18, Day 37, Day 53.\n */\n\t\t $surveynumber=1;\n if($_REQUEST['surveytakenon'] >= 1 && $_REQUEST['surveytakenon'] < 18)\n {\n $action = 'oswestry survey 1';\n\t\t\t$surveynumber=1;\n }\n else if($_REQUEST['surveytakenon'] >= 18 && $_REQUEST['surveytakenon'] < 37)\n {\n $action = 'oswestry survey 2';\n\t\t\t$surveynumber=2;\n \n //mark survey 1 as void only if it is not complete\n $this->markOswestrySurveyVoid(1, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n }\n else if($_REQUEST['surveytakenon'] >= 37 && $_REQUEST['surveytakenon'] < 53)\n {\n $action = 'oswestry survey 3';\n\t\t\t$surveynumber=3;\n \n //mark survey 1 as void only if it is not complete\n $this->markOswestrySurveyVoid(1, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n \n //mark survey 2 as void only if it is not complete\n $this->markOswestrySurveyVoid(2, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n }\n else if($_REQUEST['surveytakenon'] >= 53)\n {\n $action = 'oswestry survey 4';\n $surveynumber=4;\n //mark survey 1 as void only if it is not complete\n $this->markOswestrySurveyVoid(1, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n\n //mark survey 2 as void only if it is not complete\n $this->markOswestrySurveyVoid(2, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n \n //mark survey 3 as void only if it is not complete\n $this->markOswestrySurveyVoid(3, $userdetails['user_id'], $therapistid[0]['therapist_id']);\n }\n \n //check if the score has already been inserted in the database.\n $sqlforomcheck = \"SELECT * FROM patient_om WHERE patient_id = {$userdetails['user_id']} AND filledagainstsurvey = '{$action}' AND om_form = '1'\";\n \n //oswestry has already been taken, so returned string will be \n $string = \"\";\n \n if($this->num_rows($this->execute_query($sqlforomcheck)) == 0)\n\t\t\n {\n //oswestry has not been taken\n\n //insert in patient_om table\n $formtype = 1; //for oswestry form type\n $patientomdata = array(\n 'om_form' => $formtype,\n 'score' => $score,\n 'score2' => $painscale,\n 'patient_id' => $userdetails['user_id'],\n 'therapist_id' => $therapistid[0]['therapist_id'],\n 'filledagainstsurvey' => $action,\n 'status' => 2,\n 'created_on' => date('Y-m-d H:i:s'),\n 'submited_on' => date('Y-m-d H:i:s')\n );\n\n $this->insert('patient_om', $patientomdata);\n $newlyinsertedomid = $this->insert_id();\n\t\t\t\n\n //update the patient_history table\n $patienthistoryarr = array(\n 'patient_id' => $userdetails['user_id'],\n 'action' => $action,\n 'action_status' => 'complete', \n 'action_type' => 'outcome measure',\n 'action_time' => date('Y-m-d H:i:s')\n );\n $this->insert('patient_history', $patienthistoryarr);\n \n $string = \"{$score},{$painscale}\";\n\t\t\t\n\t\t\t//sending notification message\n\t\t\t\n\t\t\t\n\t\t$this->sendOswestryNotificion($surveynumber,$score, $userdetails, $therapistid[0]['therapist_id']);\t\n\t\t$this->sendPainlevelNotificion($surveynumber,$oswestrydata['painscale'], $userdetails, $therapistid[0]['therapist_id']);\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n }\n \n echo $string;\n }", "function userSurvey() {\n $this->autoRender = false; // turn off autoRender because we need total control over what view to render here\n if (!$this->Session->check('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 // logic for the survey process starts here\n switch ($progress) {\n case INTRO:\n $this->layout = 'intro'; // use the intro layout\n $this->render('/Elements/intro');\n break;\n case RIGHTS:\n $this->layout = 'rights'; // use the more 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);\n $this->render('/Elements/rights');\n break;\n case QUESTIONS:\n $this->redirect(array('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 }", "function standardslideshow_get_participants($slideshowid) {\n\n return false;\n}", "function UsersSubmitedOnContest( $id ) {\n\t\t //return all distinct usernames who have submitted on the contest\n\n\t\t $sql = mysql_real_escape_string( $id );\n\n\t\t $res = mysql_query( \n\t\t\t\t\"SELECT\n\t\t\t\t \tDISTINCT sources.user_id\n\t\t\t\t FROM\n\t\t\t\t \tproblems, sources\n\t\t\t\t WHERE\n\t\t\t\t \tproblems.parent_id = '$id'\n\t\t\t\t\tAND sources.parent_id = problems.id\" );\n\n\t\tif ( mysql_num_rows( $res ) == 0 ) {\n\t\t\treturn ( false );\n\t\t}\n\n\t\t$ret = array();\n\n\t\twhile ( $obj = mysql_fetch_array( $res ) ) {\n\t\t\t$ret[] = $obj;\n\t\t}\n\n\t\treturn ( $ret );\n\n}", "public function get_survey_submissions($filters, $order_by = 'updated', $order_by_order = 'DESC')\n\t{\n\t\t$data = array();\n\n\t\t$order_by = in_array($order_by, array('id', 'member_id', 'survey_id', 'created', 'updated', 'completed', 'complete')) ? $order_by : 'updated';\n\t\t$order_by_order = in_array($order_by_order, array('ASC', 'DESC', 'RANDOM')) ? $order_by_order : 'DESC';\n\n\t\t$this->db->order_by($order_by, $order_by_order);\n\n\t\t// Filter survey ID\n\t\tif ( isset($filters['survey_id']) AND $filters['survey_id'])\n\t\t{\n\t\t\t$this->db->where('survey_id', $filters['survey_id']);\n\t\t}\n\n\t\t// Filter member ID\n\t\tif ( isset($filters['member_id']) AND $filters['member_id'])\n\t\t{\n\t\t\t$this->db->where('member_id', $filters['member_id']);\n\t\t}\n\n\t\t// Filter group ID\n\t\tif ( isset($filters['group_id']) AND $filters['group_id'])\n\t\t{\n\t\t\t$this->db->join('members', 'members.member_id = vwm_surveys_submissions.member_id');\n\t\t\t$this->db->where('group_id', $filters['group_id']);\n\t\t}\n\n\t\t// If a valid created from date was provided\n\t\tif ( isset($filters['created_from']) AND strtotime($filters['created_from']) )\n\t\t{\n\t\t\t// If a valid created to date was provided as well\n\t\t\tif ( isset($filters['created_to']) AND strtotime($filters['created_to']) )\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * Add one day (86400 seconds) to created_to date\n\t\t\t\t *\n\t\t\t\t * If user is searching for all surveys created from 1/1/2000 to\n\t\t\t\t * 1/1/2000 it should show all surveys created on 1/1/2000.\n\t\t\t\t */\n\t\t\t\t$this->db->where( '`created` BETWEEN ' . strtotime($filters['created_from']) . ' AND ' . (strtotime($filters['created_to']) + 86400), NULL, FALSE );\n\t\t\t}\n\t\t\t// Just a created from date was provided\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where( 'created >=', strtotime($filters['created_from']) );\n\t\t\t}\n\t\t}\n\n\t\t// If a valid updated from date was provided\n\t\tif ( isset($filters['updated_from']) AND strtotime($filters['updated_from']) )\n\t\t{\n\t\t\t// If a valid updated to date was provided as well\n\t\t\tif ( isset($filters['updated_to']) AND strtotime($filters['updated_to']) )\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * Add one day (86400 seconds) to updated_to date\n\t\t\t\t *\n\t\t\t\t * If user is searching for all surveys updated from 1/1/2000 to\n\t\t\t\t * 1/1/2000 it should show all surveys updated on 1/1/2000.\n\t\t\t\t */\n\t\t\t\t$this->db->where( '`updated` BETWEEN ' . strtotime($filters['updated_from']) . ' AND ' . (strtotime($filters['updated_to']) + 86400), NULL, FALSE );\n\t\t\t}\n\t\t\t// Just a updated from date was provided\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where( 'updated >=', strtotime($filters['updated_from']) );\n\t\t\t}\n\t\t}\n\n\t\t// Filter completed\n\t\tif ( isset($filters['complete']) AND $filters['complete'] !== NULL)\n\t\t{\n\t\t\t// Show completed subissions\n\t\t\tif ($filters['complete'])\n\t\t\t{\n\t\t\t\t$this->db->where('completed IS NOT NULL', NULL, TRUE);\n\t\t\t}\n\t\t\t// Show incomplete submissions\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where('completed IS NULL', NULL, TRUE);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query = $this->db->get('vwm_surveys_submissions');\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach ($query->result() as $row)\n\t\t\t{\n\t\t\t\t$data[ (int)$row->id ] = array(\n\t\t\t\t\t'id' => (int)$row->id,\n\t\t\t\t\t'hash' => $row->hash,\n\t\t\t\t\t'member_id' => (int)$row->member_id,\n\t\t\t\t\t'survey_id' => (int)$row->survey_id,\n\t\t\t\t\t'created' => (int)$row->created,\n\t\t\t\t\t'updated' => (int)$row->updated,\n\t\t\t\t\t'completed' => (int)$row->completed,\n\t\t\t\t\t'complete' => (bool)$row->completed\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}", "protected function getCollectedRecords() {}", "protected function getCollectedRecords() {}", "protected function getCollectedRecords() {}", "function &getSurveyFinishedIds()\n\t{\n\t\tglobal $ilDB, $ilLog;\n\t\t\n\t\t$users = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_finished 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\tarray_push($users, $row[\"finished_id\"]);\n\t\t\t}\n\t\t}\n\t\treturn $users;\n\t}", "protected function response_survey_display($data) {\n $resptags = new \\stdClass();\n if (isset($data->{'q'.$this->id})) {\n $resptags->content = $data->{'q'.$this->id};\n }\n return $resptags;\n }", "function quiz_report_load_questions($quiz){\n global $CFG, $DB;\n $questionlist = quiz_questions_in_quiz($quiz->questions);\n //In fact in most cases the id IN $questionlist below is redundant\n //since we are also doing a JOIN on the qqi table. But will leave it in\n //since this double check will probably do no harm.\n list($usql, $params) = $DB->get_in_or_equal(explode(',', $questionlist));\n $params[] = $quiz->id;\n if (!$questions = $DB->get_records_sql(\"SELECT q.*, qqi.grade AS maxgrade\n FROM {question} q,\n {quiz_question_instances} qqi\n WHERE q.id $usql AND\n qqi.question = q.id AND\n qqi.quiz = ?\", $params)) {\n print_error('noquestionsfound', 'quiz');\n }\n //Now we have an array of questions from a quiz we work out there question nos and remove\n //questions with zero length ie. description questions etc.\n //also put questions in order.\n $number = 1;\n $realquestions = array();\n $questionids = explode(',', $questionlist);\n foreach ($questionids as $id) {\n if ($questions[$id]->length) {\n // Ignore questions of zero length\n $realquestions[$id] = $questions[$id];\n $realquestions[$id]->number = $number;\n $number += $questions[$id]->length;\n }\n }\n return $realquestions;\n}", "private function __getSurveysBySession(Instruction $instruction){\n $instruction_surveys = $this->em->getRepository('AppBundle\\Entity\\InstructionSurvey')->findBy(array('instruction' => $instruction), array('created' => 'DESC') );\n \n return $instruction_surveys;\n }", "function get_rad_survey_results($conn, $survey_id) {\n\t$query_results = \"SELECT * FROM rad_survey_result WHERE survey_id = \" . $survey_id;\n\treturn exec_query($conn, $query_results);\n}", "public static function getChallenges($session) \n {\n \n KorisnikModel::updateWrapper($session->get('user')->summonerName);\n \n $uQModel = new UserQuestModel();\n $qModel = new QuestModel();\n $uQ = $uQModel->where('summonerName', $session->get('user')->summonerName)->findAll();\n $poroUser = count($uQModel->where('summonerName', $session->get('user')->summonerName)->where('completed', 1)->findAll());\n $poroTotal = count($qModel->findAll());\n\n $data = [\n 'poroUser' => $poroUser,\n 'poroTotal' => $poroTotal,\n 'quests' => []\n ];\n \n foreach ($uQ as $userQuest) {\n $quest = $qModel->find($userQuest->questId);\n $dataQuest = [\n 'id' => $userQuest->questId,\n 'title' => $quest->title,\n 'description' => $quest->description,\n 'image' => $quest->image,\n 'completed' => $userQuest->completed,\n 'attributes' => QuestAttributeModel::getAttributes($quest->questId)\n ];\n \n \n $questRequired = null;\n $preReqSatisfied = true;\n foreach($dataQuest['attributes'] as $atr){\n if($atr->attributeKey == 'Prerequisite Id'){\n $questRequired = intval($atr->attributeValue);\n $preReQuest = $uQModel->where('questId', $questRequired)->where('summonerName',$session->get('user')->summonerName)->find();\n if($preReQuest[0]->completed == 0){\n $preReqSatisfied = false;\n break;\n } \n } \n }\n \n if($preReqSatisfied == false){ \n continue;\n }\n // $dataQuest['attributes'];\n array_push($data['quests'], $dataQuest);\n }\n return $data;\n }", "public function survey()\n {\n return $this->belongsTo('App\\Survey', 'survey_id');\n }", "public function getSurveysWithUser(User $user,$isParticipant){\n if($isParticipant){\n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\ParticipantDocument')\n ->field('user')->references($user)\n ->field('status')->equals(\"active\");\n }\n else{\n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\ResearcherDocument')\n ->field('user')->references($user)\n ->field('status')->equals(\"active\");\n \n }\n $cursor = $query->getQuery()->execute();\n $projectIds = array();\n foreach($cursor as $participant){\n array_push($projectIds,new \\MongoId($participant->project->id));\n }\n \n $query = $this->getDocumentManager()->createQueryBuilder('Application\\Document\\SurveyDocument')\n ->field('project.$id')->in($projectIds);\n $cursor = $query->getQuery()->execute();\n $surveys = array();\n foreach($cursor as $survey){\n array_push($surveys,$survey);\n }\n return $surveys;\n }", "public function mockupRiskScreening()\n {\n $f = Questionaire::with('questions.choices.subchoices')\n ->find(env('APP_RISK_ID'));\n\n $participants = Participant::all();\n $i = 0;\n $c = count($participants);\n foreach ($participants as $p) {\n $this->createAnswers($f, $p);\n\n // Points doesn't really matter alot in risk form\n $this->createResults($f, $p, 999); \n\n echo \"risk results & answers \".($i+1).\"/\".$c.\" created\\r\";\n\n $i++;\n }\n }", "function GetSubmissions () {\n $array = array ();\n $result = @mysql_query (\"SELECT `submission_id` FROM `hunt_submissions` WHERE `submission_hunt` = '\".$this->hunt_id.\"' ORDER BY `submission_timestamp` ASC;\", $this->ka_db);\n while ($row = @mysql_fetch_array ($result))\n $array [] = new Submission ($row[\"submission_id\"], $this->roster_coder);\n return $array;\n }", "public function getSurvey()\n {\n return $this->hasOne(SurveyTemplates::ClassName(), ['id' => 'survey_template_id']);\n }", "function meetsPrerequisite($clid, $course_dept,$course_num,$semester,$year,$section){\n\t$meetsPrereqSet = mysql_query(\"select * from ((select prim_key from requisite R,take T where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and T.clid='$clid' and T.course_num=R.req_course_num and T.course_dept=R.req_course_dept and (T.grade <= R.grade or T.grade is null) and T.grade <> 'W' and T.grade <> 'I' and T.grade <> 'F') union all (select prim_key from requisite R,spec_cred S where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and S.clid='$clid' and S.course_num=R.req_course_num and S.course_dept=R.req_course_dept and (S.grade <= R.grade or S.grade is null) and S.grade <> 'W' and S.grade <> 'I' and S.grade <> 'F') union all (select prim_key from requisite R,take T,counts_for C where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and T.clid='$clid' and T.course_num=C.course_num and T.course_dept=C.course_dept and C.sub_course_num=R.course_num and C.sub_course_dept=R.course_dept and (T.grade <= R.grade or T.grade is null) and T.grade <> 'W' and T.grade <> 'I' and T.grade <> 'F') union all (select prim_key from requisite R,spec_cred S,counts_for C where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and S.clid='$clid' and S.course_num=C.course_num and S.course_dept=C.course_dept and C.sub_course_num=R.course_num and C.sub_course_dept=R.course_dept and (S.grade <= R.grade or S.grade is null) and S.grade <> 'W' and S.grade <> 'I' and S.grade <> 'F') union all (select prim_key from class_requisite R,take T where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and R.semester='$semester' and R.year='$year' and R.section_num='$section' and T.clid='$clid' and T.course_num=R.req_course_num and T.course_dept=R.req_course_dept and (T.grade <= R.grade or T.grade is null) and T.grade <> 'W' and T.grade <> 'I' and T.grade <> 'F') union all (select prim_key from class_requisite R,spec_cred S where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.semester='$semester' and R.year='$year' and R.section_num='$section' and R.type='P' and S.clid='$clid' and S.course_num=R.req_course_num and S.course_dept=R.req_course_dept and (S.grade <= R.grade or S.grade is null) and S.grade <> 'W' and S.grade <> 'I' and S.grade <> 'F') union all (select prim_key from class_requisite R,take T,counts_for C where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.semester='$semester' and R.year='$year' and R.section_num='$section' and R.type='P' and T.clid='$clid' and T.course_num=C.course_num and T.course_dept=C.course_dept and C.sub_course_num=R.course_num and C.sub_course_dept=R.course_dept and (T.grade <= R.grade or T.grade is null) and T.grade <> 'W' and T.grade <> 'I' and T.grade <> 'F') union all (select prim_key from class_requisite R,spec_cred S,counts_for C where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.semester='$semester' and R.year='$year' and R.section_num='$section' and R.type='P' and S.clid='$clid' and S.course_num=C.course_num and S.course_dept=C.course_dept and C.sub_course_num=R.course_num and C.sub_course_dept=R.course_dept and (S.grade <= R.grade or S.grade is null) and S.grade <> 'W' and S.grade <> 'I' and S.grade <> 'F')) as result group by prim_key having count(*)=(select count(*) from requisite R where R.course_num='$course_num' and R.course_dept='$course_dept' and R.course_dept <> 'INST' and R.type='P' and R.prim_key=result.prim_key);\") or die(mysql_error());\n\t$act_composite=calculateAct($clid);\n\t$ACTquery=mysql_query(\"select * from course C,student S where S.clid='$clid' and (C.act_composite='$act_composite' or C.act_math=S.act_math or C.act_english=S.act_english or C.act_reading=S.act_reading or C.act_science=S.act_science);\") or die(mysql_error());\n\tif((mysql_fetch_array($meetsPrereqSet)) or (mysql_fetch_array($ACTquery))) return true;\n\telse return false;\n\n}" ]
[ "0.64826673", "0.60849106", "0.5902223", "0.58925384", "0.56816685", "0.5635475", "0.5619469", "0.55992436", "0.5588194", "0.54731953", "0.5472867", "0.54032755", "0.53898084", "0.53687656", "0.5366125", "0.53583175", "0.53583175", "0.5313885", "0.52884066", "0.52396154", "0.5234728", "0.51853365", "0.5184381", "0.51646876", "0.510344", "0.50952095", "0.5092884", "0.5074122", "0.50648576", "0.50434786", "0.503825", "0.50360703", "0.50350696", "0.5016856", "0.5001048", "0.49980056", "0.4992425", "0.49775514", "0.49758515", "0.49603057", "0.49560902", "0.49530533", "0.49391875", "0.4916021", "0.4902668", "0.49000847", "0.48961535", "0.48894337", "0.4888306", "0.48848632", "0.48848632", "0.48816293", "0.4873346", "0.48662427", "0.48557946", "0.48445162", "0.48409712", "0.48326975", "0.48276967", "0.47954744", "0.4778205", "0.47730413", "0.47687203", "0.47683495", "0.4756876", "0.4755197", "0.4744417", "0.4734597", "0.4732169", "0.47170424", "0.47154805", "0.47147143", "0.4713931", "0.47059253", "0.47050506", "0.4699802", "0.4696012", "0.4691642", "0.4688647", "0.46729276", "0.46683607", "0.4666627", "0.46648952", "0.46639287", "0.46628916", "0.46507856", "0.46507856", "0.46499822", "0.46485198", "0.46439794", "0.4640329", "0.46390462", "0.46361765", "0.463475", "0.46330476", "0.46285462", "0.46281657", "0.4623812", "0.46197072", "0.46187896" ]
0.5889542
4
Transform defines how data should be presented.
public function transform(Category $category) { return [ 'id' => (int)$category->id, 'name' => $category->name, 'slug' => $category->slug, 'description' => $category->description, 'sort_order' => $category->sort_order, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function transform();", "public static function transformer();", "public function transform()\r\n {\r\n // Retrieve and set the column headings.\r\n $headings = $this->getDiscreteColumnValues(0);\r\n \r\n // One of the retrieved headings does not appear in the first set of data and so is added to the end of the\r\n // headings. When parsing the data though it appears as the penultimate heading, and so the order of headings\r\n // needs to be adjusted so that it can be known when a set of data has been parsed and a new set is begining.\r\n // FURTHER DEVELOPMENT: Parse headings and generate the headings list in the order that they appear in each set\r\n // of data. Generate a warning if the heading order varies between sets of data or one heading does not appear\r\n // at the start of each set of data as this is required to know when one row ends and a new row is to be\r\n // generated.\r\n $headings[6] = $headings[4];\r\n $headings[4] = $headings[5];\r\n $headings[5] = $headings[6];\r\n \r\n // Add additional headings we want.\r\n $headings[6] = 'Title';\r\n $headings[7] = 'First Name';\r\n $headings[8] = 'Surname';\r\n \r\n // Create the new output CSV.\r\n $outputFile = new CsvFile();\r\n $outputFile->addRow($headings);\r\n \r\n // Set up a new empty row to fill with data.\r\n $emptyRow = [];\r\n for ($i = 0; $i < count($headings); ++$i) {\r\n $emptyRow[$i] = '';\r\n }\r\n \r\n // Loop over the data and build the rows.\r\n $row = $emptyRow;\r\n $lastIndex = 0;\r\n foreach ($this->data as $iRow => $data) {\r\n $heading = $data[0];\r\n $value = $data[1];\r\n \r\n $index = array_search($heading, $headings);\r\n \r\n // If the row is complete, add it to the output and start a new row.\r\n if ($index < $lastIndex) {\r\n $outputFile->addRow($row);\r\n $row = $emptyRow;\r\n }\r\n \r\n // Add the data to the row.\r\n $row[$index] = $value;\r\n $lastIndex = $index;\r\n \r\n // Split any name into the 3 parts.\r\n // FURTHER DEVELOPMENT: Use a library util function for this.\r\n if ($index === 0) {\r\n \r\n $titles = [\r\n 'Mr',\r\n 'Mrs',\r\n 'Miss',\r\n 'Ms',\r\n 'Dr',\r\n 'Major',\r\n 'Lt Col'\r\n ];\r\n \r\n // Find any title of the name.\r\n if (in_array(substr($value, 0, 4), $titles)) {\r\n $row[6] = substr($value, 0, 4);\r\n $value = substr($value, 5);\r\n } elseif (in_array(substr($value, 0, 3), $titles)) {\r\n $row[6] = substr($value, 0, 3);\r\n $value = substr($value, 4);\r\n } elseif (in_array(substr($value, 0, 2), $titles)) {\r\n $row[6] = substr($value, 0, 2);\r\n $value = substr($value, 3);\r\n }\r\n \r\n // Extract first name.\r\n $row[7] = substr($value, 0, strpos($value, ' '));\r\n \r\n // Extract surname;\r\n $row[8] = substr($value, strpos($value, ' ') + 1);\r\n }\r\n }\r\n \r\n // Add the last completed row.\r\n $outputFile->addRow($row);\r\n \r\n $outputFile->toFile('/home/tom/Desktop/new-physio-data.csv');\r\n }", "public function getTransformer();", "protected function applyTransformation() {\n // no transformation for index\n }", "public function transform($transformationType, $value);", "protected function getTransformedData()\n {\n return $this->transformedData;\n }", "public function transform($transformer);", "public function transform()\n {\n $object = $this->resource;\n\n $data = $object instanceof Collection || $object instanceof AbstractPaginator\n ? $object->map([$this, 'transformResource'])->toArray()\n : $this->transformResource($object);\n\n if ($object instanceof AbstractPaginator) {\n $this->withMeta(array_merge(\n $this->getExtra('meta', []), Arr::except($object->toArray(), ['data'])\n ));\n }\n\n $data = array_filter(compact('data') + $this->extras);\n ksort($data);\n\n return $data;\n }", "public function transform()\n\t{\n\t\t$this->createCollection();\n\n\t\tif($this->hasPaginator) {\n\t\t\t$output = $this->tagCollection\n\t\t\t\t->setPaginator(\n\t\t\t\t\tnew IlluminatePaginatorAdapter($this->tag)\n\t\t\t\t);\n\t\t}\n\n\t\t$output = $this->manager\n\t\t\t->createData($output)\n\t\t\t->toJson();\n\n\t\treturn $output;\n\t}", "abstract public function transform(Row $row);", "abstract protected function transformItem($item);", "function transform($data, $key, $transformedData = NULL)\n {\n return $this->getTransformerContainer()->transform($data, $key, $transformedData);\n }", "public function transformDataProvider() {\n return [\n 'no arguments' => [\n 'definition' => [\n 'source' => [\n 'plugin' => 'embedded_data',\n 'data_rows' => [\n [\n 'id' => 1,\n 'title' => 'content item 1',\n 'term' => 'Apples',\n ],\n [\n 'id' => 2,\n 'title' => 'content item 2',\n 'term' => 'Bananas',\n ],\n [\n 'id' => 3,\n 'title' => 'content item 3',\n 'term' => 'Grapes',\n ],\n ],\n 'ids' => [\n 'id' => ['type' => 'integer'],\n ],\n ],\n 'process' => [\n 'id' => 'id',\n 'type' => [\n 'plugin' => 'default_value',\n 'default_value' => $this->bundle,\n ],\n 'title' => 'title',\n $this->fieldName => [\n 'plugin' => 'entity_generate',\n 'source' => 'term',\n ],\n ],\n 'destination' => [\n 'plugin' => 'entity:node',\n ],\n ],\n 'expected' => [\n 'row 1' => [\n 'id' => 1,\n 'title' => 'content item 1',\n $this->fieldName => [\n 'tid' => 2,\n 'name' => 'Apples',\n ],\n ],\n 'row 2' => [\n 'id' => 2,\n 'title' => 'content item 2',\n $this->fieldName => [\n 'tid' => 3,\n 'name' => 'Bananas',\n ],\n ],\n 'row 3' => [\n 'id' => 3,\n 'title' => 'content item 3',\n $this->fieldName => [\n 'tid' => 1,\n 'name' => 'Grapes',\n ],\n ],\n ],\n 'pre seed' => [\n 'taxonomy_term' => [\n 'name' => 'Grapes',\n 'vid' => $this->vocabulary,\n 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,\n ],\n ],\n ],\n 'no arguments_lookup_only' => [\n 'definition' => [\n 'source' => [\n 'plugin' => 'embedded_data',\n 'data_rows' => [\n [\n 'id' => 1,\n 'title' => 'content item 1',\n 'term' => 'Apples',\n ],\n [\n 'id' => 2,\n 'title' => 'content item 2',\n 'term' => 'Bananas',\n ],\n [\n 'id' => 3,\n 'title' => 'content item 3',\n 'term' => 'Grapes',\n ],\n ],\n 'ids' => [\n 'id' => ['type' => 'integer'],\n ],\n ],\n 'process' => [\n 'id' => 'id',\n 'type' => [\n 'plugin' => 'default_value',\n 'default_value' => $this->bundle,\n ],\n 'title' => 'title',\n $this->fieldName => [\n 'plugin' => 'entity_lookup',\n 'source' => 'term',\n ],\n ],\n 'destination' => [\n 'plugin' => 'entity:node',\n ],\n ],\n 'expected' => [\n 'row 1' => [\n 'id' => 1,\n 'title' => 'content item 1',\n $this->fieldName => [\n 'tid' => NULL,\n 'name' => NULL,\n ],\n ],\n 'row 2' => [\n 'id' => 2,\n 'title' => 'content item 2',\n $this->fieldName => [\n 'tid' => NULL,\n 'name' => NULL,\n ],\n ],\n 'row 3' => [\n 'id' => 3,\n 'title' => 'content item 3',\n $this->fieldName => [\n 'tid' => 1,\n 'name' => 'Grapes',\n ],\n ],\n ],\n 'pre seed' => [\n 'taxonomy_term' => [\n 'name' => 'Grapes',\n 'vid' => $this->vocabulary,\n 'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,\n ],\n ],\n ],\n ];\n }", "public function transform($value);", "public function transform($data = null)\n {\n\n if ($data === null) {\n return '';\n }\n\n if(!is_object($data)){\n return $data;\n }\n\n if($data->isExpired()){\n return 'XXX';\n }\n\n return $data->getData();\n }", "public function transform(TransformableContract $model);", "public function transform(){\r\n\t\tswitch($this->processor){\r\n\t\t\tcase 'saxon':\r\n\t\t\t\t$this->runSaxon();\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'salbotron':\r\n\t\t\tdefault:\r\n\t\t\t\t$this->runSalbatron();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "abstract public function transform(array $item);", "public function testTransform()\n {\n $img = new P4Cms_Image();\n $data = file_get_contents(TEST_ASSETS_PATH . '/images/luigi.png');\n $img->setData($data);\n\n // test the behavior of scale with width and height\n $img->transform('scale', array(258, 355));\n $this->assertSame(\n $img->getImageSize(),\n array('width' => 258, 'height' => 355),\n 'Expected image to be scaled to 258x355 pixels.'\n );\n\n // test the behavior of scale with width only\n // 516/710 = 400/h => h = 550\n $img->transform('scale', array(400));\n $this->assertSame(\n $img->getImageSize(),\n array('width' => 400, 'height' => 550),\n 'Expected image to be scaled to 300x300 pixels.'\n );\n\n // test the behavior of crop\n $img->transform('crop', array(100, 100, 50, 50));\n $this->assertSame(\n $img->getImageSize(),\n array('width' => 100, 'height' => 100),\n 'Expected image to be cropped to 100x100 pixels.'\n );\n\n // test the behavior of unsupported transform\n try {\n $img->transform('foo');\n $this->fail('Expected failure with an unsupported transform.');\n } catch (P4Cms_Image_Exception $e) {\n $this->assertSame($e->getMessage(), \"Transform \\\"foo\\\" is not supported.\");\n } catch (Exception $e) {\n $this->fail('Unexpected exception: '. $e->getMessage());\n }\n }", "public function transform($data)\n {\n $this->resolveFieldMapping($data, $this->field_map);\n return $data;\n }", "public function transform($item)\n {\n return parent::transform($item);\n }", "abstract protected function outputInternal(string $transformedData);", "public function setTransformer() {\n\t\tif ($this->isPassword()) {\n\t\t\t$this->addTransformer('password');\n\t\t} else {\n\t\t\t$dbType = $this->getDbType();\n\t\t\tif ($dbType == 'datetime') {\n\t\t\t\t$this->addTransformer('datetime');\n\t\t\t}\n\t\t}\n\t}", "public function transform()\n\t{\n\t\t$this->createCollection();\n\n\t\tif($this->hasPaginator) {\n\t\t\t$output = $this->ticketCollection\n\t\t\t\t->setPaginator(\n\t\t\t\t\tnew IlluminatePaginatorAdapter($this->ticket)\n\t\t\t\t);\n\t\t}\n\n\t\t$output = $this->manager\n\t\t\t->createData($output)\n\t\t\t->toJson();\n\n\t\treturn $output;\n\t}", "public function testTransformData()\n {\n $request = new Request;\n $request->attributes->set('transformer', 'MJanssen\\Fixtures\\Transformer\\TestTransformer');\n\n $app = new Application();\n\n $service = new TransformerService($request, $app);\n\n $data = array('foo' => 'baz');\n\n $this->assertEquals($data, $service->transformHydrateData($data));\n $this->assertEquals($data, $service->transformExtractData($data));\n }", "public function testTransform_null()\n {\n $this->assertNull($this->transformer->transform(null));\n }", "public function transformer()\n {\n return null;\n }", "function transform(){\n\t\tif($this->request->post() && ($d = $this->form->validate($this->params))){\n\t\t\tAtk14Require::Helper(\"modifier.markdown\");\n\t\t\t$content = smarty_modifier_markdown($d[\"source\"]);\n\t\t\tif($d[\"base_href\"]){\n\t\t\t\t$base_href = $d[\"base_href\"];\n\t\t\t\tif(!preg_match('/\\/$/',$base_href)){\n\t\t\t\t\t$base_href .= \"/\";\n\t\t\t\t}\n\t\t\t\t$content = preg_replace_callback('/(<a\\b[^>]*\\bhref=\"|img\\b[^>]*\\bsrc=\")([^\"]*)/',function($matches) use($base_href){\n\t\t\t\t\t$url = $matches[2];\n\t\t\t\t\tif(!preg_match('/^https?:\\/\\//',$url) && !preg_match('/^\\//',$url)){\n\t\t\t\t\t\t$url = preg_replace('/^\\.\\/+/','',$url);\n\t\t\t\t\t\t$url = $base_href.$url;\n\t\t\t\t\t}\n\t\t\t\t\treturn $matches[1].$url.\"\";\n\t\t\t\t},$content);\n\t\t\t}\n\t\t\t$this->_report_success(array(),array(\n\t\t\t\t\"content_type\" => \"text/plain\",\n\t\t\t\t\"raw_data\" => $content,\n\t\t\t));\n\t\t}\n\t}", "public function transformRequest()\n {\n return $arrTransformReq = ['id' => 'CompanyId',\n 'type' => 'Type',\n 'name' => 'Name', 'doing_business_as' => 'DoingBusinessAs',\n 'tax_id' => 'TaxId',\n 'created_at' => 'CreatedAt', 'etag' => 'Etag',\n 'deleted_at' => 'DeletedAt'];\n }", "public function providerTransform()\n {\n return [\n [\"But Gollum, and the evil one\", Strings::TR_LOWER, \"but gollum, and the evil one\"],\n [\"Leaves are falling all around\", Strings::TR_UPPER, \"LEAVES ARE FALLING ALL AROUND\"],\n [\"It's timE I waS on my waY\", Strings::TR_TITLE, \"It's Time I Was On My Way\"],\n [\"sometimes I grow so tired\", Strings::TR_UC_FIRST, \"Sometimes I grow so tired\"],\n [\"But Gollum, and the evil one\", Strings::TR_LC_FIRST, \"but Gollum, and the evil one\"],\n [\"MaryHadALittleLamb\", Strings::TR_UNDERSCORE, \"mary_had_a_little_lamb\"],\n [\"mary_had_a_little_lamb\", Strings::TR_CAMEL_CASE, \"MaryHadALittleLamb\"]\n ];\n }", "public function getTransformResults()\n {\n return $this->transform_results;\n }", "public function testTransform_invalid()\n {\n $this->transformer->transform('invalid');\n }", "public function testTransform() {\n\t\t$this->object->addTransformer(new CropTransformer(array('width' => 100)));\n\t\t$this->object->addTransformer(new CropTransformer(array('height' => 100)));\n\n\t\ttry {\n\t\t\tif ($this->object->upload()) {\n\t\t\t\t$this->object->transform();\n\n\t\t\t\t$files = $this->object->getTransformedFiles();\n\n\t\t\t\t$this->assertEquals(2, count($files));\n\n\t\t\t\t$this->object->rollback();\n\t\t\t}\n\n\t\t\t$this->assertTrue(true);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(false, $e->getMessage());\n\t\t}\n\t}", "public function transform() {\n $input = DATABASE_XML;\t// default initial input\n for ($i = 0; $i < count($this->xslt); $i++) {\n $this->xslTransform($this->xslt[$i][\"xsl\"], $this->xslt[$i][\"param\"], $input);\n $input = TRANSFORMED_XML;\t// use result of last xsl transform for all subsequent inputs\n // if debugging is turned on, display transform information & output result\n // (particularly important for debugging more than one transform in a row)\n if ($this->debug) {\n\tprint \"XSLT transform with stylesheet \" . $this->xslt[$i][\"xsl\"];\n\tif (count($this->xslt[$i][\"param\"])) {\n\t print \"<br>\\nParameters: \\n\";\n\t foreach ($this->xslt[$i][\"param\"] as $key => $val) print \"$key => $val \\n\";\n\t}\n\tprint \"<br>\\n\";\n\tprint \"Result of transformation:<br>\\n\";\n\tprint $this->displayXML(TRANSFORMED_XML);\n }\n }\n // unbind used xslts\n unset($this->xslt);\n $this->xslt = array();\n }", "protected function createTransformer()\n {\n $this->createClass('transformer');\n }", "public function textTransformProvider()\n {\n return [[\"uppercase\"], [\"lowercase\"], [\"capitalize\"], [\"none\"]];\n }", "public function textTransformProvider()\n {\n return [[\"uppercase\"], [\"lowercase\"], [\"capitalize\"], [\"none\"]];\n }", "protected function preprocessData() {}", "public function transform ($input)\n {\n $output = [\n 'ID' => 0,\n 'post_date' => Carbon::parse($input->timestamp)->copy()->setTimezone(wp_timezone_string())->format('Y-m-d H:i:s'),\n 'post_content' => $input->caption,\n 'post_title' => $input->id,\n 'post_status' => 'publish',\n 'post_type' => $this->postType,\n 'meta_input' => [\n 'caption' => isset($input->caption) ? $input->caption : '',\n 'media_type' => isset($input->media_type) ? $input->media_type : '',\n 'media_url' => isset($input->media_url) ? $input->media_url : '',\n 'permalink' => isset($input->permalink) ? $input->permalink : '',\n 'thumbnail_url' => isset($input->thumbnail_url) ? $input->thumbnail_url : '',\n 'timestamp' => isset($input->timestamp) ? $input->timestamp : '',\n 'username' => isset($input->username) ? $input->username : '',\n ]\n ];\n\n // print_r($output);\n // die();\n\n return $output;\n\n }", "abstract public function Convert($data);", "public function setTransform(array $transform)\n {\n $this->transform = $transform;\n return $this;\n }", "public function __invoke($data) {\n return $this->transform($data);\n }", "public function dataTransform()\n {\n $input = static function ($body, $extraHead = '') {\n return TestMarkup::DOCTYPE . '<html ⚡><head>'\n . TestMarkup::META_CHARSET . TestMarkup::META_VIEWPORT . TestMarkup::SCRIPT_AMPRUNTIME\n . TestMarkup::LINK_FAVICON . TestMarkup::LINK_CANONICAL . TestMarkup::STYLE_AMPBOILERPLATE . TestMarkup::NOSCRIPT_AMPBOILERPLATE\n . $extraHead\n . '</head><body>'\n . $body\n . '</body></html>';\n };\n\n $expectWithoutBoilerplate = static function ($body, $extraHead = '') {\n return TestMarkup::DOCTYPE . '<html ⚡ i-amphtml-layout=\"\" i-amphtml-no-boilerplate=\"\"><head>'\n . TestMarkup::STYLE_AMPRUNTIME . TestMarkup::META_CHARSET . TestMarkup::META_VIEWPORT . TestMarkup::SCRIPT_AMPRUNTIME\n . TestMarkup::LINK_FAVICON . TestMarkup::LINK_CANONICAL\n . $extraHead\n . '</head><body>'\n . $body\n . '</body></html>';\n };\n\n $expectWithBoilerplate = static function ($body, $extraHead = '') {\n return TestMarkup::DOCTYPE . '<html ⚡ i-amphtml-layout=\"\"><head>'\n . TestMarkup::STYLE_AMPRUNTIME . TestMarkup::META_CHARSET . TestMarkup::META_VIEWPORT . TestMarkup::SCRIPT_AMPRUNTIME\n . TestMarkup::LINK_FAVICON . TestMarkup::LINK_CANONICAL . TestMarkup::STYLE_AMPBOILERPLATE . TestMarkup::NOSCRIPT_AMPBOILERPLATE\n . $extraHead\n . '</head><body>'\n . $body\n . '</body></html>';\n };\n\n return [\n 'modifies document only once' => [\n $expectWithBoilerplate('<amp-img layout=\"container\"></amp-img>'),\n /*\n * The expected output is actually not correctly server-side rendered, but the presence of\n * i-amphtml-layout attribute halts processing, so this is effectively a no-op.\n */\n $expectWithBoilerplate('<amp-img layout=\"container\"></amp-img>'),\n ],\n\n 'boilerplate removed and preserves noscript in body' => [\n $input('<noscript><img src=\"lemur.png\"></noscript>'),\n $expectWithoutBoilerplate('<noscript><img src=\"lemur.png\"></noscript>'),\n ],\n\n 'boilerplate removed and no changes within template tag' => [\n $input('<template><amp-img height=\"42\" layout=\"responsive\" width=\"42\"></amp-img></template>'),\n $expectWithoutBoilerplate('<template><amp-img height=\"42\" layout=\"responsive\" width=\"42\"></amp-img></template>'),\n ],\n\n 'boilerplate removed and layout applied' => [\n $input('<amp-img class=\"\" layout=\"container\"></amp-img>'),\n $expectWithoutBoilerplate('<amp-img class=\"i-amphtml-layout-container\" layout=\"container\" i-amphtml-layout=\"container\"></amp-img>'),\n ],\n\n 'nested amp component' => [\n $input('<amp-layout layout=\"fill\"><amp-img height=\"300\" layout=\"responsive\" src=\"https://acme.org/image1.png\" width=\"400\"></amp-img></amp-layout>'),\n $expectWithoutBoilerplate(\n '<amp-layout class=\"i-amphtml-layout-fill i-amphtml-layout-size-defined\" i-amphtml-layout=\"fill\" layout=\"fill\"><amp-img height=\"300\" layout=\"responsive\" src=\"https://acme.org/image1.png\" width=\"400\" class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" i-amphtml-layout=\"responsive\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block;padding-top:75%\"></i-amphtml-sizer></amp-img></amp-layout>'\n ),\n [],\n ],\n\n 'amp4Email boilerplate removed and layout applied' => [\n TestMarkup::DOCTYPE . '<html ⚡4email><head>'\n . TestMarkup::META_CHARSET . TestMarkup::SCRIPT_AMPRUNTIME . TestMarkup::STYLE_AMP_4_EMAIL_BOILERPLATE\n . '</head><body>'\n . '<amp-img layout=\"container\"></amp-img>'\n . '</body></html>',\n\n TestMarkup::DOCTYPE . '<html ⚡4email i-amphtml-layout=\"\" i-amphtml-no-boilerplate=\"\"><head>'\n . TestMarkup::STYLE_AMPRUNTIME . TestMarkup::META_CHARSET . TestMarkup::SCRIPT_AMPRUNTIME\n . '</head><body>'\n . '<amp-img layout=\"container\" class=\"i-amphtml-layout-container\" i-amphtml-layout=\"container\"></amp-img>'\n . '</body></html>',\n ],\n\n 'amp4Ads boilerplate removed and layout applied' => [\n TestMarkup::DOCTYPE . '<html ⚡4ads><head>'\n . TestMarkup::META_CHARSET . TestMarkup::META_VIEWPORT . TestMarkup::SCRIPT_AMPRUNTIME . TestMarkup::STYLE_AMP_4_ADS_BOILERPLATE\n . '</head><body>'\n . '<amp-img layout=\"container\"></amp-img>'\n . '</body></html>',\n\n TestMarkup::DOCTYPE . '<html ⚡4ads i-amphtml-layout=\"\" i-amphtml-no-boilerplate=\"\"><head>'\n . TestMarkup::STYLE_AMPRUNTIME . TestMarkup::META_CHARSET . TestMarkup::META_VIEWPORT . TestMarkup::SCRIPT_AMPRUNTIME\n . '</head><body>'\n . '<amp-img layout=\"container\" class=\"i-amphtml-layout-container\" i-amphtml-layout=\"container\"></amp-img>'\n . '</body></html>',\n ],\n\n 'boilerplate removed despite sizes (in head though)' => [\n $input('<link rel=\"shortcut icon\" type=\"a\" href=\"b\" sizes=\"c\">'),\n $expectWithoutBoilerplate('<link rel=\"shortcut icon\" type=\"a\" href=\"b\" sizes=\"c\">'),\n ],\n\n 'boilerplate removed when amp-experiment is present but empty' => [\n $input('<amp-experiment><script type=\"application/json\">{ }</script></amp-experiment>'),\n $expectWithoutBoilerplate('<amp-experiment class=\"i-amphtml-layout-container\" i-amphtml-layout=\"container\"><script type=\"application/json\">{ }</script></amp-experiment>'),\n ],\n\n 'amp-audio' => [\n $input('<amp-audio></amp-audio>'),\n $expectWithoutBoilerplate('<amp-audio><audio controls></audio></amp-audio>'),\n ],\n\n 'amp-experiment is non-empty' => [\n $input('<amp-experiment><script type=\"application/json\">{ \"exp\": { \"variants\": { \"a\": 25, \"b\": 25 } } }</script></amp-experiment>'),\n $expectWithBoilerplate('<amp-experiment class=\"i-amphtml-layout-container\" i-amphtml-layout=\"container\"><script type=\"application/json\">{ \"exp\": { \"variants\": { \"a\": 25, \"b\": 25 } } }</script></amp-experiment>'),\n [\n Error\\CannotRemoveBoilerplate::fromAmpExperiment(\n Document::fromHtmlFragment(\n '<amp-experiment><script type=\"application/json\">{ \"exp\": { \"variants\": { \"a\": 25, \"b\": 25 } } }</script></amp-experiment>'\n )->body->firstChild\n ),\n ],\n ],\n\n 'amp-story' => [\n $input('', TestMarkup::SCRIPT_AMPSTORY),\n $expectWithBoilerplate('', TestMarkup::SCRIPT_AMPSTORY),\n [\n Error\\CannotRemoveBoilerplate::fromRenderDelayingScript(\n Document::fromHtmlFragment(\n '<head>' . TestMarkup::SCRIPT_AMPSTORY . '</head>'\n )->head->lastChild\n ),\n ],\n ],\n\n 'amp-dynamic-css-classes' => [\n $input('', TestMarkup::SCRIPT_AMPDYNAMIC_CSSCLASSES),\n $expectWithBoilerplate('', TestMarkup::SCRIPT_AMPDYNAMIC_CSSCLASSES),\n [\n Error\\CannotRemoveBoilerplate::fromRenderDelayingScript(\n Document::fromHtmlFragment(\n '<head>' . TestMarkup::SCRIPT_AMPDYNAMIC_CSSCLASSES . '</head>'\n )->head->lastChild\n ),\n ],\n ],\n\n 'sizes attribute without amp-custom' => [\n $input('<amp-img height=\"300\" layout=\"responsive\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" sizes=\"(min-width: 320px) 320px, 100vw\" src=\"https://acme.org/image1.png\" width=\"400\"></amp-img>'),\n $expectWithoutBoilerplate(\n '<amp-img height=\"300\" layout=\"responsive\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" src=\"https://acme.org/image1.png\" width=\"400\" id=\"i-amp-0\" class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" i-amphtml-layout=\"responsive\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block;padding-top:75%\"></i-amphtml-sizer></amp-img>',\n '<style amp-custom>#i-amp-0{width:100vw}@media (min-width: 320px){#i-amp-0{width:320px}}</style>'\n ),\n [],\n ],\n\n 'sizes attribute with amp-custom' => [\n $input(\n '<amp-img height=\"300\" layout=\"responsive\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" sizes=\"(min-width: 320px) 320px, 100vw\" src=\"https://acme.org/image1.png\" width=\"400\"></amp-img>',\n '<style amp-custom>body h1{color:red;}</style>'\n ),\n $expectWithoutBoilerplate(\n '<amp-img height=\"300\" layout=\"responsive\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" src=\"https://acme.org/image1.png\" width=\"400\" id=\"i-amp-0\" class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" i-amphtml-layout=\"responsive\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block;padding-top:75%\"></i-amphtml-sizer></amp-img>',\n '<style amp-custom>body h1{color:red;}#i-amp-0{width:100vw}@media (min-width: 320px){#i-amp-0{width:320px}}</style>'\n ),\n [],\n ],\n\n // According to the Mozilla docs, a sizes attribute without a valid srcset attribute should have no effect.\n // Therefore, it should simply be stripped, without producing media queries.\n // @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-sizes\n 'sizes attribute without srcset' => [\n $input('<amp-img height=\"300\" layout=\"responsive\" sizes=\"(min-width: 320px) 320px, 100vw\" src=\"https://acme.org/image1.png\" width=\"400\"></amp-img>'),\n $expectWithoutBoilerplate(\n '<amp-img height=\"300\" layout=\"responsive\" src=\"https://acme.org/image1.png\" width=\"400\" class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" i-amphtml-layout=\"responsive\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block;padding-top:75%\"></i-amphtml-sizer></amp-img>'\n ),\n [],\n ],\n\n 'sizes attribute empty srcset' => [\n $input('<amp-img height=\"300\" layout=\"responsive\" srcset=\"\" sizes=\"(min-width: 320px) 320px, 100vw\" src=\"https://acme.org/image1.png\" width=\"400\"></amp-img>'),\n $expectWithoutBoilerplate(\n '<amp-img height=\"300\" layout=\"responsive\" srcset=\"\" src=\"https://acme.org/image1.png\" width=\"400\" class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" i-amphtml-layout=\"responsive\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block;padding-top:75%\"></i-amphtml-sizer></amp-img>'\n ),\n [],\n ],\n\n 'sizes attribute with disable-inline-width' => [\n $input('<amp-img height=\"300\" layout=\"responsive\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" sizes=\"(min-width: 320px) 320px, 100vw\" src=\"https://acme.org/image1.png\" width=\"400\" disable-inline-width></amp-img>'),\n $expectWithoutBoilerplate(\n '<amp-img height=\"300\" layout=\"responsive\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" sizes=\"(min-width: 320px) 320px, 100vw\" src=\"https://acme.org/image1.png\" width=\"400\" disable-inline-width class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" i-amphtml-layout=\"responsive\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block;padding-top:75%\"></i-amphtml-sizer></amp-img>'\n ),\n [],\n ],\n\n 'sizes attribute order reversal' => [\n $input('<amp-img height=\"300\" layout=\"responsive\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" sizes=\"(min-width: 200px) 200px, (min-width: 320px) 320px, 100vw\" src=\"https://acme.org/image1.png\" width=\"400\"></amp-img>'),\n $expectWithoutBoilerplate(\n '<amp-img class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" height=\"300\" i-amphtml-layout=\"responsive\" id=\"i-amp-0\" layout=\"responsive\" src=\"https://acme.org/image1.png\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" width=\"400\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block;padding-top:75%\"></i-amphtml-sizer></amp-img>',\n '<style amp-custom>#i-amp-0{width:100vw}@media (min-width: 320px){#i-amp-0{width:320px}}@media (min-width: 200px){#i-amp-0{width:200px}}</style>'\n ),\n [],\n ],\n\n 'bad sizes attribute' => [\n $input('<amp-img height=\"300\" layout=\"responsive\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" sizes=\",,,\" src=\"https://acme.org/image1.png\" width=\"400\"></amp-img>'),\n $expectWithBoilerplate('<amp-img class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" height=\"300\" i-amphtml-layout=\"responsive\" layout=\"responsive\" sizes=\",,,\" src=\"https://acme.org/image1.png\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" width=\"400\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block;padding-top:75%\"></i-amphtml-sizer></amp-img>'),\n [\n Error\\CannotRemoveBoilerplate::fromAttributeThrowingException(\n InvalidHtmlAttribute::fromAttribute(\n 'sizes',\n Document::fromHtmlFragment(\n '<amp-img height=\"300\" layout=\"responsive\" srcset=\"https://acme.org/image1.png 320w, https://acme.org/image2.png 640w, https://acme.org/image3.png 1280w\" sizes=\",,,\" src=\"https://acme.org/image1.png\" width=\"400\"></amp-img>'\n )->body->firstChild\n )\n ),\n ],\n ],\n\n 'heights attribute without amp-custom' => [\n $input('<amp-img height=\"256\" heights=\"(min-width: 500px) 200px, 80%\" layout=\"responsive\" width=\"320\"></amp-img>'),\n $expectWithoutBoilerplate(\n '<amp-img height=\"256\" layout=\"responsive\" width=\"320\" id=\"i-amp-0\" class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" i-amphtml-layout=\"responsive\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block\"></i-amphtml-sizer></amp-img>',\n '<style amp-custom>#i-amp-0>:first-child{padding-top:80%}@media (min-width: 500px){#i-amp-0>:first-child{padding-top:200px}}</style>'\n ),\n [],\n ],\n\n 'heights attribute with amp-custom' => [\n $input(\n '<amp-img height=\"256\" heights=\"(min-width: 500px) 200px, 80%\" layout=\"responsive\" width=\"320\"></amp-img>',\n '<style amp-custom>body h1{color:red;}</style>'\n ),\n $expectWithoutBoilerplate(\n '<amp-img height=\"256\" layout=\"responsive\" width=\"320\" id=\"i-amp-0\" class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" i-amphtml-layout=\"responsive\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block\"></i-amphtml-sizer></amp-img>',\n '<style amp-custom>body h1{color:red;}#i-amp-0>:first-child{padding-top:80%}@media (min-width: 500px){#i-amp-0>:first-child{padding-top:200px}}</style>'\n ),\n [],\n ],\n\n 'bad heights attribute' => [\n $input('<amp-img height=\"256\" heights=\",,,\" layout=\"responsive\" width=\"320\"></amp-img>'),\n // This adds an ID as it stores the CSS to inline before the actual error is detected.\n $expectWithBoilerplate('<amp-img class=\"i-amphtml-layout-responsive i-amphtml-layout-size-defined\" height=\"256\" heights=\",,,\" i-amphtml-layout=\"responsive\" layout=\"responsive\" width=\"320\"><i-amphtml-sizer slot=\"i-amphtml-svc\" style=\"display:block\"></i-amphtml-sizer></amp-img>'),\n [\n Error\\CannotRemoveBoilerplate::fromAttributeThrowingException(\n InvalidHtmlAttribute::fromAttribute(\n 'heights',\n Document::fromHtmlFragment(\n '<amp-img height=\"256\" heights=\",,,\" layout=\"responsive\" width=\"320\"></amp-img>'\n )->body->firstChild\n )\n ),\n ],\n ],\n\n 'media attribute without amp-custom' => [\n $input('<amp-img height=\"355\" layout=\"fixed\" media=\"(min-width: 650px)\" src=\"wide.jpg\" width=\"466\"></amp-img>'),\n $expectWithoutBoilerplate(\n '<amp-img height=\"355\" layout=\"fixed\" src=\"wide.jpg\" width=\"466\" id=\"i-amp-0\" class=\"i-amphtml-layout-fixed i-amphtml-layout-size-defined\" style=\"width:466px;height:355px;\" i-amphtml-layout=\"fixed\"></amp-img>',\n '<style amp-custom>@media not all and (min-width: 650px){#i-amp-0{display:none}}</style>'\n ),\n [],\n ],\n\n 'media attribute with amp-custom' => [\n $input(\n '<amp-img height=\"355\" layout=\"fixed\" media=\"(min-width: 650px)\" src=\"wide.jpg\" width=\"466\"></amp-img>',\n '<style amp-custom>body h1{color:red;}</style>'\n ),\n $expectWithoutBoilerplate(\n '<amp-img height=\"355\" layout=\"fixed\" src=\"wide.jpg\" width=\"466\" id=\"i-amp-0\" class=\"i-amphtml-layout-fixed i-amphtml-layout-size-defined\" style=\"width:466px;height:355px;\" i-amphtml-layout=\"fixed\"></amp-img>',\n '<style amp-custom>body h1{color:red;}@media not all and (min-width: 650px){#i-amp-0{display:none}}</style>'\n ),\n [],\n ],\n\n 'media attribute with type condition' => [\n $input('<amp-img height=\"355\" layout=\"fixed\" media=\"screen and (min-width: 650px)\" src=\"wide.jpg\" width=\"466\"></amp-img>'),\n $expectWithoutBoilerplate(\n '<amp-img height=\"355\" layout=\"fixed\" src=\"wide.jpg\" width=\"466\" id=\"i-amp-0\" class=\"i-amphtml-layout-fixed i-amphtml-layout-size-defined\" style=\"width:466px;height:355px;\" i-amphtml-layout=\"fixed\"></amp-img>',\n '<style amp-custom>@media not screen and (min-width: 650px){#i-amp-0{display:none}}</style>'\n ),\n [],\n ],\n\n 'amp-ad with fluid layout' => [\n $input('<amp-ad type=\"doubleclick\" data-slot=\"/6355419/Travel\" layout=\"fluid\" height=\"fluid\"></amp-ad>'),\n $expectWithoutBoilerplate('<amp-ad class=\"i-amphtml-layout-fluid i-amphtml-layout-awaiting-size\" data-slot=\"/6355419/Travel\" height=\"fluid\" i-amphtml-layout=\"fluid\" layout=\"fluid\" style=\"width:100%;height:0;\" type=\"doubleclick\"></amp-ad>'),\n ],\n\n 'amp-ad with fluid layout and width defined' => [\n $input('<amp-ad type=\"doubleclick\" data-slot=\"/6355419/Travel\" layout=\"fluid\" height=\"fluid\" width=\"300\"></amp-ad>'),\n $expectWithoutBoilerplate('<amp-ad class=\"i-amphtml-layout-fluid i-amphtml-layout-awaiting-size\" data-slot=\"/6355419/Travel\" height=\"fluid\" width=\"300\" i-amphtml-layout=\"fluid\" layout=\"fluid\" style=\"width:100%;height:0;\" type=\"doubleclick\"></amp-ad>'),\n ],\n\n 'server side render amp-audio' => [\n $input('<amp-audio src=\"https://example.com/audio.mp3\" width=\"300\"></amp-audio>'),\n $expectWithoutBoilerplate('<amp-audio src=\"https://example.com/audio.mp3\" width=\"300\"><audio controls></audio></amp-audio>'),\n ],\n\n 'ssr amp-audio appends audio element' => [\n $input(\n '<amp-audio src=\"https://example.com/audio.mp3\" width=\"300\">'\n . '<div fallback=\"\">Your browser doesn’t support HTML5 audio</div>'\n . '</amp-audio>'\n ),\n $expectWithoutBoilerplate(\n '<amp-audio src=\"https://example.com/audio.mp3\" width=\"300\">'\n . '<div fallback=\"\">Your browser doesn’t support HTML5 audio</div>'\n . '<audio controls></audio>'\n . '</amp-audio>'\n ),\n ],\n\n 'skip ssr amp-audio if audio child node is present' => [\n $input(\n '<amp-audio src=\"https://example.com/audio.mp3\" width=\"300\">'\n . '<div fallback=\"\">Your browser doesn’t support HTML5 audio</div>'\n . '<audio controls src=\"https://example.com/audio.mp3\"></audio>'\n . '</amp-audio>'\n ),\n $expectWithoutBoilerplate(\n '<amp-audio src=\"https://example.com/audio.mp3\" width=\"300\">'\n . '<div fallback=\"\">Your browser doesn’t support HTML5 audio</div>'\n . '<audio controls src=\"https://example.com/audio.mp3\"></audio>'\n . '</amp-audio>'\n ),\n ]\n ];\n }", "protected function getFilterTransformations()\n {\n return [\n 'id' => [[99, '99']],\n ];\n }", "public function getValueModelTransformer();", "public function transform($array) {\n//\t\t\tld(\"transform\");\n//\t\t\tld(json_encode($array));\n\t\t\treturn json_encode($array);\n\t\t}", "public static function transform(array $data)\n {\n self::transform_internal($data, -1);\n }", "public function dataTransform()\n {\n $ampStoryScript = '<script async custom-element=\"amp-story\" src=\"https://cdn.ampproject.org/v0/amp-story-1.0.js\"></script>';\n $ampStoryLink = '<link rel=\"stylesheet\" amp-extension=\"amp-story\" href=\"https://cdn.ampproject.org/v0/amp-story-1.0.css\">';\n $dvhPolyfill = '<script amp-story-dvh-polyfill>' . AmpStoryCssOptimizer::AMP_STORY_DVH_POLYFILL_CONTENT . '</script>';\n\n return [\n 'disable_the_optimization' => [\n TestMarkup::DOCTYPE . '<html><head>' . TestMarkup::META_CHARSET . '</head><body></body></html>',\n TestMarkup::DOCTYPE . '<html><head>' . TestMarkup::META_CHARSET . '</head><body></body></html>',\n ],\n\n 'optimization_requires_html_tag' => [\n TestMarkup::DOCTYPE . '<html><head>' . TestMarkup::META_CHARSET . '</head><body></body></html>',\n TestMarkup::DOCTYPE . '<html><head>' . TestMarkup::META_CHARSET . '</head><body></body></html>',\n [\n AmpStoryCssOptimizerConfiguration::OPTIMIZE_AMP_STORY => true,\n ]\n ],\n 'test_optimization_process' => [\n TestMarkup::DOCTYPE . '<html>'\n . '<head>' . TestMarkup::META_CHARSET . $ampStoryScript . '<style amp-custom></style></head><body>'\n . '<amp-story supports-landscape standalone poster-portrait-src=\"http://url.example/\" publisher-logo-src=\"http://url.example/\" publisher title>'\n . ' <amp-story-page id=\"my-first-page\">'\n . ' <amp-story-grid-layer template=\"fill\">'\n . ' <amp-img src=\"https://ampbyexample.com/img/image3.jpg\" width=\"720\" height=\"1280\"></amp-img>'\n . ' </amp-story-grid-layer>'\n . ' <amp-story-grid-layer aspect-ratio=5:10 style=\"background-color: yellow; font-size: 2px;\"></amp-story-grid-layer>'\n . ' </amp-story-page>'\n . '</amp-story>'\n . '</body></html>',\n TestMarkup::DOCTYPE . '<html data-story-supports-landscape>'\n . '<head>' . TestMarkup::META_CHARSET . $ampStoryScript . '<style amp-custom></style>'\n . $ampStoryLink\n . $dvhPolyfill\n . '</head><body>'\n . '<amp-story supports-landscape standalone poster-portrait-src=\"http://url.example/\" publisher-logo-src=\"http://url.example/\" publisher title>'\n . ' <amp-story-page id=\"my-first-page\">'\n . ' <amp-story-grid-layer template=\"fill\">'\n . ' <amp-img src=\"https://ampbyexample.com/img/image3.jpg\" width=\"720\" height=\"1280\"></amp-img>'\n . ' </amp-story-grid-layer>'\n . ' <amp-story-grid-layer aspect-ratio=\"5:10\" style=\"--aspect-ratio:5/10;background-color: yellow; font-size: 2px;\"></amp-story-grid-layer>'\n . ' </amp-story-page>'\n . '</amp-story>'\n . '</body></html>',\n [\n AmpStoryCssOptimizerConfiguration::OPTIMIZE_AMP_STORY => true,\n ]\n ],\n 'optimize_amp_custom_css' => [\n TestMarkup::DOCTYPE . '<html>'\n . '<head>' . TestMarkup::META_CHARSET . $ampStoryScript\n . '<style amp-custom>foo {transform: translate3d(80vw, 0, 0);}foo {transform: translate3d(81vh, 0, 0);}</style>'\n . '</head><body></body></html>',\n TestMarkup::DOCTYPE . '<html>'\n . '<head>' . TestMarkup::META_CHARSET . $ampStoryScript\n . '<style amp-custom>foo {transform: translate3d(calc(80 * var(--story-page-vw)), 0, 0);}foo {transform: translate3d(calc(81 * var(--story-page-vh)), 0, 0);}</style>'\n . $ampStoryLink\n . $dvhPolyfill\n . '</head><body></body></html>',\n [\n AmpStoryCssOptimizerConfiguration::OPTIMIZE_AMP_STORY => true,\n ]\n ]\n ];\n }", "public function testTransform()\n {\n $startTime = new \\DateTime();\n $endTime = new \\DateTime(\"+2 hours\");\n\n $shift = mockery::mock(Shift::class);\n $shift->shouldReceive('getId')->twice()->withNoArgs()->andReturn(1);\n $shift->shouldReceive('getBreak')->once()->withNoArgs()->andReturn(12.5);\n $shift->shouldReceive('getStartTime')->once()->withNoArgs()->andReturn($startTime);\n $shift->shouldReceive('getEndTime')->once()->withNoArgs()->andReturn($endTime);\n\n $transformer = new ShiftTransformer;\n $transformedData = $transformer->transform($shift);\n\n $this->assertEquals([\n 'id' => 1,\n 'break' => 12.5,\n 'start_time' => $startTime->format('r'),\n 'end_time' => $endTime->format('r'),\n 'links' => [\n [\n 'rel' => 'self',\n 'uri' => '/shifts/1'\n ]\n ]\n ], $transformedData);\n }", "protected function doTransform($value)\n {\n $title = array_shift($value);\n // calculate maximum string lengths of each column\n $size = array_map('mb_strlen',$title);\n foreach (array_map('array_values',$value) as $row) {\n $size = array_map('max',$size,array_map('mb_strlen',$row));\n }\n // create formats to output data\n foreach ($size as $n) {\n $format[] = \"%-{$n}s\";\n $line[] = str_repeat('-',$n);\n }\n $format = '| '.implode(' | ',$format).\" |\".EOL;\n $line = '+-'.implode('-+-',$line).\"-+\".EOL;\n // build table from title, data and existing formats\n $table = $line.vsprintf($format,$title).$line;\n foreach ($value as $row) {\n $table .= vsprintf($format,$row);\n }\n if (count($value)>0) $table .= $line;\n return rtrim($table);\n }", "public function transform($line) {\n\n return [\n 'amount' => $line->amount,\n 'description' => $line->description,\n 'quantity' => $line->quantity,\n 'product_id' => $line->product_id,\n 'is_chargeable' => $line->is_chargeable,\n ];\n }", "public function transform(Event $event)\n {\n return [\n 'id' => $event->id,\n 'title' => $event->title,\n 'summary' => $event->summary,\n 'description' => $event->description,\n 'organizer' => $event->user,\n 'image' => $event->image,\n 'language' => $event->language,\n 'is_private' => ($event->is_private) ? true : false,\n 'is_outstanding' => ($event->is_outstanding) ? true : false,\n 'country' => $event->country,\n 'place_name' => $event->place_name,\n 'place_id' => $event->place_id,\n 'latitude' => $event->latitude,\n 'longitude' => $event->longitude,\n 'address' => $event->address,\n 'timezone' => $event->timezone,\n 'end' => Carbon::parse($event->end)->toIso8601String(),\n 'start' => Carbon::parse($event->start)->toIso8601String(),\n 'duration' => Carbon::parse($event->start)->diffInHours(Carbon::parse($event->end)).' Hours',\n 'created_at' => $event->created_at->toIso8601String(),\n 'updated_at' => $event->updated_at->toIso8601String(),\n 'released' => $event->created_at->diffForHumans()\n ];\n }", "function transform_record($record, $export_format) {\n global $CFG;\n\n //is this a required course?\n if ($record->curriculumid === NULL) {\n //not part of a curriculum\n $record->required = get_string('na', 'rlreport_course_completion_by_cluster');\n } else if ($record->required == 1) {\n $record->required = get_string('required_yes', 'rlreport_course_completion_by_cluster');\n } else {\n $record->required = get_string('required_no', 'rlreport_course_completion_by_cluster');\n }\n\n\n //make sure we want to display this column\n if (property_exists($record, 'completestatusid')) {\n if ($record->completestatusid === NULL) {\n //not enrolled in the class\n $record->completestatusid = get_string('stustatus_notenrolled', 'rlreport_course_completion_by_cluster');\n } else if ($record->completestatusid == STUSTATUS_NOTCOMPLETE) {\n $record->completestatusid = get_string('stustatus_notcomplete', 'rlreport_course_completion_by_cluster');\n } else if ($record->completestatusid == STUSTATUS_PASSED) {\n //flag the class enrolment as passed and show completion date\n $a = $this->format_date($record->enrolcompletetime);\n $record->completestatusid = get_string('stustatus_passed', 'rlreport_course_completion_by_cluster', $a);\n } else {\n //flag the class enrolment as failed and show completion date\n $a = $this->format_date($record->enrolcompletetime);\n $record->completestatusid = get_string('stustatus_failed', 'rlreport_course_completion_by_cluster', $a);\n }\n }\n\n //class grade\n if ($record->grade === NULL) {\n //not enrolled\n $record->grade = get_string('na', 'rlreport_course_completion_by_cluster');\n } else {\n //format the grade value\n $record->grade = get_string(\n ($export_format == php_report::$EXPORT_FORMAT_CSV)\n ? 'formatted_grade_csv' : 'formatted_grade',\n 'rlreport_course_completion_by_cluster',\n cm_display_grade($record->grade));\n }\n\n if (isset($record->numcomplete)) {\n $record->numcomplete = get_string('numcomplete_tally', 'rlreport_course_completion_by_cluster', $record);\n }\n\n return $record;\n }", "public function convert($data);", "public function transform($data) {\n\t\t\t$output = array();\n\t\t\t\n\t\t\t// Points array.\n\t\t\t$points = array();\n\t\t\t\n\t\t\t// Full name and A#\n\t\t\t$output['full_name'] = $this->nullCheck($data['answers'][1]['prettyFormat']);\n\t\t\t$output['a_number'] = $this->nullCheck($data['answers'][4]['answer']);\n\t\t\t\n\t\t\t// GPA Calculation.\n\t\t\t$output['gpa'] = round($data['answers'][5]['answer'], 2);\n\t\t\t$points['gpa'] = round(($data['answers'][5]['answer'] * 20), 2);\n\t\t\t\n\t\t\t// HESI Calculation.\n\t\t\tforeach(array(\n\t\t\t\t'hesi_reading' => 6,\n\t\t\t\t'hesi_math' => 7,\n\t\t\t\t'hesi_ap' => 8\n\t\t\t) as $name => $id) {\n\t\t\t\t$output[$name] = $data['answers'][$id]['answer'];\n\t\t\t\t$points[$name] = round(($data['answers'][$id]['answer'] * 0.05), 2);\n\t\t\t}\n\t\t\t\n\t\t\t// No Value Checks\n\t\t\t$output['vocab_gen'] = $this->boolCheck($data['answers'][25]['answer']);\n\t\t\t$output['personality_profile'] = $this->boolCheck($data['answers'][26]['answer']);\n\t\t\t$output['learning_style'] = $this->boolCheck($data['answers'][27]['answer']);\n\t\t\t\n\t\t\t// BIOLOGY Grades\n\t\t\tforeach(array(\n\t\t\t\t'biol2401' => array('id' => 12, 'completed' => 13),\n\t\t\t\t'biol2402' => array('id' => 14, 'completed' => 15),\n\t\t\t\t'biol2420' => array('id' => 16, 'completed' => 17)\n\t\t\t) as $name => $val) {\n\t\t\t\t$points[$name] = $this->gradeToBiolPoints($data['answers'][$val['id']]['answer'], $data['answers'][$val['completed']]['answer']);\n\t\t\t}\n\t\t\t\n\t\t\t// Bonus\n\t\t\tforeach(array(\n\t\t\t\t'hitt1305' => 18,\n\t\t\t\t'hitt1303' => 19,\n\t\t\t\t'hrps12011105' => 20\n\t\t\t) as $name => $id) {\n\t\t\t\t$points[$name] = $this->gradeToBonusPoints($data['answers'][$id]['answer']);\n\t\t\t}\n\t\t\t\n\t\t\tforeach(array(\n\t\t\t\t'cna' => array('id' => 21, 'points' => 3),\n\t\t\t\t'sixmonth' => array('id' => 22, 'points' => 2),\n\t\t\t\t'tjc_enrollment' => array('id' => 23, 'points' => 2),\n\t\t\t\t'indistrict' => array('id' => 24, 'points' => 3)\n\t\t\t) as $name => $val) {\n\t\t\t\t$points[$name] = $this->boolToPoints($data['answers'][$val['id']]['answer'], $val['points']);\n\t\t\t}\n\t\t\t\n\t\t\t$output['total_points'] = 0;\n\t\t\tforeach($points as $name => $val) {\n\t\t\t\t$output[($name . '_points')] = $val;\n\t\t\t\t$output['total_points'] += $val;\n\t\t\t}\n\n\t\t\treturn $output;\n\t\t}", "abstract public function transformResource($resource);", "abstract protected function doActualConvert();", "function setTransformation($transformation){\n\t\tif($transformation){\n\t\t\t$transformation = clone $transformation;\n\t\t}\n\t\t$this->transformation = $transformation;\n\t}", "public function transform($value, $field, $source, $destination);", "public function getTransformer()\n {\n return new FaqTransformer();\n }", "public function transform()\n {\n $post = $this->post; //short alias\n\n $post->load('author', 'comments.user');\n\n $comments = (new CommentCollectionTransformer($post->comments()->limit(self::COMMENT_LIMIT)->get()))->transform();\n\n $post = (new PostTransformer($post))->transform();\n\n return [\n 'data' => array_merge($post, ['comments' => $comments]),\n ];\n }", "public function transform(Project $project)\n {\n return [\n //TODO Attributes of Transform for return\n 'id' => (int) $project->id,\n 'name' => (string) $project->name,\n //'description' => (string) $project->description,\n 'user_id' => (int) $project->user_id\n ];\n }", "public function convert();", "public function transform()\n {\n $posts = (new PostCollectionTransformer($this->posts->getCollection()))->transform();\n\n return [\n 'data' => $posts,\n 'total' => $this->posts->total(),\n 'per_page' => $this->posts->perpage(),\n 'current_page' => $this->posts->currentPage(),\n 'last_page' => $this->posts->lastpage(),\n 'next_page_url' => $this->posts->nextPageUrl(),\n 'prev_page_url' => $this->posts->previousPageUrl(),\n 'from' => $this->posts->firstItem(),\n 'to' => $this->posts->lastItem(),\n ];\n }", "static function registerTransform($class, $name=false) {\n static::$transforms[$name ?: $class::$name] = [get_called_class(), $class];\n }", "public function getTransformations()\n {\n return $this->transformations;\n }", "public function transform(Planea $model)\n {\n return [\n 'size' => $model->alumnos_programados_prueba,\n 'subjects_evaluated' => [\n 'mathematics' => [\n [\n 'grade' => 'i',\n 'percentage' => $model->nivel_i_matematicas,\n ],\n [\n 'grade' => 'ii',\n 'percentage' => $model->nivel_ii_matematicas,\n ],\n [\n 'grade' => 'iii',\n 'percentage' => $model->nivel_iii_matematicas,\n ],\n [\n 'grade' => 'iv',\n 'percentage' => $model->nivel_iv_matematicas,\n ],\n ],\n 'literature' => [\n [\n 'grade' => 'i',\n 'percentage' => $model->nivel_i_lenguaje_y_comunicacion,\n ],\n [\n 'grade' => 'ii',\n 'percentage' => $model->nivel_ii_lenguaje_y_comunicacion,\n ],\n [\n 'grade' => 'iii',\n 'percentage' => $model->nivel_iii_lenguaje_y_comunicacion,\n ],\n [\n 'grade' => 'iv',\n 'percentage' => $model->nivel_iv_lenguaje_y_comunicacion,\n ],\n ]\n ],\n 'evaluated' => [\n 'mathematics' => $model->porcentaje_de_evaluados_matematicas,\n 'literature' => $model->porcentaje_de_evaluados_lenguaje_y_comunicacion,\n ],\n 'reliability' => [\n 'mathematics' => (bool)$model->informacion_poco_confiable_matematicas,\n 'literature' => (bool)$model->informacion_poco_confiable_lenguaje_y_comunicacion,\n ],\n 'representation' => [\n 'mathematics' => (bool)$model->la_prueba_es_representativa_matematicas,\n 'literature' => (bool)$model->la_prueba_es_representativa_leguaje_y_comunicacion,\n ],\n ];\n }", "public function transformPresenter()\n {\n $result = [];\n $config = config(\"erpnetMigrates.tables.$this->table.transformPresenter\");\n if(is_array($config))\n foreach ($config as $key => $field) {\n if($field instanceof \\Closure) {\n $result[$key] = $field($this);\n }\n };\n return $result;\n }", "public function getViewTransformers(): array;", "public function transform(array &$data)\n {\n // Adjust the response format data label\n\n $named = request()->route()->getName();\n switch ($named) {\n case 'member.user.index':\n $data['data'] = collect($data['data'])->map(function ($info) {\n /* Replace account */\n if (isset($info['account'])) {\n $info['account'] = str_pad(substr($info['account'], 0, 4), 8, '*');\n }\n if (isset($info['setting'])) {\n unset($info['setting']['pin']);\n }\n return collect($info)->forget([\n 'id',\n 'password',\n ])->all();\n })->all();\n break;\n case 'member.user.read':\n /* Replace account */\n if (isset($data['account'])) {\n $data['account'] = str_pad(substr($data['account'], 0, 4), 8, '*');\n }\n if (isset($data['setting'])) {\n unset($data['setting']['pin']);\n }\n $data = collect($data)->forget([\n 'id',\n 'password',\n ])->all();\n break;\n }\n }", "private function convertContent(){\n $newContent = array();\n foreach ($this->content as $key => $value) {\n if (is_scalar($value)) {\n $newContent[$key] = $this->format($value);\n }\n }\n return $newContent;\n }", "public function processTransformationRules()\n {\n $rulesText = '';\n\n #-----------------------------------------------------------------------------\n # If auto-generated rules were specified, generate the rules,\n # otherwise, get the from the configuration\n #-----------------------------------------------------------------------------\n if ($this->configuration->getTransformRulesSource() === Configuration::TRANSFORM_RULES_DEFAULT) {\n $rulesText = $this->autoGenerateRules();\n } else {\n $rulesText = $this->configuration->getTransformationRules();\n }\n \n $tablePrefix = $this->configuration->getTablePrefix();\n $schemaGenerator = new SchemaGenerator($this->dataProject, $this->configuration, $this->logger);\n\n list($schema, $parseResult) = $schemaGenerator->generateSchema($rulesText);\n\n ###print \"\\n\".($schema->toString()).\"\\n\";\n\n $this->schema = $schema;\n\n return $parseResult;\n }", "public function transform($data, int $limit = 10, int $time = 60): Data;", "public function transform($resource)\n {\n return [];\n }", "protected function transform($data)\n {\n $fractalManager = new Manager();\n $manager = $this->applyIncludes($fractalManager);\n $this->resetIncldues();\n $manager->setSerializer(new ArraySerializer());\n\n return $manager->createData($data)->toArray();\n }", "function transform($text, $format = 'Xhtml')\n {\n $this->parse($text);\n return $this->render($format);\n }", "public function transform(Email $email)\n {\n $otherStories = $email->stories()->orderBy('email_story.order', 'asc')->get();\n $fractal = new Manager();\n $resource = new Fractal\\Resource\\Collection($otherStories->all(), new FractalStoryTransformerModel);\n $otherStories = $fractal->createData($resource)->toArray();\n\n $mainStories = $email->mainstories()->orderBy('email_mainstory.order', 'asc')->get();\n $fractal = new Manager();\n $resource = new Fractal\\Resource\\Collection($mainStories->all(), new FractalStoryTransformerModel);\n $mainStories = $fractal->createData($resource)->toArray();\n $sendAt = null;\n if($email->send_at){\n $sendAt = $email->send_at->toDateTimeString();\n }\n\n return [\n 'id' => (int) $email->id,\n 'title' => $email->title,\n 'subheading' => $email->subheading,\n 'is_approved' => $email->is_approved,\n 'is_ready' => $email->is_ready,\n 'mainStories' => $mainStories['data'],\n 'announcements' => $email->announcements()->orderBy('email_announcement.order', 'asc')->get(),\n 'events' => $email->events()->orderBy('email_event.order', 'asc')->get(),\n 'otherStories' => $otherStories['data'],\n 'send_at' => $sendAt,\n 'recipients' => $email->recipients()->get(),\n 'is_sent' => $email->is_sent,\n 'mailgun_opens' => $email->mailgun_opens,\n 'mailgun_clicks' => $email->mailgun_clicks,\n 'mailgun_spam' => $email->mailgun_spam,\n 'clone' => $email->clonedEmail()->select('id', 'title')->get(),\n 'created_at' => $email->created_at->format('n/j/y @ g:i A'),\n 'is_president_included' => $email->is_president_included,\n 'president_teaser' => $email->president_teaser,\n 'president_url' => $email->president_url,\n\t\t\t\t\t\t'exclude_events' => $email->exclude_events\n ];\n }", "public function transform(array $record) : UserModelInterface;", "protected function transform($result, $transformer, $resourceKey = null)\n {\n $transformer = is_string($transformer) ? new $transformer : $transformer;\n $transformed = $transformer->transformResult($result, $transformer);\n if (!$this->isPaginated($result) && !is_null($resourceKey)) {\n return [$resourceKey => $transformed];\n }\n return $transformed;\n }", "public function pageTransformer($data)\n {\n return [\n \"total\" => $data->total(),\n \"lastPage\" => $data->lastPage(),\n \"perPage\" => $data->perPage(),\n \"currentPage\" => $data->currentPage()\n ];\n }", "protected function transformer()\n {\n return new CourseTransformer;\n }", "private function processTransform($item, $crawler) {\n foreach ($this->transforms as $id => $transforms) {\n if ($item['id'] == $id) {\n foreach ($transforms as $transform) {\n switch ($transform['type']) {\n case 'tag':\n $tag = $crawler->filter($transform['tag']);\n if ($tag->count()) {\n $item[$transform['field']] = $tag->text();\n }\n break;\n\n case 'override':\n $item[$transform['field']] = $transform['text'];\n break;\n\n }\n }\n }\n }\n return $item;\n }", "public function transform($item)\n {\n return [\n 'title'=>$item['title'],\n 'description'=>$item['description'],\n 'active'=>(boolean)$item['active']\n ];\n }", "private function applyTransformation() {\n if($this->transform !== NULL) {\n $xsl = new DOMDocument();\n $xsl->load($this->transform);\n $xslt = new XSLTProcessor();\n $xslt->importStyleSheet($xsl);\n $document = $xslt->transformToDoc($this->document);\n if ($document) {\n $xpath = new DOMXPath($document);\n // Set the Label\n $results = $xpath->query(\"*[local-name()='title']\");\n $results->item(0)->nodeValue = $this->label;\n // Set the Pid\n $results = $xpath->query(\"*[local-name()='identifier']\");\n $results->item(0)->nodeValue = $this->pid;\n if (isset($document->documentElement)) {\n return $this->importNode($document->documentElement, TRUE);\n }\n }\n }\n return NULL;\n }", "public function testTransform()\n {\n $invite = m::mock('Braincrafted\\Bundle\\UserBundle\\Entity\\Invite');\n $invite\n ->shouldReceive('getCode')\n ->withNoArgs()\n ->once()\n ->andReturn('abcdef');\n\n $this->assertEquals('abcdef', $this->transformer->transform($invite));\n }", "function decodeTransforms($s_prefix, &$a_transform, $s_transform)\n{\n\t$a_transform[$s_prefix.'img_treatment'] = 'B';\n\t$a_transform[$s_prefix.'rot_degrees' ] = 0;\n\t$a_transform[$s_prefix.'rot_degrees_x'] = 0;\n\t$a_transform[$s_prefix.'crop_fuzz' ] = 0;\n\t$a_transform[$s_prefix.'crop_x1' ] = 0;\n\t$a_transform[$s_prefix.'crop_x2' ] = 0;\n\t$a_transform[$s_prefix.'crop_y1' ] = 0;\n\t$a_transform[$s_prefix.'crop_y2' ] = 0;\n\t$a_transform[$s_prefix.'black_pt' ] = 0;\n\t$a_transform[$s_prefix.'white_pt' ] = 100;\n\t$a_transform[$s_prefix.'gamma' ] = 1.0;\n\n\tif ( $s_transform && $s_transform != '-' )\n\t{\n\t\t$a = explode('|', $s_transform);\n\t\tfor ( $i = 0 ; $i < count($a) ; $i += 2 )\n\t\t{\n\t\t\tswitch ( $a[$i] )\n\t\t\t{\n\t\t\tcase 'it': $a_transform[$s_prefix.'img_treatment'] = $a[$i+1];\t\t\t\tbreak;\n\t\t\tcase 'rd': $a_transform[$s_prefix.'rot_degrees' ] = floatval($a[$i+1]);\tbreak;\n\t\t\tcase 'ry': $a_transform[$s_prefix.'rot_degrees_x'] = intval($a[$i+1]);\t\tbreak;\n\t\t\tcase 'fu': $a_transform[$s_prefix.'crop_fuzz' ] = intval($a[$i+1]);\t\tbreak;\n\t\t\tcase 'x1': $a_transform[$s_prefix.'crop_x1' ] = intval($a[$i+1]);\t\tbreak;\n\t\t\tcase 'x2': $a_transform[$s_prefix.'crop_x2' ] = intval($a[$i+1]);\t\tbreak;\n\t\t\tcase 'y1': $a_transform[$s_prefix.'crop_y1' ] = intval($a[$i+1]);\t\tbreak;\n\t\t\tcase 'y2': $a_transform[$s_prefix.'crop_y2' ] = intval($a[$i+1]);\t\tbreak;\n\t\t\tcase 'bk': $a_transform[$s_prefix.'black_pt' ] = intval($a[$i+1]);\t\tbreak;\n\t\t\tcase 'wh': $a_transform[$s_prefix.'white_pt' ] = intval($a[$i+1]);\t\tbreak;\n\t\t\tcase 'ga': $a_transform[$s_prefix.'gamma' ] = floatval($a[$i+1]);\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}", "public function transform(Type $type)\n {\n $data = $this->data($type, $this->getReturnData());\n return $data;\n }", "public function convert($hasHeader=false)\n {\n $this->output->convert($this->input->getData(),$hasHeader);\n }", "public function test_transform_minimal() {\n\t\t\t$text = $this->instance->transform(array(\n\t\t\t\t'revision' => \"r126299\",\n\t\t\t\t'author' => 'ph',\n\t\t\t\t'log' => 'commit message',\n\t\t\t));\n\n\t\t\t$this->assertEquals($text, 'r126299: ph - commit message');\n\t\t}", "public function map()\n {\n $mappedData = [];\n\n foreach ($this->rawData as $key => $value) {\n if (is_array($value)) {\n foreach ($value as $index => $field) {\n if ($id = getVal($field, ['id'], null)) {\n $mappedData[$index]['id'] = $id;\n }\n\n $mappedData[$index]['transaction'] = $this->template;\n $mappedData[$index]['activity_id'] = getVal($this->rawData, ['activity_id'], null);\n $mappedData[$index]['transaction']['reference'] = getVal($field, ['reference'], null);\n $mappedData[$index]['transaction']['transaction_type'][0]['transaction_type_code'] = getVal($this->rawData, ['type'], null);\n $mappedData[$index]['transaction']['transaction_date'][0]['date'] = getVal($field, ['date'], null);\n $mappedData[$index]['transaction']['value'][0]['amount'] = getVal($field, ['amount'], null);\n $mappedData[$index]['transaction']['value'][0]['currency'] = getVal($field, ['currency'], null);\n $mappedData[$index]['transaction']['value'][0]['date'] = getVal($field, ['date'], null);\n $mappedData[$index]['transaction']['description'][0]['narrative'][0]['narrative'] = getVal($field, ['description'], null);\n $mappedData[$index]['transaction']['receiver_organization'][0]['narrative'][0]['narrative'] = getVal($field, ['organisation'], null);\n }\n }\n }\n\n return $mappedData;\n }", "public function transformer()\n {\n return app(\n Contracts\\SeasonTransformer::class\n );\n }", "public function toArray()\n {\n return $this->transform();\n }", "public function renderData();", "public function transform($value)\n {\n return $value;\n }", "public function getFormattedData();", "public function transform($data)\n {\n $ret = array();\n\n foreach ($this->convertionRules as $source => $target) {\n $ret = $this->set($target, $ret, $this->get($source, $data));\n }\n\n return $ret;\n }", "public function withTransformer($transformer);", "public function test_transform_all() {\n\t\t\t$text = $this->instance->transform(array(\n\t\t\t\t'repository' => \"slack\",\n\t\t\t\t'revision' => \"r126299\",\n\t\t\t\t'url' => 'http://svn.example.com/wsvn/main/?op=revision&rev=126299',\n\t\t\t\t'author' => 'ph',\n\t\t\t\t'log' => 'commit message',\n\t\t\t));\n\n\t\t\t$this->assertEquals($text, '[slack] <http://svn.example.com/wsvn/main/?op=revision&amp;rev=126299|r126299>: ph - commit message');\n\t\t}", "public function transform(UserInformation $user_information)\n {\n return [\n 'id' => (int) $user_information->id,\n 'first_name' => $user_information->first_name,\n 'last_name' => $user_information->last_name,\n 'phone' => $user_information->phone,\n 'address' => $user_information->address,\n 'suburb' => $user_information->suburb,\n 'postcode' => $user_information->postcode\n ];\n }", "public function format($data);" ]
[ "0.70818293", "0.6368649", "0.60976124", "0.609137", "0.5990365", "0.57872236", "0.5766512", "0.57582337", "0.5722789", "0.56680095", "0.56552356", "0.5615466", "0.55892545", "0.556547", "0.55609167", "0.5547647", "0.55391484", "0.5510496", "0.5501925", "0.5493334", "0.54836875", "0.5394148", "0.5391437", "0.5377689", "0.53290945", "0.5322", "0.5280072", "0.5276102", "0.5258976", "0.5244656", "0.52317476", "0.5227492", "0.5207026", "0.5184686", "0.51383334", "0.5133726", "0.5128126", "0.5128126", "0.51146024", "0.5093042", "0.507722", "0.50692546", "0.50294095", "0.50281346", "0.5026082", "0.5021638", "0.50207555", "0.50189114", "0.5016746", "0.4999716", "0.49973938", "0.49741358", "0.4963817", "0.4957722", "0.4934546", "0.49244657", "0.48986349", "0.48786214", "0.4874769", "0.48625958", "0.48534194", "0.48424497", "0.48384997", "0.48289394", "0.48164946", "0.4815093", "0.4807945", "0.4801485", "0.48007557", "0.47828162", "0.47795272", "0.47726765", "0.47720867", "0.4766065", "0.47595173", "0.47586665", "0.47348017", "0.47266585", "0.4721624", "0.4720032", "0.47166353", "0.47075373", "0.47029915", "0.46963552", "0.46936545", "0.4684765", "0.46803182", "0.4674687", "0.46729255", "0.46715274", "0.46511626", "0.4645644", "0.4636517", "0.46341255", "0.4633613", "0.46298516", "0.46262884", "0.46143034", "0.46119025", "0.46059686", "0.45919693" ]
0.0
-1
Get list of VIN Pattern using VIN only.
public function index($vin, VinRepository $vinRepository) { $result = $vinRepository->getVinPatterns($vin); if ($result instanceof ApiException) { return ApiResponse::error( $result->getResponseCode(), $result->getMessage(), $result->getData(), $result->getCode() ); } return ApiResponse::success('Here are your VIN Patterns.', $result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function findinvirtual($pattern)\n {\n $result = array();\n $virtual = null;\n\n if ($this->file)\n $virtual = file($this->file);\n\n if (empty($virtual))\n return $result;\n\n // check each line for matches\n foreach ($virtual as $line) {\n $line = trim($line);\n if (empty($line) || $line[0]=='#')\n continue;\n\n if (preg_match($pattern, $line))\n $result[] = $line;\n }\n\n return $result;\n }", "public static function vsi() {\n $list = [];\n //dobimo objekt, ki predstavlja povezavo z bazo\n $db = Db::getInstance();\n //izvedemo query\n $result = mysqli_query($db,'SELECT * FROM nabiralnik');\n //v zanki ustvarjamo nove objekte in jih dajemo v seznam\n while($row = mysqli_fetch_assoc($result)){\n $list[] = new Nabiralnik($row['id'], $row['id_uporabnik'], $row['ime']);\n }\n\n //vrnemo list objektov/nabiralnikov\n return $list;\n }", "public function getVipAnnounces() {\n\t\treturn $this->getAnnouncesByToken('active', 'vip', array('strLimit' => '0, ' . CONF_VACANCY_VIP_SHOW_PERPAGE, 'calcRows' => true), array('RAND()' => false));\n\t}", "public function getVids($dir) {\n\n $videos = array();\n\n $scan = scandir($dir);\n\n $hidden = array('..', '.');\n\n $list = array_diff($scan, $hidden);\n\n return $list;\n\n }", "private function Venues()\n\t{\t$venues = array();\n\t\t$where = array();\n\t\t\n\t\tif ($filter = $this->SQLSafe($this->filter))\n\t\t{\t$where[] = '(vname LIKE \"%' . $filter . '%\" OR vcity LIKE \"%' . $filter . '%\" OR vaddress LIKE \"%' . $filter . '%\")';\n\t\t}\n\t\t\n\t\t$sql = 'SELECT * FROM coursevenues';\n\t\tif ($where)\n\t\t{\t$sql .= ' WHERE ' . implode(' AND ', $where);\n\t\t}\n\t\t$sql .= ' ORDER BY vname ASC';\n\t\tif ($result = $this->db->Query($sql))\n\t\t{\twhile ($row = $this->db->FetchArray($result))\n\t\t\t{\t$venues[] = $row;\n\t\t\t}\n\t\t} else echo '<p>', $sql, ': ', $this->db->Error(), '</p>';\n\t\t\n\t\treturn $venues;\t\n\t}", "public function getVICMS()\n {\n return $this->vICMS;\n }", "public function getVICMS()\n {\n return $this->vICMS;\n }", "function drush_cousin_vinny_vin_collect($vin = FALSE) {\n//drush_mymodule_custom_save_node\n // Check for existence of argument\n $arguments = _vin_arguments(); //use custom function to encapsulate\n if (!$vin) {\n $vin = drush_choice($arguments, dt('Which VIN would you like to interact with using \\'Cousin Vinny\\'?'));\n }\n\n // Check for correct argument\n $correct_args = array_keys($arguments);\n if (!in_array($vin, $correct_args)) {\n if ($vin == '0') {\n drush_user_abort('Buh-Bye! VIN Collect!');\n return;\n }\n $string = _vin_arguments('string');\n return drush_set_error(dt('\"@type\" is not a valid example. ',\n array('@type' => $example)) . $string);\n }\n $specification = drush_get_option('spec','common');\n // drush_print($vin);\n // drush_print($specification);\n // return;\n _drush_execute_vin_collect($vin, $specification);\n}", "public function getVuesinterne(): array\n {\n return $this->vuesinterne;\n }", "public function getLinInves() {\n return $this->linInves;\n }", "public function getVilles()\n {\n $arrVillesSelectionnees = [];\n if (count($this->villes) > 0) {\n //dd($this->villes);\n foreach ($this->villes as $ville) {\n array_push($arrVillesSelectionnees, $ville->id);\n }\n\n return json_encode($arrVillesSelectionnees);\n } else {\n return json_encode([]);\n }\n }", "public function getVersesFromSearch($pattern, $version = '', $book = '', $chapter = '') {\n return [];\n }", "public static function asin ($v) {\n\t\treturn asin($v);\n\t}", "public function leerListaInformes($ciu)\n {\n //leemos todos los informes de este usuario\n $this->db->select(\"id, privado, episodio, fecha, nombre_completo_medico, especialidad\");\n $this->db->where(\"CIU_paciente\", $ciu);\n $this->db->order_by(\"fecha\", \"DESC\");\n return $this->db->get(\"vista_resumen_informes\")->result_array();\n }", "public function listar(){\n $rol= $this->db->select('*')->from('versions')->join('plans', 'plans.PLAN_PK = versions.VRSN_FK_plans');\n return $rol->get();\n }", "public function _get_list_voxy_level()\n {\n return Array(\n 1 => 'Super Basic', // super basic\n 2 => 'Basic', // basic\n 3 => 'Pre Inter', // pre inter\n 4 => 'Inter', // inter\n 5 => 'Advan', // advan\n );\n }", "public function getequipesin($in)\n {\n if( is_array($in) )\n return self::whereIn('idequipe',$in)->get();\n else\n return null;\n }", "public function getListeVisiteurs(){\n\t\t$req = \"select * from visiteur order by VIS_MATRICULE\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\t$ligne = $rs->fetchAll();\n\t\treturn $ligne;\n\t}", "public static function queryListInmuebles()\n {\n $connect = Connect::getINSTANCE();\n $query = \"SELECT * FROM `list_inmuebles`\";\n $resultado = $connect->getConnection()->query($query);\n $inmuebles = array();\n if ($resultado->num_rows > 0) {\n // output data of each row\n while ($row = $resultado->fetch_assoc()) {\n $inmuebles[] = $row;\n }\n return $inmuebles;\n }\n return [];\n }", "public function getVendas()\n {\n return $this->vendas;\n }", "public function getListeSousVisiteurs($reg){\n\t\t$req = \"select distinct REG_CODE,v.VIS_MATRICULE as visiteurmat, v.VIS_NOM as nom from visiteur v, travailler t where t.TRA_ROLE ='visiteur' and REG_CODE='$reg' order by v.VIS_MATRICULE\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\treturn $rs;\n\t}", "public function vodVideosListing()\n\t\t\t{\n\t\t\t\t$cls\t\t\t=\tnew adminUser();\n\t\t\t\t$cls->unsetSelectionRetention(array($this->getPageName()));\n\t\t\t\t$user\t\t\t\t\t\t=\tnew userManagement();\n\t\t\t\t$tutor\t\t\t=\t $user->getInstructors();\n\t\t\t\t$instmnt\t\t=\t new instrument();\n\t\t\t\t$instrument_list=\t $instmnt->getAllInstruments();\n\t\t\t\t$courses\t\t=\t new userCourse();\n\t\t\t\t$course_list\t=\t$courses->getAllTaughtCourses();\n\t\t\t\t\n\t\t\t\tunset($_SESSION[\"txtCourse\"]);\n\t\t\t\tunset($_SESSION[\"txtInst\"]);\n\t\t\t\tunset($_SESSION['instrument_id']);\n\t\t\t\t\t\t\t\n\t\t\t\tif(!empty($_POST[\"txtInst\"])){\n\t\t\t\t\t$_SESSION[\"txtInst\"]\t=\ttrim($_POST[\"txtInst\"]);\n\t\t\t\t}\n\t\t\t\tif(!empty($_POST[\"txtCourse\"])){\n\t\t\t\t\t$_SESSION[\"txtCourse\"]\t=\ttrim($_POST[\"txtCourse\"]);\n\t\t\t\t}\n\t\t\t\tif(!empty($_POST['instrument_id'])){\n\t\t\t\t$_SESSION[\"instrument_id\"]\t\t=\t$_POST[\"instrument_id\"];\n\t\t\t\t}\t\t\n\t\t\t\t\n\t\t\t\t$txtInst\t\t=\t$_POST[\"txtInst\"];\n\t\t\t\t$txtCourse\t\t=\t$_POST[\"txtCourse\"];\n\t\t\t\t$instrument_id\t=\t$_POST[\"instrument_id\"];\n\t\t\t\n\t\t\t\treturn array(\"tutor\"=>$tutor,\"instrument\"=>$instrument_list,\"course\"=>$course_list,\"txtInst\"=>$txtInst,\"txtCourse\"=>$txtCourse,\"instrument_id\"=>$instrument_id);\n\t\t\t}", "public function parse(string $virin): array\n {\n $matches = [];\n $parsed = preg_match('/' . self::CAPTURE_PATTERN . '/', $virin, $matches);\n\n if (!$parsed) {\n throw new Exception(\"Unable to parse input VIRIN string (is it syntactically valid?)\");\n }\n\n // Shift the first match off the beginning, it's the full string match\n array_shift($matches);\n\n // Set the matched parts for retrieval\n $this->field1 = $matches[0];\n $this->field2 = $matches[1];\n $this->field3 = $matches[2];\n $this->field4 = $matches[3];\n $this->field5 = $matches[4] ?? null;\n\n return $matches;\n }", "function get_votos() {\n\t\t$condicion = array(\n\t\t\t'IdUsuario' => $this->session->userdata('id_usuario'),\n\t\t);\n\t\t\n\t\t$consulta = $this->db->get_where( 'pa_capacitacion_cursos_votos', $condicion ); \n\t\t\n\t\treturn $consulta;\n\t}", "function grab_video_vine($url) {\n $vId = explode('/', $url);\n $vTitle = get_vine_title($url);\n $video = array();\n $video[0]['index'] = 1;\n $video[0]['video_id'] = $vId[4];\n $video[0]['title'] = (string) $vTitle;\n $video[0]['duration'] = 'Unknown';\n $video[0]['video_source'] = 'Vine';\n\n return $video;\n}", "function Varr(&$R,$n,$m=\"\")\n\t\t{\n\t\treturn $this->Zarr($R,\"uint8\",$n,$m);\n\t\t}", "public function getMemberInBoxNotices($to_member_id, $mdb_control)\n\t{\n\t\t$notices_to_member = array();\t\t\n\t\t\n\t\t// essentially gets a list of notice ids sent to this member id\n\t\t$controller = $mdb_control->getController(\"notice_to_member\");\n\t\t$notices_to_member = $controller->getByAttribute(\"to_member_id\", $to_member_id);\n\t\t\n\t\t$num_notices = count($notices_to_member);\n\t\t$notice_list = array();\t\n\t\t$controller = $mdb_control->getController(\"notice_view\");\n\t\t\n\t\t// now get the actual notices for each notice id\n\t\tfor($i = 0; $i < $num_notices; $i++)\n\t\t{\n\t\t\t$notice_id = $notices_to_member[$i]->get_notice_id();\n\t\t\t$notice = array();\n\t\t\t$notice = $controller->getByAttribute(\"notice_id\", $notice_id);\n\t\t\t\n\t\t\tif(count($notice) == 1)\n\t\t\t{\n\t\t\t\t$notice_list[] = $notice[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $notice_list;\n\t}", "private function getListMapVille()\r\n {\r\n $repo = $this->getDoctrine()->getRepository(MapVille::class);\r\n return $repo->findAll();\r\n }", "public function getVotos() {\n return $this->votos;\n }", "public function get_patterns()\n {\n }", "public function _parse_to_array($in) {\n\t\t$string = str_replace(' ', '', trim($in));\n\t\t\n\t\tif ( ! empty($string)) {\n\t\t\treturn (array) explode('|', $string);\n\t\t}\n\t\telse {\n\t\t\treturn array();\n\t\t}\n\t}", "public function vector_scan()\n\t{\n\t\t\n\t\t// Hostnames\n\t\t$vectors = $this->Vector->typeList('hostname', false, true);\n\t\t$this->out($this->Vector->shellOut());\n\t\t\n\t\t// add the new records\n\t\t$results = $this->Hostname->checkAddBlank(array_keys($vectors));\n\t\t$this->out($this->Hostname->shellOut());\n\t\t\n\t\t// Ip Addresses\n\t\t$vectors = $this->Vector->typeList('ipaddress', false, true);\n\t\t$this->out($this->Vector->shellOut());\n\t\t\n\t\t// add the new records\n\t\t$results = $this->Ipaddress->checkAddBlank(array_keys($vectors));\n\t\t$this->out($this->Ipaddress->shellOut());\n\t}", "public function getVout()\n {\n return $this->vout;\n }", "function getAllVRSNo()\n\t\t {\n\t\t $date = date('Y-m-d');\n $day = date('l',strtotime($date));\n if($day=='Monday')\n {\n $from = date('Y-m-d',strtotime('-1 Monday', time()));\n }\n else{\n $from = date('Y-m-d',strtotime('-2 Monday', time()));\n }\n\t\t\t $to = date('Y-m-d',strtotime('Last Saturday', time()));\n\t\t \t\t \n\t\t$sql =\"SELECT * FROM be_users WHERE active='1' AND (id NOT IN (SELECT user_id FROM pof_candidates WHERE stage IN (SELECT id FROM segment_name WHERE segment_type_id='5' ) AND (date BETWEEN '\".$from.\"' AND '\".$to.\"'))) ORDER BY username ASC;\";\n\t $q = $this->db->query($sql);\n\t\tif($q->num_rows() > 0)\n\t\t{\n\t\t\tforeach($q->result() as $row)\n\t\t\t{\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\t\t\n\t}", "public function getVakterInnenDogn()\n {\n $vakterInnenDogn = array();\n if ($this->harVakt()) {\n foreach (VaktListe::medBrukerId($this->brukerId) as $vakt) {\n if (floor((strtotime($vakt->getDato()) - time()) / (60 * 60 * 24)) <= 1 && !$vakt->erFerdig()) {\n $vakterInnenDogn[] = $vakt;\n }\n }\n }\n return $vakterInnenDogn;\n }", "function getIN($name)\n{\n global $in;\n\n foreach ($in as $item) {\n if (strpos($item, $name.'.in')){\n return $item;\n }\n }\n\n return null;\n}", "function phpkd_vblvb_fetch_piped_options($piped_data)\n{\n\t$options = array();\n\t$option_lines = preg_split(\"#(\\r\\n|\\n|\\r)#s\", $piped_data, -1, PREG_SPLIT_NO_EMPTY);\n\n\tforeach ($option_lines AS $option)\n\t{\n\t\tif (preg_match('#^([^\\|]+)\\|(.+)$#siU', $option, $option_match))\n\t\t{\n\t\t\t$option_text = explode('(,)', $option_match[2]);\n\t\t\tforeach (array_keys($option_text) AS $idx)\n\t\t\t{\n\t\t\t\t$option_text[\"$idx\"] = phpkd_vblvb_fetch_phrase_from_key(trim($option_text[\"$idx\"]));\n\t\t\t}\n\t\t\t$options[\"$option_match[1]\"] = implode(', ', $option_text);\n\t\t}\n\t}\n\n\treturn $options;\n}", "public function processVat()\n {\n $query = preg_replace('/[^\\\\d.]+/', '', self::$_query);\n $vatCalculator = new Vat($query);\n $data = $vatCalculator->getVatOf($query);\n return $vatCalculator->output($data);\n }", "public function getAllVoltageParam(){\r\n\t $select=\"SELECT * FROM voltage_parameters\";\r\n\t global $pdo;\r\n\t $stmt = $pdo->query($select);\r\n\t\t$params = array();\r\n\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC)){\r\n\t\t\t$params[] = $row;\r\n\t\t}\r\n\t\treturn $params;\r\n\r\n\t}", "public function getVRizeniClanky(){\n $sth = $this->db->prepare(\"SELECT * FROM PRISPEVKY\n WHERE stav LIKE 'v recenzním řízení'\");\n $sth->execute();\n $data = $sth->fetchAll();\n return $data;\n }", "function getCandidateVideos(){\n\t$ratings = array();\n\t$vid = array();\n\tfor ($i=0; $i<10; $i++) {\n\t\t$ratings[] = $_POST[\"entry_\" . $i . \"_0_group\"];\n\t\t$vids[] = $_POST[\"vid\" . $i];\t\t\n\t}\n\t//echo print_r($ratings);\n\tasort($ratings);\n\t//echo print_r(array_slice($ratings, -3, 3, true));\n\t$result = array();\n\tforeach(array_slice($ratings, -3, 3, true) as $key => $value)\n\t\t$result[] = $vids[$key];\n\t//echo print_r($result);\n\treturn $result;\n}", "function getVenues()\n{\n\tglobal $db;\n\tglobal $venueName;\n\t$venues = array();\n\t$venue['venue_id'] = 0;\n $venue['accepting'] = getAccepting();\n $venue['name'] = $venueName;\n\t$venue['url_name'] = \"none\";\n\t$venues['venues'][] = $venue;\n\treturn $venues;\n}", "public function getInterfaces() {\n\t\t$vnstatInterfaces = [];\n\n\t\tforeach($this->vnstatData['interfaces'] as $interface) {\n\t\t if ($this->vnstatJsonVersion == 1) {\n\t\t\tarray_push($vnstatInterfaces, $interface['id']);\n\t\t } else {\n\t\t\tarray_push($vnstatInterfaces, $interface['name']);\n\t\t }\n\t\t}\n\n\t\treturn $vnstatInterfaces;\n\t}", "public function listaVentas()\n {\n $conexion = conexion::conectar();\n $sql = \"SELECT * FROM movimientos WHERE compra_venta ='v' order by id_producto asc;\";\n $stmt = $conexion->prepare($sql);\n $stmt->execute();\n $array = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt = null;\n return $array;\n }", "public function toList();", "function get_inverter_data() {\n\t$context = stream_context_create(array(\n\t\t\t'http' => array(\n\t\t\t\t\t'header' => \"Authorization: Basic \" . base64_encode(\"pvserver:pvwr\"))));\n\t$data = file_get_contents('http://inverter.fritz.box', false, $context);\n\n\t$search_string = '<td width=\"70\" align=\"right\" bgcolor=\"#FFFFFF\">';\n\t$sl = strlen($search_string);\n\n\t/* Locate fields in order current, total, totalDaily */\n\t$cur_pos = strpos($data, $search_string, 0) + $sl;\n\t$total_pos = strpos($data, $search_string, $cur_pos+1) + $sl;\n\t$total_daily_pos = strpos($data, $search_string, $total_pos+1) + $sl;\n\n\t/* echo \"${cur_pos}, ${total_pos}, ${total_daily_pos}\"; */\n\n\t$cur = get_field($data, $cur_pos);\n\tif (strpos($cur, ' x x') != FALSE)\n\t\t$cur = 0;\n\t$total = get_field($data, $total_pos);\n\t$total_daily = get_field($data, $total_daily_pos);\n\t\n\t/* Next are: string voltage 1(V), L1(V), string 1 current (A), L1 power(W), string 2 voltage (V), L2(V), string 2 current (A) */\n\t/* Aim is to calculate DC input and thereby efficiency */\n\t$s1_v_pos = strpos($data, $search_string, $total_daily_pos+1) + $sl;\n\t$l1_v_pos = strpos($data, $search_string, $s1_v_pos+1) + $sl;\n\t$s1_a_pos = strpos($data, $search_string, $l1_v_pos+1) + $sl;\n\t$l1_w_pos = strpos($data, $search_string, $s1_a_pos+1) + $sl;\n\t$s2_v_pos = strpos($data, $search_string, $l1_w_pos+1) + $sl;\n\t$l2_v_pos = strpos($data, $search_string, $s2_v_pos+1) + $sl;\n\t$s2_a_pos = strpos($data, $search_string, $l2_v_pos+1) + $sl;\n\t\n\t$s1_v = get_field($data, $s1_v_pos);\n\t$s1_a = get_field($data, $s1_a_pos);\n\t$s2_v = get_field($data, $s2_v_pos);\n\t$s2_a = get_field($data, $s2_a_pos);\n\t\n\tif ($cur == 0) {\n\t\t$dc = 0;\n\t\t$eff = 0;\n\t} else {\n\t\t$dc = $s1_v * $s1_a + $s2_v * $s2_a;\n\t\t$eff = round (100.0 * $cur / $dc, 1);\n\t}\n\t\n\t/* echo \"${s1_v} ${s1_a} ${s2_v} ${s2_a} .. ${dc} .. ${eff}\\n\"; */\n\t\n\n\treturn join(\",\", array($cur, $total_daily, $total, $eff));\n}", "public function testGetVnin()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function getExcludeListArray() {}", "private function deformatNVP($nvpstr){\r\n \r\n $intial=0;\r\n $nvpArray = array(); \r\n \r\n while(strlen($nvpstr)){\r\n //postion of Key\r\n $keypos= strpos($nvpstr,'=');\r\n //position of value\r\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\r\n \r\n /*getting the Key and Value values and storing in a Associative Array*/\r\n $keyval=substr($nvpstr,$intial,$keypos);\r\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\r\n //decoding the respose\r\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\r\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\r\n }\r\n return $nvpArray;\r\n }", "public function index()\n {\n $vids = Vid::all();\n return view('all.vid', ['vid' => $vids]);\n }", "public function providerMatches()\n {\n return array(\n array('24 - 5x01 (HR.HDTV).avi', 5, 1),\n array('3rd Rock from the Sun - 1x01 - Brains and Eggs.avi', 1, 1),\n array('American Dad! - 1x01 - Pilot (pdtv).avi', 1, 1),\n array('The X Factor - 1x02 - Mooman (ll).avi',1,2),\n );\n }", "abstract protected function getAvailablePatterns(NumberFormat $numberFormat): array;", "function\tgetVerOffs() {\n\t\treturn $this->verOffs ;\n\t}", "public static function getVPs($TruhlarID, $datum){\n $VPs = Zamestnanec::find($TruhlarID)\n ->hasPracovniDny()\n ->whereRaw('extract(month from Datum) = ?', [$datum->mesic])\n ->whereRaw('extract(year from Datum) = ?', [$datum->rok])\n ->select(\"ID_Obj\")\n ->distinct()\n ->orderBy('ID_Obj', 'asc')\n ->get();\n\n return $VPs;\n }", "function sloodle_vector_to_array($vector)\n {\n if (preg_match('/<(.*?),(.*?),(.*?)>/',$vector,$vectorbits)) {\n $arr = array();\n $arr['x'] = $vectorbits[1];\n $arr['y'] = $vectorbits[2];\n $arr['z'] = $vectorbits[3];\n return $arr;\n }\n return false;\n }", "public function getAllViruses() {\n\t\treturn $this->selectAll('VIRUSES');\n\t}", "public function listarVehiculo()\n\t{\n\t\t$varprueba = new Vehiculo();\n\t\t$resultado = $varprueba->traerVehiculo();\n\t\treturn $resultado;\n\n\t}", "public function getPatterns()\n {\n return $this->patterns;\n }", "public function getPatterns()\n {\n return $this->patterns;\n }", "private function GetCompletedOrderNoti($Vid)\n {\n \n $condition = \"orders.status=5 AND items.vid=$Vid\";\n $this->db->select('*');\n $this->db->from('orders'); \n $this->db->join('user','user.uid =orders.uid');\n $this->db->join('vendor_items','find_in_set(vendor_items.vi_id, orders.vi_id)'); \n $this->db->join('items','items.item_id=vendor_items.item_id'); \n //$this->db->where('items.vid',$Vid); \n $this->db->where($condition); \n $this->db->group_by('orders.order_id');\n $query = $this->db->get();\n $tmpArray = $query->result_array();\n $this->data[\"CompletedOrderNoti\"] = count($tmpArray);\n return $this->data[\"CompletedOrderNoti\"]; \n }", "public function getVotosNegativos()\n {\n return $this->getVotos()->where(['positivo' => false]);\n }", "public function memberIdList()\n {\n return User::where('status', 1)->where('role_id', 2)->get();\n }", "function getVIDINVnameAr($local_account_id,$DbConnection)\n {\n $query =\"SELECT DISTINCT vehicle.vehicle_id, vehicle.vehicle_name, vehicle_assignment.device_imei_no FROM vehicle,vehicle_assignment,\".\n \"vehicle_grouping USE INDEX(vg_accountid_status) WHERE vehicle.vehicle_id = vehicle_assignment.vehicle_id AND vehicle.status='1' AND \".\n \" vehicle_assignment.status = '1' AND vehicle.vehicle_id=vehicle_grouping.vehicle_id AND vehicle_grouping.account_id\".\n \"=$local_account_id AND vehicle_grouping.status=1\"; \n $result = @mysql_query($query, $DbConnection);\t\t \n while($row = mysql_fetch_object($result))\n {\n /*$vid[]= $row->vehicle_id;\n $device[] = $row->device_imei_no;\n $vname[] = $row->vehicle_name;*/\n $data[]=array('vid'=>$row->vehicle_id,'device'=>$row->device_imei_no,'vname'=>$row->vehicle_name);\n } \n return $data;\n }", "public function getSlotsList(){\n return $this->_get(5);\n }", "private function deformatNVP($nvpstr) {\n\n\t\t$intial=0;\n\t\t$nvpArray = array();\n\n\n\t\twhile(strlen($nvpstr)){\n\t\t\t//position of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr, $intial, $keypos);\n\t\t\t$valval=substr($nvpstr, $keypos+1, $valuepos-$keypos-1);\n\t\t\t//decoding the response\n\t\t\t$nvpArray[urldecode($keyval)] = urldecode($valval);\n\t\t\t$nvpstr = substr($nvpstr, $valuepos+1, strlen($nvpstr));\n\t\t}\n\t\treturn $nvpArray;\n\t}", "function fetchJudgeRoundCompletePreDefinedVoters($condition = \"\",$order = \"voter_id\")\n\t{\n\t\t$arrlist = array();\n\t\t$i = 0;\n\t\n\t\t$condition = explode(\"||##||\",$condition);\n\t\n\t\t$sQuery = \"SELECT v.voter_id,v.client_id,v.voter_username,v.voter_firstname,v.voter_lastname,v.voter_email FROM \".DB_PREFIX.\"judge_round_voter_group jrv,\".DB_PREFIX.\"voter_group vg,\".DB_PREFIX.\"voter v WHERE 1 = 1 AND jrv.voter_group_id=vg.voter_group_id AND v.voter_group_id=vg.voter_group_id AND user_type_id='\".USER_TYPE_VOTER_USER.\"' \" . $condition[0] . \" AND v.voter_id in (select voter_id from \".DB_PREFIX.\"vote vt WHERE 1 \" . $condition[1] . \" ) ORDER BY \".$order;\n\t\t\n\t\t$rs = $this->runquery($sQuery);\n\n\t\treturn $rs;\n\t}", "public function show(VehicleIn $vehicleIn)\n {\n //\n }", "function vList() {\n $vlist=$this->getListVars();\n //need database,table,varname,tableinfo for variable =\n // browse=varname;ctrl=whatever;titl=something;whatever other options\n $postStrng=\"method=useQonFly\".\n '&db='.$this->dbName.\n '&tabl='.$this->tabl.\n '&index='.$this->indx;\n if ($vlist) {\n $postStrng.=\"&cmnd=qlist\";\n $chStrng=\"document.getElementById('updBrowse').style.visibility='visible';\";\n $chStrng.=\"jtAjaxLibSelect('$postStrng','varinfo','jtSpecs','1');\";\n echo \"<p><strong>Filter by</strong>\\n<select id=\\\"varinfo\\\" name=\\\"varinfo\\\"\";\n echo \" />\\n\";\n echo \"<option value=\\\"0\\\"> -- </option>\\n\";\n foreach ($vlist as $item) {\n $a=$this->xQueryInfo[\"$item\"];\n $code=\"$item;ctrl=\".$a->getSize().';titl='.$a->getLabel().';'.\n $this->implodeAllOpts($a);\n echo \"<option value=\\\"$code\\\">\",$a->getLabel(),\"</option>\\n\";\n }\n echo \"</select>\\n\";\n addButton('myChoice','Choose',$chStrng); \n //echo \"</p>\\n\";\n } //vlist not empty\n }", "public function getFilterList($list)\n {\n $psList = array();\n foreach ($list as $key => $value) {\n $lastElement = end($value);\n $psPosition = $this->getPhaseSetPosition($value['FORMAT']);\n $gtPosition = $this->getGenoTypePosition($value['FORMAT']);\n $psValue = $this->getPhaseSetPositionValue($lastElement,$psPosition);\n $gtValue = $this->checkForSlash($lastElement,$gtPosition);\n if($gtValue) {\n $validGt = $this->skipHomo($lastElement,$gtPosition);\n }\n if(is_numeric($psValue) && $gtValue && $validGt) {\n $headerArray = array_keys($value);\n $arrayKey = $headerArray[9]; \n $value[$arrayKey] = $psValue;\n array_push($psList,$value);\n }\n }\n return $psList;\n }", "public static function NP(): VatRate\n {\n return self::fromCode('NP');\n }", "public static function getVinculosMasculinos() {\n return array_values(array_unique(self::$vinculosMasculinos));\n }", "public function getVIVIENDA()\r\n {\r\n return $this->VIVIENDA;\r\n }", "public static function getVaccin($args) {\n $filtre = [];\n\n foreach ($_GET as $key => $value) {\n $filtre[] = $value;\n }\n unset($filtre[0]);\n ModelRecolte::getRecolte($filtre);\n\n include 'config.php';\n $vue = $root . '/app/view/gestion des vaccins/viewAll.php';\n require ($vue);\n }", "public function get_interface_switch_allowed_transit_vlans($interface_obj)\r\n\t{\r\n\t}", "public function getPattern();", "public function getPattern();", "public function deformatNVP($nvpstr)\r\n {\r\n $intial=0;\r\n $nvpArray = array();\r\n\r\n while(strlen($nvpstr))\r\n {\r\n //postion of Key\r\n $keypos= strpos($nvpstr,'=');\r\n //position of value\r\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\r\n\r\n /*getting the Key and Value values and storing in a Associative Array*/\r\n $keyval=substr($nvpstr,$intial,$keypos);\r\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\r\n //decoding the respose\r\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\r\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\r\n }\r\n return $nvpArray;\r\n }", "public function getList(): array\n {\n return $this->client->request(\"/ncm/v1\");\n }", "static public function getAllowedDisciplinesList() {\n\t\t$userTSConfig_all = $GLOBALS[\"TSFE\"]->fe_user->getUserTSconf();\n\t\t$allowedDisciplines = $userTSConfig_all['tx_vsoevvscout_pi1.']['discipline.'];\n\t\treturn implode(',',$allowedDisciplines);\n\t}", "public function getVisibleInSiteVisibilities()\n {\n return Mage::getSingleton('catalog/product_visibility')->getVisibleInSiteIds();\n }", "public function getVclList() {\n $list = array();\n\n $response = $this->execute('vcl.list');\n\n $lines = explode(\"\\n\", $response);\n foreach ($lines as $line) {\n $line = trim($line);\n if (!$line) {\n continue;\n }\n\n $tokens = explode(' ', $line);\n\n $name = array_pop($tokens);\n\n $list[$name] = $tokens[0] == 'active';\n }\n\n return $list;\n }", "public static function getList(Request $request)\n {\n \t$terms = array();\n \t$isapproved = $request->isapproved;\n \tif ($isapproved == \"0\") {\n \t\t$terms[\"isapproved\"] = 0;\n \t} else {\n \t\t$terms[\"isapproved\"] = 1;\n \t}\n \t$ispublished = $request->ispublished;\n \tif ($ispublished == \"0\") {\n \t\t$terms[\"ispublished\"] = 0;\n \t} \n \tif ($ispublished == \"1\") {\n \t\t$terms[\"ispublished\"] = 1;\n \t}\n \t$isfeatured = $request->isfeatured;\n \tif ($isfeatured == \"0\") {\n \t\t$terms[\"isfeatured\"] = 0;\n \t}\n \tif ($isfeatured == \"1\") {\n \t\t$terms[\"isfeatured\"] = 1;\n \t}\n \t$type = $request->type;\n \tif ($type == \"img\") {\n \t\t$terms[\"hasvideo\"] = 0;\n \t}\n \tif ($type == \"vid\") {\n \t\t$terms[\"hasvideo\"] = 1;\n \t}\n \t$data = self::getListByFilter($terms);\n \t$hashids = new \\Hashids\\Hashids(\"\", Config::get(\"weixin.minhashlength\"));\n \tforeach ($data as $item) {\n \t\t// id number to hashStr\n \t\t$item->id = $hashids->encode($item->id);\n \t\t// add QRcode at the end of content\n \t\t$item->content = $item->content.WeixinController::addQrcode($item->sourcedomain);\n \t}\n \t$meta = self::getHtmlMeta('list', '', '/list', '');\n \n \treturn response()->view('list', [ 'data' => $data, 'isadmin' => self::isAdmin(), 'meta' => $meta ]);\n }", "static function videographers(string $pid): array {\r\n return self::contributors(MJKMeta_ACF_Auth::get(\r\n MJKMeta_ACF_Auth::videographers, $pid));\r\n }", "function get_vid_extensions()\r\n{\r\n $exts = config('allowed_types');\r\n $exts = preg_replace(\"/ /\",\"\",$exts);\r\n $exts = explode(\",\",$exts);\r\n return $exts;\r\n}", "public function getInstrucoes();", "public function getVuesequipe(): array\n {\n return $this->vuesequipe;\n }", "public function getPatternedFields(): array;", "function InseMethod(){\n\treturn array('1'=>'Natural', '2'=>'Artificial Insemination');\n}", "private function deformatNVP($nvpstr)\n {\n $intial=0;\n $nvpArray = array();\n\n while(strlen($nvpstr))\n {\n //postion of Key\n $keypos= strpos($nvpstr,'=');\n //position of value\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\n /*getting the Key and Value values and storing in a Associative Array*/\n $keyval=substr($nvpstr,$intial,$keypos);\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n //decoding the respose\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n }\n return $nvpArray;\n }", "function getAllVRSRead()\n\t\t {\n\t\t $date = date('Y-m-d');\n $day = date('l',strtotime($date));\n if($day=='Monday')\n {\n $from = date('Y-m-d',strtotime('-1 Monday', time()));\n }\n else{\n $from = date('Y-m-d',strtotime('-2 Monday', time()));\n }\n\t\t\t $to = date('Y-m-d',strtotime('Last Saturday', time()));\n\t\t \t\t \n\t\t$sql =\"SELECT * FROM pof_candidates LEFT JOIN be_users ON pof_candidates.user_id=be_users.id WHERE stage IN (SELECT id FROM segment_name WHERE segment_type_id='5' ) AND (date BETWEEN '\".$from.\"' AND '\".$to.\"') GROUP BY pof_candidates.user_id ORDER BY be_users.username ASC;\";\n\t $q = $this->db->query($sql);\n\t\tif($q->num_rows() > 0)\n\t\t{\n\t\t\tforeach($q->result() as $row)\n\t\t\t{\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\t\t\n\t}", "public function getInkLists() {}", "public function providerMatches()\n {\n return array(\n array('[DBNL] One Piece - 179 - A Raid! The Tin Tyrant and Tin Plate Wapol! [x264][D1F15206].mkv', 1, 179,'format8'),\n array('12 Oz. Mouse - S2E01 - Bowtime.avi', 2, 1, 'format1'),\n array('fdsgdfgdfgdf s01E3', 1, 3,'format1'),\n array('s1e01 - Hired.avi', 1, 1, 'format1'),\n array('24 - 5x01 (HR.HDTV).avi', 5, 1,'format2'),\n array('24 s01e01 - 0000-0100 PAL DVD.mkv', 1, 1, 'format1'),\n array('24 S07E23 720p BluRay DTS x264-CtrlHD.mkv', 7, 23,'format1'),\n array('24.618.hr.hdtv.xvid-tvff.avi', 6, 18,'format5'),\n array('30 Rock S01E01 720p WEB-DL DD5.1 AVC-CtrlHD.mkv', 1, 01,'format1'),\n array('30 Rock S04E01 Season Four 720p WEB-DL H.264 DD5.1.mkv', 4, 1,'format1'),\n array('3rd Rock from the Sun - 1x01 - Brains and Eggs.avi', 1, 1,'format2'),\n array('at.s03e01.tvrip-miragetv.avi', 3,1,'format1'),\n array('Im Alan Partridge - S01E01 - A Room With An Alan [dd].avi', 1, 1,'format1'),\n array('american.dad.316.pdtv-0tv.avi', 3, 16,'format5'),\n array('American Dad! - 1x01 - Pilot (pdtv).avi', 1, 1,'format2'),\n array('astroboy.1980s.02.the.birth.of.astro.boy-dvdrip.xvid.avi', 1, 2,'format6'),\n array('Bakemonogatari_Ep02_[1080p,BluRay,x264]_-_qIIq-THORA.mkv', 1, 2,'format4'),\n array('[DBNL] One Piece - 079 - A Raid! The Tin Tyrant and Tin Plate Wapol! [x264][D1F15206].mkv', 1, 79,'format8'),\n array('[DBNL] One Piece - 179 - A Raid! The Tin Tyrant and Tin Plate Wapol! [x264][D1F15206].mkv', 1, 179,'format8'),\n array('One Piece - 001 - I m Luffy! The Man Whos Gonna Be King of the Pirates! [x264][857DCFD6].mkv',1,1,'format8'),\n array('S02E03.mkv',2,3,'format1'),\n array('08 - A Pinky And The Brain Christmas.mpg',1,8,'format10'),\n array('Planetes.07.PSNR.mkv',1,7,'format6'),\n array('BUFFY THE VAMPIRE SLAYER - S01 E01 - WELCOME TO THE HELLMOUTH NTSC DVD DD2.0 x264 MMI.mkv',1,1,'format1'),\n array('408 - Manners.avi',4,8,'format5'),\n array('Carlos.2010.E03.720p.BluRay.x264-CiNEFiLE.mkv',1,3,'format4'),\n array('Episode 718 Whats Up Doc.avi',7,18,'format5'),\n array('Clannad_Ep05_[1080p,BluRay,x264]_-_THORA.mkv',1,5,'format4'),\n array('Code_Geass_R2_Picture_Drama_S00E13_0.923_[1080p,BluRay,x264]_-_THORA.mkv',0,13,'format1'),\n array('Shin Chan - Episode 06.avi',1,6,'format7'),\n array('2e06-Belief.mkv',2,6,'format1'),\n array('[moo-shi]_Desert_Punk_-_01[DVD][H264.AAC][17FC7F0C].mkv',1,1,'format8'),\n array('Dragons Den S07E01 - 2009-07-15 - 720p-h264-ac3-subs.mkv',7,1,'format1'),\n array('DragonsDen-2007ChristmasSpecial-S05E10.avi',5,10,'format1'),\n array('Dragons\\' Den - s6e1.avi',6,1,'format1'),\n array('EFC 0107 - Resurrection.avi',1,7,'format9'),\n array('Elfen Lied - 01 - A Chance Encounter.mkv',1,1,'format6'),\n array('E05.720p.BluRay.x264-fty.mkv',1,5,'format4'),\n array('Episode 7 - Bolognese sauce.jpg',1,7,'format7'),\n array('xpatriots.24.0815.720p.hdtv.x264-dimension.mkv',8,15,'format9'),\n array('king.of.the.hill.1306.pdtv-lol.avi',13,6,'format9'),\n array('TG1302.mkv',13,2,'format9'),\n array('EFC 0104 - Avatar.avi',1,4,'format9'),\n array('south.park.1202.dsr-0tv.avi',12,2,'format9'),\n array('Hellsing 04v2 [anime fin][6BD62B96].ogm',1,4,'format11'),\n array('Extras.2005.PAL.DVD.S02EE02.AC3.x264-sJR.mkv',2,2,'format14'),\n array('(W_B) SDF Macross 31(x264)(6BD62B96).mkv',1,31,'format12'),\n array('Star Trek Deep Space Nine s02extra03 - Sketchbook NTSC DVD x264 DD2.0-JCH.mkv',2,3,'format13'),\n );\n }", "function get_all_video_files($vdetails,$count_only=false,$with_path=false)\r\n{\r\n $details = get_video_file($vdetails,true,$with_path,true,$count_only);\r\n if($count_only)\r\n return count($details);\r\n return $details;\r\n}", "public static function getAllVideo()\n {\n \treturn VedioGallary::all();\n }", "function fetchJudgeRoundCompletionPreDefinedVoters($condition = \"\",$order = \"voter_id\")\n\t{\n\t\t$arrlist = array();\n\t\t$i = 0;\n\t\n\t\t$condition = explode(\"||##||\",$condition);\n\t\n\t\t$sQuery = \"SELECT v.voter_id,v.client_id,v.voter_username,v.voter_firstname,v.voter_lastname,v.voter_email FROM \".DB_PREFIX.\"judge_round_voter_group jrv,\".DB_PREFIX.\"voter_group vg,\".DB_PREFIX.\"voter v WHERE 1 = 1 AND jrv.voter_group_id=vg.voter_group_id AND v.voter_group_id=vg.voter_group_id AND user_type_id='\".USER_TYPE_VOTER_USER.\"' \" . $condition[0] . \" AND v.voter_id not in (select voter_id from \".DB_PREFIX.\"vote vt WHERE 1 \" . $condition[1] . \" ) ORDER BY \".$order;\n\t\t\n\t\t$rs = $this->runquery($sQuery);\n\t\t\n\t\treturn $rs;\n\t}", "public function inputSlots(): array;", "function get_isi_rawat_list(){\r\n\t\t$dapaket_dpaket = isset($_POST['dapaket_dpaket']) ? $_POST['dapaket_dpaket'] : 0;\r\n\t\t$dapaket_jpaket = isset($_POST['dapaket_jpaket']) ? $_POST['dapaket_jpaket'] : 0;\r\n\t\t$dapaket_paket = isset($_POST['dapaket_paket']) ? $_POST['dapaket_paket'] : 0;\r\n\t\t$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);\r\n\t\t$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);\r\n\t\t$result = $this->m_master_ambil_paket->get_isi_rawat_list($dapaket_dpaket,$dapaket_jpaket,$dapaket_paket,$start,$end);\r\n\t\techo $result;\r\n\t}", "public function getFarmsVegetables(){\n\t\t$url = \"http://www.vermontfresh.net/member-search/MemberSearchForm?Keywords=&ProductCategoryID=5&Categories%5B13%5D=13&RegionID=&action_doMemberSearch=Search\";\n\t\treturn $this->parse_data($url);\n\t}", "public function getInfoList() {\n return $this->_get(11);\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}" ]
[ "0.5229542", "0.5206358", "0.51823413", "0.49076906", "0.4897251", "0.48405182", "0.48405182", "0.48068368", "0.47646004", "0.47254863", "0.47246695", "0.4722298", "0.46968603", "0.4687372", "0.46547836", "0.46456403", "0.46222693", "0.46099022", "0.4602385", "0.45938125", "0.4580839", "0.45648825", "0.45521894", "0.45279568", "0.45258552", "0.4513032", "0.45040494", "0.44938797", "0.4492184", "0.44832796", "0.44603738", "0.44297495", "0.44212765", "0.43960533", "0.43910542", "0.438985", "0.43796587", "0.43667942", "0.43651316", "0.43448183", "0.43324292", "0.43317282", "0.4329676", "0.4322594", "0.43102926", "0.4308978", "0.42864206", "0.42853397", "0.4249514", "0.42404673", "0.42339194", "0.42333323", "0.4227534", "0.42177975", "0.42130053", "0.4211282", "0.4207508", "0.4204974", "0.4204974", "0.42030796", "0.42022255", "0.42012846", "0.41910708", "0.41908434", "0.41890606", "0.41874674", "0.4187008", "0.41820616", "0.41775638", "0.41775304", "0.41719225", "0.41686362", "0.41673455", "0.41657624", "0.4163422", "0.4163422", "0.41594127", "0.41525823", "0.41474283", "0.41453692", "0.4143922", "0.41436085", "0.41426122", "0.41423544", "0.41416946", "0.41411915", "0.41403627", "0.4139432", "0.4131965", "0.41318285", "0.41314048", "0.41303694", "0.41270754", "0.41251186", "0.4120517", "0.41204187", "0.41202602", "0.41183528", "0.41182193", "0.41120362" ]
0.58806443
0
will remove the uploaded images
public function tearDown(): void { unset($_FILES); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeImage()\n {\n // Suppression de l'image principale\n $fichier = $this->getAbsolutePath();\n\n if (file_exists($fichier))\n {\n unlink($fichier);\n }\n\n // Suppression des thumbnails\n foreach($this->thumbnails as $key => $thumbnail)\n {\n $thumb = $this->getUploadRootDir() . '/' . $key . '-' . $this->name;\n if (file_exists($thumb))\n {\n unlink($thumb);\n }\n }\n }", "public function remove_image() {\n\t\t$this->join_name = \"images\";\n\t\t$this->use_layout=false;\n\t\t$this->page = new $this->model_class(Request::get('id'));\n\t\t$image = new WildfireFile($this->param(\"image\"));\n\t\t$this->page->images->unlink($image);\n\t}", "public function removeUpload()\n {\n $this->picture = null;\n }", "function removeImage() {\n\t\t\n $image = $this->getImageByImageId();\n \n $file_image = $this->dir_path.$image['path_image'];\n\n $this->deleteImage(array('image_id' => $image['image_id'] ));\n\n if(file_exists($file_image)) {\n @unlink($file_image);\n }\n\t\t\n\t}", "function imageAllDelete();", "public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }", "private function delete_old_picture(){\n foreach ( glob( UPLOADS.$this->get_name_sanitized().'.*' ) as $picture ){\n if(is_writable($picture)){unlink($picture);}\n }\n }", "public function deleteImages() {\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_FULLSIZE . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete image file.\", E_USER_ERROR );\n }\n \n // Delete all thumbnail images for this book\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_THUMB . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete thumbnail file.\", E_USER_ERROR );\n }\n \n // Remove the image filename extension from the object\n $this->imageExtension = \"\";\n }", "protected function removeFiles() {}", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function cleanImagesAction()\n {\n parent::cleanImagesAction();\n $this->clearRespizrImageCache();\n }", "public function cleanUploadedFiles(): void\n {\n foreach ($this->uploadedFiles as $file) {\n @unlink($file['tmp_name']);\n }\n }", "function _ddb_cover_upload_cleanup() {\n $data = _ddb_cover_upload_session('ddb_cover_upload_submitted');\n\n // Mark image as upload to prevent more uploads of the same data.\n _ddb_cover_upload_session('ddb_cover_upload_submitted', '');\n\n // Remove local copy of the image.\n file_unmanaged_delete($data['image_uri']);\n}", "function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}", "public function remove()\n {\n $file = $this->security->xss_clean($this->input->post(\"file\"));\n $id = $this->security->xss_clean($this->input->post(\"id\"));\n if ($file && file_exists($file)) {\n unlink($file);\n $this->db->where(array('url_image'=>$file,'idProduct'=>$id));\n $this->db->delete('imageProduct');\n }\n }", "public function deleteImages()\n {\n if ($images = $this->getImages()->all()) {\n foreach ($images as $image) {\n /* @var $image AdImages */\n $image->delete();\n }\n }\n }", "private function deleteRecords(){\r\n\t\r\n\t\t$fileNames = explode(',', $this->collection['images']);\r\n\t\t// remove imagerecords which are not used anymore\r\n\t\tforeach($this->images as $filename => $image){\r\n\t\t\tif(array_search($filename, $fileNames) === false){\r\n\t\t\r\n\t\t\t\t$this->db->exec_DELETEquery('tx_gorillary_images', \"image='$filename' AND collection='\".$this->collection['uid'].\"'\");\r\n\t\t\t\t//unset ($this->images[$filename]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function removeImage() {\n //check if we have an old image\n if ($this->image) {\n //store the old name to delete the image on the upadate\n $this->temp = $this->image;\n //delete the current image\n $this->setImage(NULL);\n }\n }", "private static function purgeImages() {\n self::purgeFiles(self::getInterimImageFolder(), self::$interim_image_expiry);\n }", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public static function deleteImage(){}", "public function galeriasExcluir_action()\n\t{\n\t\t$bd = new GaleriasImagens_Model();\n\t\t$id = abs((int) $this->getParam(2));\n\t\t$resultado = $bd->read(\"id={$id} AND usuario={$this->_usuario}\");\n\t\tunlink('uploads/img_'.$resultado[0]['imagem']);\n\t\tunlink('uploads/tb_'.$resultado[0]['imagem']);\n\t\tunlink('uploads/destaque_'.$resultado[0]['imagem']);\n\t\t$bd->delete(\"id={$id} AND usuario={$this->_usuario}\");\n\t\tHTML::certo('Imagem exclu&iacute;da.');\n\t\t//POG Temporário\n\t\tHTML::Imprime('<script>Abrir(\"#abreImagemGaleria\",\"#imagens\");</script>');\n\t}", "private function removeUploadedFile()\n {\n if(!isset($_REQUEST['file']))\n {\n exit; \n }\n \n list($file, $src, $size) = explode(':', $_REQUEST['file']);\n \n if(file_exists($src))\n {\n @unlink($src);\n }\n exit;\n }", "public function onBeforeDelete(){\n\t\tparent::onBeforeDelete();\n\n\t\tif($this->Images() && $images = $this->Images()){\n\t\t\tforeach($images as $image){\n\t\t\t\tif($image->exists()){\n\t\t\t\t\t$image->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function deleteImage(){\n if(file_exists($this->getImage())){\n unlink($this->getImage());\n }\n $this->setImage(null);\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "function cleanImages()\r\n {\r\n if (!count($this->imagesContent)) return true;\r\n $this->_echo('<br>Очистка не используемых файлов картинок...');\r\n foreach ($this->imagesContent as $file) {\r\n @unlink($this->rootPath.$file);\r\n }\r\n }", "public function DeletePhotos()\n\t{\tforeach ($this->imagesizes as $sizename=>$size)\n\t\t{\t@unlink($this->GetImageFile($sizename));\n\t\t}\n\t}", "public function deleteImage1()\n {\n Storage::delete($this->image1);\n }", "function _delete_photo($file){\n\t\t@unlink('web/upload/'.image_small($file));\n\t\t@unlink('web/upload/'.image_large($file));\n\t}", "public function Remove()\n {\n $file = __DIR__ . \\Extensions\\PHPImageWorkshop\\ImageWorkshop::UPLOAD_PATH . \"/banners/\" . $this->getSrc();\n if (file_exists($file)) {\n unlink($file);\n }\n parent::Remove();\n }", "public function delete_multipleimage() \n {\n \n $fullpath = './assets/uploads/fashion_prod/';\n $bigpath = './assets/uploads/fashion_prod/mainimage/';\n $thumbpath = './assets/uploads/fashion_prod/thumbs/';\n $picture=$_POST[\"key\"];\n \n unlink($fullpath.$picture);\n unlink($bigpath.$picture);\n unlink($thumbpath.$picture);\n $this->db->delete('productimages', array('imagename' => $picture));\n echo true;\n \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function remove_images(Request $request)\n\t{\n\t\tif(isset($request->remove_image)) {\n\t\t\t$images = $request->remove_image;\n\n\t\t\tforeach($images as $image) {\n\t\t\t\t$removeImage = PropertyImages::find($image);\n\n\t\t\t\tif($removeImage->delete()) {\n\t\t\t\t\tStorage::delete($removeImage->path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(isset($request->remove_video)) {\n\t\t\t$videos = $request->remove_video;\n\n\t\t\tforeach($videos as $video) {\n\t\t\t\t$removeVideo = PropertyVideos::find($video);\n\n\t\t\t\tif($removeVideo->delete()) {\n\t\t\t\t\tStorage::delete($removeVideo->path);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn redirect()->back()->with('status', 'Property Media Items Deleted Successfully');\n\t}", "public function handleDeleteImage(){\n\n $session = $this->hlp->sess(\"images\");\n $img = $session->toDelete;\n $listingID = $this->hlp->sess(\"listing\")->listingID;\n $imgs = $this->listings->getListingImages($listingID);\n \n unset($imgs[$img]);\n\n //reindexed array after unset\n $newArray = array();\n \n foreach ($imgs as $image){\n array_push($newArray, $image);\n }\n \n unset($imgs);\n \n //final array - updated - without deleted images to store in db\n $images = serialize($newArray);\n \n $this->listings->updateListingImages($listingID, $images);\n $this->redirect(\"Listings:editListing\", $listingID);\n }", "public function clear_thumbnails() {\n\n $wpp_image = WPP_Image::get_instance();\n\n if ( $wpp_image->can_create_thumbnails() ) {\n\n $wpp_uploads_dir = $wpp_image->get_plugin_uploads_dir();\n\n if ( is_array($wpp_uploads_dir) && !empty($wpp_uploads_dir) ) {\n\n $token = isset( $_POST['token'] ) ? $_POST['token'] : null;\n $key = get_option( \"wpp_rand\" );\n\n if (\n current_user_can( 'manage_options' )\n && ( $token === $key )\n ) {\n\n if ( is_dir( $wpp_uploads_dir['basedir'] ) ) {\n\n $files = glob( \"{$wpp_uploads_dir['basedir']}/*\" ); // get all related images\n\n if ( is_array($files) && !empty($files) ) {\n\n foreach( $files as $file ){ // iterate files\n if ( is_file( $file ) ) {\n @unlink( $file ); // delete file\n }\n }\n\n echo 1;\n\n } else {\n echo 2;\n }\n\n } else {\n echo 3;\n }\n\n } else {\n echo 4;\n }\n\n }\n\n } else {\n echo 3;\n }\n\n wp_die();\n\n }", "public function delete_image_from_storage($image_file_name) {\n\t\t unlink(\"product_images/\".$image_file_name);\n\t }", "public static function clearImages()\n {\n $session = self::getSession();\n unset($session->ids);\n }", "public function delete() {\n\n\t \t if(!unlink($this->directory .'/' . $_FILES[$this->inputName]['name']))\n Log::debug('Upload::delete Failed to delete upload');\n else\n Log::debug('Upload::delete Delete successful');\n\t }", "public function postRemove() {\n if(Request::ajax()) {\n $status = false; // Start status check\n $image_src = Input::get('src');\n $task_id = Input::get('id');\n $type = Input::get('type');\n $tasks = Task::find($task_id);\n $imagePath = public_path($image_src);\n switch($type){\n case 'new_image':\n @unlink($imagePath);\n return Response::json(['success'=>true]);\n\n break;\n\n default: // Old images already saved in DB\n\n if(isset($tasks->image_src)) {\n $new_image_src = json_decode($tasks->image_src,true);\n foreach($new_image_src as $key => $value) {\n\n if($value['path'] == $image_src) { // Matches in db so remove from the set\n unset($new_image_src[$key]); // removes image from array\n // remove image from folder\n @unlink($imagePath);\n // update the db with a new \n $tasks->image_src = json_encode($new_image_src);\n if($tasks->save()){\n return Response::json(['success'=>true]);\n }\n }\n }\n }\n break;\n }\n return Response::json(['success'=>false]);\n }\n }", "public function removeProduct($id){\n ProductCategory::where('product_id', $id)->delete();\n $del = DB::table('imageupload')->where('content_id', $id)->get();\n foreach ($del as $img) {\n $path = public_path().'/uploads/'.$img->path;\n if( file_exists($path) ){\n //File::delete('uploads/'.$img->path);\n unlink($path);\n }\n ImageUpload::find($img->id)->delete();\n }\n Product::find($id)->delete();\n return redirect('admin/products');\n }", "public function actionDeleteimage()\n {\n $this->enableCsrfValidation = false;\n $filename = Yii::$app->request->post('filename');\n $path_name = \"../web/web_mat/temp/\" . $filename;\n if (unlink($path_name)) {\n echo \"success\";\n } else {\n echo \"fail\";\n }\n }", "public function deleteldImage() {\n\n if (!empty($this->oldImg) && $this->oldImg != $this->avatar) {\n $file = Yii::app()->basePath . DIRECTORY_SEPARATOR . \"..\" . DIRECTORY_SEPARATOR;\n $file.= \"uploads\" . DIRECTORY_SEPARATOR . \"user_profile\" . DIRECTORY_SEPARATOR . $this->user->primaryKey . DIRECTORY_SEPARATOR . $this->oldImg;\n\n DTUploadedFile::deleteExistingFile($file);\n }\n }", "private static function toDelete(){\n $filesNotToDelete = [];\n $dir = public_path().'/images/';\n $filesInPublicFolder = scandir($dir);\n\n // izbacivanje assets foldera, .. i .\n $ignoreFiles = ['assets', '.', '..', 'pig.png', 'placeholder.png', 'logo.png', 'index.php'];\n foreach ($ignoreFiles as $toIgnore) {\n if (($key = array_search($toIgnore, $filesInPublicFolder)) !== false) {\n unset($filesInPublicFolder[$key]);\n }\n }\n // dd($filesInPublicFolder);\n $images = [];\n $collectionsOfObjectsWithImages = [Product::all(), ProductGroup::all(), Manufacturer::all(),\n Suggestion::all(), ImageSuggestion::all(), MainAd::all(),SecondAd::all()];\n\n foreach ($collectionsOfObjectsWithImages as $collection) {\n foreach ($collection as $object) {\n if($object->images->count()){\n foreach ($object->images as $image) {\n $images[] = $image->name;\n }\n }\n }\n }\n\n // dd($images);\n // dd(array_diff($filesInPublicFolder, $images));\n // dd($filesNotToDelete, $filesInPublicFolder);\n return $toDelete = array_diff($filesInPublicFolder, $images); //za fju array_dif vazan je redoslijed argumenata\n\n }", "public function delete_image_file()\n {\n if(Image::remove_image($this->image_url))\n {\n $this->image_url = '';\n return true;\n }\n return true; \n }", "function deleteUserImageFiles($username) {\n $target_dir = \"uploads/\" . $username . \"/\";\n\n $files = glob(\"$target_dir/*.*\");\n foreach ($files as $file) {\n unlink($file);\n }\n if (is_dir($target_dir)) {\n rmdir($target_dir);\n }\n}", "public function deleteImages($images){\n if (count($images) > 0) {\n foreach($images as $image) {\n /** @var Image $image */\n $this->em->remove($image);\n $image->onPreRemove();\n $this->em->flush();\n }\n }\n }", "public function delete_unknown_images() {\n global $wpdb;\n $wpdb->query('DELETE FROM `' . $wpdb->prefix . 'bwg_image` WHERE gallery_id=0');\n }", "function tfuse_delete_resized_images( $post_id ) {\r\n $metadata = wp_get_attachment_metadata( $post_id );\r\n if ( !$metadata )\r\n return;\r\n\r\n // Do some bailing if we cannot continue\r\n if ( !isset( $metadata['file'] ) || !isset( $metadata['image_meta']['resized_images'] ) )\r\n return;\r\n $pathinfo = pathinfo( $metadata['file'] );\r\n $resized_images = $metadata['image_meta']['resized_images'];\r\n\r\n // Get Wordpress uploads directory (and bail if it doesn't exist)\r\n $wp_upload_dir = wp_upload_dir();\r\n $upload_dir = $wp_upload_dir['basedir'];\r\n if ( !is_dir( $upload_dir ) )\r\n return;\r\n\r\n // Delete the resized images\r\n foreach ( $resized_images as $dims ) {\r\n\r\n // Get the resized images filename\r\n $file = $upload_dir .'/'. $pathinfo['dirname'] .'/'. $pathinfo['filename'] .'-'. $dims .'.'. $pathinfo['extension'];\r\n\r\n // Delete the resized image\r\n @unlink( $file );\r\n\r\n }\r\n\r\n $remote_uploaded_by_tfuse = get_option('tfuse_remote_images', array());\r\n $image_uri = wp_get_attachment_url($post_id);\r\n $key = array_search($image_uri, $remote_uploaded_by_tfuse);\r\n if($key)\r\n {\r\n unset($remote_uploaded_by_tfuse[$key]);\r\n update_option('tfuse_remote_images', $remote_uploaded_by_tfuse);\r\n }\r\n\r\n\r\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function DeleteNotasImagenes() {\n\t\t\t$this->objNotasImagenes->Delete();\n\t\t}", "public function deleteImage()\n {\n $this->checkImage($this->logo, $this);\n }", "public function deleteAboutImgMultiLocation(){\n\t\t\n\t\t\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$photo = $_POST['photo'];\n\t\t\t//echo $_POST['image_path'];die;\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($photo == 'right_photo'){\n\t\t\t\t$query = $this->db->query(\"update tblaboutschoolheader set right_photo='' where location_id=\".$location_id.\"\");\n\t\t\t}else {\n\t\t\t\t$query = $this->db->query(\"update tblaboutschoolheader set left_photo='' where location_id=\".$location_id.\"\");\n\t\t\t}\n\t\t\tif($query)\n\t\t\t{\t\n\t\t\t\t$dir=pathinfo(BASEPATH);\n\t\t\t\t//print_r($dir) ; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img);\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}", "public function removeImage($image)\n {\n if (file_exists('upload_image/' . $image)) {\n unlink('upload_image/' . $image);\n }\n }", "function deleteimage()\r\n\t{ \t\r\n\t if (isset($_POST['remove']) && $_POST['remove']=='remove selected')\r\n\t {//get the values \r\n \t $id1 = array();\r\n \t $id1 = $_POST['removeid'];\r\n \t $parentid = $_POST['parentid'];\r\n \t if (count($id1) > 0)\r\n \t { //fetch each and every one check box item\r\n \t foreach ($id1 as $id)\r\n \t {\r\n \t \t$this->categeory_model->deleteimage($id);\r\n \t \tunlink('./assets/fun/image'.$id.'.jpg');\r\n \t\t unlink('./assets/fun/thumbnail_'.$id.'.jpg');\r\n \t }\r\n\t }\r\n\t }\r\n\t else{\r\n\t \t\r\n\t\t$id = $this->uri->segment(4);\r\n\t\t$parentid = $this->uri->segment(5);\r\n\t\t$this->categeory_model->deleteimage($id);\r\n\t\tunlink('./assets/fun/image'.$id.'.jpg');\r\n \t unlink('./assets/fun/thumbnail_'.$id.'.jpg');\r\n\t }\r\n\tredirect('admin/categeory/image_view/'.$parentid);\r\n\t}", "protected function deleteOldImage(){\n if(auth()->user()->profileImage){\n Storage::delete('/public/images/'.auth()->user()->profileImage);\n }\n }", "function photo_remove() {\n if ( ! $this->input->is_ajax_request() || ! $this->auth->is_login()) {\n return redirect(config_item('site_url'));\n }\n \n $item = filter($this->uri->segment(3), 'str', 40);\n $photo = $this->media->get_by_id($item);\n \n if ( ! $photo || empty($photo)) {\n log_write(LOG_WARNING, 'Photo not found, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n \n if ($photo->item_author != $this->auth->get_user_id()) {\n log_write(LOG_ERR, 'User is not the author of the photo, ID: ' . $item . ', USER: ' . $this->auth->get_user_id(), __METHOD__);\n return $this->output->set_output(json_encode(array(\n 'code' => 'error'\n )));\n }\n\n $image = explode('.', $photo->item_filename);\n\n unlink(FCPATH . '/uploads/' . $photo->item_point . '/' . $image[0] . '_thumb.' . $image[1]);\n unlink(FCPATH . '/uploads/' . $photo->item_point . '/' . $image[0] . '.' . $image[1]);\n\n $this->media->remove($item);\n \n return $this->output->set_output(json_encode(array(\n 'code' => 'luck'\n )));\n }", "public function postRemoveTmpImages() {\n if (Request::ajax()) {\n $images = Input::get('images');\n $this->removeImages($images);\n\n return Response::json($images);\n }\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "public function delete_related_images($column_name = 'image',$folder) {\n\t\t$image_name = $this->getOriginal($column_name);\n\t\t// if we don't have previous image then no need to delete it.\n\t\tif ( ! is_null($image_name) && file_exists($this->upload_path .$folder.'/modified/'.$image_name)) {\n\t\t\t$image_path = $this->upload_path .$folder.'/modified/'.$image_name;\n\n\t\t\t$img = Image::make($image_path);\n\t\t\t$mask = $img->filename . '*.*';\n\n\t\t\tarray_map('delete_if_exists', glob(public_path('uploads/'.$folder.'/modified/' . $mask)));\n\t\t}\n\t}", "function cleanTrash() {\n\t\t$result = $this->select(\"logo_url\", \"status=2\");\n\t\tif ($result)\n\t\tforeach ($result as $image){\n\t\t\tunlink(ROOT_PATH.\"gallery/avatar_upload/flash/storage/\".$image['logo_url']);\n\t\t}\n\t\t$results = $this->delete(\"status=2\");\n\t\tif ($results)\n\t\t\treturn 1;\n\t\treturn 0;\n\t}", "public function deleteImage($event)\n {\n $this->unlinkFiles($event->sender->{$this->attribute});\n }", "public function actionDeletepimage()\n\t{\n\t $sessionimagesarr = array();\n\t if($_POST['type']=='1'){\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'.$_POST['path']);\n\t\t $thumbpath = str_replace(basename($_POST['path']), 'thumb/'.basename($_POST['path']),$_POST['path']);\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'. $thumbpath);\n\t\t }else{\n\t\t $images = Images::model()->findByPK($_POST['path']);\n\t\t @unlink( Yii::getPathOfAlias('webroot').'/'.$images->image_path );\n\t\t $thumbpath = str_replace(basename($images->image_path), 'thumb/'.basename($images->image_path),$images->image_path);\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'. $thumbpath);\n\t\t $images->delete();\n\t\t }\n\t \n\t\t echo 'Deleted';\n\t\t die;\n\t}", "function remove_image($image_id)\n\t{\n\t\t// global variables from config/db_config.php\n\t\tglobal $idea_db;\n\t\tglobal $images_db_table;\n\t\tglobal $db_hostname;\n\t\tglobal $db_user;\n\t\tglobal $db_password;\n\n\t\t// get the image's name to remove from file system\n\t\t$image = get_image($image_id);\n\n\t\t// construct query\n\t\t$query = \"DELETE FROM images WHERE images . id='$image_id'\";\n\n\t\t//send query\n\t\tif (send_query($query,$db_hostname,$db_user,$db_password,$idea_db))\n\t\t{\n\t\t\t// remove from file system\n\t\t\tunlink($image);\n\t\t} else {\n\t\t\t// TODO: Error occured with removing image. Redirect Appropriately.\n\t\t\t// debug\n\t\t\techo \"<h1> Image Not Deleted </h1>\";\n\t\t}\n\t}", "function delImage($filename)\n\t{\n\t\t// TODO: Retrieve different pictures from root model\t\t\n\t\tif(is_file(WWW_ROOT . \"img/thumbnails/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/thumbnails/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/medium/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/medium/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/large/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/large/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/original/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/original/\" . $filename);\n\t\t}\n\t\treturn true;\n\t}", "protected function tidyUpFiles() {\n\t\t/* load valid ids */\n\t\t$validIds = array();\n\t\t$result = $this->db->query('SELECT id FROM image');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_NUM)) {\n\t\t\t\t$validIds[] = $entry[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* remove entries with missing file */\n\t\tforeach ($validIds as $id) {\n\t\t\tif (!is_file(self::getPath($id))) {\n\t\t\t\t$this->delete($id);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* delete from list what is not in the database */\n\t\tif ($dh = opendir(self::FILES_DIR)) {\n\t\t\twhile (($id = readdir($dh)) !== false) {\n\t\t\t\tif (preg_match('#^[0-9a-zA-Z]+$#', $id) && !in_array($id, $validIds) && $id != self::DATABASE_FILE) {\n\t\t\t\t\t$this->delete($id);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t}\n\t}", "function remove() {\n\n\t\t$this->readychk();\n\n\t\t// Remove slide from its queue.\n\t\t$queue = $this->get_queue();\n\t\t$queue->remove_slide($this);\n\t\t$queue->write();\n\n\t\t// Remove slide data files.\n\t\tif (!empty($this->dir_path)) {\n\t\t\trmdir_recursive($this->dir_path);\n\t\t}\n\t}", "public function removeRegisteredFiles() {}", "public function actionDelImg(){\n $img_id = Yii::$app->request->post('img_id');\n $model_id = Yii::$app->request->post('model_id');\n\n $docModel = Product::find()\n ->where([\n 'id' => $model_id\n ])\n ->limit(1)\n ->one();\n $img = $docModel->getImageById($img_id);\n $docModel->removeImageNoDel($img);\n }", "public function file_cleanup(){\n\t\t$query = $this->db->get('carousels');\n\t\t$map = directory_map('./carousel/', 1);\n\t\t$g = \"x\";\n\t\tforeach($map as $file)\n\t\t{\n\t\t\t\t\t\t\t\n\t\t\t//return $query->result();\n\t\t\t$g = $g . \"--\";\n\t\t\t$x = 0;\n\t\t\t$soundfile=\"\";\n\t\t\tforeach($query->result() as $row){\n\t\t\t\t//return $row;\n\t\t\t\t$picture = $row->image;\n\t\t\t\t$g = $g . \"<\" . $soundfile . \"-\" . $file . \">\";\n\t\t\t\tif ($file==$picture)\t{\n\t\t\t\t\t$g = $g . \"files are the same\";\n\t\t\t\t\t$x++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($x==0 )\n\t\t\t{\n\t\t\t \t$g = $g . \"we're in the loop\";\n\t\t\t\tunlink(\"./carousel/\" . $file);\n\t\t\t\t\t$g = $g . \" removed: \" . \"./carousel/\" . $file . \" - \";\n\t\t\t\t\n\t\t\t}\n\t\t\tif (strlen($g) > 700)\n \t\t\t\t$g = substr($g, 0, 700);\n\t\t}\n\t\t//return $g;\n\t\t//$this->session->set_flashdata('carousel_saved', $file . \"--\" . $soundfile );\n\t}", "public function actionDelete()\n {\n if (Yii::$app->user->can('imagedelete')) {\n if (Yii::$app->request->isAjax) {\n $system = new Filesystem();\n $param = Yii::$app->request->post();\n $model = $this->findModel($param['id']);\n $system->remove($this->original . $model->unique_name);\n $system->remove($this->thumb_145x145 . $model->unique_name);\n $system->remove($this->thumb_original . $model->unique_name);\n $system->remove($this->thumb_191x128 . $model->unique_name);\n $model->delete();\n }\n } else {\n throw new HttpException(403, 'You are not allowed to access this page', 0);\n }\n }", "public function deleteImage($image_path,$file_name)\n {\n if($file_name!=\"\"){\n unlink($image_path.$file_name);\n unlink($image_path.'thumbnails/small/'.$file_name);\n unlink($image_path.'thumbnails/medium/'.$file_name);\n unlink($image_path.'thumbnails/large/'.$file_name);\n }\n }", "function delete_logoimage() \n {\n \n $fullpath = './assets/uploads/fashion_prod/';\n $thumbpath = './assets/uploads/fashion_prod/thumbs/';\n $picture=$_POST[\"r_logoimage\"];\n \n unlink($fullpath.$picture);\n unlink($thumbpath.$picture);\n $this->db->delete('productimages', array('imagename' => $picture));\n echo true;\n \n }", "function delete_image($imageId) {\n\t\t\tglobal $wpdb;\n\t\t\t$sql = \"select `filename` from `\".$this->table_img_name.\"` where `id` = '\".$imageId.\"'\";\n\t\t\t$img = $wpdb->get_row($sql, ARRAY_A, 0);\n\n\t\t\t$sql = \"delete from `\".$this->table_img_name.\"` where `id` = '\".$imageId.\"'\";\n\t\t\t$wpdb->query($sql);\n\n\t\t\t$page = $this->plugin_path.$this->images_dir.\"/\".$img['filename'];\n\n\t\t\t@unlink( $page );\n\n\t\t\t$fileExt = split( \"\\.\", $img['filename'] );\n\t\t\tif( $fileExt[1] != \"swf\" ) \n\t\t\t\t{\n\t\t\t\t\t $thumb = $this->plugin_path.$this->images_dir.\"/thumb_\".$img['filename'];\n\t\t\t\t\t @unlink( $thumb );\n\t\t\t\t}\n\t\t}", "public function delImg($item_id, $imgfile)\n {\n $this->db->update(array('id'=>$item_id), array('$pull'=>array('imgs'=>$imgfile)));\n \n // if this img is defimg, remove it, and replace with next img if still exists\n if ( $this->db->getOne(array('id'=>$item_id, 'defimg'=>$imgfile)) )\n {\n $defimg = ( $imgs = $this->db->getOne(array('id'=>$item_id, array('imgs'))) ) ? $imgs[0] : null;\n $this->db->update(array('id'=>$item_id), array('defimg'=>null));\n }\n }", "public function removeimage(Request $req){\n\t$s = checksession();\n if(!$s){\n return view('login');\n }\n $sessionid = Session::getId();\n $session = DB::table('sessions')->where('sessionid', $sessionid)->first();\n $userid = $session->userid;\n\t$inputuserid = $req->input(\"userid\");\n\tif($userid != $inputuserid){\n\t $response = Response::make(\"The session seems to be corrupt. The image could not be removed due to this issue.\", 200);\n $response->header(\"Content-Type\", \"Text/Plain\");\n return $response;\n\t}\n\t$imagefilename = $req->input(\"imagefilename\");\n\t$user = DB::table('users')->where('id', $userid)->first();\n\t$username = $user->username;\n $imagepath = \"/var/www/html/imageweb/storage/users/\".$username.\"/\".$imagefilename;\n\t# Delete records from DB tables first.\n\t$imgobj = DB::table('images')->where([ ['imagepath', '=', $imagepath] ])->first();\n\t$imgid = $imgobj->id;\n\tDB::table('images')->where('id', $imgid)->update(array('removed' => 1));\n\t$removedpath = \"/var/www/html/imageweb/storage/removed/\".$username;\n\tif(!file_exists($removedpath)){\n mkdir($removedpath, 0777, true);\n }\n\t// Find all files related to the selected image\n\t$imagepathparts = explode(\".\", $imagepath);\n\t$userpath = \"/var/www/html/imageweb/storage/users/\".$username;\n\t$lowresimage = $imagepathparts[0].\"_lowres.\".$imagepathparts[1];\n\t$iconimage = $imagepathparts[0].\"_ico.\".$imagepathparts[1];\n\t$imagefilenameparts = explode(\".\", $imagefilename);\n\t$newlowresfilename = $imagefilenameparts[0].\"_lowres.\".$imagefilenameparts[1];\n\t$newiconfilename = $imagefilenameparts[0].\"_ico.\".$imagefilenameparts[1];\n\t$newimagefilepath = $removedpath.\"/\".$imagefilename;\n\t$newlowresfilepath = $removedpath.\"/\".$newlowresfilename;\n\t$newiconfilepath = $removedpath.\"/\".$newiconfilename;\n\trename($imagepath, $newimagefilepath);\n\trename($lowresimage, $newlowresfilepath);\n\trename($iconimage, $newiconfilepath);\n\t$response = Response::make(\"Deleted the selected image successfully\", 200);\n\t$response->header(\"Content-Type\", \"Text/Plain\");\n return $response;\n }", "public function destroy(ImageUploads $imageUploads)\n {\n //\n }", "public function deleteImage() {\n $file = $this->getImageFile();\n \n // check if file exists on server\n if (empty($file) || !file_exists($file)) {\n return false;\n }\n \n // check if uploaded file can be deleted on server\n if (!unlink($file)) {\n return false;\n }\n \n // if deletion successful, reset your file attributes\n $this->imagen = null;\n $this->file = null;\n \n return true;\n }", "public function deleteUnusedImages()\n {\n $names = app(ExportHelpCenterImages::class)->execute();\n\n $files = Storage::disk('public')->files('article-images');\n $toDelete = array_diff($files, $names->toArray());\n\n return Storage::disk('public')->delete($toDelete);\n }", "public function clearRespizrImageCache()\n {\n $mediaPath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA);\n $resizedDirPath = $mediaPath . DS\n . Mage::getSingleton('respizr/config')->getRespizrDirName();\n\n if (is_dir($resizedDirPath)) {\n $io = new Varien_Io_File();\n $io->rmdir($resizedDirPath, true);\n }\n }", "private function _removePictureStorage($pictures)\n {\n foreach ($pictures as $picture) {\n // http://127.0.0.1:8000/storage/assets/product/\n $directory = \"/storage/assets/product/\";\n $url = url('') . $directory;\n $filename = str_replace($url, '', $picture->filepath);\n\n if (file_exists(public_path($directory . $filename))) {\n unlink(storage_path('app/public/assets/product/' . $filename));\n }\n }\n }", "public function pre_delete()\r\n\t{\r\n\t\tparent::pre_delete();\r\n\t\t$Change = App::make('Change');\r\n\t\t$Change::where('fmodel', 'GalleryItem')\r\n\t\t\t ->where('fid', $this->id)\r\n\t\t\t ->delete();\r\n\t\t\t \r\n\t\t// Thumbs\r\n\t\t/*if($this->file) {\r\n\t\t\t# Should really check if these are used anywhere else, but no easy way to do that in other modules yet so just leaving them for now\r\n\t\t\t\r\n\t\t\t// Name\r\n\t\t\t$name = basename(public_path().$this->file);\r\n\t\t\t\r\n\t\t\t// Thumbs\r\n\t\t\t$thumbs = Config::get('galleries::thumbs');\r\n\t\t\tforeach($thumbs as $k => $v) {\r\n\t\t\t\tif(file_exists(public_path().$v['path'].$name)) unlink(public_path().$v['path'].$name);\r\n\t\t\t}\r\n\t\t}*/\r\n\t}", "public function delete()\n\t{\n\t\tforeach( \\IPS\\Db::i()->select( '*', 'form_fields', array( 'field_type=?', 'Upload' ) ) AS $field )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tforeach( \\IPS\\Db::i()->select( '*', 'form_values', array( \"value_value<>? OR value_value IS NOT NULL\", '' ) ) as $cfield )\n\t\t\t\t{\n\t\t\t\t\t\\IPS\\File::get( 'core_FileField', $cfield[ 'value_value' ] )->delete();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch( \\Exception $e ){}\n\t\t}\n\t}", "public function deleteImage($path)\n {\n // $file_name = end($file);\n File::delete(public_path($path));\n // File::delete($file_name);\n }", "public function destroyimage($id) {\n $delete = ProductsGallary::find($id);\n if(!empty($delete->media) and file_exists(public_path().'/upload/products/'.$delete->media))\n {\n unlink(public_path().'/upload/products/'.$delete->media);\n }\n $delete->delete();\n session()->flash('success',trans('admin.deleted'));\n return back();\n }", "public function supprimerImageMorphoAction()\n\t{\n\t\t$id_cons = $this->params()->fromPost('id_cons');\n\t\t$id = $this->params()->fromPost('id'); //numero de l'image dans le diapo\n\t\t$typeExamen = $this->params()->fromPost('typeExamen');\n\t\n\t\t/**\n\t\t * RECUPERATION DE TOUS LES RESULTATS DES EXAMENS MORPHOLOGIQUES\n\t\t*/\n\t\t $result = $this->demandeExamensTable()->recupererDonneesExamenMorpho($id_cons, $id, $typeExamen);\n\t\t/**\n\t\t * SUPPRESSION PHYSIQUE DE L'IMAGE\n\t\t*/\n\t\t unlink ( 'C:\\wamp\\www\\simens\\public\\images\\images\\\\' . $result['NomImage'] . '.jpg' );\n\t\t/**\n\t\t * SUPPRESSION DE L'IMAGE DANS LA BASE\n\t\t*/\n\t\t $this->demandeExamensTable()->supprimerImage($result['IdImage']);\n\t\n\t\t$this->getResponse()->getHeaders ()->addHeaderLine ( 'Content-Type', 'application/html' );\n\t\treturn $this->getResponse ()->setContent(Json::encode ());\n\t}", "public function afterDelete($event)\n {\n\n\n $imagesList = $this->owner->attachments;\n //die(print_r($imagesList));\n if (!empty($imagesList)) {\n foreach ($imagesList as $image) {\n\n\n $alias = $this->attachmentAttributes['path'];\n\n\n // Delete file\n if (file_exists(Yii::getPathOfAlias(\"webroot.uploads.{$alias}\") . '/' . $image->name))\n unlink(Yii::getPathOfAlias(\"webroot.uploads.{$alias}\") . '/' . $image->name);\n\n if (file_exists(Yii::getPathOfAlias(\"webroot.assets.{$alias}\"))) {\n $listfile = CFileHelper::findFiles(Yii::getPathOfAlias(\"webroot.assets.{$alias}\"), array(\n 'absolutePaths' => true\n ));\n foreach ($listfile as $path) {\n if (strpos($path, $image->name) !== false) {\n if (file_exists($path)) {\n unlink($path);\n }\n }\n }\n }\n if ($image->is_main) {\n // Get first image and set it as main\n $model = AttachmentModel::model()->find();\n if ($model) {\n $model->is_main = 1;\n $model->save(false, false, false);\n }\n }\n\n $image->delete();\n }\n }\n return parent::afterDelete($event);\n }", "function media_cleanup() { \r\n global $media;\r\n global $avatars;\r\n global $photoalbumsmedia;\r\n \r\n $query1 = \"SELECT `media_id` , `media_userid` FROM `$media`s;\";\r\n $sqlr1 = bcsql_query( $query1 );\r\n $mediaids = bcsql_fetch_array( $sqlr1 );\r\n $num_rows1 = bcsql_num_rows( $mediaids );\r\n for( $i = 0; $i<$num_rows1; $i++ ) {\r\n $thismedia = $mediaids[ $i ];\r\n $thismediaid = $thismedia[ \"media_id\" ];\r\n $mediaclass = New media( $thismediaid );\r\n $userid = $mediaclass->userid();\r\n $userfile = $uploaddir . $userid .\"/\". $thismediaid;\r\n if( !file_exists( $userfile ) ) {\r\n $sql = \"DELETE FROM `$media` WHERE `media_id` = '$thismediaid';\"; \r\n bcsql_query( $sql );\r\n $sql = \"DELETE FROM `$avatars` WHERE `avatar_mediaid` = '$thismediaid';\";\r\n bcsql_query( $sql );\r\n $sql = \"DELETE FROM `$photoalbumsmedia` WHERE `pamedia_mediaid` = '$thismediaid';\";\r\n bcsql_query( $sql );\r\n }\r\n }\r\n //the oposite thing remains to be done\r\n }", "public function destroy($id)\n {\n // $images=LookbookCategoryController::where('lookbook_category_id',$id)->get();\n // foreach ($images as $img) {\n // unlink(public_path('/img/uploads/'.$img->img));\n // }\n // LookbookCategoryController::find($id)->delete();\n }", "public function remove_added_files() {\r\n\t\t\t$this->Files_ready = array();\r\n\t\t\t$this->Files_valid = array();\r\n\t\t\t$this->Files_invalid = array();\r\n\t\t\t$this->Files_ready_count = 0;\r\n\t\t\t$this->Files_valid_count = 0;\r\n\t\t\t$this->Files_invalid_count = 0;\r\n\t\t}", "public function deletePicture($id){\n $picName = null;\n $images = new Images();\n $dataPic = $images->get_image($id);\n foreach ($dataPic as $key => $value) {\n $picName = $value->img_url;\n }\n $checkFile = file_exists(public_path() . '/' . $picName);\n if ($checkFile){\n unlink(public_path() . '/' . $picName);\n }\n }", "public function removeImage(Request $request){\n\n \ttry{\n\t $folderName=$request->model_name;\n\t $fileName = $request->file_name;\n\t $file = \\Storage::disk('local')->path('public/'.$fileName);\n if(is_file($file))\n\t unlink($file);\n\t \n\t $response['result'] = 'success';\n\t return response()->json($response);\n\n \t}catch(\\Exception $exception){\n \t\t$response['result'] = 'failure';\n\t return response()->json($response);\t\n \t}\n }", "public function product_image_remove($data)\n {\n \n\n $imageid = $data['imagekey'];\n $image_path = $data['image_path'];\n $product_id = $data['product_id'];\n\n $query = \"DELETE\n FROM \" . $this->db_table_prefix . \"images WHERE id = $imageid\";\n \n $result = $this->commonDatabaseAction($query);\n\n\n\n// if (@mysql_affected_rows($result) > 0)\n if ($result > 0)\n {\n\n $query2 = \"SELECT image_path FROM \" . $this->db_table_prefix. \"products where id = '\" . $product_id . \"'\";\n $result2 = $this->commonDatabaseAction($query2);\n $prArray = $this->resultArray($result2);\n \n if(trim($prArray[0]['image_path']) == trim($image_path))\n {\n\n $query3 = \"SELECT image_path FROM \" . $this->db_table_prefix. \"images where product_id = '\" . $product_id . \"' order by id DESC\";\n $result3 = $this->commonDatabaseAction($query3);\n $imgArray = $this->resultArray($result3);\n /*print_r(count($imgArray[0])); \n exit;*/\n if(count($imgArray[0])==1)\n { \n $query4= \"UPDATE \" . $this->db_table_prefix . \"products set image_path = '\".$imgArray[0]['image_path'].\"'WHERE id = $product_id\";\n $result4 = $this->commonDatabaseAction($query4);\n }\n else\n {\n $query5= \"UPDATE \" . $this->db_table_prefix . \"products set image_path = '' WHERE id = $product_id\";\n $result5 = $this->commonDatabaseAction($query5);\n }\n\n }\n\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "function unsetImage($uid,$table,$data,$path) {\n\t\n\t $this->db->select($data);\n $this->db->from($table);\n\t\t$this->db->where('uid',$uid);\n $query=$this->db->get();\t\t\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t $query=$query->result();\n\t\t $img=$query[0]->$data;\n @unlink($path.$img);\n\t\t}\t\n return true;\t\t\n\t}", "public function getDelete()\n {\n $name_to_delete = $this->getRequest('items');\n\n $file_to_delete = $this->getWorkingDir() . '/' . $name_to_delete ;\n $thumb_to_delete = $this->getWorkingDir() . '/'.config('lfm.thumb_folder_name').'/' . $name_to_delete ;\n\n\n event(new ImageIsDeleting($file_to_delete));\n\n if (is_null($name_to_delete)) {\n return $this->error('folder-name');\n }\n\n if (!Storage::disk('s3')->exists($file_to_delete)) {\n return $this->error('folder-not-found', ['folder' => $file_to_delete]);\n }\n\n $is_directoty = File::isDirectory($file_to_delete);\n Storage::deleteDirectory($file_to_delete);\n\n if (!Storage::disk('s3')->exists($file_to_delete)) {\n return $this->success_response;\n }\n\n Storage::delete($file_to_delete);\n if (Storage::disk('s3')->exists($thumb_to_delete)) {\n Storage::delete($thumb_to_delete);\n }\n\n foreach(config('lfm.resize_folder') as $width){\n $resize_file = $this->getWorkingDir() . '/' . $width .'/' . $name_to_delete ;\n if (Storage::disk('s3')->exists($resize_file)) {\n Storage::delete($resize_file);\n }\n }\n\n event(new ImageWasDeleted($file_to_delete));\n\n return $this->success_response;\n }", "public function deleteImage($image){\n /** @var Image $image */\n $this->em->remove($image);\n $image->onPreRemove();\n $this->em->flush();\n }", "public function destroy_photo($id)\n {\n //\n if(File::exists(public_path('files/products_img/'.Photo::find($id)->name)))\n {\n File::delete(public_path('files/products_img/'.Photo::find($id)->name));\n Photo::find($id)->delete();\n return redirect()->back();\n }\n }", "public function galeriaExcluir_action()\n\t{\n\t\t$bd = new GaleriasImagens_Model();\n\t\t$id = abs((int) $this->getParam(3));\n\t\t$resultado = $bd->read(\"galeria={$id} AND usuario={$this->_usuario}\");\n\t\tforeach($resultado as $dados){\n\t\t\tunlink('uploads/img_'.$dados['imagem']);\n\t\t\tunlink('uploads/tb_'.$dados['imagem']);\n\t\t\tunlink('uploads/destaque_'.$dados['imagem']);\n\t\t}\n\t\t$bd->delete(\"galeria={$id} AND usuario={$this->_usuario}\");\n\t\t\n\t\t$bd = new Galerias_Model();\n\t\t$bd->delete(\"id={$id} AND usuario={$this->_usuario}\");\n\t\t\n\t\tHTML::certo('Galeria exclu&iacute;da.');\n\t\t//POG Temporário\n\t\tHTML::Imprime('<script>Abrir(\"#abreGaleriasListar\",\"#galerias\");</script>');\n\t}", "protected function removeGenomeUploads() {\n // Retrieves genome uploads main folder (before users' folders)\n $rootDir = new Folder($this->GenomeUpload->getUploadPath(''), false);\n\n // Checks if folder exists\n if(!$rootDir->Path) {\n $this->error('no-uploads-root', 'Uploads root folder has not been found');\n }\n\n // Loops users' folders\n foreach($rootDir->find() as $userId) {\n // Instances folder\n $userDir = new Folder($rootDir->pwd() . DS . $userId, false);\n // Checks if folder exists\n if($userDir->path) {\n // Searches user\n $user = $this->findUser($userId);\n // Case folder is not bound to any user\n if(!$user) {\n // Removes folder\n $userDir->remove();\n }\n // Case folder ha an user bound to istelf\n else {\n // Makes a list of files which should be stored into current user's directory\n $uploads = array();\n foreach($user['configs'] as $config) {\n $uploads = array_merge($uploads, $config['uploads']);\n }\n\n // Lists files into directory\n $files = $userDir->find();\n // Loops every file\n foreach($files as $file) {\n // Checks if name is present into uploads array\n if (!isset($uploads[$file]) || !$uploads[$file]) {\n $file = new File($userDir->pwd() . DS . $file, false);\n $file->delete();\n }\n }\n }\n }\n }\n }", "private function cleanupFiles() {\n\t\t$this -> loadModel('Archivo');\n\t\t$items = $this -> Archivo -> find('all');\n\t\t$db_files = array();\n\t\tforeach ($items as $key => $item) {\n\t\t\t$db_files[] = $item['Archivo']['ruta'];\n\t\t}\n\t\t$dir_files = array();\n\t\t$dir_path = APP . 'webroot/files/uploads/solicitudesTitulacion';\n\t\tif ($handle = opendir($dir_path)) {\n\t\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\t\tif ($entry != 'empty' && is_file($dir_path . DS . $entry))\n\t\t\t\t\t$dir_files[] = 'files/uploads/solicitudesTitulacion/' . $entry;\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\tforeach ($dir_files as $file) {\n\t\t\tif (!in_array($file, $db_files)) {\n\t\t\t\t$file = explode('/', $file);\n\t\t\t\t$file = $file[count($file) - 1];\n\t\t\t\t$tmp_file_path = $dir_path . DS . $file;\n\t\t\t\tunlink($tmp_file_path);\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.79675156", "0.78796256", "0.77181107", "0.76629716", "0.76242584", "0.75260824", "0.75230443", "0.750297", "0.74999183", "0.74731976", "0.7470765", "0.7451296", "0.74005854", "0.7368245", "0.7366393", "0.735528", "0.735394", "0.7333979", "0.72689027", "0.7230916", "0.7208647", "0.71845025", "0.71792316", "0.7160044", "0.7156852", "0.71535105", "0.71448356", "0.71366185", "0.7119219", "0.71101063", "0.70805365", "0.70543563", "0.70508784", "0.70307493", "0.7027004", "0.702387", "0.7000339", "0.69972306", "0.6982886", "0.6964448", "0.6954168", "0.69486487", "0.6935181", "0.6922694", "0.68761927", "0.6854568", "0.68500227", "0.68487024", "0.6848342", "0.6822487", "0.68181205", "0.68044436", "0.6791981", "0.6791974", "0.6789785", "0.6789028", "0.67884475", "0.67864347", "0.67861044", "0.6781221", "0.6777496", "0.67741823", "0.676718", "0.6766104", "0.67614347", "0.6751901", "0.6741413", "0.6733721", "0.67285335", "0.6712601", "0.6701004", "0.6699624", "0.66866904", "0.6682371", "0.6676745", "0.6674006", "0.6672764", "0.6664718", "0.6659244", "0.665702", "0.6652779", "0.6623923", "0.6614539", "0.6613661", "0.6610026", "0.66097754", "0.66080487", "0.65980077", "0.659611", "0.6578757", "0.65773547", "0.6576972", "0.6575602", "0.6575063", "0.6559231", "0.65580714", "0.6556533", "0.6556222", "0.6553829", "0.65528435", "0.65504795" ]
0.0
-1
Function returns node string ready for insertion into database. If parameters are null or '', returns empty string (possibly delimited)
function new_node_str($flag = '', $parent_pos = null, $keys = null, $values_pos = null, $children_pos = null) { $empty_str = str_repeat(Database::$empty_char, $this->pos_len); $flag_str = $flag ? $flag : str_repeat(Database::$empty_char, $this->n_format['flag']['length']); $parent_pos_str = $parent_pos ? str_pad($parent_pos, $this->pos_len, Database::$empty_char, STR_PAD_LEFT) : $empty_str; $keys_str = $this->get_property_pos_str($keys, $this->t * 2 - 1); $values_pos_str = $this->get_property_pos_str($values_pos, $this->t * 2 - 1); $children_pos_str = $this->get_property_pos_str($children_pos, $this->t * 2); if ($this->is_delimited) { $d = $this->delimiter; return $flag_str . $d . $parent_pos_str . $d . $keys_str . $d . $values_pos_str . $d . $children_pos_str . "\n"; } else { return $flag_str . $parent_pos_str . $keys_str . $values_pos_str . $children_pos_str . "\n"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function to_str() {\n $smt=\"INSERT \\n\"\n //\n //Get the root of the sql \n . \"INTO {$this->root->fromexp()}\\n\"\n //The values\n . \"{$this->str_values()}\\n\"\n //\n //The joins if any because some insert may have sqls as their root\n .\"{$this->joins->to_str()}\" \n \n \n ;\n //\n //Return the sql statement that inserts \n return $smt;\n }", "public function insert() : string\n {\n if (empty($this->newProperties)) {\n $this->fillProperties();\n }\n\n $params = [];\n $columns = [];\n\n foreach ($this->newProperties as $key => $value) {\n if ($key === 'id') {\n continue;\n }\n\n $params[\":{$key}\"] = $value;\n $columns[] = \"`{$key}`\";\n }\n\n $columns = implode(', ', $columns);\n $placeholders = implode(', ', array_keys($params));\n $tableName = static::getTableName();\n\n $sql = sprintf(\n \"INSERT INTO `%s` (%s) VALUES (%s)\",\n $tableName,\n $columns,\n $placeholders\n );\n\n $stmt = static::getConn()->prepare($sql);\n $stmt->execute($params);\n\n $info = $stmt->errorInfo();\n if ($info[0] !== \\PDO::ERR_NONE) {\n die('We have : ' . $info[2]);\n }\n\n return static::getLastInsertId();\n }", "public function build($statement, ...$params) : PlainNode\n\t{\n\t\tif (!($statement instanceof Node)) {\n\t\t\tif (strpos($statement, '{') !== false) {\n\t\t\t\t$statement = $this->prepare($statement);\n\t\t\t} else {\n\t\t\t\t$statement = new PlainNode($statement);\n\t\t\t}\n\t\t}\n\t\treturn $this->formatter->format($statement, $params, [$this->link, 'real_escape_string']);\n\t}", "private function newNode($params=null) \n {\n $id=$this->storage->newId();\n $node=new DataNode($this,$id,$this->untypedNode);\n if (is_array($params)) {\n foreach ($params as $k=>$v) {\n $node->set($k,$v);\n }\n }\n return $node;\n }", "public function createString($entity)\n {\n if (is_string($entity)) {\n return $entity;\n }\n\n if ($entity instanceof Node) {\n $string = $this->getPrettyPrinter()->prettyPrint([$entity]);\n\n if (!($entity instanceof Use_)) {\n // Single nodes don't get trailling ;s\n if (substr($string, -1) === ';') {\n $string = substr($string, 0, -1);\n }\n } else {\n $string .= PHP_EOL;\n }\n\n return $string;\n }\n\n if (is_array($entity)) {\n // Sets of node haves a trailing newline\n $string = $this->getPrettyPrinter()->prettyPrint($entity);\n $string .= \"\\n\";\n return $string;\n }\n\n throw new \\InvalidArgumentException('createString must be passed a string, Node, or array of Nodes');\n }", "private function getNodeToStringConverter(): callable\n {\n return function (...$nodes) {\n $value = '';\n foreach ($nodes as $node) {\n if (is_scalar($node)) {\n $value .= $node;\n } else {\n $value .= $node->getValue();\n }\n }\n\n return $value;\n };\n }", "function insertparen($inparms){ \n if ($this->selectedNode >= 0) {\n if ($inparms['ptype'] == 'open') {\n $this->_query->insert(new queryElement('(', 'p'), $this->selectedNode);\n if ($this->selectedOperator > $this->selectedNode) {\n $this->selectedOperator++;\n }\n $this->selectedNode++;\n } else {\n $this->_query->insert(new queryElement(')', 'p'), $this->selectedNode+1);\n if ($this->selectedOperator > $this->selectedNode) {\n $this->selectedOperator++;\n } \n }\n }\n\n return $this->output(NULL);\n }", "private function getInsertString($data, $table) {\n $attr = '';\n $values = '';\n\n foreach ($data as $key => $val) {\n if ($val instanceof \\DateTime) {\n $val = $val->format('Y-m-d H:i:s');\n }\n if ($attr == '' && $values == '') {\n $attr .= $key;\n $values .= \"'\" . trim(addslashes(htmlspecialchars($val))) . \"'\";\n } else {\n $attr .= \", \" . $key;\n $values .= \", '\" . trim(addslashes(htmlspecialchars($val))) . \"'\";\n }\n }\n return \"INSERT INTO \" . $table . \" (\" . $attr . \") VALUES (\" . $values . \");\";\n }", "function encodeNode($data, $as) {\n $result = \"<$as>\";\n\n if(is_foreachable($data)) {\n $has_numeric = false;\n foreach($data as $k => $v) {\n if(is_numeric($k)) {\n $has_numeric = true;\n break;\n } // if\n } // if\n\n $singular = null;\n if($has_numeric) {\n $singular = Inflector::singularize($as);\n } // if\n\n foreach($data as $k => $v) {\n if(is_numeric($k)) {\n $k = $singular;\n } // if\n $result .= $this->encodeNode($v, $k);\n } // if\n } else {\n if(is_int($data) || is_float($data)) {\n $result .= $data;\n } elseif(is_array($data)) {\n $result .= '';\n } elseif(instance_of($data, 'DateValue')) {\n $result .= $data->toMySQL();\n } elseif(is_null($data)) {\n $result .= '';\n } elseif(is_bool($data)) {\n $result .= $data ? '1' : '0';\n } else {\n $result .= '<![CDATA[' . $data . \"]]>\";\n } // if\n } // if\n\n return $result . \"</$as>\\n\";\n }", "function addNode($nodename, $nodeaddress) {\n\t$query = sprintf(\"INSERT INTO Nodes VALUES('%s','%s')\",\n\t\tmysql_real_escape_string($nodename),\n\t\tmysql_real_escape_string($nodeaddress)\n\t);\n\t\n\tdb_query($query);\n}", "function addNode($inparms){\n if ($this->_query->sizeof()) {\n $this->_query->append(new queryElement($_SESSION['global_currentOperator'], 'o'));\n }\n $this->_query->append(new queryNode($inparms['title'],$inparms['id']));\n\n return $this->output(NULL);\n }", "public static function createInsertUrl($getParams = null): ?string;", "function prepare_insert($data = []){\n // if there is no data to set, then return an empty string\n if($data == []){\n return '';\n }\n $set_sql = $this->create_set($data);\n // check again to make sure there were proper columns listed in the SET\n if(strlen($set_sql) == 0){\n return '';\n }\n $return_string = \"INSERT INTO {$this->table_name} $set_sql;\";\n return $return_string;\n }", "function addSlhs($elm){return \"'\".$elm.\"'\";}", "public function getInsert(): string;", "public static function sqlInsert($params)\n\t{\t\n\t\tif(!$params) return \"\";\n\t $table = $params[\"table\"];\n\t\tunset($params[\"table\"]);\n\t\t$columns = array_keys($params);\n\t\t$columns = implode(\", \", $columns);\n\n\t \tforeach($params as $key => $param)\n\t\t\t$values[] = \"?\";\n\t\t$values = implode(\",\", $values);\n\t return \"INSERT INTO $table ($columns) VALUES ($values)\";\n\t}", "function sduconnect_nodelist_to_string($node_list) {\n if ($node_list->length) {\n return trim($node_list->item(0)->nodeValue);\n }\n return '';\n}", "public function get()\n {\n $values = (array) $this->parts['values'];\n\n $keys = ' (' . implode(', ', array_keys($values)) . ')';\n\n $values = ' VALUES (' . implode(', ', $values) . ')';\n\n return 'INSERT INTO ' . $this->table() . $keys . $values;\n }", "public function get_insert()\n {\n $pairs = !empty($this->multiset) ? $this->multiset: array($this->set);\n\n $vals = array();\n $keys = null;\n foreach ($pairs as $row)\n {\n $keys = array_keys($row);\n $vals[] = join(', ', self::prepare($row));\n }\n $keys = join(', ', $keys);\n $vals = join('), (', $vals);\n $table = self::quote_name($this->table);\n return \"insert into $table ($keys) values ($vals)\";\n }", "public function prepare_insertNewEmail($params)\n\t{\n\t\t$xml_string = \"p_Token=\".$params['p_Token'].\"&p_UserID=\".$params['p_UserID'].\"&p_SenderName=\".$params['p_SenderName'].\"&p_SenderEmail=\".$params['p_SenderEmail'].\"&p_RecipientName=\".$params['p_RecipientName'].\"&p_RecipientEmail=\".$params['p_RecipientEmail'].\"&p_Subject=\".$params['p_Subject'].\"&p_Body=\".$params['p_Body'].\"&p_BookingID=\".$params['p_BookingID'].\"\";\n\t\treturn $xml_string;\n\t}", "public function insertValues() \r\n { \r\n $str = \"''\" . \",\"; \r\n $str .= \"'\". self::getFolderName() . \"', \"; \r\n $str .= \"'\". self::getFullPath() . \"', \";\r\n $str .= \"'\". self::getStatus() . \"', \";\r\n $str .= self::getStatusCode() . \", \"; \r\n $str .= \"now()\"; \r\n \r\n return $str;\r\n }", "public function __toString()\n {\n if (empty($this->data)) {\n return \"INSERT INTO `{$this->entity->name}` (`id`) VALUES (NULL)\";\n }\n\n $fields = array_keys($this->data);\n\n $query = \"INSERT INTO `{$this->entity->name}`\";\n $query .= ' (`'.implode('`, `', $fields).'`)';\n $query .= ' VALUES (:'.implode(', :', $fields).')';\n\n if ($this->duplications) {\n $query .= ' ON DUPLICATE KEY UPDATE';\n $query .= ' id = LAST_INSERT_ID(id), '.static::buildFields($fields);\n }\n\n return $query;\n }", "public function node($input) {\n if(is_string($input)) {\n return $this->name($input);\n }\n return $input;\n }", "function insertData($strInput)//Use In inserting or updating data into database\n{\n\t$strInput = addslashes(unconvertHTML($strInput));\n\treturn $strInput;\n}", "function tosql_string($string,$addslashes = false,$quotes){\n\tif (empty($string) && (!isset($string) || $string!='0')){\n\t\t$string = \"NULL\";\n\t}else{\n\t\t$string = trim(addslashes($string));\n\t\tif ($quotes){\n\t\t\tif ($addslashes){\n\t\t\t\t$string = \"\\\\'\".$string.\"\\\\'\";\n\t\t\t}else{\n\t\t\t\t$string = \"'\".$string.\"'\";\n\t\t\t}\n\t\t}\n\t}\n\treturn $string;\n}", "private function create_insert_sql($param) {\n $ques = array();\n foreach ($param as $key => $value) {\n $ques[] = '?';\n }\n\n return implode(', ', $ques);\n }", "protected function doInsert() {\n return '';\n }", "function buildInsert($params)\n {\n $fieldList = $this->getFieldList($params['table']);\n $fieldInsert = '';\n $valueInsert = '';\n\n reset($fieldList);\n while(current($fieldList))\n {\n if (in_array(current($fieldList), array_keys($params)))\n {\n $fieldInsert .= \"`\" . current($fieldList) . \"`, \";\n $valueInsert .= \"'\" . $params[current($fieldList)] . \"', \";\n }\n else\n {\n $this->setError(\"\", \"buildInsert #001\");\n return false;\n }\n $fieldInfo = next($fieldList);\n }\n\n $fieldInsert = preg_replace(\"/,\\s*$/\", \"\", $fieldInsert);\n $valueInsert = preg_replace(\"/,\\s*$/\", \"\", $valueInsert);\n\n $result = \"INSERT INTO `\"\n . $params[\"table\"]\n . \"` (\" . $fieldInsert . \") VALUES (\" . $valueInsert . \");\";\n return $result;\n }", "function delimited_to_xml($params, $reduce_null = FALSE)\n\t{\n\t\tif ( ! is_array($params))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$defaults = array (\n\t\t\t\t\t\t\t'data'\t\t\t=>\tNULL,\n\t\t\t\t\t\t\t'structure'\t\t=>\tarray(),\n\t\t\t\t\t\t\t'root'\t\t\t=>\t'root',\n\t\t\t\t\t\t\t'element'\t\t=>\t'element',\n\t\t\t\t\t\t\t'delimiter'\t\t=>\t\"\\t\",\n\t\t\t\t\t\t\t'enclosure'\t\t=>\t''\n\t\t\t\t\t\t\t);\n\n\t\tforeach ($defaults as $key => $val)\n\t\t{\n\t\t\tif ( ! isset($params[$key]))\n\t\t\t{\n\t\t\t\t$params[$key] = $val;\n\t\t\t}\n\t\t}\n\n\t\textract($params);\n\n\t\t/*\n\t\t $data \t\t- string containing delimited data\n\t\t $structure \t- array providing a key for $data elements\n\t\t $root\t\t\t- the root XML document tag name\n\t\t $element\t\t- the tag name for the element used to enclose the tag data\n\t\t $delimiter\t- the character delimiting the text, default is \\t (tab)\n\t\t $enclosure\t- character used to enclose the data, such as \" in the case of $data = '\"item\", \"item2\", \"item3\"';\n\t\t*/\n\n\t\tif ($data === NULL OR ! is_array($structure) OR count($structure) == 0)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t/** -------------------------------------\n\t\t/** Convert delimited text to array\n\t\t/** -------------------------------------*/\n\t\t$data_arr \t= array();\n\t\t$data\t\t= str_replace(array(\"\\r\\n\", \"\\r\"), \"\\n\", $data);\n\t\t$lines\t\t= explode(\"\\n\", $data);\n\n\t\tif (empty($lines))\n\t\t{\n\t\t\t$this->errors[] = \"No data to work with\";\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tif ($enclosure == '')\n\t\t{\n\t\t\tforeach ($lines as $key => $val)\n\t\t\t{\n\t\t\t\tif ( ! empty($val))\n\t\t\t\t\t$data_arr[$key] = explode($delimiter, $val);\n\t\t\t}\n\t\t}\n\t\telse // values are enclosed by a character, e.g.: \"value\",\"value2\",\"value3\"\n\t\t{\n\t\t\tforeach ($lines as $key => $val)\n\t\t\t{\n\t\t\t\tif ( ! empty($val))\n\t\t\t\t{\n\t\t\t\t\tpreg_match_all(\"/\".preg_quote($enclosure).\"(.*?)\".preg_quote($enclosure).\"/si\", $val, $matches);\n\t\t\t\t\t$data_arr[$key] = $matches[1];\n\n\t\t\t\t\tif (empty($data_arr[$key]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->errors[] = 'Structure mismatch, skipping line: '.$val;\n\t\t\t\t\t\tunset($data_arr[$key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Construct the XML\n\n\t\t$xml = \"<{$root}>\\n\";\n\n\t\tforeach ($data_arr as $datum)\n\t\t{\n\t\t\tif ( ! empty($datum) AND count($datum) == count($structure))\n\t\t\t{\n\n\t\t\t\t$xml .= \"\\t<{$element}>\\n\";\n\n\t\t\t\tforeach ($datum as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif ($reduce_null == TRUE && $structure[$key] == '')\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$xml .= \"\\t\\t<{$structure[$key]}>\".xml_convert($val).\"</{$structure[$key]}>\\n\";\n\t\t\t\t}\n\n\t\t\t\t$xml .= \"\\t</{$element}>\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$details = '';\n\n\t\t\t\tforeach ($datum as $val)\n\t\t\t\t{\n\t\t\t\t\t$details .= \"{$val}, \";\n\t\t\t\t}\n\n\t\t\t\t$this->errors[] = 'Line does not match structure: '.substr($details, 0, -2);\n\t\t\t}\n\t\t}\n\n\t\t$xml .= \"</{$root}>\\n\";\n\n\t\tif ( ! stristr($xml, \"<{$element}>\"))\n\t\t{\n\t\t\t$this->errors[] = \"No valid elements to build XML\";\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn $xml;\n\t}", "public function createCommaDelimitedValueForInsert() {\n $retVal = \"\";\n $retVal .= \"$this->btxid\";\n $retVal .= \",'$this->coin'\";\n $retVal .= \",'$this->market'\";\n $retVal .= \",\". $this->quantity .\"\";\n $retVal .= \",\". $this->value . \"\";\n $retVal .= \",\". $this->usdValue .\"\";\n $retVal .= \",\". $this->total .\"\";\n $retVal .= \",\". $this->fillytype .\"\";\n $retVal .= \",\". $this->ordertype .\"\";\n $retVal .= \",\". $this->btxtimestamp .\"\";\n\n return $retVal;\n }", "function basicXMLNode( $obj, $nodeName )\r\n{\r\n\t$xmlString = \"<Site>\"; //. $nodeName .\r\n\r\n\tforeach ($obj as $fieldName => $fieldValue) {\r\n\t\t$xmlString .= \"<\" . $fieldName . \">\";\r\n\t\t$xmlString .= $fieldValue;\r\n\t\t$xmlString .= \"</\" . $fieldName . \">\";\r\n\t}\r\n\t\r\n\t$xmlString .= \"</Site>\"; //. $nodeName .\r\n\t\r\n\t\r\n\t\r\n\treturn $xmlString;\r\n}", "public function sql(): string\n {\n $columnsNames = array();\n $columnsValues = array();\n\n foreach ($this->parameters as $key => $val) {\n $arg = $this->getArgName($key);\n $columnsNames[] = $this->escape($key); \n $columnsValues[] = ':' . $arg;\n } \n return trim(sprintf(\n 'INSERT INTO %s (%s) VALUES (%s)',\n $this->escape($this->tableName),\n implode(', ', $columnsNames),\n implode(', ', $columnsValues)\n ));\n }", "protected function build()\n {\n return 'INSERT'\n . $this->buildFlags()\n . $this->buildInto()\n . $this->buildValuesForInsert()\n . $this->buildReturning();\n }", "function null($input)\n{\n return ($input != NULL || $input!='')? $input : \" -- \";\n}", "function params2string($params)\n{\n\tif (is_array( $params ) && ! empty( $params ))\n\t{\n\t\t$ret\t= null;\n\t\tforeach ($params as $key => $value)\n\t\t\t$ret .= '/' . $key . '/' . $value;\n\t\t\t\n\t\treturn $ret;\n\t}\n}", "public function toString() {\n return $this->prepare('/' . Fn::join_ne('/', $this->data));\n }", "function GenerateSqlInsert($data, $fields)\n{\n $loc = \"database.php->GenerateSqlInsert\";\n // First make an array that is an intersection of the two inputs.\n $final = array();\n foreach($fields as $f)\n {\n $fn = $f[0]; // Field name\n $ft = $f[1]; // Field type\n if(!isset($data[$fn])) continue;\n if(is_null($data[$fn])) continue;\n $v = $data[$fn];\n $final[] = array(\"FieldName\"=>$fn, \"FieldType\"=>$ft, \"Value\"=>$v);\n }\n if(count($final) <= 0) return false;\n\n // First, list the columns...\n $sql = ' (';\n $c = 0;\n foreach($final as $f)\n {\n if($c != 0) $sql .= ', ';\n $sql .= $f[\"FieldName\"];\n $c++;\n }\n $sql .= ') VALUES (';\n $c = 0;\n foreach($final as $f)\n {\n if($c != 0) $sql .= ', ';\n if($f[\"FieldType\"] == 'int') $sql .= intval($f[\"Value\"]);\n else if($f[\"FieldType\"] == 'str') $sql .= '\"' . SqlClean($f[\"Value\"]) . '\"';\n else if($f[\"FieldType\"] == 'bool') $sql .= TFstr($f[\"Value\"]);\n else \n {\n DieWithMsg($loc, \"Bad Sql type: \" . $f[\"FieldType\"] . \n \" for field \" . $f[\"FieldName\"] . '.'); \n }\n $c++;\n }\n $sql .= ') ';\n return $sql;\n}", "protected function createString() {\n\t\tswitch ( $this->columnSchema[ self::COLUMN_DEFINITION_TYPE ] ) {\n\t\t\tcase self::COLUMN_TYPE_CHAR:\n\t\t\tcase self::COLUMN_TYPE_VARCHAR:\n\t\t\t\t$maxLen = $this->columnSchema[ self::COLUMN_DEFINITION_CHAR_MAX_LEN ];\n\t\t\t\tbreak;\n\t\t\tcase self::COLUMN_TYPE_TEXT:\n\t\t\tcase self::COLUMN_TYPE_MEDIUMTEXT:\n\t\t\tcase self::COLUMN_TYPE_LONGTEXT:\n\t\t\t\t$maxLen = NULL;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$string =\n\t\t\t\t$this->columnSchema[ self::COLUMN_DEFINITION_TYPE ]\n\t\t\t\t. ( !empty( $maxLen ) ? '(' . $maxLen . ')' : '' )\n\t\t\t\t. ( isset( $this->columnSchema[ self::COLUMN_DEFINITION_DEFAULT ] ) && $this->columnSchema[ self::COLUMN_DEFINITION_DEFAULT ] !== NULL\n\t\t\t\t\t\t? ' DEFAULT \"' . $this->columnSchema[ self::COLUMN_DEFINITION_DEFAULT ] . '\"'\n\t\t\t\t\t\t: '' )\n\t\t\t\t. ( isset( $this->columnSchema[ self::COLUMN_DEFINITION_IS_NULLABLE ] )\n\t\t\t\t\t\t? ( strtolower( $this->columnSchema[ self::COLUMN_DEFINITION_IS_NULLABLE ] ) == 'no' ? ' NOT NULL' : '' )\n\t\t\t\t\t\t: '' );\n\n\t\treturn $string;\n\t}", "public function insertFormat(): string\n {\n throw new \\RuntimeException(__CLASS__ . ' does not support data insert');\n }", "protected function createAddEmptyNodeQuery()\n {\n $db = $this->dbh;\n\n $q = $db->createInsertQuery();\n $q->insertInto( $db->quoteIdentifier( $this->indexTableName ) )\n ->set( 'parent_id', $q->bindValue( null ) );\n\n return $q;\n }", "protected function escapeNULL()\n {\n return 'NULL';\n }", "public function dbSerialize(): string;", "function _dumpNode($key,$value,$indent) {\n\t// do some folding here, for blocks\n\tif (strpos($value,\"\\n\") !== false || strpos($value,\": \") !== false || strpos($value,\"- \") !== false) {\n\t\t$value = $this->_doLiteralBlock($value,$indent);\n\t} else {\n\t\t$value = $this->_doFolding($value,$indent);\n\t}\n\n\tif (is_bool($value)) {\n\t\t$value = ($value) ? \"true\" : \"false\";\n\t}\n\n\t$spaces = str_repeat(' ',$indent);\n\n\tif (is_int($key)) {\n\t\t// It's a sequence\n\t\t$string = $spaces.'- '.$value.\"\\n\";\n\t} else {\n\t\t// It's mapped\n\t\t$string = $spaces.$key.': '.$value.\"\\n\";\n\t}\n\treturn $string;\n\t}", "function insertNode($name, $type, $zone){\n \ttry{\n \t\t//random unique integer only ID\n \t\t$id = hexdec(uniqid());\n\t\t\t$db = getConnection();\n\n\t\t\t$sql = \"INSERT INTO authorized_nodes (keycode, name, type, zone, active) VALUES(?,?,?,?,?)\";\n $stmt = $db->prepare($sql);\n $stmt->execute(array($id,$name,$type,$zone,0));\n\n $stmt = null;\n\t \t$db = null;\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t echo $e->getMessage();\n\t }\n\t \n\t return $id;\n }", "public function get_xml_string ($vars = array());", "public static function encodeNull($data, $node = 'root',$options = array())\n {\n return self::declaration($options) . self::offset($options) . '<' . self::normalizeNode($node) . '/>';\n }", "function getInsertSql()\n {\n $str1 = '';\n $str2 = '';\n $n = 0;\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n if (!in_array($k, $this->tblIndex) && $k != 'tblName' && $k != 'schema' && $k != 'tblIndex' && $k != 'exists' && isset($this->$k)) {\n if ($n++ > 0) {\n $str1 .= ',';\n $str2 .= ',';\n }\n\n\n $str1 .= $k . \" \";\n $str2 .= $this->prepareForQuery($this->$k) . \" \";\n\n\n }\n }\n $str = 'INSERT INTO ';\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n $str = $str . $this->tblName . ' ( ';\n $str .= $str1;\n $str .= ') VALUES (';\n $str .= $str2;\n $str .= ');';\n return $str;\n }", "function l1NodeString($x) {\n global $dom;\n // Get document element of main document.\n $root = $dom->documentElement;\n // Get its children.\n $l1Nodes = $root->childNodes;\n // Get pointer to the L1 node we want to print.\n $srcNode = $l1Nodes->item($x);\n\n // Create a new tree.\n $newdoc = new DOMDocument();\n // Designate that serialized output should be formatted.\n $newdoc->formatOutput = TRUE;\n // Make a copy of the old node from old tree.\n $copyNode = $srcNode->cloneNode(TRUE);\n // Associate the new node with the new tree.\n $copyNode = $newdoc->importNode($copyNode,TRUE);\n // Graft the new node into the new tree.\n // If this works then this is a way to create a document's\n // document element which I haven't read about in any documentation.\n $newdoc->appendChild($copyNode);\n // Serialize and print the new tree.\n // I'm using saveHTML instead of saveXML to avoid the the XML type\n // declaration in output.\n $nodeStr = $newdoc->saveHTML();\n\n return $nodeStr;\n}", "function __toString(){\n\t\tif( $this->is_terminal() ){\n\t\t\treturn parent::__toString();\n\t\t}\n\t\t$src = '';\n\t\tforeach( $this->children as $i => $Child ){\n\t\t\tif( $Child->is_terminal() ){\n\t\t\t\t$s = (string) $Child->value;\n\t\t\t\tswitch( $Child->t ){\n\t\t\t\t// these terminals will may or may not be followed by an identifier\n\t\t\t\t// but always by the next terminal in this node.\n\t\t\t\tcase J_FUNCTION:\n\t\t\t\tcase J_CONTINUE:\n\t\t\t\tcase J_BREAK;\n\t\t\t\t\t$identFollows = isset($this->children[$i+1]) && $this->children[$i+1]->is_symbol(J_IDENTIFIER);\n\t\t\t\t\t$identFollows and $s .= ' ';\n\t\t\t\t\tbreak;\n\t\t\t\t// these terminals will always be followed by an idenfifer\n\t\t\t\tcase J_VAR:\n\t\t\t\t// these terminals are followed by a non terminal;\n\t\t\t\t// adding a space to be on the safe side.\n\t\t\t\tcase J_DO:\n\t\t\t\tcase J_ELSE:\n\t\t\t\tcase J_RETURN:\n\t\t\t\tcase J_CASE:\n\t\t\t\tcase J_THROW:\n\t\t\t\tcase J_NEW:\n\t\t\t\tcase J_DELETE:\n\t\t\t\tcase J_VOID:\n\t\t\t\tcase J_TYPEOF:\n\t\t\t\t\t$s .= ' ';\n\t\t\t\t\tbreak;\n\t\t\t\t// these terminals require a space on either side\n\t\t\t\tcase J_IN:\n\t\t\t\tcase J_INSTANCEOF:\n\t\t\t\t\t$s = ' '.$s.' ';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// recursion into non-terminal\n\t\t\t\t$s = $Child->__toString();\n\t\t\t}\n\t\t\t$src .= $s;\n\t\t}\n\t\treturn $src;\n\t}", "private static function addQuotes($el) {\r\n if( is_array($el) ) {\r\n $el = array_map(array($this, __FUNCTION__), $el);\r\n }\r\n if( is_string($el) ) {\r\n $el = '\\'' . SQLite3::escapeString($el) . '\\'';\r\n }\r\n if( is_bool($el) ){\r\n $el = $el?'1':'0';\r\n }\r\n if( is_null($el) ){\r\n $el = 'NULL';\r\n }\r\n return $el;\r\n }", "public static function allDataType2String(&$params)\n {\n if (!is_array($params) || !count($params))\n {\n $params = \"\";\n return ;\n }\n\n foreach ($params as $key => $val) {\n $params[$key] = is_null($val) ? \"\" : strval($val);\n }\n\n return ;\n }", "function _splurgh_do_node($map,$node,$chain,&$fulltable,$nest)\n{\n\t$fulltable[$node]=1;\n\n\t$title=$map[$node]['title'];\n\t$children=$map[$node]['children'];\n\n\t$out=strval($node).'!'.str_replace('[','&#91;',str_replace(']','&#93;',str_replace(',','&#44;',$title))).',';\n\tif (count($children)>0)\n\t{\n\t\t$out.='[';\n\t\tforeach ($children as $child)\n\t\t{\n\t\t\tif ((!array_key_exists($child,$fulltable)) && (array_key_exists($child,$map)))\n\t\t\t\t$out.=_splurgh_do_node($map,$child,$chain.strval($node).'~',$fulltable,$nest+1);\n\t\t}\n\t\t$out.='],';\n\t}\n\n\treturn $out;\n}", "protected function toString($params)\n {\n $temp = array();\n foreach ((array)$params as $key => $val)\n {\n $temp[] = $key;\n $temp[] = $val;\n }\n\n return implode('/', $temp);\n }", "public static function encodeString($data, $node = 'root',$options = array())\n {\n $data = \\htmlspecialchars($data);\n return self::makeNode($data, $node, $options);\n }", "protected function buildSQL(): string\n {\n $sql = 'INSERT' . PHP_EOL;\n\n $sql .= $this->buildTable();\n $sql .= $this->buildFields();\n $this->buildBindings();\n $sql .= $this->buildValues();\n $sql .= $this->buildValuesFromSelect();\n $sql .= $this->buildReturning();\n\n\n return $sql;\n }", "public function __toString()\n {\n $query = '';\n\n switch ($this->type) {\n case 'insert':\n $query .= (string) $this->insert;\n\n // Set method\n if ($this->set) {\n $query .= (string) $this->set;\n }\n // Columns-Values method\n elseif ($this->values) {\n if ($this->columns) {\n $query .= (string) $this->columns;\n }\n\n $elements = $this->insert->getElements();\n $tableName = array_shift($elements);\n\n $query .= 'VALUES ';\n $query .= (string) $this->values;\n\n if ($this->autoIncrementField) {\n $query = 'SET IDENTITY_INSERT ' . $tableName . ' ON;' . $query . 'SET IDENTITY_INSERT ' . $tableName . ' OFF;';\n }\n\n if ($this->where) {\n $query .= (string) $this->where;\n }\n }\n\n break;\n\n default:\n $query = parent::__toString();\n break;\n }\n\n return $query;\n }", "public function buildInsert()\n {\n $columns = array();\n $values = array();\n\n /* build sql arguments */\n\n if ( $this->driver->placeholder ) {\n foreach( $this->insert as $k => $v ) {\n if ( is_integer($k) )\n $k = $v;\n\n if ( is_array($v) ) {\n // just interpolate the raw value\n $columns[] = $this->driver->getQuoteColumn($k);\n $values[] = $v[0];\n } else {\n $columns[] = $this->driver->getQuoteColumn($k);\n $newK = $this->setPlaceHolderVar( $k , $v );\n $values[] = $this->driver->getPlaceHolder($newK);\n }\n }\n\n } else {\n foreach( $this->insert as $k => $v ) {\n if ( is_integer($k) ) {\n $k = $v;\n }\n $columns[] = $this->driver->getQuoteColumn( $k );\n $values[] = $this->driver->inflate($v);\n }\n }\n\n $sql = 'INSERT INTO ' . $this->getTableSql() \n . ' ( '\n . join(',',$columns) \n . ') VALUES (' \n . join(',', $values ) \n . ')';\n ;\n\n if ( $this->returning && ( 'pgsql' == $this->driver->type ) ) {\n $sql .= ' RETURNING ' . $this->driver->getQuoteColumn($this->returning);\n }\n\n if ( $this->driver->trim ) {\n return trim($sql);\n }\n return $sql;\n }", "private function formatInsertCommand( )\n {\n $data_buffer_length = @ count( $this->data_buffer );\n if ( $data_buffer_length == 0 )\n return false;\n\n $sql = 'INSERT INTO ' . $this->table_name . ' ';\n $sql_columns = '(';\n $sql_values = ' VALUE(';\n $this->quote( );\n $i = 0;\n foreach ( $this->data_buffer as $k => $v )\n {\n $sql_columns .= $k;\n $sql_values .= $v;\n if ( ( $i + 1 ) < $data_buffer_length )\n {\n $sql_columns .= ',';\n $sql_values .= ',';\n }\n $i++;\n }\n $sql_columns .= ')';\n $sql_values .= ')';\n $sql .= $sql_columns . $sql_values;\n return $sql;\n }", "abstract protected function getNodeName();", "public function postfix(){ $dbPostfix = \"\"; if( $this->ID != 0 ){ $dbPostfix = $this->name; } if( $dbPostfix != \"\" ){ $dbPostfix = \"/\" . $dbPostfix; } return $dbPostfix; }", "function create_dom_node(&$dom, &$parent_node, $node_name, $node_value = NULL){\n\t\t$node = $dom->create_element($node_name);\n\t\t$new_node = $parent_node->append_child($node);\n\t\tif($node_value != NULL){\n\t\t\t$txt_node = $dom->create_text_node($node_value);\n\t\t\t$new_node->append_child($txt_node);\n\t\t}\n\t\treturn $new_node;\n\t}", "public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }", "function sb_assignment_insert ($node) {\n\n db_query(\"INSERT INTO {eto_assignments}\n (\" . $node->key_field . \", \" . $node->target_field . \")\n VALUES\n (%d, %d)\",\n\t $node->uid, $node->selected_uid);\n\n}", "function XMLify($input){\n return '<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>' . \"\\n\" . $input;\n\n}", "function toSQL($mixed,$addslashes = false,$quotes = true){\n\tif (is_null($mixed)){\n\t\treturn 'NULL';\n\t}\n\tif (!is_array($mixed)){\n\t\treturn tosql_string($mixed,$addslashes,$quotes);\n\t}\n\t$string = '';\n\tforeach($mixed as $value){\n\t\tif ($string != ''){\n\t\t\t$string .= ',';\n\t\t}\n\t\t$string .= tosql_string($value,$addslashes,$quotes);\n\t}\n\treturn $string;\n}", "public function sql(){\n $str = \"\";\n foreach($this->params as $key => $val){\n if($val != false){\n $str .= \"$key $val \";\n }\n }\n return $str;\n }", "public function insert($params){\n\t\t$DB = Registry::getInstance()->DB;\n\t\t$prefix = \"INSERT \";\n\t\t$p = $this->clean($params);\t\n\t\t$statement = $prefix.\" \".$params['tables'][0].\" \".$this->genSet($p['set']);\t\n\t\t$DB->exec($statement);\t\n\t}", "private static function getInsertStatement(array $options) {\n $keys = array();\n $values = array();\n foreach ($options as $k=>$v) {\n $value = \"'${v}'\";\n $key = $k;\n if (substr($k, 0, 1) == '!') {\n $key = substr($k, 1);\n $value = $v;\n }\n\n $keys[] = $key;\n $values[] = $value;\n }\n\n $keys = implode(', ', $keys);\n $values = implode(', ', $values);\n\n return \"INSERT INTO \".TABLE_CONFIGURATION.\" (${keys}) VALUES (${values})\";\n }", "function to_str() {\n return \n //\n //For now we are deleting everything in that record\n \"DELETE {$this->str_values()}\"\n //\n //Get the from expression of the root\n . \"FROM {$this->root->fromexp()}\"\n //\n //the where condition is that the primary value is equal to the \n //primary column\n .\"WHERE {$this->wheres->to_str()} \\n\";\n }", "function __toString(): string {\n return $this->getSQL(null);\n }", "public function compileInsertString( $data )\n {\n \t$field_names\t= \"\";\n\t\t$field_values\t= \"\";\n\n\t\tforeach( $data as $k => $v )\n\t\t{\n\t\t\t$add_slashes = 1;\n\t\t\t\n\t\t\tif ( $this->manual_addslashes )\n\t\t\t{\n\t\t\t\t$add_slashes = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif ( !empty($this->no_escape_fields[ $k ]) )\n\t\t\t{\n\t\t\t\t$add_slashes = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $add_slashes )\n\t\t\t{\n\t\t\t\t$v = $this->addSlashes( $v );\n\t\t\t}\n\t\t\t\n\t\t\t$field_names .= $this->fieldNameEncapsulate . \"$k\" . $this->fieldNameEncapsulate . ',';\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Forcing data type?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( substr( $v, -1 ) == '\\\\' )\n\t\t\t{\n\t\t\t\t$v = preg_replace( '#\\\\\\{1}$#', '&#92;', $v );\n\t\t\t}\n\t\t\t\t\t\n\t\t\tif ( !empty($this->_dataTypes[ $k ]) )\n\t\t\t{\n\t\t\t\tif ( $this->_dataTypes[ $k ] == 'string' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= $this->fieldEncapsulate . $v . $this->fieldEncapsulate . ',';\n\t\t\t\t}\n\t\t\t\telse if ( $this->_dataTypes[ $k ] == 'int' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= intval($v).\",\";\n\t\t\t\t}\n\t\t\t\telse if ( $this->_dataTypes[ $k ] == 'float' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= floatval($v).\",\";\n\t\t\t\t}\n\t\t\t\tif ( $this->_dataTypes[ $k ] == 'null' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= \"NULL,\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// No? best guess it is then..\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( is_numeric( $v ) and strcmp( intval($v), $v ) === 0 )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= $v.\",\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$field_values .= $this->fieldEncapsulate . $v . $this->fieldEncapsulate . ',';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$field_names = rtrim( $field_names, \",\" );\n\t\t$field_values = rtrim( $field_values, \",\" );\n\t\n\t\treturn array( 'FIELD_NAMES' => $field_names,\n\t\t\t\t\t 'FIELD_VALUES' => $field_values,\n\t\t\t\t\t);\n\t}", "function forum_insert_nopost($id_forum, $id_article, $id_breve, $id_syndic, $id_rubrique, $id_message)\n{\n\tif ($id_forum>0)\n\t\t$r = generer_url_entite($id_forum, 'forum');\n\telseif ($id_article)\n\t\t$r = generer_url_entite($id_article, 'article');\n\telseif ($id_breve)\n\t\t$r = generer_url_entite($id_breve, 'breve');\n\telseif ($id_syndic)\n\t\t$r = generer_url_entite($id_syndic, 'site');\n\telseif ($id_rubrique) # toujours en dernier\n\t\t$r = generer_url_entite($id_rubrique, 'rubrique');\n\telseif ($id_message)\n\t\t$r = generer_url_entite($id_message, 'mssage');\n\telse $r = ''; # ??\n\treturn str_replace('&amp;','&',$r);\n}", "public function compileInsertString( $data );", "public function _addNode(array $data, $tableColumn, $nodeName, SimpleXMLElement $xml)\n\t{\n\t\tswitch($nodeName)\n\t\t{\n\t\t\tcase 'name':\n\t\t\tcase 'admin_name':\n\t\t\t\tif($this->nodeExists($xml, $nodeName, array('language_id', $data['language_id'])) === false)\n\t\t\t\t{\n\t\t\t\t\t$xml->addChild($nodeName);\n\t\t\t\t\t$xml->{$nodeName}[count($xml->{$nodeName}) - 1] = $this->wrapValue($data[$tableColumn]);\n\t\t\t\t\t$coo_child = $xml->{$nodeName}[count($xml->{$nodeName}) - 1];\n\t\t\t\t\t$coo_child['language_id'] = $data['language_id'];\n\t\t\t\t\t\n\t\t\t\t\t$languageIso = ''; \n\t\t\t\t\tif(isset($this->languageArray[$data['language_id']]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$languageIso = $this->languageArray[$data['language_id']]['iso']; \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$coo_child['language_iso'] = $languageIso;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif($this->nodeExists($xml, $nodeName) === false)\n\t\t\t\t{\n\t\t\t\t\t$xml->{$nodeName} = $data[$tableColumn];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "protected function dumpToString()\n {\n if ($this->_type == self::NODE_ROOT) {\n return 'root';\n }\n return (string)$this->_type;\n }", "public function createNode($arr,$node = null){\r\n if(is_null($node)){\r\n $node = $this->root;\r\n }\r\n foreach($arr as $element => $value){\r\n $element = is_numeric($element)? $this->node_name : $element;\r\n\r\n $child = $this->createElement($element,(is_array($value)? null : $value));\r\n $node->appendChild($child);\r\n\r\n if(is_array($value)){\r\n self::createNode($value,$child);\r\n }\r\n }\r\n }", "function str_values(){\n //\n //map the std objects inthe array to return an array of strings of this \n //format INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)\n //VALUES ('Cardinal', 'Tom B. Erichsen', 'Skagen 21', 'Stavanger', '4006', 'Norway');\n\n $col_str= array_map(function($obj){\n //\n //Return the full description of the columns\n return \"`$obj->name`\"; \n }, $this->values);\n //\n //\n $values_str= array_map(function($obj){\n //\n //Trim the spaces\n $tvalue = trim($obj->value);\n //\n //Replace '' with null\n $value = $tvalue=='' ? 'null': \"'$tvalue'\";\n //\n return $value;\n \n }, $this->values);\n //\n //retun the imploded version of the array with a , separator\n $values= implode(\",\",$values_str);\n $cols= implode(\",\",$col_str);\n return \"($cols) VALUES ($values)\";\n }", "function genericinsert ($table, $data) {\n $names = '';\n $values = '';\n foreach ($data as $key => $value) {\n if (substr($key,0,1) == '@') {\n $names .= substr($key,1).',';\n $values .= $value.',';\n } else {\n $names .= $key.',';\n $values .= '\"'.mysql_real_escape_string($value).'\",';\n }\n }\n // INSERT INTO table (a,b,c) values (1,2,3)\n $query = 'INSERT INTO `'.mysql_real_escape_string($table).'` '.\n '('.substr($names ,0,strlen($names )-1).') values '.\n '('.substr($values,0,strlen($values)-1).')';\n return $query;\n}", "function generateXML( $node,&$strArr,$level ){\r\n\r\n\t$i=0;\r\n\t$tabs=\"\";\r\n\twhile( $i<$level ){\r\n\t\t$tabs .= \"\t\";\r\n\t\t$i++;\r\n\t}\r\n\t//print_r($node);\r\n\tif( isset($node['childs']) && is_array( $node['childs'] ) && count( $node['childs'] )>0 ){\r\n\t\t$strArr[] = $tabs.\"<\".$node['name'].\">\";\r\n\t\t$i=0;\r\n\t\tforeach ( $node['childs'] as $k=>$c ) {\r\n\t\t\tgenerateXML( $c,$strArr,$level+1 );\r\n\t\t}\r\n\t\t$strArr[] = $tabs.\"</\".$node['name'].\">\";\r\n\t}\r\n\telse{\r\n\t\t$strArr[] = $tabs.\"<\".$node['name'].\">\".$node['value'].\"</\".$node['name'].\">\";\r\n\t}\r\n}", "public static function createAttrString($attr=null){\n\t\t$output = '';\n\t\tif(is_string($attr))parse_str($attr, $attr);\n\t\tif(is_null($attr))return '';\n\t\tforeach($attr as $key=>$value){\n\t\t\t$value = str_replace('\"', '\\\\\"', $value);\n\t\t\tif(is_null($value) or empty($value))$output .= (' '.$key);\n\t\t\telse $output .= (' '.$key.'=\"'.$value.'\"');\n\t\t}\n\t\treturn trim($output);\n\t}", "function db($var) {\n return addslashes($var);\n}", "public function toString() {\n return $this->getClassName().'{'.$this->form->getTest()->getDom()->saveXML($this->node).'}';\n }", "public function prepare_insertNewBooking($params)\n\t{\n\t\t$xml_string = \"p_Token=\".$params['p_Token'].\"&p_UserID=\".$params['p_UserID'].\"&p_VillaID=\".$params['p_VillaID'].\"&p_CIDate=\".$params['p_CIDate'].\"&p_CODate=\".$params['p_CODate'].\"&p_GuestFirstName=\".$params['p_GuestFirstName'].\"&p_GuestLastName=\".$params['p_GuestLastName'].\"&p_Email=\".$params['p_Email'].\"&p_CountryOfResidence=\".$params['p_CountryOfResidence'].\"&p_MobileNo=\".$params['p_MobileNo'].\"&p_TelNo=\".$params['p_TelNo'].\"&p_BookingSourceID=\".$params['p_BookingSourceID'].\"&p_TotalPax=\".$params['p_TotalPax'].\"&p_TotalChild=\".$params['p_TotalChild'].\"&p_TotalInfant=\".$params['p_TotalInfant'].\"&p_SpecialRequest=\".$params['p_SpecialRequest'].\"&p_MarketingMediaID=\".$params['p_MarketingMediaID'].\"&p_AffID=\".$params['p_AffID'].\"\";\n\t\treturn $xml_string;\n\t}", "public function getValue(): string\n {\n $value = '';\n \n if ($this->currentNode->childNodes !== NULL){\n foreach ($this->currentNode->childNodes as $node) {\n $value .= $this->doc->saveXML($node);\n }\n } else {\n $value = $this->currentNode->nodeValue;\n }\n \n return $value;\n }", "public function getNodeName();", "function insert($word){\n\t\tinsert($root,$word);\n\t}", "private static function genInsertRecordQuery($init_params) {\n $fully_qualified_table_name = static::getFullyQualifiedTableName();\n $database_name = \n $query = \"INSERT INTO {$fully_qualified_table_name} (\";\n\t\t$values_string = \") VALUES (\";\n\t\tforeach ($init_params as $name => $value) {\n $query .= $name . \", \";\n\n // Accumulate value specification string with PDO param bindings \n $transformed_key_name = self::transformForPreparedStatement($name);\n $values_string .= \"$transformed_key_name, \"; \n\t\t}\n \n // Trim redundant commas from strings\n\t\t$query = substr($query, 0, strlen($query) - 2);\n\t\t$values_string = substr($values_string, 0, strlen($values_string) - 2);\n \n // Assemble full query\n return $query . $values_string . \")\";\n\t}", "function get_RPN($tree = array()) {\n\t\t$RPN = \"\";\n\t\tif (empty($tree)) { // first call\n\t\t\t$tree = $this->_parse_tree;\n\t\t}\n\t\tif (is_array($tree[\"left\"])) {\n\t\t\t$RPN .= $this->get_RPN($tree[\"left\"]);\n\t\t}\n\t\telse if($tree[\"left\"] != \"\") { // final node\n\t\t\t$RPN .= $this->_convert($tree[\"left\"]);\n\t\t}\n\t\tif (is_array($tree[\"right\"])) {\n\t\t\t$RPN .= $this->get_RPN($tree[\"right\"]);\n\t\t}\n\t\telse if($tree[\"right\"] != \"\") { // final node\n\t\t\t$RPN .= $this->_convert($tree[\"right\"]);\n\t\t}\n\t\t$RPN .= $this->_convert($tree[\"value\"]);\n\t\treturn $RPN;\n\t}", "private function getSyntaxe(){\n $Fields = implode(', ', array_keys($this->Dados));\n $Places = ':' . implode(', :', array_keys($this->Dados));\n\n $this->Create = \"INSERT INTO {$this->Tabela} ({$Fields}) VALUES ({$Places})\";\n }", "function getInsertQuery($j_obj,$tblName,$ignore){\n $qi = \"INSERT INTO $tblName (\";\n //reset($j_obj);\n try{\n foreach($j_obj as $j_arr_key => $value){\n if(in_array($j_arr_key,explode(\",\",$ignore))){\n continue;\n }\n $qi .= $j_arr_key . \",\";\n }\n $qi = substr_replace($qi,\"\",-1);\n $qi .= \") VALUES (\";\n reset($j_obj);\n foreach($j_obj as $j_arr_key => $value){\n if(in_array($j_arr_key,explode(\",\",$ignore))){\n continue;\n }\n $qi .= \"'\" . $value . \"',\";\n }\n $qi = substr_replace($qi,\"\",-1);\n $qi .= \")\";\n }catch(Exception $e){\n return \"In Exception\";\n }\n return $qi;\n}", "function generateInsertQuery($tableName,$columns,$values)\n{\n $i = 0;\n $columnString = \"\";\n $valueString = \"\";\n\n for($i = 0; $i < count($columns); $i++)\n {\n\tif($i > 0)\n\t{\n\t $columnString = $columnString . \",\" . $columns[$i];\n\t \n\t $len = strlen($values[$i]);\n\t if( $len <= 1 || $values[$i][0] != \"'\" || $values[$i][$len-1] != \"'\" )\n\t\t$valueString = $valueString . \",'\" . $values[$i] . \"'\";\n\t else\n\t\t$valueString = $valueString . \",\" . $values[$i];\n\t}\n\telse\n\t{\n\t $columnString = $columns[0];\n\n\t $len = strlen($values[0]);\n\t if( $len <= 1 || $values[0][0] != \"'\" || $values[0][$len-1] != \"'\" )\n\t\t$valueString = \"'\" . $values[0] . \"'\";\n\t else\n\t\t$valueString = $values[0];\n\t}\n }\n \n //INSERT INTO table_name (column1, column2, column3,...)\n //VALUES (value1, value2, value3,...) \n return \"INSERT INTO $tableName ($columnString) VALUES ($valueString)\";\n}", "private function getValidNode(int | string | null $node): string\n {\n if ($node === null) {\n $node = $this->nodeProvider->getNode();\n }\n\n // Convert the node to hex, if it is still an integer.\n if (is_int($node)) {\n $node = dechex($node);\n }\n\n if (!preg_match('/^[A-Fa-f0-9]+$/', (string) $node) || strlen((string) $node) > 12) {\n throw new InvalidArgumentException('Invalid node value');\n }\n\n return (string) hex2bin(str_pad((string) $node, 12, '0', STR_PAD_LEFT));\n }", "function insert($mysqli,$parent,$name){\n $sql=\"insert into root (name,parent,lft,rgt) values('$name','$parent',0,0) \";\n $res=$mysqli->query($sql);\n if($res){\n echo \"添加成功!\";\n }\n}", "public function createSystemType()\r\n{\r\n $query_string = \"INSERT INTO system_type \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"systemtypename = :systemtypename, \";\r\n $query_string .= \"systemtypedesc = :systemtypedesc\";\r\n\r\n return $query_string;\r\n}", "public function toString($include_parent = null) {}", "function parent_Add($conn,$ParentID)\r\n{\r\n\r\n\r\n$parent_id = $ParentID;\r\n$parent_fname = \"Jenny\";\r\n$parent_sname = \"Kelly\";\r\n$password = \"cool\";\r\n$address1 = \"23 The Close\";\r\n$address2 = \"Liffey Hall\";\r\n$phonenumber = rand(100000,10000000);\r\n\r\n\r\n//created a template\r\n$query = \"INSERT INTO parent VALUES($1, $2, $3, $4, $5, $6, $7)\"; \r\n//prepare a statement\r\npg_prepare($conn, \"prepare1\", $query) \r\n or die (\"Cannot prepare statement\\n\"); \r\n\r\n//ececute the statemant\r\npg_execute($conn, \"prepare1\", array($parent_id, $parent_fname, $parent_sname,$password,$address1,$address2,$phonenumber))\r\n or die (\"Cannot execute statement\\n\"); \r\n//success\r\necho \"Row successfully inserted\\n\";\r\n\r\n// close function.\r\n\r\n}", "public function pushNode( $node );", "protected function _connectString()\n {\n $components = array(\n 'hostname' => 'host',\n 'port' => 'port',\n 'database' => 'dbname',\n 'username' => 'user',\n 'password' => 'password'\n );\n\n $connect_string = \"\";\n foreach ($components as $key => $val) {\n if (isset($this->$key) && $this->$key != '') {\n $connect_string .= \" $val=\".$this->$key;\n }\n }\n return trim($connect_string);\n }", "abstract protected function buildSQL(): string;", "protected static function nullable_string_to_db($string){\n $string = trim(\"$string\");\n if($string === \"\"){\n return null;\n }else{\n return $string;\n }\n }" ]
[ "0.5991256", "0.5452782", "0.5351307", "0.52994555", "0.5198407", "0.5192369", "0.5127906", "0.51028", "0.5093311", "0.5076967", "0.50089824", "0.50012976", "0.5000416", "0.4995035", "0.49949732", "0.49794808", "0.49641508", "0.4957233", "0.49563095", "0.49465948", "0.49387634", "0.49285275", "0.49269184", "0.4907615", "0.48981914", "0.489513", "0.4886344", "0.48425597", "0.48405764", "0.48339856", "0.48254323", "0.48220518", "0.48201966", "0.4800619", "0.4790851", "0.47904253", "0.47855267", "0.47517326", "0.47430187", "0.473913", "0.47283062", "0.4696514", "0.46948594", "0.46812204", "0.46727806", "0.466485", "0.46618614", "0.46562794", "0.4635626", "0.4632168", "0.46299893", "0.46271002", "0.46183875", "0.46108043", "0.46077713", "0.46015692", "0.4601291", "0.4573709", "0.4571904", "0.4571182", "0.45612022", "0.45607743", "0.45606914", "0.45435557", "0.45214406", "0.4516307", "0.45108226", "0.45043048", "0.45032278", "0.45023304", "0.44952014", "0.4493433", "0.4488083", "0.4487876", "0.44865027", "0.44678804", "0.44677994", "0.4466851", "0.44666234", "0.44649217", "0.44647086", "0.44570845", "0.44557396", "0.44551724", "0.44528848", "0.44489336", "0.44461948", "0.4444922", "0.44433695", "0.44372353", "0.44348398", "0.44336507", "0.44304335", "0.44299513", "0.4427221", "0.4426319", "0.44250354", "0.4421003", "0.4413585", "0.44095278" ]
0.6110811
0
filling children nodes position
function get_property_pos_str($children_pos, $fill_num) { $str = ''; $d_empty_str = $this->empty_str . ($this->is_inner_delimited ? $this->delimiter : null); // var_dump($children_pos); if ($children_pos) { foreach ($children_pos as $pos) { $str .= str_pad($pos, $this->pos_len, Database::$empty_char, STR_PAD_LEFT); if ($this->is_inner_delimited) { $str .= $this->delimiter; } } $c_num = count($children_pos); if ($c_num < $fill_num) { for ($i = 0, $diff = $fill_num - $c_num; $i < $diff; $i++) { $str .= $d_empty_str; } } } else { $str = str_repeat($d_empty_str, $fill_num); } return $str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function populateParentFromSortedByParentIdList() {\n for ($i = 0; $i < sizeof($this->nodeList); $i++) {\n $node = $this->nodeList[$i];\n// echo \"<br>Text: \".$node->getText();\n $this->insertNode($node);\n }\n }", "public function getChildNodes() {}", "public function getChildNodes() {}", "function SetAllHierarchyPositions()\n\t{\n\t\tglobal $gCms;\n\t\t$db = $gCms->GetDb();\n\n\t\t$query = \"SELECT content_id FROM \".cms_db_prefix().\"content\";\n\t\t$dbresult = &$db->Execute($query);\n\n\t\twhile ($dbresult && !$dbresult->EOF)\n\t\t{\n\t\t\tContentOperations::SetHierarchyPosition($dbresult->fields['content_id']);\n\t\t\t$dbresult->MoveNext();\n\t\t}\n\t\t\n\t\tif ($dbresult) $dbresult->Close();\n\t}", "function getChildNodes() ;", "function add_children(){\n\t\t\t\t\t//if the array has a parent add it to the parents child array\n\t\tforeach ($this->nodes as $node){\n\t\t\tif($node->parent!=-1){\n\t\t\t\tif(isset($this->nodes[$node->parent])){\n\t\t\t\t\t$parent=$this->nodes[$node->parent];\n\t\t\t\t\t$parent->add_child($node->id);\n\t\t\t\t}else{\n\t\t\t\t\tprint_error('nonode','socialwiki');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function getChildNodes();", "abstract protected function getNewChildren(): array ;", "public function reorderChildren()\n {\n $sql = \"select ID_PAGE from \" . $this->mode . \"PAGE where PAG_IDPERE=\" . $this->getID() . \" order by PAG_POIDS\";\n $stmt = $this->dbh->prepare(\"update \" . $this->mode . \"PAGE set PAG_POIDS=:PAG_POIDS where ID_PAGE=:ID_PAGE\");\n $PAG_POIDS = 1;\n $stmt->bindParam(':PAG_POIDS', $PAG_POIDS, PDO::PARAM_INT);\n foreach ($this->dbh->query($sql)->fetchAll(PDO::FETCH_COLUMN) as $ID_PAGE) {\n $stmt->bindValue(':ID_PAGE', $ID_PAGE, PDO::PARAM_INT);\n $stmt->execute();\n $PAG_POIDS ++;\n }\n }", "function __construct()\n {\n $this->isEnd = false;\n //$this->children = array_fill(0, 26, null); //这种也可以 感觉有点浪费\n $this->children = [];\n }", "function appendChildren () {\n $this->menu[]=new Marker('start');\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $this->current->id() ) {\n $this->menu[]=$item;\n }\n }\n $check=end($this->menu);\n if ( $check->isStart() )\n array_pop($this->menu);\n else\n $this->menu[]=new Marker('end');\n }", "function _relocate_children($old_ID, $new_ID)\n {\n }", "function populate() {\n $this->populateInputElements($this->children);\n }", "public function calc() {\n $this->getChildNodes(0, 0, 0);\n }", "protected function _populateNodes()\n {\n // and some for user 1 and some for user 2.\n // five nodes for each area.\n $nodes = $this->_catalog->getModel('nodes');\n for ($i = 1; $i <= 10; $i++) {\n $node = $nodes->fetchNew();\n $node->subj = \"Subject Line $i: \" . substr(md5($i), 0, 5);\n $node->body = \"Body for $i ... \" . md5($i);\n $node->area_id = $i % 2 + 1; // sometimes 1, sometimes 2\n $node->user_id = ($i + 1) % 2 + 1; // sometimes 2, sometimes 1\n $node->save();\n }\n }", "function getNodePositions() {\n if (!$this->prepared) {\n $this->__prepare($this->struct[0], true);\n $this->prepared = true;\n }\n \n $data = $this->__nodePosition($this->struct[0]['childs'][0], 0, 0, $this->struct[0]['childs'][0]['attrib']['NODEHEIGHT']);\n return $data;\n }", "function _init(){\n\t\t$total = $this->node->childCount;\n\n\t\tfor($i = 0; $i < $total; $i++) {\n\t\t\t$currNode =& $this->node->childNodes[$i];\n\t\t\t$tagName = strtolower($currNode->nodeName);\n\n\t\t switch ($tagName) {\n case DOMIT_RSS_ELEMENT_TITLE:\n case DOMIT_RSS_ELEMENT_LINK:\n case DOMIT_RSS_ELEMENT_DESCRIPTION:\n case DOMIT_RSS_ELEMENT_URL:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_WIDTH:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_HEIGHT:\n\t\t\t\t $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_simpleelement($currNode);\n\t\t\t\t break;\n\t\t\t\tdefault:\n\t\t\t\t $this->addIndexedElement($currNode);\n\t\t\t\t //$this->DOMIT_RSS_indexer[$tagName] =& $currNode;\n\t\t }\n\t\t}\n\t}", "private function prepareObjectArray(){\n\t//scorro l' array $this->objarr settando su ciascun oggetto gli attributi children\n\tforeach($this->objarr as $key=>$object){\n\t\t//echo \"-\".$object->getAppendToIndex().\"<br />\";\n\t\t\n\t\tif(($appind=$object->getAppendToIndex()) != \"\"){\n\t\t\n\t\t$object->setIntegrated(true); //indico che l' oggetto è stato incluso come figlio di un altro.\t\n\t\t\n\t\t $objparent=$this->objarr[$appind];\n\t\t\t$objparent->appendChild($object);\t\n\t\t\t//echo $objparent->getIndex();\n\t\t}\n\t}\n}", "private function brokeTree()\n {\n $i = 0;\n foreach ($this->nodeIdList as $node) {\n $this->getDb()->createCommand()->update(\n self::tableName(),\n [\n $this->leftAttribute => ++$i,\n $this->rightAttribute => ++$i,\n $this->depthAttribute => 0,\n '_tree' => $this->globalParentNode,\n ],\n ['=', 'id', $node]\n )->query();\n }\n }", "public function getChildElements() {}", "function _init(){\n\t\t$total = $this->node->childCount;\n\n\t\tfor($i = 0; $i < $total; $i++) {\n\t\t\t$currNode =& $this->node->childNodes[$i];\n\t\t\t$tagName = strtolower($currNode->nodeName);\n\n\t\t switch ($tagName) {\n case DOMIT_RSS_ELEMENT_TITLE:\n case DOMIT_RSS_ELEMENT_LINK:\n case DOMIT_RSS_ELEMENT_DESCRIPTION:\n case DOMIT_RSS_ELEMENT_NAME:\n\t\t\t\t $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_simpleelement($currNode);\n\t\t\t\t break;\n\t\t\t\tdefault:\n\t\t\t\t $this->addIndexedElement($currNode);\n\t\t\t\t //$this->DOMIT_RSS_indexer[$tagName] =& $currNode;\n\t\t }\n\t\t}\n\t}", "public function removeChildNodes() {}", "public function beginChildren()\n {\n parent::beginChildren();\n\n $this->call($this->descendCallback);\n }", "protected function actionPostLoadingEvent()\n {\n if (self::$child_data === null) {\n self::$child_data = [];\n foreach ($this->getParentModel()->children->child->iterateItems() as $node_uuid => $node) {\n if (empty((string)$node->enabled)) {\n continue;\n }\n $conn_uuid = (string)$node->connection;\n if (!isset(self::$child_data[$conn_uuid])) {\n self::$child_data[$conn_uuid] = [];\n }\n foreach (self::$child_attrs as $key) {\n if (!isset(self::$child_data[$conn_uuid][$key])) {\n self::$child_data[$conn_uuid][$key] = [];\n }\n self::$child_data[$conn_uuid][$key][] = (string)$node->$key;\n }\n }\n }\n foreach ($this->internalChildnodes as $node) {\n if (!$node->getInternalIsVirtual()) {\n $extra_attr = ['local_ts' => '', 'remote_ts' => ''];\n $conn_uuid = (string)$node->getAttribute('uuid');\n foreach (self::$child_attrs as $key) {\n $child_node = new TextField();\n $child_node->setInternalIsVirtual();\n if (isset(self::$child_data[$conn_uuid]) && !empty(self::$child_data[$conn_uuid][$key])) {\n $child_node->setValue(implode(',', array_unique(self::$child_data[$conn_uuid][$key])));\n }\n $node->addChildNode($key, $child_node);\n }\n }\n }\n return parent::actionPostLoadingEvent();\n }", "public function setChildNodeIds(array $ids)\n {\n // since some child nodes may already exist out of order, in order for childNodes to end up\n // in the correct order, we must empty the array first\n $this->_childNodesById = array();\n\n if (count($ids) > 0) {\n // add child nodes, setting their parent/child and inner prev/next relationships\n $this->addChildNodeIds($ids, true, true);\n // addChildNodeIds does not set the first child's previousSibling nor the last's nextSibling\n // so we manually set these to null\n $this->getKnownChildNodeById($ids[0])->setPreviousSiblingId(null, false, false);\n $this->getKnownChildNodeById(array_pop($ids))->setNextSiblingId(null, false, false);\n }\n $this->_allChildrenKnown = true;\n return $this;\n }", "public function setChildren(NodeList $children) {\n\t\t$this->children = $children;\n\t}", "public function __construct()\n {\n $this->children = [];\n }", "public function get_children();", "protected function resolveChildren()\n {\n foreach ($this->unresolvedChildren as $name => $info) {\n $this->children[$name] = $this->create($name, $info['type'], $info['init_options'], $info['exec_options']);\n }\n\n $this->unresolvedChildren = array();\n }", "function composeL1EditForm_nodeDivs() {\n\n /*\n Some things we should have a handle on.\n */\n global $dom;\n $root = $dom->documentElement;\n $children = $root->childNodes;\n $length = $children->length;\n $nodeID = $_SESSION['EKA_nodeID'];\n\n /*\n I'm thinking out-loud here while looking ot the specification I wrote\n in Yahoo! Notepad.\n \n We need to compose a string consisting of the node divs for a patricular\n range of child indices. So, the first thing we need to establish is the\n range. There are three types of ranges: all, local, toEnd. We need to\n have a value for the index of the first and last child in the range.\n */\n $focus = $_SESSION['EKA_intendedFocusAfterL1Edit'];\n if ($focus == 'all') {\n $first = 0;\n $last = ($length - 1);\n } elseif ($focus == 'local') {\n /*The range should be from the second node before nodeID to the second\n node after nodeID (assuming all these nodes exist - adjust appropriately)*/\n /*\n The players: $nodeID, 0, ($length - 1).\n We would prefer that $first = ($nodeID - 2).\n Our second preference is $first = ($nodeID - 1).\n Our last resort is $first = $nodeID.\n */\n $firstPref = ($nodeID - 2);\n $secondPref = ($nodeID - 1);\n if (!($firstPref < 0)) {\n $first = $firstPref;\n } elseif (!($secondPref < 0)) {\n $first = $secondPref;\n } else {\n $first = $nodeID;\n }\n /*\n Our first preference would be $last = ($nodeID + 2).\n Our second preferende would be $last = ($nodeID + 1).\n Our last resort is $last = $nodeID.\n */\n $firstPref = ($nodeID + 2);\n $secondPref = ($nodeID + 1);\n if (!($firstPref > ($length - 1))) {\n $last = $firstPref;\n } elseif (!($secondPref > ($length - 1))) {\n $last = $secondPref;\n } else {\n $last = $nodeID;\n }\n } elseif ($focus == 'toEnd') {\n /*The range should be from the second node before nodeID to the last\n node (assuming all these nodes exist - adjust appropriately)*/\n /*\n We would prefer that $first = ($nodeID - 2).\n Our second preference is $first = ($nodeID - 1).\n Our last resort is $first = $nodeID.\n */\n $firstPref = ($nodeID - 2);\n $secondPref = ($nodeID - 1);\n if (!($firstPref < 0)) {\n $first = $firstPref;\n } elseif (!($secondPref < 0)) {\n $first = $secondPref;\n } else {\n $first = $nodeID;\n }\n $last = ($length - 1);\n } else {\n form_destroy();\n die('Non-valid focus. Err 119410. -Programmer.');\n }\n\n $string = makeL1EditForm_nodeDivs($first, $last);\n return $string;\n}", "function init(&$node){\n\tif(!$node) return;\n\tforeach($node->getChildNode() as &$childNode){\n\t\t$childNode->addParentNode($node);\n\t\tinit($childNode);\n\t}\n}", "public function getChildren() {}", "public function getChildren() {}", "public function getChildren() {}", "public function renderChildren() {}", "public function rewind()\r\n {\r\n reset($this->children);\r\n }", "public function evaluateChildNodes();", "private function setParentChildrenClass() {\n $tmp_schemedata = $this->schemedata;\n \n // replace parents with primary key.\n foreach($this->schemedata as $index => $class) {\n $parents = array();\n $see = array();\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $parent) {\n $tmp = $tmp_class['pkFields'];\n $tmp_cols = $cols;\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n $key = array_shift($tmp_cols);\n $tmp2[$key] = $val;\n }\n $parents[$tmp_class['name']] = $tmp2;\n $see[] = $tmp_class['name'];\n }\n }\n }\n $this->schemedata[$index]['parents'] = $parents;\n $this->schemedata[$index]['see'] = $see;\n }\n\n // children\n foreach($this->schemedata as $index => $class) {\n foreach ($class['parents'] as $parent=>$cols) {\n foreach($tmp_schemedata as $tmp_class) {\n if ($tmp_class['table'] == $this->schemedata[$parent]['table']) {\n if ($class['type'] != 'TO' AND $class['type'] != 'TS' AND $class['type'] != 'TB') {\n $tmp = $class['parents']; // children's parent def\n $tmp2 = array();\n foreach ($tmp as $key=>$val) {\n if($key == $tmp_class['name']) {\n $tmp2 = $val;\n }\n }\n if($class['name']) {\n $this->schemedata[$tmp_class['name']]['children'][$class['name']] = $tmp2;\n $this->schemedata[$tmp_class['name']]['see'][] = $class['name'];\n } else {\n $this->schemedata[$tmp_class['name']]['children'][$index] = $tmp2;\n }\n }\n }\n }\n }\n }\n\n // relationships\n foreach($this->schemedata as $class) {\n if ($class['type'] == 'TO' OR $class['type'] == 'TS' OR $class['type'] == 'TB') {\n foreach ($class['parents'] as $parent=>$pkFields) {\n if(!isset($this->schemedata[$parent]['relationships'])) {\n $this->schemedata[$parent]['relationships'] = array();\n }\n // add parent to another parent list getter\n foreach ($class['parents'] as $p=>$fs) {\n if ($parent != $p) {\n $type = 'List';\n $mname = '';\n foreach($fs as $k => $v) {\n $name = $k;\n }\n foreach($class['params'] as $param) {\n if($name == $param['name']) {\n $type = ($param['pair']=='N')?'List':'Class';\n break;\n }\n }\n\n $this->schemedata[$parent]['relationships'][$p]= array(\n 'table' => $class['table'],\n 'myFields' => $pkFields,\n 'fields' => $fs,\n 'type' => $type\n );\n }\n }\n }\n }\n }\n\n // rewrite relation key for parents, children and relations\n foreach($this->schemedata as $key => $class) {\n // parent\n foreach($class['parents'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$k2) {\n unset($this->schemedata[$key]['parents'][$k1][$k2]);\n $this->schemedata[$key]['parents'][$k1][$param['mname']] = $value;\n break;\n }\n }\n }\n }\n // children\n foreach($class['children'] as $k1 => $values) {\n foreach($values as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['children'][$k1][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n // relations\n if(isset($class['relationships'])) {\n foreach($class['relationships'] as $k1 => $values) {\n foreach($values['myFields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['myFields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n foreach($values['fields'] as $k2 => $value) {\n foreach($class['params'] as $param) {\n if($param['name']==$value) {\n $this->schemedata[$key]['relationships'][$k1]['fields'][$k2] = $param['mname'];\n break;\n }\n }\n }\n }\n }\n }\n }", "protected function preorder($nodes){\n if(empty($nodes)){\n return;\n }\n\n foreach($nodes as $node){\n $this->visit_root($node);\n\n $this->visit_children($node);\n }\n }", "public function completeNode() {\n $this->current = $this->current->parent();\n }", "protected function organizing()\n {\n $nbrOfNodes = \\count($this->getNodes());\n\n for ($i = 0; $i < $nbrOfNodes; $i++) {\n $node = $this->getNodes()[$i];\n\n if ($node instanceof Constraint) {\n if ($node instanceof Index) {\n $this->indexes[] = $node;\n } else {\n $this->constraints[] = $node;\n }\n\n $this->removeNode($i--);\n $nbrOfNodes--;\n }\n }\n }", "public function setChildren(array $children)\n {\n $this->children = [];\n foreach ($children as $child) {\n if ($child instanceof Node) {\n $this->addChild($child);\n }\n }\n }", "function FixTree(&$tree)\r\n\t{\r\n\t\tusort($tree->children, array($this, \"SortByChild\"));\r\n\t\tif (!empty($tree->children))\r\n\t\tforeach ($tree->children as $cnode) $this->FixTree($cnode);\r\n\t}", "public function getChildren()\n {\n }", "public function getChildren()\n {\n }", "public function getChilds();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function getChildren();", "public function cleanChildrenPositions(bool $setPositions = true): float\n {\n /*\n * Force collection to sort on position\n */\n $sort = Criteria::create();\n $sort->orderBy([\n 'position' => Criteria::ASC\n ]);\n\n $children = $this->getNode()->getChildren()->matching($sort);\n $i = 1;\n /** @var Node $child */\n foreach ($children as $child) {\n if ($setPositions) {\n $child->setPosition($i);\n }\n $i++;\n }\n\n return $i;\n }", "public function iterateChildren();", "public function __construct()\n {\n $this->parent = null;\n $this->children = array();\n }", "function loadedChildren()\r\n {\r\n //Calls childrens loaded recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->loaded();\r\n }\r\n }", "public function reorder()\n {\n $node = $this->page->find($this->request->get('nodeToChangeParent'));\n\n if ($this->request->get('parent') === '#') {\n $node->makeRoot();\n $this->changeSiblingsPositions($node, $this->request->get('position'));\n } else {\n $parent = $this->page->find($this->request->get('parent'));\n $node->makeChildOf($parent);\n $this->changeSiblingsPositions($node, $this->request->get('position'));\n }\n\n return [\n 'Position changed' => true,\n ];\n }", "private function initDepth()\n {\n if ($this->depth !== null) { // Is de diepte reeds ingesteld?\n return;\n }\n if (isset(self::$current) == false) { // Gaat het om de eerste VirtualFolder (Website)\n if (($this instanceof Website) == false) {\n notice('VirtualFolder outside a Website object?');\n }\n self::$current = &$this; // De globale pointer laten verwijzen naar deze 'virtuele map'\n if (defined('Sledgehammer\\WEBPATH')) {\n $this->depth = preg_match_all('/[^\\/]+\\//', \\Sledgehammer\\WEBPATH, $match);\n } else {\n $this->depth = 0;\n }\n\n return;\n }\n $this->parent = &self::$current;\n self::$current = &$this; // De globale pointer laten verwijzen naar deze 'virtuele map'\n $this->depth = $this->parent->depth + $this->parent->depthIncrement;\n }", "public function testNodeinsertAsChildAtPositionToNewNode()\n {\n $this->haveFixture('animal', 'an_addon', false);\n \n $model13 = Animal::findOne(13);\n $model = new Animal(['name' => 'new']);\n \n $this->expectExceptionMessage('You cannot add nodes to a new node');\n $model13->insertAsChildAtPosition($model, 3);\n }", "function getChildren() {\n foreach ( $this->parents as $parent ) {\n $this->children[$parent->name()]=array();\n foreach ( $this->items as $item ) {\n if ( $item->parent_id() == $parent->id() ) {\n $this->children[$parent->name()][]=$item;\n }\n }\n }\n }", "public function __clone()\n\t{\n\t\t$this->children=[];\n\t}", "function addChildren(array $children) : void;", "protected function listChildren()\n {\n $this->children = new ArrayObject();\n if ($this->cursor instanceof DOMNode) {\n $childrenNodes = $this->cursor->childNodes;\n foreach ($childrenNodes as $child) {\n switch ($child->nodeName) {\n case 'text:p':\n $element = new OpenDocument_Element_Paragraph($child, $this);\n break;\n case 'text:h':\n $element = new OpenDocument_Element_Heading($child, $this);\n break;\n default:\n $element = false;\n }\n if ($element) {\n $this->children->append($element);\n }\n }\n }\n }", "private function parse()\n {\n $this->parseChildrenNodes($this->_dom, $this->_rootNode);\n }", "public function setChildrenFromDOMNodes(array $children): void\n {\n foreach ($children as $node) {\n if ($node instanceof DOMText) {\n // TODO: we are skipping the actual text inside the Node.. is this useful?\n continue;\n }\n\n switch ($node->localName) {\n case Payment::NODE_NAME:\n $payment = Payment::createFromDomNode($node);\n $this->addPayment($payment);\n break;\n default:\n throw new CFDIException(sprintf(\"Unknown children node '%s' in %s\", $node->nodeName, self::NODE_NS_NAME));\n }\n }\n }", "public function getChildren(array $columns = ['*']);", "public function reSetDepth()\n\t{\t\t\n\t\tif ($this->getParentId() !== 0 && $this->getParentId() != null)\n\t\t{\n\t\t\t$parentCat = $this->getParentCategory();\n\t\t\t$this->setDepth($parentCat->getDepth() + 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setDepth(0);\n\t\t}\n\t}", "public function initializeTreeData() {}", "public function initializeTreeData() {}", "function __renumber($node_id = 1, $i = 1)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$query = 'UPDATE '.$this->table_tree.' SET lft = %s WHERE child = %s';\n\t\t$res = $ilDB->manipulateF($query,array('integer','integer'),array(\n\t\t\t$i,\n\t\t\t$node_id));\n\n\t\t$childs = $this->getChilds($node_id);\n\n\t\tforeach ($childs as $child)\n\t\t{\n\t\t\t$i = $this->__renumber($child[\"child\"],$i+1);\n\t\t}\n\t\t$i++;\n\t\t\n\t\t// Insert a gap at the end of node, if the node has children\n\t\tif (count($childs) > 0)\n\t\t{\n\t\t\t$i += $this->gap * 2;\n\t\t}\n\t\t\n\t\t\n\t\t$query = 'UPDATE '.$this->table_tree.' SET rgt = %s WHERE child = %s';\n\t\t$res = $ilDB->manipulateF($query,array('integer','integer'),array(\n\t\t\t$i,\n\t\t\t$node_id));\n\t\treturn $i;\n\t}", "function push_nodelist() {\r\n\t\t\r\n\t\tif (!is_null($this->right)) {\r\n\t\t\t$this->nodelists[] = array($this->right, $this->nodelist);\r\n\t\t\t\r\n\t\t} \r\n\t\t\r\n\t}", "function preinit()\r\n {\r\n //Calls children's init recursively\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->preinit();\r\n }\r\n }", "public function getNumberChildren();", "public function setChildren(array $children);", "protected function deleteChildren() {}", "protected function transferNestedColumnPosition()\n {\n $select_fields = 'tx_multicolumn_parentid, colPos';\n $where = 'tx_multicolumn_parentid > 0 AND deleted = 0';\n $resource = $this->execSelect($select_fields, $where);\n if ($resource === false) {\n $this->results['error'] = 'error_no_mc_contents';\n return false;\n }\n\n // Find colPos values used for elements in multicolum containers\n $mcColPosValsPerParent = array();\n while ($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($resource)) {\n $mcpid = $row['tx_multicolumn_parentid'];\n if (!isset($mcColPosValsPerParent[$mcpid])) {\n $mcColPosValsPerParent[$mcpid] = array(\n 'colPosVals' => array(),\n 'geLayout' => '',\n );\n }\n $mcColPosValsPerParent[$mcpid]['colPosVals'][] = $row['colPos'];\n }\n $GLOBALS[\"TYPO3_DB\"]->sql_free_result($resource);\n\n // Update colPos values\n foreach ($mcColPosValsPerParent as $mcpid => &$array) {\n $array['colPosVals'] = array_unique($array['colPosVals']);\n $select_fields = 'uid, tx_gridelements_backend_layout';\n $where = 'uid = ' . $mcpid;\n $resource = $this->execSelect($select_fields, $where);\n if ($resource === false) {\n continue; // Parent container doesn't exist anymore.\n }\n\n while ($row = $GLOBALS[\"TYPO3_DB\"]->sql_fetch_assoc($resource)) {\n $array['geLayout'] = $row['tx_gridelements_backend_layout'];\n }\n $GLOBALS[\"TYPO3_DB\"]->sql_free_result($resource);\n }\n\n $layoutColPosVals = $this->getLayoutColPosVals();\n foreach ($mcColPosValsPerParent as $mcpid => $array) {\n $i = 0;\n foreach ($array['colPosVals'] as $colPos) {\n $where = 'tx_multicolumn_parentid = ' . $mcpid\n . ' AND colPos = ' . $colPos;\n $geColumn = $i + 100;\n $geColPos = -2; // Column NOT available in GE layout\n if (isset($layoutColPosVals[$array['geLayout']][$i])) {\n $geColumn = $layoutColPosVals[$array['geLayout']][$i];\n $geColPos = -1; // Column available in GE layout\n }\n $fields_values = array(\n 'colPos' => $geColPos,\n 'backupColPos' => $colPos,\n 'tx_gridelements_columns' => $geColumn,\n );\n $this->execUpdate($where, $fields_values);\n ++$i;\n }\n }\n $this->results['transferNestedColumnPosition'] = true;\n return true;\n }", "function _makeChilds()\n\t{\n\t\t$menuIdToSort = array();\n\t\t$IDs = array_keys($this->_siteMapArray);\n\t\tforeach ($IDs as $key)\n\t\t{\n\t\t\t$menuNode = &$this->_siteMapArray[$key];\n\t\t\t$parentId = $menuNode['parentId'];\n\n\t\t\tif ( !is_bool( $menuNode['isVisible'] ) )\n\t\t\t{\n\t\t\t\tif (preg_match(\"/\\{php\\:.*\\}/i\", $menuNode['isVisible'] ) )\n\t\t\t\t{\n\t\t\t\t\t$phpcode = org_glizy_helpers_PhpScript::parse( $menuNode['isVisible'] );\n\t\t\t\t\t$menuNode['isVisible'] = eval($phpcode)==1 ? true : false;\t\t\t\t\t\n\t\t\t\t\t$menuNode['hideByAcl'] = !$menuNode['isVisible'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$menuNode['isVisible'] = $menuNode['isVisible']==='false' ? false : true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !$this->isAdmin && $menuNode['isLocked'] && !$this->_user->isLogged() && $this->hidePrivatePage ) {\n\t\t\t\t$menuNode['isVisible'] = false;\n\t\t\t\t$menuNode['hideByAcl'] = true;\n\t\t\t}\n\n\t\t\t$this->_pageTypeMap[strtolower($menuNode['pageType'])] = &$menuNode;\n\t\t\tif (($this->_type=='db' && $parentId==0) || ($this->_type=='xml' && $parentId=='') || ($this->_type=='' && $parentId===0)) continue;\n\n\t\t\tif (isset($this->_siteMapArray[$parentId]))\n\t\t\t{\n\t\t\t\t$menuNodeParent = &$this->_siteMapArray[$parentId];\n\n\t\t\t\t// aggiunge il riferimento come childNode\n\t\t\t\t$menuNodeParent['childNodes'][] = $menuNode['id'];\n\t\t\t\t$menuNode['depth'] \t\t\t\t= $menuNodeParent['depth']+1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// cancella il menu\n\t\t\t\t// perché è orfano\n\t\t\t\tunset($this->_siteMapArray[$key]);\n\t\t\t\t// TODO cancellare anche i figli in modo ricorsivo\n\t\t\t}\n\n\t\t\tif ($menuNode['sortChild']) {\n\t\t\t\t$menuIdToSort[] = $key;\n\t\t\t}\n\t\t}\n\n\t\t// order the menus\n\t\tforeach($menuIdToSort as $key) {\n\t\t\t$menuNode = &$this->_siteMapArray[$key];\n\t\t\t$tempNode = array();\n\t\t\tforeach($menuNode['childNodes'] as $childId) {\n\t\t\t\t$tempNode[$childId] = &$this->_siteMapArray[$childId];\n\t\t\t}\n\t\t\tusort($tempNode, function($a, $b) {\n\t\t\t\tif (!$a['title'] && !$b['title']) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} else if (!$a['title']) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (!$b['title']) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn strnatcasecmp($a['title'], $b['title']);\n\t\t\t\t}\n\t\t\t});\n\t\t\t$menuNode['childNodes'] = array();\n\t\t\tforeach($tempNode as $node) {\n\t\t\t\t$menuNode['childNodes'][] = $node['id'];\n\t\t\t}\n\t\t}\n\n\t\t$this->_makeDepth($IDs[0], 0);\n\t}", "public function loadChildNodes()\n {\n $ids = $this->_cache->getBackend()->getChildNodeIds($this);\n return $this->setChildNodeIds($ids);\n }", "public function endChildren()\n {\n parent::endChildren();\n\n $this->call($this->ascendCallback);\n }", "public function reposition_self($pos){ //TODO: could set 1 as default\n\t\t//throw new Exception('ha, gotcha!!');\n\t\t\n\t\t\n\t\t$this->__set('left',$pos++);\n\t\tforeach($this->kids as $kid) $pos = $kid->reposition_self($pos);\n\t\t$this->__set('right',$pos++);\n\t\t\n\t\t//TODO: BUGFIX, this shouldn't be necessary.\n\t\tif(get_class($this) == 'ContentBox')\n\t\t\t$this->reposition_kids();\n\t\t\n\t\t$this->store(); //we might need a writeback ...\n\n\t\treturn $pos;\n\t}", "public function __construct()\n {\n $this->children = new ArrayCollection();\n }", "public function optimizeIteration( ) {\n\t\tif ( ( ( self::ALTERNATE === $this->mType )\n\t\t && ( 1 === count( $this->mChildNodes ) )\n\t\t )\n\t\t || ( ( self::SEQUENCE === $this->mType )\n\t\t\t && ( 1 === count( $this->mChildNodes ) )\n\t\t\t )\n\t\t ){\n\t\t\t$son = $this->mChildNodes[0];\n\t\t\t\n\t\t\t$this->mType \t\t\t= $son->mType;\n\t\t\t$this->mToken \t\t\t= $son->mToken;\n\t\t\t$this->mChildNodes \t\t= $son->mChildNodes;\n\t\t\t$this->mLookAheadSet \t= $son->mLookAheadSet;\n\t\t\t$this->mASTSymbol \t= $son->mASTSymbol;\n\t\t\t$this->mEnclosingRule \t= $son->mEnclosingRule;\n\n\t\t\tforeach( $this->mChildNodes as $key => $value ) {\n\t\t\t\t$value->mParentNode = $this;\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\tif ( ( ( self::ALTERNATE === $this->mType )\n\t\t && ( 0 < count( $this->mChildNodes ) ) \n\t\t && ( self::ALTERNATE === $this->mChildNodes[0]->mType ) \n\t\t && ( 0 < count( $this->mChildNodes[0]->mChildNodes ) ) \n\t\t )\n\t\t ){\n\t\t\t\n\t\t\t$son = $this->mChildNodes[0]->mChildNodes[0];\n\t\t\t$this->appendChild( $son );\n\t\t\t\n\t\t\t$son->mParentNode = $this;\n\n\t\t\tarray_shift( $this->mChildNodes[0]->mChildNodes );\n\t\t\t\n\t\t}\n\n\n\n\t\tforeach( $this->mChildNodes as $key => $value ) {\n\t\t\t$value->optimizeIteration();\n\t\t}\n\t\t\n\t}", "function ys_makelaar_fill_items($makelaars_id, $realty_item_id, $web_page) {\n $xpath = new DOMXpath($web_page);\n $Xresult = $xpath-> query('//div[@id=\"content_small\"]/div[1]/div/h1');\n $object_title = $Xresult-> item(0) ->nodeValue;\n // DEBUG drupal_set_message($object_title. \" | \");\n $values = $xpath-> query('//div[(@id=\"detail_content_coll\" or @id=\"detail_content\")]/table/tr/td');\n /* DEBUG foreach($values as $value) {\n echo $value-> nodeValue ;\n echo '<br />';\n }*/\n $node = new stdClass();\n\t$node-> type = 'job_post';\n\tnode_object_prepare($node); //default node items invullen\n $node-> ysm_id = $realty_item_id; //TODOitem id van detail tabel koppelen aan die van de bron tabel\n $node-> title = $object_title;\n\t$node->language = 'en';\n\t\n for ($i = 0; $i < $values->length; $i=$i+2) {\n //detailgegevens parsen\n $value = $values-> item($i)->nodeValue;\n $value1 = strtr($value, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES))); \n str_replace('&nbsp;','',$value);\n $next_value = $values-> item($i+1)->nodeValue;\n // DEBUG drupal_set_message(trim($value) .'| '. $next_value . '<br />');\n switch(trim($value1,chr(0xC2).chr(0xA0))) {\n case 'Prijs: ' :\n $node-> t_prijs[$node-> language][0]['value'] = $next_value; \n\t\t\t\tdrupal_set_message('next_value = '. $next_value . ' | node = '. $node-> t_prijs[$node-> language][0]['value']); \n break;\n case 'Wijk: ' :\n $node-> wijk[$node->language][0]['value'] = $next_value; break; \n case 'Bouwjaar: ' :\n $node-> t_bouwjaar[$node->language][0]['value'] = $next_value; break; \n case 'Slaapkamers: ' :\n $node-> t_slaapkamers[$node->language][0]['value'] = $next_value; break; \n case 'Badkamers: ' :\n $node-> t_badkamers[$node->language][0]['value'] = $next_value; break; \n case 'Datum oplevering: ' :\n $node-> oplevering[$node->language][0]['value'] = $next_value; break; \n case 'Woonoppervlakte: ' :\n $node-> t_woonoppervl[$node->language][0]['value'] = $next_value; break; \n case 'Kavelgrootte: ' : \n $node-> t_kavel[$node->language][0]['value'] = $next_value; break;\n case 'Project: ' : \n $node-> project[$node->language][0]['value'] = $next_value; break; \n case 'Zwembad: ' : \n $node-> zwembad[$node->language][0]['value'] = 1; break; \n case 'Zeezicht: ' : \n $node-> zeezicht[$node->language][0]['value'] = 1; break; \n default:\n echo(trim($value1,chr(0xC2).chr(0xA0)). '| not matched<br />');\n }\n } // foreach\n\t //drupal_set_message('buiten loop '. $node-> t_prijs[$node-> language][0]['value']);\n // omschrijving parsen\n $xpath = new DOMXpath($web_page);\n $values = $xpath-> query('//div[@id=\"detail_content_nocolor\"]');\n $body_text = $values-> item(0) ->nodeValue;\n\n// Object valuta ophalen uit omschrijving:\n // $node-> valuta[$node->language][0]['value'] = substr($body_text, -4, 3);\n\t\n\t// Items wegschrijven als ysm node.\n\n $node->body[$node->language][0]['value'] = $body_text;\n $node->body[$node->language][0]['summary'] = text_summary($body_text);\n $node->body[$node->language][0]['format'] = 1;\n// $path = 'content/programmatically_created_node_' . date('YmdHis');\n// $node->path = array('alias' => $path);\n // drupal_set_message('voor save '. $node-> t_prijs[$node-> language][0]['value']); debug\n node_save($node);\n //drupal_set_message('na save '. $node-> t_prijs[$node-> language][0]['value']); debug\n \n\n // url van de plaatjes opslaan\n ys_makelaar_get_images_links($makelaars_id, $realty_item_id, $web_page, $node-> nid);\n\n}", "function _init() {\n\t\t$total = $this->node->childCount;\n\t\t$itemCounter = 0;\n\t\t$categoryCounter = 0;\n\t\t\n\t\tfor ($i = 0; $i < $total; $i++) {\n\t\t\t$currNode =& $this->node->childNodes[$i];\n\t\t\t$tagName = strtolower($currNode->nodeName);\n\t\t\t\n\t\t\tswitch($tagName) {\n\t\t\t\tcase DOMIT_RSS_ELEMENT_ITEM:\n\t\t\t\t\t$this->domit_rss_items[$itemCounter] =& new xml_domit_rss_item($currNode);\n\t\t\t\t\t$itemCounter++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_CATEGORY:\n\t\t\t\t\t$this->domit_rss_categories[$categoryCounter] =& new xml_domit_rss_category($currNode);\n\t\t\t\t\t$categoryCounter++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_IMAGE:\n\t\t\t\t\t$this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_image($currNode);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_CLOUD:\n\t\t\t\t\t$this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_cloud($currNode);\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOMIT_RSS_ELEMENT_TEXTINPUT:\n\t\t\t\t\t$this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_textinput($currNode);\n\t\t\t\t\tbreak;\n case DOMIT_RSS_ELEMENT_TITLE:\n case DOMIT_RSS_ELEMENT_LINK:\n case DOMIT_RSS_ELEMENT_DESCRIPTION:\n case DOMIT_RSS_ELEMENT_LANGUAGE:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_COPYRIGHT:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_MANAGINGEDITOR:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_WEBMASTER:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_PUBDATE:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_LASTBUILDDATE:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_GENERATOR:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_DOCS:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_TTL:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_RATING:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_SKIPHOURS:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_SKIPDAYS:\n\t\t\t\t $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_simpleelement($currNode);\n\t\t\t\t break;\n\t\t\t\tdefault:\n\t\t\t\t $this->addIndexedElement($currNode);\n\t\t\t\t\t//$this->DOMIT_RSS_indexer[$tagName] =& $currNode;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($itemCounter != 0) {\n\t\t\t$this->DOMIT_RSS_indexer[DOMIT_RSS_ARRAY_ITEMS] =& $this->domit_rss_items;\n\t\t}\n\t\t\n\t\tif ($categoryCounter != 0) {\n\t\t\t$this->DOMIT_RSS_indexer[DOMIT_RSS_ARRAY_CATEGORIES] =& $this->domit_rss_categories;\n\t\t}\n\t}", "public function countChildren();", "public function setChildren(array $children) {\n\t\t$this->tmpSetChildren($children);\n\t}", "public function getChildAt($position, array $columns = ['*']);", "public function initializeChildren() {\n\t\tif ($this->initialized === TRUE) {\n\t\t\treturn;\n\t\t}\n\t\t/** @var \\TYPO3\\CMS\\Core\\Resource\\Folder $folder */\n\t\t$subFolders = $this->folder->getSubfolders();\n\t\tforeach ($subFolders as $folder) {\n\t\t\t$f = new Storage($this->mapFolderIdToEntityName($folder->getName()), array());\n\t\t\t$f->setStorage($this->storage);\n\t\t\t$f->setFolder($folder);\n\t\t\t$this->addChild($f);\n\t\t}\n\n\t\t$files = $this->folder->getFiles();\n\t\tforeach ($files as $file) {\n\t\t\t$f = new File();\n\t\t\t$f->setFalFileObject($file);\n\t\t\t$this->addChild($f);\n\t\t}\n\t\t$this->initialized = TRUE;\n\t}", "protected function buildRenderChildrenClosure() {}", "public function testChildren()\n {\n $cData = $this->demoCData();\n $comment1 = $this->demoComment();\n $comment2 = $this->demoComment();\n $comment3 = $this->demoComment();\n\n $element1 = $this->demoElement()\n ->insertAfter($cData)\n ->insertAfter($comment1);\n $element2 = $this->demoElement()\n ->insertAfter($comment2);\n\n $dom = (new Dom())\n ->add($element1)\n ->add($element2)\n ->add($comment3);\n\n $this->assertSame([$cData, $comment1, $comment2], $dom->children()->get());\n }", "public static final function inject_trees(&$parent_array,&$children_trees,$parent_ident_field,$kids_field){\n\t\tforeach($children_trees as $kid){\n\t\t\tif(isset($parent_array[$kid->$parent_ident_field])){\n\t\t\t\t$parent_array[$kid->$parent_ident_field]->insert_kids($kid,'e'); //insert at end.\n\t\t\t}\n\t\t}\n\t}", "public function updateValue(){\n\n\t\t$this->value += (int)max($this->left_parent_value,$this->right_parent_value);\n\t}", "function _init(){\n\t\t$total = $this->node->childCount;\n\t\t$categoryCounter = 0;\n\t\t\n\t\tfor($i = 0; $i < $total; $i++) {\n\t\t\t$currNode =& $this->node->childNodes[$i];\n\t\t\t$tagName = strtolower($currNode->nodeName);\n\t\t\n\t\t switch ($tagName) {\n\t\t case DOMIT_RSS_ELEMENT_CATEGORY:\n\t\t $this->categories[$categoryCounter] =& new xml_domit_rss_category($currNode);\n\t\t\t\t\t$categoryCounter++;\n\t\t break;\n case DOMIT_RSS_ELEMENT_ENCLOSURE:\n $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_enclosure($currNode);\n\t\t break;\n case DOMIT_RSS_ELEMENT_SOURCE:\n $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_source($currNode);\n\t\t break;\n case DOMIT_RSS_ELEMENT_GUID:\n $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_guid($currNode);\n\t\t break;\n case DOMIT_RSS_ELEMENT_TITLE:\n case DOMIT_RSS_ELEMENT_LINK:\n case DOMIT_RSS_ELEMENT_DESCRIPTION:\n case DOMIT_RSS_ELEMENT_AUTHOR:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_COMMENTS:\n\t\t\t\tcase DOMIT_RSS_ELEMENT_PUBDATE:\n\t\t\t\t $this->DOMIT_RSS_indexer[$tagName] =& new xml_domit_rss_simpleelement($currNode);\n\t\t\t\t break;\n\t\t\t\tdefault:\n\t\t\t\t $this->addIndexedElement($currNode);\n\t\t\t\t //$this->DOMIT_RSS_indexer[$tagName] =& $currNode;\n\t\t }\n\t\t}\n\t\t\n\t\tif ($categoryCounter != 0) {\n\t\t\t$this->DOMIT_RSS_indexer[DOMIT_RSS_ARRAY_CATEGORIES] =& $this->domit_rss_categories;\n\t\t}\n\t}", "public function clearChildren(): void\n {\n if ($this->children instanceof Collection) {\n $this->children = new Collection;\n return;\n }\n\n $this->children = [];\n }", "public function testExistedNodeSiblingsMoveAppendTo()\n {\n $model8 = Animal::findOne(8);\n \n $this->assertTrue($model8->appendTo($model8->parent()));\n $this->assertEquals(3, $model8->weight);\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }", "public function get_nodes()\n {\n }" ]
[ "0.6655544", "0.6473671", "0.64735717", "0.6251944", "0.6241311", "0.61856717", "0.6158279", "0.6079425", "0.60539937", "0.59365493", "0.5872178", "0.5855873", "0.580003", "0.5780835", "0.5752802", "0.57238847", "0.5706202", "0.56814253", "0.5673971", "0.56584454", "0.56254077", "0.5613017", "0.56065005", "0.55942684", "0.5593545", "0.5565211", "0.55595815", "0.5549814", "0.55360305", "0.5504603", "0.5493831", "0.5482458", "0.5482458", "0.5482458", "0.54313534", "0.54146206", "0.5411494", "0.5403972", "0.5390866", "0.53566754", "0.53066915", "0.5289437", "0.52894104", "0.5260949", "0.5260949", "0.5257631", "0.52539766", "0.52539766", "0.52539766", "0.52539766", "0.52539766", "0.52539766", "0.52539766", "0.52539766", "0.52539766", "0.52332324", "0.5230392", "0.52286446", "0.5218501", "0.5209553", "0.5188462", "0.51755464", "0.51681644", "0.5167898", "0.51678246", "0.5166392", "0.51574427", "0.5152315", "0.51444393", "0.5141869", "0.5139879", "0.5139879", "0.5134539", "0.5133399", "0.51324874", "0.51247585", "0.5117598", "0.51108587", "0.51088536", "0.5090713", "0.5073515", "0.5069402", "0.50691885", "0.50433445", "0.5039774", "0.5031243", "0.5021495", "0.5018206", "0.50078887", "0.4997774", "0.49947134", "0.49892843", "0.49851584", "0.49832162", "0.49796504", "0.49765462", "0.49716124", "0.4969628", "0.49654666", "0.49654666", "0.49654666" ]
0.0
-1
Function builds BNode from string given. If get_values = true, fills node data with key=>values
function get_node($str, $pos, $get_data) { $start = 0; $len = $this->n_format['flag']['length'] + $this->d_len; $flag = $this->get_substr($str, $start, $len); $parent_pos = $this->get_pos_value($this->get_substr($str, $start, $this->pos_len + $this->d_len)); $keys = $this->get_property_arr('keys', $str); $children_pos = $this->get_property_arr('children_pos', $str); $values_pos = $this->get_property_arr('values_pos', $str); return new BNode($pos, $keys, $parent_pos, $children_pos, $values_pos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function build($value, $key)\n {\n $key = str_replace(\"_\", \" \", $key);\n\n if ($value) {\n if (in_array($key, [\"code\", \"name\", \"native\"])) {\n $key = \"Language \" . $key;\n } else {\n $key = ucfirst($key);\n }\n $this->allData[$key] = $value;\n }\n }", "function new_node_str($flag = '', $parent_pos = null, $keys = null, $values_pos = null, $children_pos = null)\n {\n $empty_str = str_repeat(Database::$empty_char, $this->pos_len);\n\n $flag_str = $flag ? $flag : str_repeat(Database::$empty_char, $this->n_format['flag']['length']);\n\n $parent_pos_str = $parent_pos ? str_pad($parent_pos, $this->pos_len, Database::$empty_char, STR_PAD_LEFT)\n : $empty_str;\n\n $keys_str = $this->get_property_pos_str($keys, $this->t * 2 - 1);\n $values_pos_str = $this->get_property_pos_str($values_pos, $this->t * 2 - 1);\n $children_pos_str = $this->get_property_pos_str($children_pos, $this->t * 2);\n\n if ($this->is_delimited) {\n $d = $this->delimiter;\n return $flag_str . $d . $parent_pos_str . $d . $keys_str . $d . $values_pos_str . $d . $children_pos_str . \"\\n\";\n } else {\n return $flag_str . $parent_pos_str . $keys_str . $values_pos_str . $children_pos_str . \"\\n\";\n }\n }", "protected function parse()\n {\n if($this->isRelationalKey()){\n $this->parsedValue = $this->makeRelationInstruction();\n } \n else {\n $this->parsedValue = $this->parseFlatValue($this->value);\n } \n }", "function makeNodeObject($NodeHash, $eachNodeName, $NewNodesHash){\n$selConVal1=$NodeHash[$eachNodeName];\n$group1=substr($selConVal1, strlen($selConVal1)-2, 1);\n$ConStr1=substr($selConVal1, 0, strlen($selConVal1)-3);\n$conAry1=explode(\"'\", $ConStr1);\n$conLen1=count($conAry1);\n$conElementsAry1=array();\nfor($i=0; $i<$conLen1; $i++){\n\tif($i%2 != 0){\n\t\tarray_push($conElementsAry1, $conAry1[$i]);\n\t}\n}\n\n$TempAry=array(\"name\"=> $eachNodeName, \"group\"=> intval($group1), \"cc\"=>$conElementsAry1, \"index1\"=>$NewNodesHash[$eachNodeName]);\nreturn json_encode($TempAry);\n}", "public function test_build_a_leaf_instance_with_mixed_values() {\n\t\t\t$confValName = \"value\";\n\t\t\t$confVal = \"testString\";\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$confValName\\\": \\\"$confVal\\\",\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\",\\\"args\\\": [{\\\"dep\\\": \\\"$confValName\\\"},5]}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance = $obj->build($instanceName);\n\t\t\t$result = $instance->val1;\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals($confVal, $result);\n\t\t\t$this->assertEquals($instance->val2, 5);\n\t\t}", "protected function parseToNode($node_id, $node_name, $id, $key, $value)\n\t{\n\t\t$query = \"//*[@c.\" . $node_name . \"][@id='\" . $node_id . \"']//*[@c.\" . $key . \"]\";\n\t\t$results = $this->xpath->query($query);\n\n\t\tif ($results->length > 0) {\n\t\t\t$child_node = $results->item(0);\n\t\t\t$child_node->setAttribute('rel', $id);\n\t\t\t$child_node->setAttribute('id', 'c.' . $key . $id);\n\n\t\t\tif (is_array($value)) {\n\t\t\t\tforeach ($value as $key2 => $value2) {\n\t\t\t\t\tif ($key2 === 0) {\n\t\t\t\t\t\t$child_node->nodeValue = $value2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$child_node->setAttribute($key2, $value2);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->setElementContent($child_node, $value);\n\t\t\t}\n\t\t\t$child_node->removeAttribute('c.' . $key);\n\t\t}\n\t}", "private static function convert($node_name, $arr=array()) \n { \n //print_arr($node_name);\n $xml = self::getXMLRoot();\n $node = $xml->createElement($node_name);\n \n if(is_array($arr)){\n // get the attributes first.;\n if(isset($arr['@attributes'])) {\n foreach($arr['@attributes'] as $key => $value) {\n if(!self::isValidTagName($key)) {\n throw new Exception('[Array2XML] Illegal character in attribute name. attribute: '.$key.' in node: '.$node_name);\n }\n $node->setAttribute($key, self::bool2str($value));\n }\n unset($arr['@attributes']); //remove the key from the array once done.\n }\n \n // check if it has a value stored in @value, if yes store the value and return\n // else check if its directly stored as string\n if(isset($arr['@value'])) {\n $node->appendChild($xml->createTextNode(self::bool2str($arr['@value'])));\n unset($arr['@value']); //remove the key from the array once done.\n //return from recursion, as a note with value cannot have child nodes.\n return $node;\n } else if(isset($arr['@cdata'])) {\n $node->appendChild($xml->createCDATASection(self::bool2str($arr['@cdata'])));\n unset($arr['@cdata']); //remove the key from the array once done.\n //return from recursion, as a note with cdata cannot have child nodes.\n return $node;\n }\n }\n \n //create subnodes using recursion\n if(is_array($arr)){\n // recurse to get the node for that key\n foreach($arr as $key=>$value){\n if(!self::isValidTagName($key)) {\n throw new Exception('[Array2XML] Illegal character in tag name. tag: '.$key.' in node: '.$node_name);\n }\n if(is_array($value) && is_numeric(key($value))) {\n // MORE THAN ONE NODE OF ITS KIND;\n // if the new array is numeric index, means it is array of nodes of the same kind\n // it should follow the parent key name\n foreach($value as $k=>$v){\n $node->appendChild(self::convert($key, $v));\n }\n } else {\n // ONLY ONE NODE OF ITS KIND\n $node->appendChild(self::convert($key, $value));\n }\n unset($arr[$key]); //remove the key from the array once done.\n }\n }\n \n // after we are done with all the keys in the array (if it is one)\n // we check if it has any text value, if yes, append it.\n if(!is_array($arr)) {\n $node->appendChild($xml->createTextNode(self::bool2str($arr)));\n }\n \n return $node;\n }", "function d2d_value_decode($string) {\n $array = preg_split('/\\$/', $string, 2);\n if (sizeof($array) != 2) {\n return array(FALSE, '');\n }\n switch ($array[0]) {\n case 'n': return array(TRUE, NULL);\n case 'b': return array(TRUE, $array[1] ? TRUE : FALSE);\n case 's': return array(TRUE, $array[1]);\n }\n return array(FALSE, '');\n}", "public function test_build_a_leaf_instance_with_configuration_value() {\n\t\t\t$confValName = \"value\";\n\t\t\t$confVal = \"testString\";\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\\\"$confValName\\\": \\\"$confVal\\\",\\\"$instanceName\\\": {\\\"class\\\": \\\"$value\\\",\\\"args\\\": [{\\\"dep\\\": \\\"$confValName\\\"}]}}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$instance = $obj->build($instanceName);\n\t\t\t$result = $instance->val1;\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals($confVal, $result);\n\t\t}", "private function makeStructure3($key, $value, $elements) {\r\n if ($value != '')\r\n $elements->appendChild($this->createElementEscape($key, $value));\r\n return $elements;\r\n }", "public function newBNode($types = array())\n {\n return $this->resource($this->newBNodeId(), $types);\n }", "abstract public function parse($value);", "abstract public static function parse($value);", "public function parse(string $value);", "public function Create ( )\r\n\t {\r\n\t\t$default\t= '' ;\r\n\t\t\r\n\t\tif ( $this -> StringSize < 16384 )\t\t// Not really the maximum size of a VARCHAR, but we have to fix a limit\r\n\t\t {\r\n\t\t\t$value_type\t= \"VARCHAR( {$this -> StringSize} )\" ;\r\n\t\t\t$default\t= \"DEFAULT ''\" ;\r\n\t\t }\r\n\t\telse if ( $this -> StringSize < 65536 )\r\n\t\t\t$value_type\t= \"TEXT\" ;\r\n\t\telse if ( $this -> StringSize < 16 * 1024 * 1024 )\r\n\t\t\t$value_type\t= \"MEDIUMTEXT\" ;\r\n\t\telse\r\n\t\t\t$value_type\t= \"LONGTEXT\" ;\r\n\t\t\r\n\t\tif ( $this -> StringIndexSize )\r\n\t\t\t$value_index\t= \"KEY\t\t( value( {$this -> StringIndexSize} ) ),\" ;\r\n\t\telse\r\n\t\t\t$value_index\t= '' ;\r\n\t\t\r\n\t\t$sql\t= <<<END\r\nCREATE TABLE IF NOT EXISTS {$this -> Name}\r\n (\r\n\tid\t\tBIGINT UNSIGNED\t\tNOT NULL AUTO_INCREMENT\r\n\t\t\t\t\t\tCOMMENT 'Unique id for this string entry',\r\n\ttype\t\tINT\t\t\tNOT NULL DEFAULT 0\r\n\t\t\t\t\t\tCOMMENT 'Value type ; can be used to differentiate between value groups',\r\n\tchecksum\tINT UNSIGNED\t\tNOT NULL DEFAULT 0\r\n\t\t\t\t\t\tCOMMENT 'CRC32 hash of the string value',\r\n\t\r\n\tvalue\t\t$value_type \t\tNOT NULL $default\r\n\t\t\t\t\t\tCOMMENT 'String value',\r\n\t\t\t\t\t\t\r\n\tPRIMARY KEY\t( id ),\r\n\t$value_index\r\n\tKEY\t\t( type, checksum )\r\n ) ENGINE = MyISAM CHARSET latin1 COMMENT '{$this -> Comment}' ;\r\nEND;\r\n\t\t\r\n\t\tmysqli_query ( $this -> Database, $sql ) ;\r\n\t }", "private function newNode($params=null) \n {\n $id=$this->storage->newId();\n $node=new DataNode($this,$id,$this->untypedNode);\n if (is_array($params)) {\n foreach ($params as $k=>$v) {\n $node->set($k,$v);\n }\n }\n return $node;\n }", "function parseBISArray($str) {\n $str = substr($str, 1, -1); // Strip trailing quotes\n $bla = parseBISArray_helper($str);\n $result = array();\n\n foreach ($bla as $row) {\n foreach ($row as $child) {\n $result[] = $child;\n }\n if (count($row) == 0)\n $result[] = array();\n }\n //var_dump($result);\n return $result;\n}", "private function createFeatureValue($BkpFeatureId, $value){\r\n\r\n $ObjectValue = BkpFeatureValue::getValueByFeature($BkpFeatureId, $value['valuekey']);\r\n\r\n if (!Validate::isLoadedObject($ObjectValue)) {\r\n\r\n $ObjectValue->id_bkp_feature = $BkpFeatureId;\r\n $ObjectValue->value_key = $value['valuekey'];\r\n $ObjectValue->value_desc = $value['valuedesc'];\r\n $ObjectValue->save();\r\n }\r\n\r\n return $ObjectValue;\r\n }", "public function create($string)\n {\n $setInfo = $this->parse($string);\n $setObj = null;\n $fabricList = [\n new StringSpecial(),\n new StringNumeric(),\n new StringText(),\n new StringDatetime(),\n new StringEn(),\n new StringRu()\n ];\n\n while (!$setObj && $fabricList) {\n $fabric = array_shift($fabricList);\n $setObj = $fabric->create($setInfo);\n }\n\n if ($setObj && $setInfo->getParams()) {\n $setObj->init($setInfo->getParams());\n }\n\n return $setObj ?: new \\RandData\\Set\\NullValue();\n }", "function set($keystr, $value)\n{\n\t$key = explode('/',$keystr);\n\tif (count($key) == 3) $block = array_shift($key);\n\t$id = $key[0];\n\t$attr = $key[1];\n\t$sattr = false;\n\tif (strpos($id,'=')) list($sattr,$svalue) = explode('=', $id);\n\n\tif (!$sattr and $id != '*') {\n\t\t$this->elements[$id][$attr] = $value;\n\t\treturn;\n\t}\n\n\tforeach($this->elements as $id => $tmp) {\n\t\tif ($block and !$this->isInBlock($id,$block)) continue;\n\t\tif ($sattr and $this->elements[$id][$sattr] != $svalue) continue;\n\t\t$this->elements[$id][$attr] = $value;\n\t}\n}", "function create($value)\n {\n return new Value($value);\n }", "public abstract function makeValue($value);", "static function dn2n($data,$set=array()){\n if(!is_array($data)) return($data);\n $def = array('def'=>'label','childs'=>'childs');\n $set = ops_array::setdefault($set,$def);\n $stack = array();\n $keys = array_keys($data);\n $res = array();\n while(count($data)>0 or count($stack)>0){\n if(count($data)==0){\n\tlist($ckey,$tres,$data,$keys)= array_pop($stack);\n\t$tres[$ckey] = $res;\n\t$res = $tres;\n } else {\n\t$ckey = array_shift($keys);\n\t$cdat = array_shift($data);\n\n\tif(isset($cdat[$set['childs']]) and is_array($cdat[$set['childs']])){\n\t $stack[] = array($ckey,$res,$data,$keys);\n\t $data = $cdat[$set['childs']];\n\t $keys = array_keys($data);\n\t $res = array();\n\t} else $res[$ckey] = $cdat[$set['def']];\n }\n }\n return($res);\n \n }", "protected function _parseNestedValues($values)\n {\n foreach ($values as $key => $value) {\n if ($value === '1') {\n $value = true;\n }\n if ($value === '') {\n $value = false;\n }\n\n if (strpos($key, '.') !== false) {\n $values = Set::insert($values, $key, $value);\n //$this->_parseNestedValues($values);\n } else {\n $values[$key] = $value;\n }\n }\n return $values;\n }", "abstract protected function getNode(array $values, $line);", "public function buildByText($text);", "function AbbcInit()\r\n{\r\n\tglobal $ABBC;\r\n\r\n\t// Special Character that need to be masked for use in reg-exps\r\n\t// the '/' at the end is the default delimiting character!\r\n\t// nothing should be placed before the '\\' replacing or its '\\' will be doubled!\r\n\t$ABBC['sc'] = array('\\\\', '^', '$', '.', '[', ']', '|', '(', ')', '?', '*', '+', '{', '}', '/');\r\n\t$ABBC['sc2'] = array();\r\n\tforeach ($ABBC['sc'] as $c) $ABBC['sc2'][] = '\\\\' . $c;\r\n\r\n\t$ABBC['scan'] = array();\r\n\r\n\t// prepare tag configuration\r\n\t$ABBC['MaxTagLength'] = 0;\r\n\tforeach ($ABBC['Tags'] as $key => $value)\r\n\t{\r\n\t\t$ABBC['Tags'][$key]['level'] = 0;\r\n\t\t$ABBC['Tags'][$key]['start'] = array();\r\n\r\n\t\t// get the longest tag and stop looking for a '=' or ']' after $max_taglen characters\r\n\t\t// add 1 for the ending tag's preceeding '/'\r\n\t\tif (strlen($key) + 1 > $ABBC['MaxTagLength']) $ABBC['MaxTagLength'] = strlen($key) + 1;\r\n\t}\r\n\r\n\t// prepare smileys\r\n\t$ABBC['SmilieStarts'] = '';\r\n\t$ABBC['SmilieCount'] = sizeof($ABBC['Smilies']);\r\n\tfor ($n = 0; $n < $ABBC['SmilieCount']; $n++)\r\n\t{\r\n\t\t// get the first character of this smiley and store it, it it isn't already there\r\n\t\t$start = $ABBC['Smilies'][$n]['code']{0};\r\n\t\tif (strpos($ABBC['SmilieStarts'], $start) === false) $ABBC['SmilieStarts'] .= $start;\r\n\r\n\t\t$ABBC['Smilies'][$n]['code_len'] = strlen($ABBC['Smilies'][$n]['code']);\r\n\r\n\t\tif ($ABBC['Smilies'][$n]['code_len'] > $ABBC['MaxSmilieLength']) $ABBC['MaxSmilieLength'] = $ABBC['Smilies'][$n]['code_len'];\r\n\t}\r\n\r\n\t// Set initial nice quotes\r\n\t// You can change them after including this file\r\n\t$ABBC['Config']['use_nicequotes'] = true;\r\n\t$ABBC['Config']['nicequote_ls'] = '&lsquo;';\r\n\t$ABBC['Config']['nicequote_rs'] = '&rsquo;';\r\n\t$ABBC['Config']['nicequote_ld'] = '&ldquo;';\r\n\t$ABBC['Config']['nicequote_rd'] = '&rdquo;';\r\n\r\n\t$ABBC['HighlightWords'] = null;\r\n}", "private function _toType($value) {\n\t//--\n\tif($value === '') {\n\t\treturn null;\n\t} //end if\n\t//--\n\t$first_character = $value[0];\n\t$last_character = substr($value, -1, 1);\n\t//--\n\t$is_quoted = false;\n\tdo {\n\t\tif(!$value) {\n\t\t\tbreak;\n\t\t} //end if\n\t\tif($first_character != '\"' && $first_character != \"'\") {\n\t\t\tbreak;\n\t\t} //end if\n\t\tif($last_character != '\"' && $last_character != \"'\") {\n\t\t\tbreak;\n\t\t} //end if\n\t\t$is_quoted = true;\n\t} while (0);\n\t//--\n\tif($is_quoted) {\n\t\treturn strtr(substr($value, 1, -1), array ('\\\\\"' => '\"', '\\'\\'' => '\\'', '\\\\\\'' => '\\''));\n\t} //end if\n\t//--\n\tif(strpos($value, ' #') !== false && !$is_quoted) {\n\t\t$value = preg_replace('/\\s+#(.+)$/','',$value);\n\t} //end if\n\t//--\n\tif(!$is_quoted) {\n\t\t$value = str_replace('\\n', \"\\n\", $value);\n\t} //end if\n\t//--\n\tif($first_character == '[' && $last_character == ']') {\n\t\t// Take out strings sequences and mappings\n\t\t$innerValue = trim(substr($value, 1, -1));\n\t\tif($innerValue === '') {\n\t\t\treturn array();\n\t\t} //end if\n\t\t$explode = $this->_inlineEscape($innerValue);\n\t\t// Propagate value array\n\t\t$value = array();\n\t\tforeach($explode as $z => $v) {\n\t\t\t$value[] = $this->_toType($v);\n\t\t} //end foreach\n\t\treturn $value;\n\t} //end if\n\t//--\n\tif(strpos($value, ': ') !== false && $first_character != '{') {\n\t\t$array = explode(': ', $value);\n\t\t$key = trim($array[0]);\n\t\tarray_shift($array);\n\t\t$value = trim(implode(': ', $array));\n\t\t$value = $this->_toType($value);\n\t\treturn array($key => $value);\n\t} //end if\n\t//--\n\tif($first_character == '{' && $last_character == '}') {\n\t\t$innerValue = trim(substr($value, 1, -1));\n\t\tif($innerValue === '') {\n\t\t\treturn array();\n\t\t} //end if\n\t\t// Inline Mapping\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($innerValue);\n\t\t// Propagate value array\n\t\t$array = array();\n\t\tforeach($explode as $z => $v) {\n\t\t\t$SubArr = $this->_toType($v);\n\t\t\tif(empty($SubArr)) {\n\t\t\t\tcontinue;\n\t\t\t} //end if\n\t\t\tif(is_array ($SubArr)) {\n\t\t\t\t$array[key($SubArr)] = $SubArr[key($SubArr)]; continue;\n\t\t\t} //end if\n\t\t\t$array[] = $SubArr;\n\t\t} //end foreach\n\t\treturn $array;\n\t} //end if\n\t//--\n\tif((string)$value == '') {\n\t\treturn '';\n\t} //end if\n\t//--\n\tif(strtolower($value) == 'null' || $value == '~') {\n\t\treturn null;\n\t} //end if\n\t//--\n\tif(is_numeric($value) && preg_match('/^(-|)[1-9]+[0-9]*$/', $value)){\n\t\t$intvalue = (int)$value;\n\t\tif($intvalue != PHP_INT_MAX) {\n\t\t\t$value = $intvalue;\n\t\t} //end if\n\t\treturn $value;\n\t} //end if\n\t//--\n\t/* this was added in v.0.5.1 but is unsafe !!\n\tif(is_numeric($value) && preg_match('/^0[xX][0-9a-fA-F]+$/', $value)) {\n\t\t// Hexadecimal value.\n\t\treturn hexdec($value);\n\t} //end if\n\t*/\n\t//--\n\tif(in_array(strtolower($value), array('true', 'on', '+', 'yes', 'y'))) {\n\t\treturn true;\n\t} //end if\n\t//--\n\tif(in_array(strtolower($value), array('false', 'off', '-', 'no', 'n'))) {\n\t\treturn false;\n\t} //end if\n\t//--\n\tif(is_numeric($value)) {\n\t\tif((string)$value == '0') {\n\t\t\treturn 0;\n\t\t} //end if\n\t\tif(rtrim($value, 0) === $value) {\n\t\t\t$value = (float)$value;\n\t\t} //end if\n\t\treturn $value;\n\t} //end if\n\t//--\n\treturn $value;\n\t//-- $k\n}", "public function testConvertStringtoObjects(): void\n {\n $tests = [\n [\n 'input' => '',\n 'expected' => [],\n ],\n [\n 'input' => 'gate',\n 'expected' => ['gate'],\n ],\n [\n 'input' => 'gate;cost index',\n 'expected' => [\n 'gate',\n 'cost index',\n ],\n ],\n [\n 'input' => 'gate=B32;cost index=100',\n 'expected' => [\n 'gate' => 'B32',\n 'cost index' => '100',\n ],\n ],\n [\n 'input' => 'Y?price=200&cost=100; F?price=1200',\n 'expected' => [\n 'Y' => [\n 'price' => 200,\n 'cost' => 100,\n ],\n 'F' => [\n 'price' => 1200,\n ],\n ],\n ],\n [\n 'input' => 'Y?price&cost; F?price=1200',\n 'expected' => [\n 'Y' => [\n 'price',\n 'cost',\n ],\n 'F' => [\n 'price' => 1200,\n ],\n ],\n ],\n [\n 'input' => 'Y; F?price=1200',\n 'expected' => [\n 0 => 'Y',\n 'F' => [\n 'price' => 1200,\n ],\n ],\n ],\n [\n 'input' => 'Y?;F?price=1200',\n 'expected' => [\n 'Y' => [],\n 'F' => [\n 'price' => 1200,\n ],\n ],\n ],\n [\n 'input' => 'Departure Gate=4;Arrival Gate=C61',\n 'expected' => [\n 'Departure Gate' => '4',\n 'Arrival Gate' => 'C61',\n ],\n ],\n // Blank values omitted\n [\n 'input' => 'gate; ',\n 'expected' => [\n 'gate',\n ],\n ],\n ];\n\n foreach ($tests as $test) {\n $parsed = $this->importBaseClass->parseMultiColumnValues($test['input']);\n $this->assertEquals($test['expected'], $parsed);\n }\n }", "public function test_build_retrieve_a_configuraion_value() {\n\t\t\t$instanceName = \"value\";\n\t\t\t$value = \"testString\";\n\t\t\t$json = \"{\\\"$instanceName\\\": \\\"$value\\\"}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$result = $obj->build($instanceName);\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$expected = $value;\n\t\t\t$this->assertEquals($expected, $result);\n\t\t}", "public function __construct($string)\n\t{\n\t\t$pos = strpos($string, ':');\n\t\tif($pos === false)\n\t\t\tthrow new MegaException(strtr('Impossible to find semicolon from string \"{key}\".',\n\t\t\t\tarray('{key}' => $string)));\n\t\t\n\t\t$this->_node_id = new MegaNodeId(substr($string, 0, $pos));\n\t\t$this->_node_key = new MegaBase64String(substr($string, $pos+1));\n\t}", "function getBBCodeValue($string, $balise){\n $sub = substr($string, 0, stripos($string, '{/' . $balise . '}')); // Supprime tout l'excédent incluant la balise de fermeture\n $len = strlen($sub); $inParamValue = false;\n for($j = 0; $j < $len; $j++){\n $j1 = $j - 1;\n if($j1 < 0) $j1 = 0;\n \n if($sub[$j] == '\"' && $sub[$j1] != '\\\\')\n $inParamValue = !$inParamValue;\n \n if(!$inParamValue){\n if($sub[$j] == '}'){ // Fin de la balise d'ouverture\n $sub[$j] = '';\n break;\n }\n }\n \n $sub[$j] = '';\n }\n \n return $sub;\n}", "function genCategorStr($idstr, $catstr, $allstr){\n if (empty($idstr) || empty($catstr)) {\n return $allstr;//it was passed from str, but here it will become an array; \n } else {\n $_ids = explode(\"|\", $idstr);\n array_pop($_ids);\n array_shift($_ids);\n $_catestr = explode(\", \", $catstr);\n if (count($_ids) == count($_catestr)) {\n $categories = array_combine($_ids, $_catestr);\n return array(\"0\" => '[Website Category]') + $categories;//Here will return the array, not the string!!!!\n } else {\n return $allstr;\n }\n }\n}", "static function n2dn($data,$set=array()){ \n if(!is_array($data)) return(NULL);\n $def = array('def'=>'label','childs'=>'childs');\n $set = ops_array::Setdefault($set,$def);\n $res = array();\n $stack = array();\n $keys = array_keys($data);\n while(count($data)>0 or count($stack)>0){\n if(count($data)==0){\n\tlist($ckey,$tres,$data,$keys)= array_pop($stack);\n\t$tres[$ckey][$set['childs']] = $res;\n\t$res = $tres;\n } else {\n\t$ckey = array_shift($keys);\n\t$cdat = array_shift($data);\n\tif(is_array($cdat)){\n\t $stack[] = array($ckey,$res,$data,$keys);\n\t $keys = array_keys($cdat);\n\t $data = $cdat;\n\t $res = array();\n\t} else $res[$ckey] = array($set['def']=>$cdat);\n }\n }\n return($res);\n }", "protected function buildValue($values)\n {\n $valueData = [];\n foreach ($values as $value) {\n $valueData[] = [\n '@value' => $value['amount'],\n '@attributes' => [\n 'currency' => $value['currency'],\n 'value-date' => $value['value_date']\n ]\n ];\n }\n\n return $valueData;\n }", "public function buildByKey($keyYml);", "public function create( $strname, $value, $strtype=\"NA\" ){ \n\t\tif(CWidget_option($this->m_strtype, $this->m_inum, $strname) != \"\")\n\t\t\treturn NULL;\n\t\tCWidget_option($this->m_strtype, $this->m_inum, $strname, $value);\n\t\treturn ( $this->save() ) ? array( \"m_strname\"=>$strname, \"m_value\"=>$value, \"m_strtype\"=>$strtype ) : NULL;\n\t}", "function build_custom_field_data($field_id, $value, $enum = null)\n{\n\n $data = array(\n 'id' => $field_id,\n );\n\n if (is_array($value)) {\n if (isset($value[0]['subtype']) && isset($value[0]['value'])) {\n foreach ($value as $key => $value) {\n $data['values'][$key]['value'] = $value['value'];\n $data['values'][$key]['subtype'] = $value['subtype'];\n }\n } else {\n $data['values'] = $value;\n }\n } else {\n $data['values'] = array(array('value' => $value));\n }\n\n if ($enum) {\n $data['values'][0]['enum'] = $enum;\n }\n\n return $data;\n}", "public function build(){\n\n\t\t// Node Attributes;\n\t\t$this->getAttrString();\n\t\t\n\t\tif(is_array($this->content)){\n\t\t\t$this->html.= '<'. $this->tag .' '. $this->attrString .'>' ;\n\t\t\tforeach ($this->content as $key => $value) \n\t\t\t\t$this->html.= $value->build() ;\n\n\t\t\t$this->html .= '</'. $this->tag .'>';\n\t\t}else{\n\t\t\t// Node Content\n\t\t\t$nodeContent = $this->content instanceof HTMLNode ? $this->content->build() : $this->content ; \n\n\t\t\t// Node HTML\n\t\t\t$this->html = '<'. $this->tag .' '. $this->attrString .'>'. $nodeContent .'</'. $this->tag .'>' ;\n\t\t}\n\n\t\treturn $this->html ;\n\t}", "function ys_makelaar_fill_items($makelaars_id, $realty_item_id, $web_page) {\n $xpath = new DOMXpath($web_page);\n $Xresult = $xpath-> query('//div[@id=\"content_small\"]/div[1]/div/h1');\n $object_title = $Xresult-> item(0) ->nodeValue;\n // DEBUG drupal_set_message($object_title. \" | \");\n $values = $xpath-> query('//div[(@id=\"detail_content_coll\" or @id=\"detail_content\")]/table/tr/td');\n /* DEBUG foreach($values as $value) {\n echo $value-> nodeValue ;\n echo '<br />';\n }*/\n $node = new stdClass();\n\t$node-> type = 'job_post';\n\tnode_object_prepare($node); //default node items invullen\n $node-> ysm_id = $realty_item_id; //TODOitem id van detail tabel koppelen aan die van de bron tabel\n $node-> title = $object_title;\n\t$node->language = 'en';\n\t\n for ($i = 0; $i < $values->length; $i=$i+2) {\n //detailgegevens parsen\n $value = $values-> item($i)->nodeValue;\n $value1 = strtr($value, array_flip(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES))); \n str_replace('&nbsp;','',$value);\n $next_value = $values-> item($i+1)->nodeValue;\n // DEBUG drupal_set_message(trim($value) .'| '. $next_value . '<br />');\n switch(trim($value1,chr(0xC2).chr(0xA0))) {\n case 'Prijs: ' :\n $node-> t_prijs[$node-> language][0]['value'] = $next_value; \n\t\t\t\tdrupal_set_message('next_value = '. $next_value . ' | node = '. $node-> t_prijs[$node-> language][0]['value']); \n break;\n case 'Wijk: ' :\n $node-> wijk[$node->language][0]['value'] = $next_value; break; \n case 'Bouwjaar: ' :\n $node-> t_bouwjaar[$node->language][0]['value'] = $next_value; break; \n case 'Slaapkamers: ' :\n $node-> t_slaapkamers[$node->language][0]['value'] = $next_value; break; \n case 'Badkamers: ' :\n $node-> t_badkamers[$node->language][0]['value'] = $next_value; break; \n case 'Datum oplevering: ' :\n $node-> oplevering[$node->language][0]['value'] = $next_value; break; \n case 'Woonoppervlakte: ' :\n $node-> t_woonoppervl[$node->language][0]['value'] = $next_value; break; \n case 'Kavelgrootte: ' : \n $node-> t_kavel[$node->language][0]['value'] = $next_value; break;\n case 'Project: ' : \n $node-> project[$node->language][0]['value'] = $next_value; break; \n case 'Zwembad: ' : \n $node-> zwembad[$node->language][0]['value'] = 1; break; \n case 'Zeezicht: ' : \n $node-> zeezicht[$node->language][0]['value'] = 1; break; \n default:\n echo(trim($value1,chr(0xC2).chr(0xA0)). '| not matched<br />');\n }\n } // foreach\n\t //drupal_set_message('buiten loop '. $node-> t_prijs[$node-> language][0]['value']);\n // omschrijving parsen\n $xpath = new DOMXpath($web_page);\n $values = $xpath-> query('//div[@id=\"detail_content_nocolor\"]');\n $body_text = $values-> item(0) ->nodeValue;\n\n// Object valuta ophalen uit omschrijving:\n // $node-> valuta[$node->language][0]['value'] = substr($body_text, -4, 3);\n\t\n\t// Items wegschrijven als ysm node.\n\n $node->body[$node->language][0]['value'] = $body_text;\n $node->body[$node->language][0]['summary'] = text_summary($body_text);\n $node->body[$node->language][0]['format'] = 1;\n// $path = 'content/programmatically_created_node_' . date('YmdHis');\n// $node->path = array('alias' => $path);\n // drupal_set_message('voor save '. $node-> t_prijs[$node-> language][0]['value']); debug\n node_save($node);\n //drupal_set_message('na save '. $node-> t_prijs[$node-> language][0]['value']); debug\n \n\n // url van de plaatjes opslaan\n ys_makelaar_get_images_links($makelaars_id, $realty_item_id, $web_page, $node-> nid);\n\n}", "function phpkd_vblvb_build()\n{\n\trequire_once(DIR . '/includes/adminfunctions_options.php');\n\n\tglobal $vbulletin;\n\n\t$vbulletin->phpkd_vblvb = array();\n\t$settings = $vbulletin->db->query_read(\"SELECT varname, value, datatype FROM \" . TABLE_PREFIX . \"phpkd_vblvb_setting\");\n\n\twhile ($setting = $vbulletin->db->fetch_array($settings))\n\t{\n\t\t$vbulletin->phpkd_vblvb[\"$setting[varname]\"] = phpkd_vblvb_validate_value($setting['value'], $setting['datatype'], true, false);\n\t}\n\n\tbuild_datastore('phpkd_vblvb', serialize($vbulletin->phpkd_vblvb), 1);\n\n\treturn $vbulletin->phpkd_vblvb;\n}", "public function get_definition_tuple($parent, $string_def) { \n\n\t// Extract child numbers\n\t$address_definition = explode(\"/\", $string_def);\n\t\t\n\t// Load the depth of the parent key.\n\t$import = $this->import($parent);\n\t$depth = $import['depth']; \n\t\t\n\t// Start building the address bytes tuple\n\tforeach ($address_definition as &$def) {\n\n\t\t// Check if we want the prime derivation\n\t\t$want_prime = 0;\n\t\tif(strpos($def, \"'\") !== false) {\n\t\t\t// Remove ' from the number, and set $want_prime\n\t\t\tstr_replace(\"'\", '', $def);\n\t\t\t$want_prime = 1;\n\t\t}\n\n\t\t// Calculate address byres\n\t\t$and_result = ($want_prime == 1) ? $def | 0x80000000 : $def;\n\t\t$hex = unpack(\"H*\", pack(\"N\", $and_result)); \n\t\t$def = $hex[1];\n\t\t$depth++;\n\t}\n\t\n\t// Reverse the array (to allow array_pop to work) and return.\n\treturn array_reverse($address_definition);\n\n}", "public function __construct($input)\n {\n $this->type = gettype($input);\n $types = array('object', 'array');\n\n if (!in_array($this->type, $types)) {\n $this->value = $input;\n } else {\n foreach ($input as $key => $value) {\n $this->nodes[$key] = new self($value);\n $this->nodes[$key]->setParent($this);\n }\n }\n }", "public function populateRequest($post_string)\n {\n parse_str($post_string, $post_variables);\n \n foreach ($post_variables as $field => $value) {\n switch ($field) {\n case \"endpoint\":\n foreach ($value as $fld => $val) {\n switch ($fld) {\n case \"method\":\n $this->endpoint->method = $val;\n break;\n case \"url\":\n $this->endpoint->url = $val;\n break;\n default:\n break;\n }\n }\n break;\n case \"data\":\n //Create new dataRequest for each set of values\n foreach ($value as $data_point => $data_value) {\n $req = new dataRequest($data_value);\n $this->data_requests[$req->getUUID()] = $req;\n }\n break;\n default:\n break;\n }\n }\n if (!empty($this->data_requests) && !empty($this->endpoint)) {\n $this->ready = true;\n }\n \n }", "public static function construct_base_string()\n\t{\n\t\t$args = func_get_args();\n\t\tif (count($args) == 1 && is_array($args[0]) && isset($args[0][0]) && is_array($args[0][0]))\n\t\t{\n\t\t\t$args = $args[0];\n\t\t}\n\t\t$keys = array();\n\t\t$values = array();\n\n\t\tforeach ($args as $assoc_array)\n\t\t{\n\t\t\t$keys = array_merge($keys, array_keys($assoc_array));\n\t\t\t$values = array_merge($values, array_values($assoc_array));\n\t\t}\n\n\t\tarray_multisort($keys, SORT_ASC, SORT_STRING, $values, SORT_STRING, SORT_ASC);\n\t\treturn SPUtils::join_key_values(\"=\", \"&\", $keys, $values);\n\t}", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "private function _populateBranch()\n {\n return $this->branch->create(\n $this->branchData['name'], \n $this->branchData['region_ID'], \n $this->branchData['promotor_ID']\n );\n }", "private static function rec_xmlDeserialize($child, $parent_node)\n\t{\n\t\tif($child['value'] instanceof Component)\n\t\t{\n\t\t\t$child['value']->_parent\t= $parent_node;\n\t\t\t$child['value']->_fullname\t= $child['name'];\n\n\t\t\t$node_name = get_class($child['value']);\n\t\t\tif(strncmp('Biome\\\\Component\\\\', $node_name, 16) == 0)\n\t\t\t{\n\t\t\t\t$node_name = substr($node_name, 16);\n\t\t\t}\n\n\t\t\t$child['value']->_nodename\t\t= strtolower(substr($node_name, 0, -strlen('Component')));\n\t\t\t$child['value']->_attributes = $child['attributes'];\n\t\t\t$child['value']->getId(); // Generate ID.\n\t\t\t$child['value']->building();\n\t\t\treturn $child['value'];\n\t\t}\n\n\t\t/* Load standard HTML markup. */\n\t\tif(is_array($child['value']))\n\t\t{\n\t\t\t$list = array();\n\t\t\tforeach($child['value'] AS $c)\n\t\t\t{\n\t\t\t\t$list[] = self::rec_xmlDeserialize($c, $parent_node);\n\t\t\t}\n\t\t\t$child['value'] = $list;\n\t\t\treturn $child;\n\t\t}\n\n\t\treturn $child;\n\t}", "function setNodeValues(&$node, $ebsLeafletValues){\n \t\t\n \t\tglobal $user;\n \t\t\t\n \t\t//create only\n \t\t$node->type = \"leaflet\";\n \t\tnode_object_prepare($node); // Sets some defaults. Invokes hook_prepare() and hook_node_prepare().\n \t\t$node->language = LANGUAGE_NONE; // Or e.g. 'en' if locale is enabled\n \t\t$node->uid = $user->uid; //set to 1?\n \t\t$node->promote = 0; //(1 or 0): promoted to front page\n \t\t$node->comment = 0; // 0 = comments disabled, 1 = read only, 2 = read/write\n \t\t$node->sticky = 0; // (1 or 0): sticky at top of lists or not\n \t\t\n \t\t//Static values, not from EBS\n \t\t$node->status = 1;\n \t\t$node->field_source[$node->language][0]['value'] = \"automated\";\n \t\t$node->path['pathauto'] = true;\n \t\t\n \t\t/*\n \t\t * Loop through the field mapping, retrieving:\n \t\t * \n \t\t * $myArray[0] is Drupal field name\n \t\t * $myArray[1] is function name to use\n \t\t * $myArray[2] is default value to use\n \t\t * $ebsLeafletValues[$ebsFieldName] is the value of the field\n \t\t * contained in $this->goodEbsLeaflets\n \t\t * field_weeks_per_year\n \t\t */\n \t\t//dsm($this->fieldMapping);\n \t\t//dsm($ebsLeafletValues);\n \t\t foreach ($this->fieldMapping as $ebsFieldName => $myArray):\n \t\t \t//dsm($ebsLeafletValues->$ebsFieldName.\" \".$myArray[0]);\n \t\t \n \t\t \t$valueToUse = $ebsLeafletValues->$ebsFieldName;\n \t\t \t\n \t\t \tif (empty($valueToUse)){\n \t\t \t\t$valueToUse = $myArray[2];//subsitute default value from mapping\n \t\t \t}\n\n \t\t \t//Set node->field value, or delete existing value\n \t\t \t$this->$myArray[1]($node, $myArray[0], $valueToUse);\n\t \t\n \t\t endforeach; \n\n \t}", "function bdec_dict($s) {\n\tif ($s[0] != \"d\")\n\treturn;\n\t$sl = strlen($s);\n\t$i = 1;\n\t$v = array();\n\t$ss = \"d\";\n\tfor (;;) {\n\t\tif ($i >= $sl)\n\t\treturn;\n\t\tif ($s[$i] == \"e\")\n\t\tbreak;\n\t\t$ret = bdec(substr($s, $i));\n\t\tif (!isset($ret) || !is_array($ret) || $ret[\"type\"] != \"string\")\n\t\treturn;\n\t\t$k = $ret[\"value\"];\n\t\t$i += $ret[\"strlen\"];\n\t\t$ss .= $ret[\"string\"];\n\t\tif ($i >= $sl)\n\t\treturn;\n\t\t$ret = bdec(substr($s, $i));\n\t\tif (!isset($ret) || !is_array($ret))\n\t\treturn;\n\t\t$v[$k] = $ret;\n\t\t$i += $ret[\"strlen\"];\n\t\t$ss .= $ret[\"string\"];\n\t}\n\t$ss .= \"e\";\n\treturn array('type' => \"dictionary\", 'value' => $v, 'strlen' => strlen($ss), 'string' => $ss);\n}", "private static function buildAttrs($name, $attrs, $value = null) {\n\t\treturn self::parseAttrs(self::getAttrs($name, $attrs, $value));\n\t}", "public static function provideJsonDecodeConfigTypeB()\n {\n return [\n [[ConfigTypeB::JSON_MSHOST => '4htV2O3BMH'], '{\"'.ConfigTypeB::JSON_MSHOST.'\":\"4htV2O3BMH\"}'],\n [[ConfigTypeB::JSON_R3NAME => 'XmJsmqU3ua'], '{\"'.ConfigTypeB::JSON_R3NAME.'\":\"XmJsmqU3ua\"}'],\n [[ConfigTypeB::JSON_GROUP => 'Tczw3KTagh'], '{\"'.ConfigTypeB::JSON_GROUP.'\":\"Tczw3KTagh\"}']\n ];\n }", "function create_sub_node($id, $values)\r\n\t{\r\n\t\t// invalid parent id, bail out\r\n\t\tif (!($this_node = $this->get_node($id)))\r\n\t\t{\n \tdebug :: write_error(NESE_ERROR_NOT_FOUND,\r\n \t\t __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, \r\n \t\tarray('id' => $id)\r\n \t);\n \treturn false;\r\n\t\t} \r\n\t\t// Try to aquire a table lock\r\n\t\t$lock = $this->_set_lock();\r\n\r\n\t\t$this->_verify_user_values($values); \r\n\t\t// Get the children of the target node\r\n\t\t$children = $this->get_children($id); \r\n\t\t// We have children here\r\n\t\tif ($this_node['r']-1 != $this_node['l'])\r\n\t\t{ \r\n\t\t\t// Get the last child\r\n\t\t\t$last = array_pop($children); \r\n\t\t\t// What we have to do is virtually an insert of a node after the last child\r\n\t\t\t// So we don't have to proceed creating a subnode\r\n\t\t\t$new_node = $this->create_right_node($last['id'], $values);\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn $new_node;\r\n\t\t} \r\n\r\n\t\t$sql = array();\r\n\t\t$sql[] = sprintf('UPDATE %s SET\r\n\t\t\t l=CASE WHEN l>%s THEN l+2 ELSE l END,\r\n\t\t\t r=CASE WHEN (l>%s OR r>=%s) THEN r+2 ELSE r END\r\n\t\t\t WHERE root_id=%s',\r\n\t\t\t\t\t\t\t\t\t\t\t$this->_node_table,\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['l'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['r'],\r\n\t\t\t\t\t\t\t\t\t\t\t$this_node['root_id']);\r\n\r\n\t\t$insert_data = array();\r\n\t\t$insert_data['parent_id'] = $this_node['id'];\r\n\r\n\t\t$insert_data['l'] = $this_node['r'];\r\n\t\t$insert_data['r'] = $this_node['r'] + 1;\r\n\t\t$insert_data['root_id'] = $this_node['root_id'];\r\n\t\t$insert_data['ordr'] = 1;\r\n\t\t$insert_data['level'] = $this_node['level'] + 1;\r\n\r\n\t\tif (!$this->_dumb_mode || !$node_id = isset($values['id']))\r\n\t\t{\r\n\t\t\t$node_id = $insert_data['id'] = $this->db->get_max_column_value($this->_node_table, 'id') + 1;\r\n\t\t} \r\n\t\telse\r\n\t\t{\r\n\t\t\t$node_id = $values['id'];\r\n\t\t} \r\n\r\n\t\tif (!$qr = $this->_values2insert_query($values, $insert_data))\r\n\t\t{\r\n\t\t\t$this->_release_lock();\r\n\t\t\treturn false;\r\n\t\t} \r\n\r\n\t\t$sql[] = sprintf('INSERT INTO %s (%s) VALUES (%s)', $this->_node_table, implode(', ', array_keys($qr)), implode(', ', $qr));\r\n\t\tforeach ($sql as $qry)\r\n\t\t{\r\n\t\t\t$this->db->sql_exec($qry);\r\n\t\t} \r\n\r\n\t\t$this->_release_lock();\r\n\t\treturn $node_id;\r\n\t}", "public function fromString(string $string);", "public static function create($value);", "public static function create($value);", "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}", "function vbtk_tag_builder($tag, $attrs = [], $children = []) {\n\n // $GLOBALS['vbtk_tag_builder_depth']++;\n\n if (is_string($attrs)) {\n $attrs = [ 'class' => $attrs ];\n }\n\n if (!is_array($attrs)) {\n $attrs = [$attrs];\n }\n\n if (!is_array($children)) {\n $children = [$children];\n }\n\n if ((!is_array($children) || sizeof($children) < 1) && is_array($attrs) && isset($attrs[0])) {\n $children = $attrs;\n $attrs = [];\n }\n\n $attributes = [];\n\n foreach ($attrs as $key => $value) { \n if (is_callable($value)) {\n $value = $value();\n }\n\n if (is_array($value)) {\n foreach ($value as $i => $v) {\n if (is_callable($v)) {\n $value[$i] = $v();\n }\n }\n\n $value = implode(' ', array_filter($value));\n }\n\n if (is_bool($value) && !$value) {\n continue;\n }\n\n $value = trim(preg_replace('/\\\\s{2,}/', ' ', $value));\n\n if (is_callable('esc_attr')) {\n $value = esc_attr($value);\n }\n\n $attributes[] = $key . '=\"' . $value . '\"';\n }\n\n if (sizeof($attrs) === 1 && isset($attrs[0])) {\n if (is_numeric($attrs[0]) || is_bool($attrs[0])) {\n if (!$attrs[0]) {\n return '';\n }\n }\n }\n\n $false_children = 0;\n\n foreach ($children as &$child) {\n if (is_callable($child)) {\n ob_start();\n \n $failed = false;\n\n try {\n try {\n $fail = function ($value = false, $expected = true) use (&$false_children, &$failed) {\n if (is_callable($expected)) {\n $expected = $expected($value);\n }\n\n if (!$failed && $value != $expected) {\n error_log(json_encode($value) . ' != ' . json_encode($expected));\n $failed = true;\n $false_children++;\n } else {\n\n error_log(json_encode($value) . ' == ' . json_encode($expected));\n }\n\n return $value;\n };\n\n $child = $child($fail);\n } catch (\\Error $e) {\n $child = generate_js_error($e);\n }\n } catch (\\Exception $e) {\n $child = generate_js_error($e);\n }\n\n if (!$failed) {\n if (!$child) {\n $child = ob_get_contents();\n }\n }\n\n ob_end_clean();\n }\n\n if (is_bool($child)) {\n $child = '';\n \n if ($child === false) {\n $false_children++;\n }\n } else if (is_string($child)) {\n\n } else if (is_numeric($child)) {\n\n } else if (is_array($child)) {\n if (empty($child) || isset($child[0])) {\n $child = implode(\"\\n\", $child);\n }\n } else {\n $child = print_r($child, 1);\n }\n }\n\n if ($false_children > 0 && sizeof($children) === $false_children) {\n $out = false;\n } else if (sizeof($attrs) < 1 && sizeof($children) == 1 && !$children[0]) {\n $out = '';\n } else {\n $out = '<' . implode(' ', array_filter([$tag, implode(' ', $attributes)]));\n\n if ($tag === 'img' || $tag === 'link') {\n $out .= '/>';\n } else {\n $out .= '>';\n $out .= implode(\"\\n\", $children);\n $out .= '</' . $tag . '>';\n }\n }\n\n return $out;\n}", "public function build($str)\n {\n $abc = [\"A\" => \"B\", \"B\" => \"C\", \"C\" => \"D\", \"D\" => \"E\", \"E\" => \"F\", \"F\" => \"G\", \"G\" => \"H\", \"H\" => \"I\", \"I\" => \"J\", \"J\" => \"K\",\n \"K\" => \"L\", \"L\" => \"M\", \"M\" => \"N\", \"N\" => \"Ñ\", \"Ñ\" => \"O\", \"O\" => \"P\", \"P\" => \"Q\", \"Q\" => \"R\", \"R\" => \"s\", \"S\" => \"T\",\n \"T\" => \"U\", \"U\" => \"V\", \"V\" => \"W\", \"W\" => \"X\", \"X\" => \"Y\", \"Y\" => \"Z\", \"Z\" => \"A\", \"a\" => \"b\", \"b\" => \"c\", \"c\" => \"d\", \"d\" => \"e\",\n \"e\" => \"f\", \"f\" => \"g\", \"g\" => \"h\", \"h\" => \"i\", \"i\" => \"j\", \"j\" => \"k\", \"k\" => \"l\", \"l\" => \"m\", \"m\" => \"n\", \"n\" => \"ñ\", \"ñ\" => \"o\",\n \"o\" => \"p\", \"p\" => \"q\", \"q\" => \"r\", \"r\" => \"s\", \"s\" => \"t\", \"t\" => \"u\", \"u\" => \"v\", \"v\" => \"w\", \"w\" => \"x\", \"x\" => \"y\", \"y\" => \"z\",\n \"z\" => \"a\"\n ];\n\n return strtr($str, $abc);\n }", "static public function load($value) {\n\t\t$value = trim ( $value );\n\t\t\n\t\tif (0 == strlen ( $value )) {\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\tswitch ($value [0]) {\n\t\t\tcase '[' :\n\t\t\t\treturn self::parseSequence ( $value );\n\t\t\tcase '{' :\n\t\t\t\treturn self::parseMapping ( $value );\n\t\t\tdefault :\n\t\t\t\treturn self::parseScalar ( $value );\n\t\t}\n\t}", "abstract function build();", "function get_value_uri($uri, $key){\n $find = $key.'=';\n $v_pos = strpos($uri, $find);\n $v_p = $v_pos;\n if($v_pos!==false){\n $v_pos += strlen($find);\n $v_tmp = substr($uri,$v_pos);\n $v_pos = strpos($v_tmp,'&');\n if($v_pos>0){\n return substr($v_tmp,0,$v_pos);\n }else{\n return $v_tmp;\n }\n }else return '';\n}", "public function create( $value, $type = 'standard' );", "public static function toValue($values){\n\n $mapped = array();\n foreach($values as $p){\n $mapped[] = $p;\n }\n return new Less_Tree_Value($mapped);\n }", "public function createConfig(array $nodes);", "public static function setFromString($keys, $value)\n {\n $array = $value;\n \n foreach (array_reverse(explode('.', $keys)) as $key) {\n $value = $array;\n unset($array);\n \n $array[$key] = $value;\n }\n \n return $array;\n }", "public function createBuilder();", "public function parseValue();", "function BuildProperty($PropNode)\n {\n $objProp = new clsProperty();\n\n foreach ($PropNode->children() as $PropChild)\n {\n switch ($PropChild->getName())\n {\n case \"ID\":\n $objProp->ID = $PropChild;\n break;\n case \"Name\":\n $objProp->Name = $PropChild;\n break;\n case \"Address\":\n $objProp->Address = $PropChild;\n break;\n case \"City\":\n $objProp->City = $PropChild;\n break;\n case \"State\":\n $objProp->State = $PropChild;\n break;\n case \"Zip\":\n $objProp->Zip = $PropChild;\n break;\n case \"Phone\":\n $objProp->Phone = $PropChild;\n break;\n case \"Email\" :\n $objProp->Email = $PropChild;\n break;\n case \"Maint\":\n $objProp->Maint = $PropChild;\n break;\n case \"WebSite\":\n $objProp->WebSite = $PropChild;\n break;\n case \"Desc\" :\n $objProp->Desc = $PropChild;\n break;\n case \"Amenities\":\n $objProp->Amenities = explode(\"--\",$PropChild);\n break;\n case \"Highlights\" :\n $objProp->Highlights = $PropChild;\n break;\n case \"Coupon\" :\n $objProp->Coupon = $PropChild;\n break;\n case \"Vtour\" :\n $objProp->Vtour = $PropChild;\n break;\n case \"MainPic\" :\n $objProp->MainPic = $PropChild;\n break;\n case \"SubPic1\" :\n case \"SubPic2\" :\n case \"SubPic3\" :\n case \"SubPic4\" :\n case \"SubPic5\" :\n array_push($objProp->SubPics, $PropChild) ;\n break;\n case \"OneBedLowPrices\" :\n case \"TwoBedLowPrices\" :\n case \"ThreeBedLowPrices\" :\n case \"FourBedLowPrices\" :\n\n array_push($objProp->BedLowPrices,$PropChild) ;\n // or die(\" Error Creating BedLowPrices object \");\n break;\n\n case \"UnitTypes\" :\n\n $objProp->Units = $this->BuildUnit($objProp->Units,$PropChild);\n // die(\" Error Creating Unit object \") ;\n\n break;\n case \"ReportRoster\" :\n \n\n $objProp->Reports = $this->BuildReport($objProp->Reports,$PropChild) ;\n // or die (\" Error Creating Report object \") ;\n break;\n }\n\n }\n\n return $objProp;\n\n\n }", "public function createValue(mixed $data, ?PathInterface $path = null): NodeValueInterface;", "abstract public function parse ();", "function _toType($value) {\n\tif (preg_match('/^(\"(.*)\"|\\'(.*)\\')/',$value,$matches)) {\n\t$value = (string)preg_replace('/(\\'\\'|\\\\\\\\\\')/',\"'\",end($matches));\n\t$value = preg_replace('/\\\\\\\\\"/','\"',$value);\n\t} elseif (preg_match('/^\\\\[(.+)\\\\]$/',$value,$matches)) {\n\t\t// Inline Sequence\n\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($matches[1]);\n\n\t\t// Propogate value array\n\t\t$value = array();\n\t\tforeach ($explode as $v) {\n\t\t$value[] = $this->_toType($v);\n\t\t}\n\t} elseif (strpos($value,': ')!==false && !preg_match('/^{(.+)/',$value)) {\n\t\t// It's a map\n\t\t$array = explode(': ',$value);\n\t\t$key = trim($array[0]);\n\t\tarray_shift($array);\n\t\t$value = trim(implode(': ',$array));\n\t\t$value = $this->_toType($value);\n\t\t$value = array($key => $value);\n\t} elseif (preg_match(\"/{(.+)}$/\",$value,$matches)) {\n\t\t// Inline Mapping\n\n\t\t// Take out strings sequences and mappings\n\t\t$explode = $this->_inlineEscape($matches[1]);\n\n\t\t// Propogate value array\n\t\t$array = array();\n\t\tforeach ($explode as $v) {\n\t\t$array = $array + $this->_toType($v);\n\t\t}\n\t\t$value = $array;\n\t} elseif (strtolower($value) == 'null' or $value == '' or $value == '~') {\n\t\t$value = NULL;\n\t} elseif (preg_match ('/^[0-9]+$/', $value)) {\n\t// Cheeky change for compartibility with PHP < 4.2.0\n\t\t$value = (int)$value;\n\t} elseif (in_array(strtolower($value),\n\t\t\t\tarray('true', 'on', '+', 'yes', 'y'))) {\n\t\t$value = true;\n\t} elseif (in_array(strtolower($value),\n\t\t\t\tarray('false', 'off', '-', 'no', 'n'))) {\n\t\t$value = false;\n\t} elseif (is_numeric($value)) {\n\t\t$value = (float)$value;\n\t} else {\n\t\t// Just a normal string, right?\n\t\t$value = trim(preg_replace('/#(.+)$/','',$value));\n\t}\n\n\treturn $value;\n\t}", "function convert_string_to_post_data($post_string, $exclude_array=array(), $replace_array=array())\n{\n\t$post_array = array();\n\t\n\t$post_array_level1 = explode('<>', $post_string);\n\t\n\tforeach($post_array_level1 AS $key_value)\n\t{\n\t\t$key_value_array = explode('=', $key_value);\n\t\t\n\t\t#Was an array\n\t\tif(isset($key_value_array[1]) && strpos($key_value_array[1], '|') !== FALSE)\n\t\t{\n\t\t\t$post_array[$key_value_array[0]] = array();\n\t\t\t$post_array_level2 = explode('**', $key_value_array[1]);\n\t\t\t\n\t\t\tforeach($post_array_level2 AS $sub_key_value)\n\t\t\t{\n\t\t\t\t$sub_key_value_array = explode('|', $sub_key_value);\n\t\t\t\t#Was an array\n\t\t\t\tif(strpos($sub_key_value_array[1], '_') !== FALSE && $sub_key_value_array[1] != '_' && $sub_key_value_array[0] != 'drillevent')\n\t\t\t\t{\n\t\t\t\t\t$post_array[$key_value_array[0]][$sub_key_value_array[0]] = array();\n\t\t\t\t\t$post_array_level3 = explode(',', $sub_key_value_array[1]);\n\t\t\t\t\t\n\t\t\t\t\tforeach($post_array_level3 AS $sub_sub_key_value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sub_sub_key_value_array = explode('_', $sub_sub_key_value);\n\t\t\t\t\t\t#If key is in the excluded array do not include it in the conversion results\n\t\t\t\t\t\tif(!in_array($key_value_array[0], $exclude_array) && !in_array($sub_key_value_array[0], $exclude_array) && !in_array($sub_sub_key_value_array[0], $exclude_array))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t#If key requires replacing the value with that given, change it here\n\t\t\t\t\t\t\tif(array_key_exists($sub_sub_key_value_array[0], $replace_array))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$post_array[$key_value_array[0]][$sub_key_value_array[0]][$sub_sub_key_value_array[0]] = $replace_array[$sub_sub_key_value_array[0]];\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$post_array[$key_value_array[0]][$sub_key_value_array[0]][$sub_sub_key_value_array[0]] = $sub_sub_key_value_array[1];\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\telse\n\t\t\t\t{\n\t\t\t\t\t#If was an empty string\n\t\t\t\t\tif($sub_key_value_array[1] == '_')\n\t\t\t\t\t{\n\t\t\t\t\t\t$sub_key_value_array[1] = '';\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t#If key is in the excluded array do not include it in the conversion results\n\t\t\t\t\tif(!in_array($key_value_array[0], $exclude_array) && !in_array($sub_key_value_array[0], $exclude_array))\n\t\t\t\t\t{\n\t\t\t\t\t\t#If key requires replacing the value with that given, change it here\n\t\t\t\t\t\tif(array_key_exists($sub_key_value_array[0], $replace_array))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$post_array[$key_value_array[0]][$sub_key_value_array[0]] = $replace_array[$sub_key_value_array[0]];\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$post_array[$key_value_array[0]][$sub_key_value_array[0]] = $sub_key_value_array[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t#If was an empty string\n\t\t\tif(isset($key_value_array[1]) && $key_value_array[1] == '_')\n\t\t\t{\n\t\t\t\t$key_value_array[1] = '';\n\t\t\t}\n\t\t\t\n\t\t\t#If key is in the excluded array do not include it in the conversion results\n\t\t\tif(!in_array($key_value_array[0], $exclude_array))\n\t\t\t{\n\t\t\t\t#If key requires replacing the value with that given, change it here\n\t\t\t\tif(isset($key_value_array[1]) && array_key_exists($key_value_array[1], $replace_array))\n\t\t\t\t{\n\t\t\t\t\t$post_array[$key_value_array[0]] = $replace_array[$key_value_array[1]];\n\t\t\t\t}\n\t\t\t\telse if(isset($key_value_array[0]) && isset($key_value_array[1]))\n\t\t\t\t{\n\t\t\t\t\t$post_array[$key_value_array[0]] = $key_value_array[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\treturn $post_array;\n}", "static function dn2f($data,$set=array()){\n if(!is_array($data)) return($data);\n $_int = array('pos','lev','cns','par','pth','key');\n $def = array('sep'=>':','set'=>'=','childs'=>'childs');\n foreach($_int as $ci) $def[$ci] = NULL;\t\t \n\n $set = ops_array::setdefault($set,$def);\n $stack = array();\n $clev = 0;\n $cpos = 0;\n $cpath = '';\n $keys = array_keys($data);\n $res = array();\n\n while(count($data)>0 or count($stack)>0){\n if(count($data)==0){\n\tlist($ckey,$tres,$data,$keys,$cpath,$cpos)= array_pop($stack);\n\t$res = array_merge($tres,$res);\n\t$clev--;\n } else {\n\t$ckey = array_shift($keys);\n\t$cdat = array_shift($data);\n\n\tif(!empty($set['pos'])) $cdat[$set['pos']] = $cpos;\n\tif(!empty($set['lev'])) $cdat[$set['lev']] = $clev;\n\tif(!empty($set['key'])) $cdat[$set['key']] = $ckey;\n\tif(!empty($set['par'])) {\n\t $nc = count($stack)-1;\n\t $cdat[$set['par']] = $nc>=0?$stack[$nc][0]:NULL;\n\t}\n\tif(!empty($set['cns']))\n\t if(isset($cdat[$set['childs']]) and is_array($cdat[$set['childs']]))\n\t $cdat[$set['cns']] = array_keys($cdat[$set['childs']]);\n\t\n\tif(!empty($set['pth'])){\n\t foreach($stack as $cs) $cdat[$set['pth']][] = $cs[0];\n\t $cdat[$set['pth']][] = $ckey;\n\t}\n\n\tif(is_null($set['sep'])) $cp = $ckey;\n\telse $cp = (strlen($cpath)>0?($cpath . $set['sep']):'') . $ckey;\n\n\tif(is_null($set['set'])){\n\t $res[$cp] = $cdat;\n\t unset($res[$cp][$set['childs']]);\n\t} else {\n\t foreach($cdat as $ck=>$cv)\n\t if($ck!=$set['childs']) \n\t $res[$cp . $set['set'] . $ck] = $cv;\n\t}\n\t$cpos++;\n\tif(isset($cdat[$set['childs']]) and is_array($cdat[$set['childs']])){\n\t $clev++;\n\t $stack[] = array($ckey,$res,$data,$keys,$cpath,$cpos);\n\t $cpath .= strlen($cpath)>0?( $set['sep'] . $ckey):$ckey;\n\t $data = $cdat[$set['childs']];\n\t $keys = array_keys($data);\n\t $res = array();\n\t $cpos = 0;\n\t} \n }\n }\n return($res);\n \n }", "public static function create($products = '') {\n\t\t// Generate the random string, \n\t\t$str = random_string();\n\t\t\n\t\t// Set it to a session for easy access\n\t\tself::$_slug = Session::set('dime_basket', $str);\n\t\t\n\t\t// And insert it in the database so we don't forget it\n\t\t$db = self::$_db->insert()->into('baskets')->values(array(\n\t\t\tnull, $str, ip_address(), $products, time(), 'active'\n\t\t))->go();\n\t\t\n\t\treturn $str;\n\t}", "static function fs2dn($data,$struct='childs',$set=array()){\n $_int = array('pos','lev','cns','par','pth','key');\n $def = array('set'=>'=','def'=>'label','childs'=>'childs');\n foreach($_int as $ci) $def[$ci] = NULL;\t\t \n $set = ops_array::Setdefault($set,$def);\n $res = array(); \n $par = array();\n foreach($data as $key=>$val){\n if(is_null($set['set'])) $item = NULL;\n else list($key,$item) = ops_narray::expl2($set['set'],$key);\n if(!is_null($item)){\n\tif($item!=$struct)\n\t $res[$key][$item] = $val;\n\telse if(is_array($val))\n\t foreach($val as $cv) $par[$cv] = $key;\n\telse \n\t $par[$key] = $val;\n } else {\n\tif(!is_array($val))\n\t $res[$key][$set['def']] = $val;\n\telse {\n\t foreach($val as $ck=>$cv){\n\t if($ck!=$struct)\n\t $res[$key][$ck] = $cv;\n\t else if(is_array($cv))\n\t foreach($cv as $sv) $par[$sv] = $key;\n\t else \n\t $par[$key] = $cv;\n\t }\n\t}\n }\n }\n while(count($par)>0){\n $ak = array_keys($par);\n foreach($ak as $ck){\n\tif(!in_array($ck,$par)){\n\t $res[$par[$ck]][$set['childs']][$ck] = isset($res[$ck])?$res[$ck]:array();\n\t unset($res[$ck]);\n\t unset($par[$ck]);\n\t}\n }\n }\n return($res);\n }", "private function buildValues(iterable $values): Generator\n {\n foreach ($values as $key => $value) {\n yield $key => new Value($value);\n }\n }", "function tracking_unserialize($string, $max_depth = 3)\n{\n\t$n = strlen($string);\n\tif ($n > 10010)\n\t{\n\t\tdie('Invalid data supplied');\n\t}\n\t$data = $stack = array();\n\t$key = '';\n\t$mode = 0;\n\t$level = &$data;\n\tfor ($i = 0; $i < $n; ++$i)\n\t{\n\t\tswitch ($mode)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\tswitch ($string[$i])\n\t\t\t\t{\n\t\t\t\t\tcase ':':\n\t\t\t\t\t\t$level[$key] = 0;\n\t\t\t\t\t\t$mode = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase ')':\n\t\t\t\t\t\tunset($level);\n\t\t\t\t\t\t$level = array_pop($stack);\n\t\t\t\t\t\t$mode = 3;\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$key .= $string[$i];\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 1:\n\t\t\t\tswitch ($string[$i])\n\t\t\t\t{\n\t\t\t\t\tcase '(':\n\t\t\t\t\t\tif (sizeof($stack) >= $max_depth)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tdie('Invalid data supplied');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$stack[] = &$level;\n\t\t\t\t\t\t$level[$key] = array();\n\t\t\t\t\t\t$level = &$level[$key];\n\t\t\t\t\t\t$key = '';\n\t\t\t\t\t\t$mode = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$level[$key] = $string[$i];\n\t\t\t\t\t\t$mode = 2;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 2:\n\t\t\t\tswitch ($string[$i])\n\t\t\t\t{\n\t\t\t\t\tcase ')':\n\t\t\t\t\t\tunset($level);\n\t\t\t\t\t\t$level = array_pop($stack);\n\t\t\t\t\t\t$mode = 3;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase ';':\n\t\t\t\t\t\t$key = '';\n\t\t\t\t\t\t$mode = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$level[$key] .= $string[$i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 3:\n\t\t\t\tswitch ($string[$i])\n\t\t\t\t{\n\t\t\t\t\tcase ')':\n\t\t\t\t\t\tunset($level);\n\t\t\t\t\t\t$level = array_pop($stack);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase ';':\n\t\t\t\t\t\t$key = '';\n\t\t\t\t\t\t$mode = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdie('Invalid data supplied');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (sizeof($stack) != 0 || ($mode != 0 && $mode != 3))\n\t{\n\t\tdie('Invalid data supplied');\n\t}\n\n\treturn $level;\n}", "function pg_array_parse($s,$start=0,&$end=NULL){\n if (empty($s) || $s[0]!='{') return NULL;\n $return = array();\n $br = 0;\n $string = false;\n $quote='';\n $len = strlen($s);\n $v = '';\n for($i=$start+1; $i<$len;$i++){\n $ch = $s[$i];\n\n if (!$string && $ch=='}'){\n if ($v!=='' || !empty($return)){\n $return[] = $v;\n }\n $end = $i;\n break;\n }else\n if (!$string && $ch=='{'){\n $v = pg_array_parse($s,$i,$i);\n }else\n if (!$string && $ch==','){\n $return[] = $v;\n $v = '';\n }else\n if (!$string && ($ch=='\"' || $ch==\"'\")){\n $string = TRUE;\n $quote = $ch;\n }else\n if ($string && $ch==$quote && $s[$i-1]==\"\\\\\"){\n $v = substr($v,0,-1).$ch;\n }else\n if ($string && $ch==$quote && $s[$i-1]!=\"\\\\\"){\n $string = FALSE;\n }else{\n $v .= $ch;\n }\n }\n return $return;\n}", "public static function create($string)\n {\n $v = new self();\n $v->value = $string;\n\n return $v;\n }", "function drupal_parse_info_file($filename) {\n\n $info = array();\n if (!file_exists($filename)) {\n return $info;\n }\n\n $data = file_get_contents($filename);\n if (preg_match_all('\n @^\\s* # Start at the beginning of a line, ignoring leading whitespace\n ((?:\n [^=;\\[\\]]| # Key names cannot contain equal signs, semi-colons or square brackets,\n \\[[^\\[\\]]*\\] # unless they are balanced and not nested\n )+?)\n \\s*=\\s* # Key/value pairs are separated by equal signs (ignoring white-space)\n (?:\n (\"(?:[^\"]|(?<=\\\\\\\\)\")*\")| # Double-quoted string, which may contain slash-escaped quotes/slashes\n (\\'(?:[^\\']|(?<=\\\\\\\\)\\')*\\')| # Single-quoted string, which may contain slash-escaped quotes/slashes\n ([^\\r\\n]*?) # Non-quoted string\n )\\s*$ # Stop at the next end of a line, ignoring trailing whitespace\n @msx', $data, $matches, PREG_SET_ORDER)) {\n foreach ($matches as $match) {\n // Fetch the key and value string\n $i = 0;\n foreach (array('key', 'value1', 'value2', 'value3') as $var) {\n $$var = isset($match[++$i]) ? $match[$i] : '';\n }\n $value = stripslashes(substr($value1, 1, -1)) . stripslashes(substr($value2, 1, -1)) . $value3;\n\n // Parse array syntax\n $keys = preg_split('/\\]?\\[/', rtrim($key, ']'));\n $last = array_pop($keys);\n $parent = &$info;\n\n // Create nested arrays\n foreach ($keys as $key) {\n if ($key == '') {\n $key = count($parent);\n }\n if (!isset($parent[$key]) || !is_array($parent[$key])) {\n $parent[$key] = array();\n }\n $parent = &$parent[$key];\n }\n\n // Handle PHP constants\n if (defined($value)) {\n $value = constant($value);\n }\n\n // Insert actual value\n if ($last == '') {\n $last = count($parent);\n }\n $parent[$last] = $value;\n }\n }\n\n return $info;\n}", "abstract public function build();", "abstract public function build();", "function parseValue($value);", "abstract protected function buildMap();", "public function test_build_get_evaluated_without_args() {\n\t\t\t$instanceName = \"leafStub\";\n\t\t\t$value = \"aae\\\\\\\\std\\\\\\\\LeafStub\";\n\t\t\t$json = \"{\n \\\"$instanceName\\\": {\n \\\"class\\\": \\\"$value\\\",\n \\\"args\\\": [\n 5\n ],\n \\\"evaluate\\\": \\\"getValue\\\"\n }\n}\";\n\t\t\t$obj = new DIFactory(json_decode($json, true));\n\t\t\n\t\t\t# When build is called\n\t\t\t$result = $obj->build($instanceName);\n\t\t\t\n\t\t\t# Then an instance with all dependencies\n\t\t\t# declared in the configuration object is created\n\t\t\t$this->assertEquals(5, $result);\n\t\t}", "function jmap_xmlrpc_ee($parser, $name, $rebuild_xmlrpcvals = true)\n{\n\tif ($GLOBALS['_xh']['isf'] < 2)\n\t{\n\t\t$curr_elem = array_pop($GLOBALS['_xh']['stack']);\n\n\t\tswitch($name)\n\t\t{\n\t\t\tcase 'VALUE':\n\t\t\t\tif ($GLOBALS['_xh']['vt']=='value')\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac'];\n\t\t\t\t\t$GLOBALS['_xh']['vt']=$GLOBALS['xmlrpcString'];\n\t\t\t\t}\n\n\t\t\t\tif ($rebuild_xmlrpcvals)\n\t\t\t\t{\n\t\t\t\t\t$temp = new jmap_xmlrpcval($GLOBALS['_xh']['value'], $GLOBALS['_xh']['vt']);\n\t\t\t\t\tif (isset($GLOBALS['_xh']['php_class']))\n\t\t\t\t\t\t$temp->_php_class = $GLOBALS['_xh']['php_class'];\n\t\t\t\t\t$vscount = count($GLOBALS['_xh']['valuestack']);\n\t\t\t\t\tif ($vscount && $GLOBALS['_xh']['valuestack'][$vscount-1]['type']=='ARRAY')\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['_xh']['valuestack'][$vscount-1]['values'][] = $temp;\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$GLOBALS['_xh']['value'] = $temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (isset($GLOBALS['_xh']['php_class']))\n\t\t\t\t\t{\n\t\t\t\t\t}\n\n\t\t\t\t\t$vscount = count($GLOBALS['_xh']['valuestack']);\n\t\t\t\t\tif ($vscount && $GLOBALS['_xh']['valuestack'][$vscount-1]['type']=='ARRAY')\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['_xh']['valuestack'][$vscount-1]['values'][] = $GLOBALS['_xh']['value'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'BOOLEAN':\n\t\t\tcase 'I4':\n\t\t\tcase 'INT':\n\t\t\tcase 'STRING':\n\t\t\tcase 'DOUBLE':\n\t\t\tcase 'DATETIME.ISO8601':\n\t\t\tcase 'BASE' . '64':\n\t\t\t\t$GLOBALS['_xh']['vt']=strtolower($name);\n\t\t\t\tif ($name=='STRING')\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac'];\n\t\t\t\t}\n\t\t\t\telseif ($name=='DATETIME.ISO8601')\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['vt']=$GLOBALS['xmlrpcDateTime'];\n\t\t\t\t\t$GLOBALS['_xh']['value']=$GLOBALS['_xh']['ac'];\n\t\t\t\t}\n\t\t\t\telseif ($name=='BASE' . '64')\n\t\t\t\t{\n\t\t\t\t\t$bas64FunctionNameDecode = 'base'. 64 . '_decode';\n\t\t\t\t\t$GLOBALS['_xh']['value']=$bas64FunctionNameDecode($GLOBALS['_xh']['ac']);\n\t\t\t\t}\n\t\t\t\telseif ($name=='BOOLEAN')\n\t\t\t\t{\n\t\t\t\t\tif ($GLOBALS['_xh']['ac']=='1' || strcasecmp($GLOBALS['_xh']['ac'], 'true') == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['_xh']['value']=true;\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// log if receiveing something strange, even though we set the value to false anyway\n\t\t\t\t\t\t$GLOBALS['_xh']['value']=false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($name=='DOUBLE')\n\t\t\t\t{\n\t\t\t\t\tif (!preg_match('/^[+-eE0123456789 \\t.]+$/', $GLOBALS['_xh']['ac']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND';\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$GLOBALS['_xh']['value']=(double)$GLOBALS['_xh']['ac'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!preg_match('/^[+-]?[0123456789 \\t]+$/', $GLOBALS['_xh']['ac']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$GLOBALS['_xh']['value']='ERROR_NON_NUMERIC_FOUND';\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$GLOBALS['_xh']['value']=(int)$GLOBALS['_xh']['ac'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//$GLOBALS['_xh']['ac']=''; // is this necessary?\n\t\t\t\t$GLOBALS['_xh']['lv']=3; // indicate we've found a value\n\t\t\t\tbreak;\n\t\t\tcase 'NAME':\n\t\t\t\t$GLOBALS['_xh']['valuestack'][count($GLOBALS['_xh']['valuestack'])-1]['name'] = $GLOBALS['_xh']['ac'];\n\t\t\t\tbreak;\n\t\t\tcase 'MEMBER':\n\t\t\t\tif ($GLOBALS['_xh']['vt'])\n\t\t\t\t{\n\t\t\t\t\t$vscount = count($GLOBALS['_xh']['valuestack']);\n\t\t\t\t\t$GLOBALS['_xh']['valuestack'][$vscount-1]['values'][$GLOBALS['_xh']['valuestack'][$vscount-1]['name']] = $GLOBALS['_xh']['value'];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'DATA':\n\t\t\t\t//$GLOBALS['_xh']['ac']=''; // is this necessary?\n\t\t\t\t$GLOBALS['_xh']['vt']=null; // reset this to check for 2 data elements in a row - even if they're empty\n\t\t\t\tbreak;\n\t\t\tcase 'STRUCT':\n\t\t\tcase 'ARRAY':\n\t\t\t\t// fetch out of stack array of values, and promote it to current value\n\t\t\t\t$curr_val = array_pop($GLOBALS['_xh']['valuestack']);\n\t\t\t\t$GLOBALS['_xh']['value'] = $curr_val['values'];\n\t\t\t\t$GLOBALS['_xh']['vt']=strtolower($name);\n\t\t\t\tif (isset($curr_val['php_class']))\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['php_class'] = $curr_val['php_class'];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'PARAM':\n\t\t\t\t// add to array of params the current value,\n\t\t\t\t// unless no VALUE was found\n\t\t\t\tif ($GLOBALS['_xh']['vt'])\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['params'][]=$GLOBALS['_xh']['value'];\n\t\t\t\t\t$GLOBALS['_xh']['pt'][]=$GLOBALS['_xh']['vt'];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'METHODNAME':\n\t\t\t\t$GLOBALS['_xh']['method']=preg_replace('/^[\\n\\r\\t ]+/', '', $GLOBALS['_xh']['ac']);\n\t\t\t\tbreak;\n\t\t\tcase 'NIL':\n\t\t\t\tif ($GLOBALS['xmlrpc_null_extension'])\n\t\t\t\t{\n\t\t\t\t\t$GLOBALS['_xh']['vt']='null';\n\t\t\t\t\t$GLOBALS['_xh']['value']=null;\n\t\t\t\t\t$GLOBALS['_xh']['lv']=3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// drop through intentionally if nil extension not enabled\n\t\t\tcase 'PARAMS':\n\t\t\tcase 'FAULT':\n\t\t\tcase 'METHODCALL':\n\t\t\tcase 'METHORESPONSE':\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "public function prepare_marc_values($value_arr, $subfields, $delimiter = ' ') {\n\n // Repeatable values can be returned as an array or a serialized value\n foreach ($subfields as $subfield) {\n if (is_array($value_arr[$subfield])) {\n\n foreach ($value_arr[$subfield] as $subkey => $subvalue) {\n\n if (is_array($subvalue)) {\n foreach ($subvalue as $sub_subvalue) {\n if ($i[$subkey]) { $pad[$subkey] = $delimiter; }\n $sv_tmp = trim($sub_subvalue);\n $matches = array();\n preg_match_all('/\\{u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]\\}/', $sv_tmp, $matches);\n foreach ($matches[0] as $match_string) {\n $code = hexdec($match_string);\n $character = html_entity_decode(\"&#$code;\", ENT_NOQUOTES, 'UTF-8');\n $sv_tmp = str_replace($match_string, $character, $sv_tmp);\n }\n if (trim($sub_subvalue)) { $marc_values[$subkey] .= $pad[$subkey] . $sv_tmp; }\n $i[$subkey] = 1;\n }\n } else {\n if ($i[$subkey]) { $pad[$subkey] = $delimiter; }\n\n // Process unicode for diacritics\n $sv_tmp = trim($subvalue);\n $matches = array();\n preg_match_all('/\\{u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]\\}/', $sv_tmp, $matches);\n foreach ($matches[0] as $match_string) {\n $code = hexdec($match_string);\n $character = html_entity_decode(\"&#$code;\", ENT_NOQUOTES, 'UTF-8');\n $sv_tmp = str_replace($match_string, $character, $sv_tmp);\n }\n\n if (trim($subvalue)) { $marc_values[$subkey] .= $pad[$subkey] . $sv_tmp; }\n $i[$subkey] = 1;\n }\n }\n }\n }\n\n if (is_array($marc_values)) {\n foreach ($marc_values as $mv) {\n $result[] = $mv;\n }\n }\n return $result;\n }", "function civicrm_api3_custom_value_create($params) {\n // @todo it's not clear where the entity_table is used as CRM_Core_BAO_CustomValueTable::setValues($create)\n // didn't seem to use it\n // so not clear if it's relevant\n if (!empty($params['entity_table']) && substr($params['entity_table'], 0, 7) == 'civicrm') {\n $params['entity_table'] = substr($params['entity_table'], 8, 7);\n }\n $create = array('entityID' => $params['entity_id']);\n // Translate names and\n //Convert arrays to multi-value strings\n $sp = CRM_Core_DAO::VALUE_SEPARATOR;\n \n foreach ($params as $id => $param) {\n if (is_array($param)) {\n $param = $sp . implode($sp, $param) . $sp;\n }\n list($c, $id) = CRM_Utils_System::explode('_', $id, 2);\n if ($c != 'custom') {\n continue;\n }\n list($i, $n, $x) = CRM_Utils_System::explode(':', $id, 3);\n if (is_numeric($i)) {\n $key = $i;\n $x = $n;\n }\n else {\n // Lookup names if ID was not supplied\n $key = CRM_Core_BAO_CustomField::getCustomFieldID($n, $i);\n if (!$key) {\n continue;\n }\n }\n if ($x && is_numeric($x)) {\n $key .= '_' . $x;\n }\n $create['custom_' . $key] = $param;\n }\n $result = CRM_Core_BAO_CustomValueTable::setValues($create);\n if ($result['is_error']) {\n throw new Exception($result['error_message']);\n }\n return civicrm_api3_create_success(TRUE, $params);\n}", "public function parse($string, array $values = array(), $default = null)\n\t{\n\t\treturn ($string = $this->get($string)) ? $this->parser()->parse_string($string, $values) : __val($default);\n\t}", "public function build($data)\n\t{\n\t\t$this->checkData($data);\n\n\t\t$hierarchyMember = $this->hierarchyMember;\n\t\t$charsPerLevel = $this->charsPerLevel;\n\t\t$usePositionAsIndex = TRUE;\n\n\t\t$root = $this->createNode();\n\t\t$nodes = [];\n\t\tforeach ($data as $item) {\n\t\t\t$rawPosition = $this->getMember($item, $hierarchyMember) ?? '';\n\t\t\t$cutoff = substr($rawPosition, 0, strlen($this->hierarchyCutoff));\n\t\t\tif (!empty($this->hierarchyCutoff) && $cutoff !== $this->hierarchyCutoff) {\n\t\t\t\tthrow new RuntimeException(sprintf('Item hierarchy member \"%s\" does not start with the set hierarchy cut-off string \"%s\".', $rawPosition, $this->hierarchyCutoff), 3);\n\t\t\t}\n\t\t\t$itemPosition = substr($rawPosition, strlen($this->hierarchyCutoff));\n\n\t\t\tif ($itemPosition === NULL || strlen($itemPosition) < $this->charsPerLevel) {\n\t\t\t\t// root node found\n\t\t\t\t$newRoot = $this->createNode($item);\n\t\t\t\t$this->copyNodesRelationsAndReplace($root, $newRoot);\n\t\t\t\t$root = $newRoot;\n\t\t\t\tcontinue;\n\t\t\t} elseif (!isset($nodes[$itemPosition])) {\n\t\t\t\t// insert the node into the check table\n\t\t\t\t$nodes[$itemPosition] = $node = $this->createNode($item);\n\t\t\t} else {\n\t\t\t\t// the node has been inserted before - due to data failure or gap bridging\n\t\t\t\t// replace the node, copy node relations and continue\n\t\t\t\t$oldNode = $nodes[$itemPosition];\n\t\t\t\t$nodes[$itemPosition] = $this->createNode($item);\n\t\t\t\t$this->copyNodesRelationsAndReplace($oldNode, $nodes[$itemPosition]);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$parentPos = substr($itemPosition, 0, -$charsPerLevel);\n\t\t\tif (isset($nodes[$parentPos])) {\n\t\t\t\t// parent has already been processed, link the child\n\t\t\t\t$nodes[$parentPos]->addChild($node, $usePositionAsIndex ? $cutoff . $itemPosition : NULL);\n\t\t\t} else {\n\t\t\t\t// bridge the gap between the current node and the nearest parent\n\t\t\t\t$pos = $parentPos;\n\t\t\t\t$childPosition = $itemPosition;\n\t\t\t\t$childNode = $node;\n\t\t\t\twhile (strlen($pos) >= $charsPerLevel && strlen($pos) >= strlen($cutoff) && !isset($nodes[$pos])) {\n\t\t\t\t\t$nodes[$pos] = $newNode = $this->createNode();\n\t\t\t\t\t$newNode->addChild($childNode, $usePositionAsIndex ? $cutoff . $childPosition : NULL);\n\t\t\t\t\t$childNode = $newNode;\n\t\t\t\t\t$childPosition = $pos;\n\t\t\t\t\t$pos = substr($pos, 0, -$charsPerLevel);\n\t\t\t\t}\n\t\t\t\tif (!isset($nodes[$pos])) {\n\t\t\t\t\t$root->addChild($childNode, $usePositionAsIndex ? $cutoff . $childPosition : NULL);\n\t\t\t\t} else {\n\t\t\t\t\t$nodes[$pos]->addChild($childNode, $usePositionAsIndex ? $cutoff . $childPosition : NULL);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->autoSort && $this->sortChildren($root);\n\t\treturn $root;\n\t}", "public function setData($key, $value = null)\n {\n if (is_string($key) && (strpos($key, '/') !== false)) {\n $this->_hasDataChanges = true;\n $keys = $this->_explodeCompoundKey($key);\n $result = $this->_hardTraverseDataKeys($keys);\n $result[1] = $value;\n return $this;\n }\n return parent::setData($key, $value);\n }", "abstract public function parse($string);", "protected function build()\r\n {\r\n $tag = array_shift($this->attributes);\r\n $content = implode('', $this->childs);\r\n if (empty($tag) || $tag == 'dummy') {\r\n return $content;\r\n }\r\n $spaces = $this->tagdep != 0 ? PHP_EOL.str_repeat(\" \",abs($this->tagdep)) : '';\r\n $strTag = $spaces.'<'.$tag;\r\n foreach ($this->attributes as $key => $value) {\r\n if (is_object($value) && !method_exists($value, '__toString')) {\r\n $strTag .= ' error=\"Attribute value is object ('.get_class($value).')\"';\r\n continue;\r\n }\r\n $strTag .= ' '.$key.'=\"'.htmlspecialchars($value, ENT_QUOTES).'\"';\r\n // la conversione del contentuto degli attributi viene fornita da Tag in modo\r\n // tale che non debba essere gestito dai suoi figli\r\n /*$strTag .= ' '.$key.'=\"'.$val.'\"';*/\r\n }\r\n $strTag .= '>';\r\n \r\n if (!in_array($tag, ['input', 'img', 'link', 'meta'])) {\r\n $strTag .= $content . ($this->tagdep < 0 ? $spaces : '') .\"</{$tag}>\";\r\n }\r\n return $strTag;\r\n }", "function init($varname, $value = \"\", $append = false) {\n if (!is_array($varname)) {\n if ($varname !== '') {\n $this->_keys[$varname] = $this->_varname($varname);\n ($append) ? $this->_vals[$varname] .= $value : $this->_vals[$varname] = $value;\n }\n } else {\n reset($varname);\n while (list($k, $v) = each($varname)) {\n if ($k !== '') {\n $this->_keys[$k] = $this->_varname($k);\n ($append) ? $this->_vals[$k] .= $v : $this->_vals[$k] = $v;\n }\n }\n }\n }", "function create()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t$this->setId($ilDB->nextId(\"bookmark_data\"));\n\t\t$q = sprintf(\n\t\t\t\t\"INSERT INTO bookmark_data (obj_id, user_id, title,description, target, type) \".\n\t\t\t\t\"VALUES (%s,%s,%s,%s,%s,%s)\",\n\t\t\t\t$ilDB->quote($this->getId(), \"integer\"),\n\t\t\t\t$ilDB->quote($_SESSION[\"AccountId\"], \"integer\"),\n\t\t\t\t$ilDB->quote($this->getTitle(), \"text\"),\n\t\t\t\t$ilDB->quote($this->getDescription(), \"text\"),\n\t\t\t\t$ilDB->quote($this->getTarget(), \"text\"),\n\t\t\t\t$ilDB->quote('bm', \"text\")\n\t\t\t);\n\n\t\t$ilDB->manipulate($q);\n\t\t$this->tree->insertNode($this->getId(), $this->getParent());\n\t}", "public function make($value);" ]
[ "0.4749919", "0.4705231", "0.46302524", "0.4597355", "0.44590124", "0.44415614", "0.4433053", "0.44121525", "0.43920425", "0.43707222", "0.43684363", "0.43556684", "0.43428394", "0.43185925", "0.4316652", "0.4286249", "0.42704257", "0.42618603", "0.4235861", "0.4225837", "0.4196809", "0.41862956", "0.41856828", "0.4173555", "0.41673216", "0.41608003", "0.41526598", "0.41402555", "0.41181272", "0.41060162", "0.40953305", "0.40839085", "0.40837058", "0.40740398", "0.4070445", "0.40658444", "0.40621868", "0.40364772", "0.40178972", "0.40098318", "0.40088055", "0.3985187", "0.39807826", "0.39675137", "0.39662766", "0.39500022", "0.39500022", "0.39500022", "0.39500022", "0.3947902", "0.39415798", "0.39246643", "0.39207882", "0.39205307", "0.39115402", "0.39113492", "0.3907594", "0.3902193", "0.3902193", "0.39003646", "0.39003482", "0.3899169", "0.38884288", "0.38797045", "0.38786405", "0.38746253", "0.38542375", "0.38426384", "0.38398293", "0.38391802", "0.3839109", "0.38362393", "0.3831777", "0.3831316", "0.38289484", "0.38269717", "0.38205338", "0.38179862", "0.3816888", "0.38165015", "0.3813715", "0.38131046", "0.38120034", "0.3810502", "0.38093382", "0.38093382", "0.38065544", "0.380327", "0.38020772", "0.38011044", "0.38007984", "0.37995303", "0.3798744", "0.3798167", "0.37905344", "0.3790254", "0.3788015", "0.3785137", "0.37806773", "0.3779403" ]
0.6251009
0
Function replaces $name property on position $pos with $new value in string $str
function edit_property(&$str, $new_value, $pos, $name = 'keys') { $prop_str = $this->get_pos_str($new_value); $start = $this->get_start_pos($name) + $pos * ($this->pos_len + $this->d_len); $str = substr($str, 0, $start) . $prop_str . substr($str, $start + strlen($prop_str)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _replaceVariable($str, $pos, $var, $repl)\n {\n $expr = substr($str, $pos, strpos($str, ')', $pos + 1) - $pos + 1);\n $eqsign = strpos($expr, '=');\n if (false !== $eqsign)\n {\n $name = substr($expr, $eqsign + 1, strlen($expr) - $eqsign - 2);\n }\n return substr_replace($str, \"(?P<$name>$repl)\", $pos, strlen($expr));\n }", "function __replace_special_name($leters = array(),$name = \"\", $idx = 0){\n\t\t\n\t\tif(count($leters) > $idx){\n\t\t\t$name = str_replace($leters[$idx][0], $leters[$idx][1], $name);\n\t\t\treturn $this->__replace_special_name($leters,$name,++$idx);\n\t\t}else{\n\t\t\treturn $name;\n\t\t\t\n\t\t}\t\n\t\t\n\t}", "function str_replace_from_offset($search, $replace, $subject, $count = -1, $offset = 0) {\r\n\t\t$substr = substr($subject, $offset);\r\n\t\t$substr = str_replace($search, $replace, $substr, $count);\r\n\t\t$subject = substr($subject, 0, $offset) . $substr;\r\n\t\treturn $subject;\r\n\t}", "private function update_name($new_name) { \n\n\t\tif ($this->_update_item('name',$new_name,'50')) { \n\t\t\t$this->name = $new_name;\n\t\t}\n\n\t}", "public function setName ($name){\n\t\tif($name){\n\t\t\t$this->Item['name'] = substr($name, 0,100);\n\t\t}\n\t}", "function transform_name( $name = '', $type = '' ) {\n $word = array( ' ' => $type, '&' => '' );\n $new = strtr( $name, $word );\n $new = strtolower( $new );\n\n return $new;\n}", "function transform_name( $name = '', $type = '' ) {\n\t$word = array( ' ' => $type, '&' => '' );\n\t$new = strtr( $name, $word );\n $new = strtolower( $new );\n return $new;\n}", "public function updateName($s, $write = true)\n {\n $this->Name = $s;\n if (isset(self::$charges[$s])) {\n $this->CalculatedTotal = self::$charges[$s];\n }\n if ($write) {\n $this->write();\n }\n }", "function setName($existingNames)\n\t{\n\t\t$str = str_word_count(strtolower($this->getLabel()),1);\n\t\t$name = $str[0];\n\t\t$i=0;\n\t\twhile(in_array($name,$existingNames))\n\t\t{\n\t\t\t$i++;\n\t\t\tif(isset($str[$i]))\n\t\t\t{\n\t\t\t\t$name = $name.'_'.$str[$i];\n\t\t\t} \n\t\t\telse\n\t\t\t{ \t\n\t\t\t\t$j=2;\n\t\t\t\twhile(in_array($name.'_'.$j,$existingNames))\n\t\t\t\t{\n\t\t\t\t\t$j++;\n\t\t\t\t}\n\t\t\t\t$name = $name.'_'.$j;\n\t\t\t}\n\t\t}\n\t\t$this->_position = count($existingNames) + 1; \n\t\t$this->_name = $name;\n\t\treturn $this->_name;\n\t}", "public function setName(string $name)\n\t{\n\t\t$this->name=$name; \n\t\t$this->keyModified['name'] = 1; \n\n\t}", "function setName($newName){\n $this->name = \"Glittery \" . $newName;\n }", "function newName($name)\n{\nreturn ' My name is' .$name;\n}", "function name2field($name) {\n return str_replace(\n array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'), array('_a', '_b', '_c', '_d', '_e', '_f', '_g', '_h', '_i', '_j', '_k', '_l', '_m', '_n', '_o', '_p', '_q', '_r', '_s', '_t', '_u', '_v', '_w', '_x', '_y', '_z'), lcfirst($name)\n );\n}", "function replace_credential($credentials, $credName, $newValue)\n\t{\n\t\t$newCredentials = '';\n\t\t$tempCredString = explode(\"'$credName'\", $credentials);\n\t\t$newCredentials = $tempCredString[0] . \"'$credName', '$newValue');\";\n\t\t$tempCredString = explode(\";\", $tempCredString[1]);\n\t\tunset($tempCredString[0]);\n\t\t$tempCredString = implode(';', $tempCredString);\n\t\t$newCredentials = $newCredentials . $tempCredString;\n\t\treturn $newCredentials;\n\t}", "function our_str_replace($find, &$replacements, $subject)\n\n{\n\n $l = strlen($find);\n\n // allocate some memory\n\n $new_subject = str_repeat(' ', strlen($subject));\n\n $new_subject = '';\n\n foreach($replacements as $r)\n\n {\n\n if(($pos = strpos($subject, $find)) === false) break;\n\n $new_subject .= substr($subject, 0, $pos).$r;\n\n $subject = substr($subject, $pos+$l);\n\n // the above appears to be the fastest method\n\n //$subject = substr_replace($subject, $r, $pos, $l);\n\n //$subject = substr($subject, 0, $pos).$r.substr($subject, $pos+strlen($find));\n\n }\n\n $new_subject .= $subject;\n\n return $new_subject;\n\n}", "function old_replace_credential($credentials, $credName, $newValue)\n\t{\n\t\t$newCredentials = '';\n\t\t$tempCredString = explode(\"'$credName', '\", $credentials);\n\t\t$newCredentials = $tempCredString[0] . \"'$credName', '\";\n\t\t$tempCredString = explode(\"'\", $tempCredString[1]);\n\t\t$tempCredString[0] = $newValue;\n\t\t$tempCredString = implode(\"'\", $tempCredString);\n\t\t$newCredentials = $newCredentials . $tempCredString;\n\t\treturn $newCredentials;\n\t}", "public function formatName($name);", "public function setName($NewName){\n\t\t// public function __construct($NewName)\n\n\t\t$nameVar = $this->name = $NewName;\n\t\treturn $nameVar;\n\t\t\n\t}", "public function setReplacementId($name, $replacement);", "public function replace($key,$value,$string){\n\t\treturn str_replace(\"::$key::\",$value,$string);\n\t}", "public function set_name($new_name) {\r\n\t\t$this->name = strtoupper($new_name);\r\n\t}", "public function setName($newName) {\n\t\t$newName = filter_var($newName, FILTER_SANITIZE_STRING);\n\n\t\t//Exception if input is only non-sanitized string data\n\t\tif($newName === false) {\n\t\t\tthrow (new InvalidArgumentException(\"name is not a valid string\"));\n\t\t}\n\n\t\t//Exception if input will not fit in the database\n\t\tif(strlen($newName) > 128) {\n\t\t\tthrow (new RangeException(\"name is too large\"));\n\t\t}\n\n\t\t//If input is a valid string, save the value\n\t\t$this->name = $newName;\n\t}", "public function setterIze($offset)\n {\n return 'set' . str_replace(' ', '', ucwords(strtr($offset, '_-', ' ')));\n }", "function replace($p, $str){\n $p2 = __t($p)->map(function($x) use($str){return $str;});\n return $p2();\n }", "public function setName($x) { $this->name = $x; }", "function replace($str){\n\t$temp = preg_replace('#([^a-z0-9]+)#i',' ',$str);\n\t$tab = explode(' ',$temp);\n\t$val = null;\n\tfor($i=0; $i<count($tab);$i++){\n\t\tif($i != 0){\n\t\t\t$val .= ucfirst($tab[$i]);\n\t\t}\n\t\telse{\n\t\t\t$val .= $tab[$i];\n\t\t}\n\t}\n\treturn $val;\n}", "public function assign($name, $value)\n {\n $this->_data = str_replace(\"%\" . $name . \"%\", $value, $this->_data);\n return $this;\n }", "public function setName($name, $value)\t{\n\n\t\t\t$this->{$name} = $value;\n\t\t\t\t\n\t\t\t//if (ctype_alnum($name) == true)\n\t\t\t\n\t\t\t//(die('The name of the store should only contain letters');\n\t\t\t\n\t\t\t//$this->name = $name;\n\t\t}", "public function setName($string)\r\n {\r\n $this->_name = $string;\r\n }", "function tpl_modifier_replace($string, $search, $replace)\r\n{\r\n\treturn str_replace($search, $replace, $string);\r\n}", "public function setByName($name, $value, $type = BasePeer::TYPE_FIELDNAME)\n {\n $pos = SanitasiPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);\n\n $this->setByPosition($pos, $value);\n }", "public function set_name($name);", "public function __set($name, $value) {\n\t\t\tif (isset($this->object->$name) && $name != 'authority') {\n\t\t\t\t\\uri\\actions::modify($this->object, 'replace', $name, $value);\n\t\t\t\treturn $value;\n\t\t\t} else {\n\t\t\t\t$this->_err('FORBIDDEN', debug_backtrace(), $name);\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}", "public function update($name)\n {\n foreach ($this->content as $key => $val) {\n if ($val['name'] == $name) {\n $this->content[$key]['city'] = \"siwan\";\n }\n }\n }", "function propertyStringReplace($htmlString, $array) {\n foreach($array as $property => $value) {\n $htmlString = str_replace('%'.$property.'%', $value, $htmlString);\n }\n return $htmlString;\n}", "private function set_name($v)\n\t{\n\t\tUtil::validateArgCount(func_num_args(), 1);\n\t\tUtil::validateType($v, \"string\");\n\t\t$this->m_name = $v;\n\t\t$this->n_name = true;\n\t\treturn $this->m_name;\n\t}", "private function set_name($v)\n\t{\n\t\tUtil::validateArgCount(func_num_args(), 1);\n\t\tUtil::validateType($v, \"string\");\n\t\t$this->m_name = $v;\n\t\t$this->n_name = true;\n\t\treturn $this->m_name;\n\t}", "public function replace(&$input, $args)\n {\n $args = $this->getArgs($args);\n $search = array_keys($args);\n $replace = array_values($args);\n $input = str_replace($search, $replace, $input);\n }", "public function __set($name, $value) {\n if (ctype_alnum($name) && (ctype_digit($name[0]) == FALSE)) {\n $this->$name = $this->db->quote($value);\n $this->properties[$name] = $value;\n }\n }", "public function set_name($new_name) {\r\n\t\tif ($new_name == \"Stefan Sucks\") {\r\n\t\t\t$this->name = $new_name;\r\n\t\t} elseif ($new_name == \"Johnny Fingers\") {\r\n\t\t\tperson::set_name($new_name);\t//\trevert back to the parent's method instead of the child's method\r\n\t\t\t//\tparent::set_name($new_name);\t//\tcould also use \"parent::\"\r\n\t\t}\r\n\t}", "function scss_nameparse($str){\n \n $result = preg_replace_callback (\n \"/\\\\{([^}]+)\\\\}/\", \n function($matches){\n $tmp=explode('||',$matches[1]);\n $param=\\e::request(trim($tmp[0]),isset($tmp[1])?trim($tmp[1]):'');\n return preg_replace(\"/[^a-z0-9_-]/i\",'-',$param);\n }, \n $str);\n // echo $result;\n return $result;\n}", "function set_name(string $name) {\n\t\t$tmp = preg_match('/[^a-zA-Z0-9_-]/', $name);\n\t\tif ($tmp) {\n\t\t\tthrow new ArgException(\"Invalid chars in slide name.\");\n\t\t} else if ($tmp === NULL) {\n\t\t\tthrow new IntException(\"Regex match failed.\");\n\t\t}\n\n\t\t// Check name length.\n\t\tif (strlen($name) === 0) {\n\t\t\tthrow new ArgException(\"Invalid empty slide name.\");\n\t\t} else if (strlen($name) > gtlim('SLIDE_NAME_MAX_LEN')) {\n\t\t\tthrow new ArgException(\"Slide name too long.\");\n\t\t}\n\t\t$this->name = $name;\n\t}", "function stri_replace($find,$replace,$string)\n{\n if(!is_array($find))\n $find = array($find);\n \n if(!is_array($replace))\n {\n if(!is_array($find))\n $replace = array($replace);\n else\n {\n // this will duplicate the string into an array the size of $find\n $c = count($find);\n $rString = $replace;\n unset($replace);\n for ($i = 0; $i < $c; $i++)\n {\n $replace[$i] = $rString;\n }\n }\n }\n foreach($find as $fKey => $fItem)\n {\n $between = explode(strtolower($fItem),strtolower($string));\n $pos = 0;\n foreach($between as $bKey => $bItem)\n {\n $between[$bKey] = substr($string,$pos,strlen($bItem));\n $pos += strlen($bItem) + strlen($fItem);\n }\n $string = implode($replace[$fKey],$between);\n }\n return($string);\n}", "public function stringInsert($str, $insert, $index)\n {\n $str = substr($str, 0, $index) . $insert . substr($str, $index);\n return $str;\n }", "public function setName(string $name);", "public function setName(string $name);", "function updateBracket($con, $input, $spot)\n{\n mysqli_query($con,\"UPDATE ro16 \"\n . \"SET name = '$input' \"\n . \"WHERE spot='$spot'\");\n}", "function setName( &$value )\r\n {\r\n $this->Name = $value;\r\n }", "function setName( &$value )\r\n {\r\n $this->Name = $value;\r\n }", "function name($name)\n {\n $name = utf8ize($name);\n\n /* The shortname is a simple way to make sure people don't use names */\n /* that are too similar */\n /* FIXME: We should handle letters with accents, etc as well - */\n /* setting the character set to utf8 will probably work. */\n $shortname = strtolower(preg_replace('/[_\\W]+/', \"\", $name));\n\n if ($name != $this->name)\n $this->update['name'] = $name;\n if ($shortname != $this->shortname)\n $this->update['shortname'] = $shortname;\n\n $this->name = $name;\n $this->shortname = $shortname;\n\n return true;\n }", "public static function adjustNameCallback($name, $i) {}", "public function setName($val)\n {\n $this->name = $val;\n }", "function smarty_modifier_myreplace($string, $search) {\n\tif (count($search) > 0) {\n\t\t$newstring = strtr($string, $search);\n\t\treturn $newstring;\n\t} else {\n\t\treturn $string;\n\t}\n}", "public function setName($newName){\n\t}", "public function setName(string $newName): void\n {\n $entry = new StringEntry($newName);\n\n // TODO: investigate what to do with string copying\n $this->node->name = $entry->copy()->getRawValue();\n }", "function seoname($name) {\n\tglobal $language_char_conversions, $originals, $replacements;\n\tif ((isset($language_char_conversions)) && ($language_char_conversions == 1)) {\n\t\t$search = explode(\",\", $originals);\n\t\t$replace = explode(\",\", $replacements);\n\t\t$name = str_replace($search, $replace, $name);\n\t}\n\t$name = stripslashes($name);\n\t$name = strtolower($name);\n\t$name = str_replace(\"&\", \"and\", $name);\n\t$name = str_replace(\" \", \"-\", $name);\n\t$name = str_replace(\"---\", \"-\", $name);\n\t$name = str_replace(\"/\", \"-\", $name);\n\t$name = str_replace(\"?\", \"\", $name);\n\t$name = preg_replace( \"/[\\.,\\\";'\\:]/\", \"\", $name );\n\t//$name = urlencode($name);\n\treturn $name;\n}", "private static function format($name, $value)\n {\n return $value ?: ucwords(str_replace('_', ' ', $name));\n }", "abstract protected function prefixName($name);", "abstract protected function prefixName($name);", "public function setName($val) {\n $this->name = $val;\n }", "public function setName(?string $name): void\n {\n $this->name['value'] = $name;\n }", "public function setName(?string $name): void\n {\n $this->name['value'] = $name;\n }", "public function setName(?string $name): void\n {\n $this->name['value'] = $name;\n }", "final public function offsetSet($name, $component)\n\t{\n\t\t$this->addComponent($component, $name);\n\t}", "protected function _setName($name, $value) {}", "public function replace($section, $str) {\n\t\t\treturn \\uri\\actions::modify($this->object, 'replace', $section, $str);\n\t\t}", "public function setName($_name)\n {\n if (is_string($_name)) {\n \t$this->_name = $_name;\n }\n }", "public static function modify($name, $value)\n {\n self::write($name, $value);\n }", "function FormatName ($name) {\n\t\n\t\t//\tStart by lower casing the name\n\t\t$name=MBString::ToLower(MBString::Trim($name));\n\t\t\n\t\t//\tFilter the name through\n\t\t//\tthe substitutions\n\t\tforeach (array(\n\t\t\t'(?<=^|\\\\W)(\\\\w)' => function ($matches) {\treturn MBString::ToUpper($matches[0]);\t},\n\t\t\t'(?<=^|\\\\W)O\\'\\\\w' => function ($matches) {\treturn MBString::ToUpper($matches[0]);\t},\n\t\t\t'(?<=^|\\\\W)(Ma?c)(\\\\w)' => function ($matches) {\treturn $matches[1].MBString::ToUpper($matches[2]);\t}\n\t\t) as $pattern=>$substitution) {\n\t\t\n\t\t\t$pattern='/'.$pattern.'/u';\n\t\t\t\n\t\t\t$name=(\n\t\t\t\t($substitution instanceof Closure)\n\t\t\t\t\t?\tpreg_replace_callback($pattern,$substitution,$name)\n\t\t\t\t\t:\tpreg_replace($pattern,$substitution,$name)\n\t\t\t);\n\t\t\n\t\t}\n\t\t\n\t\t//\tReturn formatted name\n\t\treturn $name;\n\t\n\t}", "public function setByName($name, $value, $type = BasePeer::TYPE_FIELDNAME)\n {\n $pos = BangunanPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);\n\n $this->setByPosition($pos, $value);\n }", "public function setName($x) {\n $this->name = $x;\n }", "protected function setName($name){\n \n $ret_str = new Path($name);\n if($parent = $name->getParent()){\n \n $ret_str = new Path($parent,$ret_str->getFilename());\n \n }else{\n \n $ret_str = $ret_str->getFilename();\n \n }//if/else\n \n // all directory separators should be url separators...\n $ret_str = str_replace('\\\\','/',$ret_str);\n $this->setField('name',$ret_str);\n \n }", "abstract public function calcultateName($value, $isNew = false, $name = null, array $context = array());", "public static function stringrpl($r,$str){\n\t$temp = substr($str,6);\n\t$out1 = substr_replace($str,\"$r\",6);\n\t$out1 .= $temp;\n\t\n\t$temp = substr($out1,4);\n\t$out = substr_replace($out1,\"$r\",4);\n\t$out .= $temp;\n\treturn $out;\n}", "public function forName();", "public function testMapToName() {\n\t\t$name = 'some_name';\n\t\t$otherName = 'other_name';\n\n\t\t$this->Field->name($name);\n\t\t$this->assertSame($name, $this->Field->mapToName());\n\n\t\t$this->Field->map(null, $otherName);\n\t\t$this->assertSame($otherName, $this->Field->mapToName());\n\t}", "function rectifyName($name){\r\n return getNameForId(getIdForName($name));\r\n}", "public function updateString( Inx_Api_Recipient_Attribute $attr, $sValue );", "public function setNameInP($value, int $position = 6)\n {\n return $this->setField($position, $value);\n }", "public function apply(string $content): string\n {\n $search = '/(?:'.$this->getKey().'=.*)/';\n $replacement = $this->getKey().'='.$this->getValue();\n\n $content = preg_replace($search, $replacement, $content);\n\n if ($this->before) {\n $content = (new Move($this->getKey()))->before($this->before)->apply($content);\n }\n\n if ($this->after) {\n $content = (new Move($this->getKey()))->after($this->after)->apply($content);\n }\n\n return $content;\n }", "public function putString(string $name, ?string $value): string;", "public function setByName($name, $value, $type = BasePeer::TYPE_FIELDNAME)\n {\n $pos = JadwalPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);\n\n $this->setByPosition($pos, $value);\n }", "private function setNameLocation($newName)\n\t {\n\t $this->nameLocation = $newName;\n\t }", "function rename($old_name,$name){\r\n $file = lako_ljson::make_ljson_file($old_name);\r\n $file = $this->loader->locate($file);\r\n $definition = lako::get('ljson')->require_file($file);\r\n $location = dirname($file);\r\n //edit definition\r\n $definition['table'] = $definition['name'] = $name;\r\n lako::get('ljson')->save($location.\"/{$name}\",$definition);\r\n @unlink($file);\r\n }", "public function testReplace1()\n {\n $this->assertEquals(Str::replace('foo', 'oo', 'yy'), 'fyy');\n }", "function joinStr($str, $args){\n\t//$str = '將在%{level}級時解鎖%{name}';\n\tif(preg_match_all(\"/\\%{([\\d\\w\\_]+)}/\", $str, $match)){\n\t\t$r = [];\n\t\t$_args = [];\n\t\tforeach($match[1] as $_m){\n\t\t\t//$r[] = '\".@$args[\"'.$_m.'\"].\"';\n\t\t\t$r[] = \"%s\";\n\t\t\t$_args[] = $args[$_m];\n\t\t}\n\t\t$s = str_replace($match[0], $r, $str);\n\t\t$str = vsprintf($s, $_args);\n\t\t//var_dump(eval('$str = '.$s.';'));\n\t\t//var_dump($str);\n\t\treturn $str;\n\t}else{\n\t\treturn $str;\n\t}\n}", "function set_name($name) { \n $this->name = $name;\n }", "function setName( $value )\n {\n $this->Name = $value;\n }", "public function setName($name) {\n\t\t$this->_name = (string)$name;\n\t}", "public function SetName ($name);", "public function rename()\n\t{\n\t\t$newValue = $this->name;\n\t\t$previousValue = $this->getPreviousValue('name');\n\t\t$fieldName = $this->fieldModel->getName();\n\n\t\t$dbCommand = \\App\\Db::getInstance()->createCommand();\n\t\t$dataReader = (new \\App\\Db\\Query())->select(['tablename', 'columnname', 'fieldid', 'tabid'])\n\t\t\t->from('vtiger_field')\n\t\t\t->where(['fieldname' => $fieldName, 'uitype' => [15, 16, 33]])\n\t\t\t->createCommand()->query();\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$tableName = $row['tablename'];\n\t\t\t$columnName = $row['columnname'];\n\t\t\t$dbCommand->update($tableName, [$columnName => $newValue], [$columnName => $previousValue])\n\t\t\t\t->execute();\n\t\t\t$dbCommand->update('vtiger_field', ['defaultvalue' => $newValue], ['defaultvalue' => $previousValue, 'fieldid' => $row['fieldid']])\n\t\t\t\t->execute();\n\t\t\t$moduleName = \\App\\Module::getModuleName($row['tabid']);\n\n\t\t\t\\App\\Fields\\Picklist::clearCache($fieldName, $moduleName);\n\t\t\t$eventHandler = new \\App\\EventHandler();\n\t\t\t$eventHandler->setParams([\n\t\t\t\t'fieldname' => $fieldName,\n\t\t\t\t'oldvalue' => $previousValue,\n\t\t\t\t'newvalue' => $newValue,\n\t\t\t\t'module' => $moduleName,\n\t\t\t\t'id' => $this->getId(),\n\t\t\t]);\n\t\t\t$eventHandler->trigger('PicklistAfterRename');\n\t\t}\n\t\t\\App\\Fields\\Picklist::clearCache($fieldName, $this->fieldModel->getModuleName());\n\t}", "protected static function __replace(string $substring, string $replacement, string $str): string {\n\t\treturn str_replace($substring, $replacement, $str);\n\t}", "private function setName($name) {\n if (is_string($name)) {\n $this->name = $name;\n }\n }", "private function setName(string $name)\n {\n $this->name = trim($name);\n }", "function _fixName($field_or_value_name) {\r\n if ($field_or_value_name == \"\")\r\n return \"\";\r\n // convert space into underscore\r\n $result = preg_replace(\"/ /\", \"_\", strtolower($field_or_value_name));\r\n // strip all non alphanumeric chars\r\n $result = preg_replace(\"/\\W/\", \"\", $result);\r\n return $result;\r\n }", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);", "public function setName($name);" ]
[ "0.59950745", "0.5923943", "0.58378243", "0.5704068", "0.5572111", "0.54351354", "0.5431104", "0.5281488", "0.52504885", "0.5223439", "0.52060515", "0.5193551", "0.5186991", "0.5161758", "0.5124974", "0.5110818", "0.5088579", "0.5080547", "0.50745887", "0.5071972", "0.50369227", "0.5015791", "0.4984487", "0.4979421", "0.49678826", "0.49648333", "0.49637112", "0.49634874", "0.4957389", "0.494571", "0.49370423", "0.491779", "0.49116638", "0.48889816", "0.48879978", "0.48844957", "0.48844957", "0.48761633", "0.4872304", "0.48688227", "0.4864176", "0.48640937", "0.48569915", "0.48400226", "0.48372272", "0.48372272", "0.4832718", "0.48270702", "0.48270702", "0.4821622", "0.48155516", "0.48061267", "0.47874397", "0.4778957", "0.47761604", "0.47630256", "0.4755764", "0.4752734", "0.4752734", "0.47514135", "0.47513166", "0.47513166", "0.47513166", "0.474092", "0.473764", "0.47376135", "0.47316977", "0.473155", "0.47293976", "0.47248006", "0.47192973", "0.47134477", "0.47025648", "0.47003138", "0.46976665", "0.46971098", "0.46964163", "0.4693891", "0.46921673", "0.46914917", "0.46902493", "0.4686277", "0.46804824", "0.46771628", "0.46720254", "0.46703196", "0.4665187", "0.46641022", "0.46617433", "0.46565342", "0.4655169", "0.4655017", "0.4644557", "0.46437964", "0.4639736", "0.46396285", "0.46396285", "0.46396285", "0.46396285", "0.46396285" ]
0.7856642
0
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE estadistica (id INT AUTO_INCREMENT NOT NULL, id_equipo INT DEFAULT NULL, id_jornada SMALLINT DEFAULT NULL, puntos INT NOT NULL, jugados INT NOT NULL, ganados INT NOT NULL, ganados_local INT NOT NULL, ganados_visitante INT NOT NULL, empatados INT NOT NULL, empatados_local INT NOT NULL, empatados_visitante INT NOT NULL, perdidos INT NOT NULL, perdidos_local INT NOT NULL, perdidos_visitante INT NOT NULL, goles_favor INT NOT NULL, goles_favor_local INT NOT NULL, goles_favor_visitante INT NOT NULL, goles_contra INT NOT NULL, goles_contra_local INT NOT NULL, goles_contra_visitante INT NOT NULL, UNIQUE INDEX UNIQ_DF3A8544E2ABE6E6 (id_equipo), UNIQUE INDEX UNIQ_DF3A8544BF4FB5CF (id_jornada), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB'); $this->addSql('ALTER TABLE estadistica ADD CONSTRAINT FK_DF3A8544E2ABE6E6 FOREIGN KEY (id_equipo) REFERENCES equipo (id)'); $this->addSql('ALTER TABLE estadistica ADD CONSTRAINT FK_DF3A8544BF4FB5CF FOREIGN KEY (id_jornada) REFERENCES jornada (id)'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function up();", "abstract public function up();", "abstract public function up();", "abstract public function up();", "public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function up()\n {\n $this->execute(\"\n\n ALTER TABLE `cucp_user_company_position` \n ADD COLUMN `cucp_role` CHAR(20) NULL AFTER `cucp_name`;\n\n \");\n }", "public function up()\n\t{\n\t\t$this->dbforge->add_column($this->table, $this->field);\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }", "public function up()\n\t{\n\t\t$this->dbforge->modify_column($this->table, $this->field);\n\t}", "public function safeUp()\n {\n $this->createTable(\n $this->tableName,\n [\n 'id' => $this->primaryKey(),\n 'user_id' => $this->integer(). ' UNSIGNED NOT NULL' ,\n 'source' => $this->string()->notNull(),\n 'source_id' => $this->string()->notNull(),\n ],\n 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'\n );\n\n $this->addForeignKey('fk_social_auth_user_id_to_user_id', $this->tableName, 'user_id', '{{%user}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n }", "public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }", "public function up()\n {\n // Drop table 'table_name' if it exists\n $this->dbforge->drop_table('lecturer', true);\n\n // Table structure for table 'table_name'\n $this->dbforge->add_field(array(\n 'nip' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => true,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'nik' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => false,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'name' => array(\n 'type' => 'VARCHAR(24)',\n 'null' => false,\n ),\n\t\t\t'id_study_program' => array(\n\t\t\t\t'type' => 'VARCHAR(24)',\n\t\t\t\t'null' => false,\n\t\t\t)\n\n ));\n $this->dbforge->add_key('nik', true);\n $this->dbforge->create_table('lecturer');\n }", "public function up()\n\t{\n\t\t// are not setting the foreign key constraint, to allow the examination module to work without the intravitreal\n\t\t// injection module being installed\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'left_treatment_id', 'int(10) unsigned');\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'right_treatment_id', 'int(10) unsigned');\n\t}", "public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }", "public function preUp()\n {\n }", "public function up()\n\t{\n\t\t// create the purchase_order_details table\n\t\tSchema::create('purchase_order_details', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\t\t \n\t\t $table->integer('purchase_order_id')->unsigned();//->foreign()->references('id')->on('orders');\n\t\t $table->integer('product_id')->unsigned();//->foreign()->references('id')->on('products');\n\t\t $table->integer('quantity');\t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \n\t\t $table->integer('updated_by')->unsigned();\n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }", "public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}", "public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }", "public function up()\n {\n $this->addForeignKey('tours_fk', 'tours', 'id', 'tour_to_hotel', 'tour_id');\n\n $this->addForeignKey('t2h_fkh', 'tour_to_hotel', 'hotel_id', 'hotels', 'id');\n $this->addForeignKey('t2h_fkt', 'tour_to_hotel', 'tour_id', 'tours', 'id');\n }", "public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }", "public function safeUp() {\n\n $this->createTable('word', [\n 'word_id' => Schema::TYPE_PK,\n 'word_lang_id' => $this->integer(),\n 'word_name' => $this->string(500) . ' NOT NULL',\n 'word_detais' => $this->string(1000),\n ]);\n\n // Add foreign key\n $this->addForeignKey('fk_language_word_1', 'word',\n 'word_lang_id', 'language', 'lang_id', 'CASCADE', 'NO ACTION');\n \n // Create index of foreign key\n $this->createIndex('word_lang_id_idx', 'word', 'word_lang_id');\n }", "public function up()\n {\n $fields = array(\n 'first_login' => array('type' => 'char', 'constraint' => '1', 'default' => '1'),\n );\n $this->dbforge->add_column('user', $fields);\n }", "public function safeUp()\n {\n $this->alterColumn('item_keuangan', 'created_at', \"TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00'\");\n\n /* Tambah Field */\n $this->addColumn('item_keuangan', 'status', \"TINYINT(1) NOT NULL DEFAULT '1' COMMENT '0=tidak aktif; 1=aktif;' AFTER `jenis`\");\n }", "public function up()\n {\n $this->addForeignKey(\n 'fk_category_product_from_category',\n 'category_product',\n 'category_id',\n 'category',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n\n $this->addForeignKey(\n 'fk_category_product_from_product',\n 'category_product',\n 'product_id',\n 'product',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n\t\t$this->dropColumn('korzet','utca'); \n\t\t$this->addColumn('korzet','utca','string NOT NULL');\n\t}", "public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }", "public function up()\n {\n Schema::table($this->table, function (Blueprint $table) {\n // $table->bigInteger('user_id')->default(0)->after('id'); // Example\n $table->dropColumn([\n // 'user_id', // Example\n ]);\n });\n }", "public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }", "public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}", "public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function up()\n {\n $this->query(\"UPDATE `subscription_types` SET `user_label` = `name` WHERE `user_label` = '' OR `user_label` IS NULL;\");\n\n $this->table('subscription_types')\n ->changeColumn('user_label', 'string', ['null' => false])\n ->update();\n }", "public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}", "public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function up()\n {\n\t\t$this->addColumn('{{%user}}', 'is_super', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `status`\");\n\t\t\n\t\t//Add new column for Option Group table\n\t\t$this->addColumn('{{%option_group}}', 'option_type', Schema::TYPE_STRING . \"(25) NULL DEFAULT 'text' AFTER `title`\");\n\t\t\n\t\t//Add new column for Order table\n\t\t$this->addColumn('{{%order}}', 'is_readed', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `shipment_method`\");\n }", "public function up()\n {\n $this->addColumn(\\backend\\models\\VodProfile::tableName(), 'language', \"char(5) not null default 'en-US'\");\n }", "public function up()\n {\n if (!Schema::hasTable($this->table))\n Schema::create($this->table, function (Blueprint $table)\n {\n $table->integer('parent_id')->unsigned()->index();\n $table->foreign('parent_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->integer('child_id')->unsigned()->index();\n $table->foreign('child_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->primary(['parent_id','child_id'],'organisation_relations_primary');\n\n $table->timestamps();\n $table->softDeletes();\n\n $table->engine = 'InnoDB';\n });\n }", "public function up(){\n $table = $this->table('users', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('email', 'string', array('limit'=>100));\n $table->save();\n }", "public function up() { return $this->run('up'); }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t// examples:\n\t\t\t\t'l_label' => 'VARCHAR(200) NULL DEFAULT NULL',\n\t\t\t\t'l_announce' => 'TEXT NULL DEFAULT NULL',\n\t\t\t\t//'l_content' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_principles_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_principles_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t// create the purchase_orders table\n\t\tSchema::create('purchase_orders', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\n\t\t $table->string('order_number', 128);\n\t\t $table->string('approved',50);\n\t\t $table->date('purchase_date');\t\t \t \t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \t\t \n\t\t $table->integer('updated_by')->unsigned();\t\t \n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}", "public function up()\n {\n $this->execute('Update goods SET price_rub = price WHERE currency_id = 1');\n }", "public function up()\n\t{\n $this->dropColumn('calculo','fecha');\n\n //add column fecha in producto\n $this->addColumn('producto','fecha','date');\n\t}", "public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }", "public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }", "public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` TEXT NOT NULL AFTER `positive_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }", "public function up()\n {\n $this->table('agent_order_consignee_address')\n ->addColumn(Column::string('order_number')->setUnique()->setComment('订单编号'))\n \t\t->addColumn(Column::integer('agent_id')->setComment('代理商ID'))\n\t ->addColumn(Column::integer('create_time')->setDefault(1)->setComment('创建时间'))\n\t \n\t ->addColumn(Column::string('consignee_name')->setComment('收货人姓名'))\n\t ->addColumn(Column::string('consignee_phone')->setComment('收货人电话'))\n\t ->addColumn(Column::string('province')->setComment('省份'))\n\t ->addColumn(Column::string('city')->setComment('城市'))\n\t ->addColumn(Column::string('area')->setComment('地区'))\n\t ->addColumn(Column::string('address')->setComment('收货人详细地址'))\n ->create(); \n }", "public function up()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t'l_value' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_configuration_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_configuration_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function safeUp()\r\n {\r\n $this->up();\r\n }", "public function up(){\n // $table->table('kelas')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('NamaKelas', 'varchar', \"100\")\n // ->create();\n }", "public function safeUp()\n\t{\n\t\t$this->createTable('pesquisa', array(\n\t\t\t'id' => 'serial NOT NULL primary key',\n\t\t\t'nome' => 'varchar',\n\t\t));\n\t}", "public function safeUp()\n\t{\n\t\t$this->up();\n\t}", "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\n {\n $this->up();\n }", "public function up(){\n // $table->table('kelassiswa')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('Kelas_Id', 'int', \"11\")\n // ->addColumn('Peserta_Id', 'int', \"11\")\n // ->addForeignKey('Peserta_Id', 'peserta', \"Id\", \"CASCADE\")\n // ->addForeignKey('Kelas_Id', 'kelas', \"Id\")\n // ->create();\n\n }", "public function up()\n\t{\n\t\tSchema::table('project_sections', function($t){\n\t\t\t$t->integer('created_by_project_id')->nullable()->unsigned();\n\t\t\t$t->boolean('public')->default(0);\n\n $t->foreign('created_by_project_id')->references('id')->on('projects')->on_delete('SET NULL');\n\t\t});\n\t}", "public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}", "public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }", "public function up()\n {\n Schema::dropIfExists('db_question_new.t_answer_type');\n Schema::create('db_question_new.t_answer_type', function (Blueprint $table){\n $table->increments('id');\n t_field($table->integer('answer_type_no'),\"答案序号\");\n t_field($table->string('name'),\"步骤名字\");\n t_field($table->integer('subject'),\"科目id\");\n t_field($table->integer('open_flag')->default(1),\"开启与否\");\n }); \n }", "public function up()\n\t{\n\t\t$sql = \"create table tbl_rights\n\t\t\t\t(\n\t\t\t\t\titemname varchar(64) not null,\n\t\t\t\t\ttype integer not null,\n\t\t\t\t\tweight integer not null,\n\t\t\t\t\tprimary key (itemname),\n\t\t\t\t\tforeign key (itemname) references tbl_auth_item (name) on delete cascade on update cascade\n\t\t\t\t)\";\n\t\t $this->execute($sql);\n\t\t \n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable( 'tbl_auth_item', array(\n\t\t \"name\" => \"varchar(64) not null\",\n\t\t \"type\" => \"integer not null\",\n\t\t \"description\" => \"text\",\n\t\t \"bizrule\" => \"text\",\n\t\t \"data\" => \"text\",\n\t\t \"primary key (name)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_item_child\", array(\n \t\t\"parent\" => \" varchar(64) not null\",\n\t\t\"child\" => \" varchar(64) not null\",\n \t\t\"primary key (parent,child)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_assignment\",array(\n \t\t\"itemname\" => \"varchar(64) not null\",\n \t\t\"userid\" => \"varchar(64) not null\",\n \t\t\"bizrule\" => \"text\",\n \t\t\"data\"\t => \"text\",\n \t\t\"primary key (itemname,userid)\",\n\t\t));\n\n\t\t$this->addForeignKey('fk_auth_item_child_parent','tbl_auth_item_child','parent','tbl_auth_item','name','CASCADE','CASCADE');\n\t\t$this->addForeignKey('fk_auth_assignment_itemname','tbl_auth_assignment','itemname','tbl_auth_item','name');\n\t\t$this->addForeignKey('fk_auth_assignment_userid','tbl_auth_assignment','userid','tbl_user','id');\n\t}", "public function up()\n {\n // add foreign key for table `articles`\n $this->addForeignKey(\n 'fk-comments-article_id',\n 'comments',\n 'article_id',\n 'article',\n 'id'\n );\n }", "public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}", "public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }", "public function up()\n\t{\n\t\tSchema::table('user_hasil', function($table)\n\t\t{\n\t\t\t$table->create();\n\t\t\t$table->integer('user_id');\n\t\t\t$table->string('grade', 2);\n\t\t\t$table->decimal('hasil', 5, 2);\n\t\t\t$table->year('tahun');\n\t\t\t$table->timestamps();\n\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_update('cascade');\n\t\t});\n\t}", "public function safeUp()\r\n {\r\n $tableOptions = null;\r\n if ($this->db->driverName === 'mysql') {\r\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';\r\n }\r\n\r\n $this->createTable('{{%contact_msg}}', [\r\n 'id' => Schema::TYPE_PK,\r\n 'from_email' => Schema::TYPE_STRING . \"(320) NOT NULL\",\r\n 'to_email' => Schema::TYPE_STRING . \"(320) NULL\",\r\n 'subject' => Schema::TYPE_STRING . \"(300) NOT NULL\",\r\n 'text' => Schema::TYPE_TEXT,\r\n 'viewed' => Schema::TYPE_BOOLEAN . \"(1) NOT NULL DEFAULT '0'\",\r\n 'created_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n 'updated_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n ], $tableOptions);\r\n }", "public function up()\n {\n $this->alterColumn('{{%hystorical_data}}', 'project_id', $this->integer());\n\n $this->dropForeignKey('fk-hystorical_data-project_id',\n '{{%hystorical_data}}');\n\n $this->addForeignKey(\n 'fk-hystorical_data-project_id',\n '{{%hystorical_data}}',\n 'project_id',\n '{{%projects}}',\n 'id',\n 'SET NULL'\n );\n }", "public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }", "public function up()\n\t{\n\t\tSchema::create('flows_steps', function($table) {\n\n\t\t\t$table->engine = 'InnoDB';\n\n\t\t $table->increments('stepid');\n\t\t $table->integer('flowid');\n\t\t $table->string('step', 100);\n\t\t $table->integer('roleid');\n\t\t $table->integer('parentid');\n\t\t $table->integer('state');\n\t\t $table->integer('page');\n\t\t $table->integer('condition2');\n\t\t $table->timestamps();\n\n\t\t});\n\t}", "public function up()\n\t{\n\t\tSchema::table('devices', function($table)\n\t\t{\n\t\t\t$table->string('uuid')->unique;\n\t\t\t$table->drop_column('uid');\n\t\t});\n\t}", "public function up()\n {\n $this->createTable('post',[\n 'id' => $this->primaryKey(),\n 'author_id' => $this->integer(),\n 'title' => $this->string(255)->notNull()->unique(),\n 'content' => $this->text(),\n 'published_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'updated_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'status' => \"ENUM('draft','published')\",\n 'image' => $this->string(255)\n ]); \n\n $this->addForeignKey(\n 'fk_post_author_id',\n 'post',\n 'author_id',\n 'user',\n 'id',\n 'CASCADE',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}", "public function up()\n\t{\n// $import->import();\n\t}", "public function up()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"authItem\");\n\t\t}\n\n\t\t$this->createTable(\"{{rights}}\", array(\n\t\t\t\"itemname\" => \"varchar(64) CHARACTER SET UTF8 NOT NULL\",\n\t\t\t\"type\"\t => \"int not null\",\n\t\t\t\"weight\" => \"int not null\",\n\t\t\t\"PRIMARY KEY (itemname)\"\n\t\t\t));\n\t}", "public function up() {\r\n\t\t// UP\r\n\t\t$column = parent::Column();\r\n\t\t$column->setName('id')\r\n\t\t\t\t->setType('biginteger')\r\n\t\t\t\t->setIdentity(true);\r\n\t\tif (!$this->hasTable('propertystorage')) {\r\n\t\t\t$this->table('propertystorage', [\r\n\t\t\t\t\t\t'id' => false,\r\n\t\t\t\t\t\t'primary_key' => 'id'\r\n\t\t\t\t\t])->addColumn($column)\r\n\t\t\t\t\t->addColumn('path', 'text', ['limit' => 1024])\r\n\t\t\t\t\t->addColumn('name', 'text', ['limit' => 100])\r\n\t\t\t\t\t->addColumn('valuetype', 'integer',[])\r\n\t\t\t\t\t->addColumn('value', 'text', [])\r\n\t\t\t\t\t->create();\r\n\t\t}\r\n\t}", "public function up()\n {\n $perfis = [\n [\n 'id' => 1,\n 'perfil' => 'Genérico',\n 'ativo' => 1\n ]\n ];\n\n $this->insert('singular_perfil', $perfis);\n\n $usuarios = [\n [\n 'id' => 1,\n 'nome' => 'Singular Framework',\n 'login' => 'singular',\n 'senha' => 'singular',\n 'perfil_id' => 1\n ]\n ];\n\n $this->insert('singular_usuario', $usuarios);\n }", "public function safeUp()\n {\n $this->createTable('user', array(\n 'name' => 'string',\n 'username' => 'string NOT NULL',\n 'password' => 'VARCHAR(32) NOT NULL',\n 'salt' => 'VARCHAR(32) NOT NULL',\n 'role' => \"ENUM('partner', 'admin')\"\n ));\n }", "public function up()\n\t{\n\t\t$demoUser = new User();\n\t\t$demoUser->username = \"demo\";\n\t\t$demoUser->email = '[email protected]';\n\t\t$demoUser->password = 'password';\n\t\t$demoUser->create_time = new CDbExpression('NOW()');\n\t\t$demoUser->update_time = new CDbExpression('NOW()');\n\n\t\t$demoUser->save();\n\n\t\t$adminUser = new User();\n\t\t$adminUser->username = \"admin\";\n\t\t$adminUser->email = '[email protected]';\n\t\t$adminUser->password = 'password';\n\t\t$adminUser->create_time = new CDbExpression('NOW()');\n\t\t$adminUser->update_time = new CDbExpression('NOW()');\n\n\t\t$adminUser->save();\n\n\t}", "public function safeUp()\n {\n $tables = Yii::$app->db->schema->getTableNames();\n $dbType = $this->db->driverName;\n $tableOptions_mysql = \"CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB\";\n\n /* MYSQL */\n if (!in_array('question_tag', $tables)) {\n if ($dbType == \"mysql\") {\n $this->createTable('{{%question_tag}}', [\n 'question_id' => 'INT(11) NOT NULL',\n 'tag_id' => 'INT(11) NOT NULL',\n ], $tableOptions_mysql);\n }\n }\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t'like',\n\t\t\tarray(\n\t\t\t\t'id'=>'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',\n\t\t\t\t'user_id' => 'int(11) UNSIGNED NOT NULL',\n\t\t\t\t'post_id' => 'int (11) NOT NULL',\n\t\t\t\t'status' => 'TINYINT(1)',\n\t\t\t\t'created_at' => 'int(11)',\n\t\t\t\t'updated_at' => 'int(11)',\n\t\t\t\t'PRIMARY KEY (id)',\n\t\t\t\t),\n\t\t\t'ENGINE=InnoDB'\n\n\t\t\t);\n\t}", "public function up()\n\t{\n\t\tSchema::table('entries', function($table) {\n $table->create();\n $table->increments('id');\n $table->string('title', 128);\n $table->string('body');\n $table->integer('users_id')->unsigned();\n $table->index('users_id');\n $table->integer('last_edited_by');\n $table->foreign('users_id')->references('id')->on('users')->on_delete('no action');\n $table->timestamps();\n });\n\t}", "public function up()\n {\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'password', $this->string()->null());\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'status', $this->integer()->null());\n }", "public function up()\n {\n\t\t$tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\t\t\n\t\t$TABLE_NAME = 'HaberDeneme12';\n $this->createTable($TABLE_NAME, [\n 'HaberID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(12)->notNull(),\n 'Baslik' => $this->string(128)->notNull(),\n 'Ozet' => $this->text()->notNull(),\n 'Detay' => $this->text()->notNull(),\n 'Resim' => $this->text()->notNull(),\n 'EklenmeTarihi' => $this->date(),\n 'GuncellenmeTarihi' => $this->date()\n ], $tableOptions);\n\t\t\n\t\t\n\t\t$TABLE_NAME = 'HaberKategoriDeneme12';\n\t\t $this->createTable($TABLE_NAME, [\n 'KategoriID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(20)->notNull()\n ], $tableOptions);\n\t\t\n }", "public function up()\n\t{\n\t\t$fields = array(\n \"`piezas` DECIMAL(3,2) DEFAULT NULL\",\n\n\t\t);\n\t\t$this->dbforge->add_column('rel_monto_servicios', $fields);\n\n\t}", "public function up()\n {\n $this->insert('key_value', [\n 'key' => 'day_feed_count_dnr',\n 'value' => '15',\n ]);\n }", "public function up()\n {\n // 创建操作记录表\n $tables = $this->table('history');\n // 用户动作\n $tables->addColumn('action', 'string', ['limit' => 20])\n ->addColumn('ip', 'string', ['limit' => 129])\n // 建立用户\n ->addColumn('user_id', 'integer')\n // 登录时间\n ->addColumn('operation_time', 'datetime')\n // 操作详情\n ->addColumn('desc', 'string',['limit'=>500,'null' => true])\n ->create();\n }", "public function up()\n {\n $table = $this->table('vehicle_model_suggestions');\n\n if (!$table->exists()) {\n $table\n ->addPrimaryKey('id')\n ->addColumn('vehicle_id', 'integer', ['null' => false])\n ->addColumn('vehicle_model_id', 'integer', ['null' => false])\n ->addColumn('suggestion', 'text')\n ->addTimestamps()\n ->addColumn('deleted_at', 'datetime')\n ->create();\n }\n }", "public function safeUp()\n {\n $this->insert('category',['name'=>'Uncategorized', 'slug'=>'uncategorized', 'description'=>'Default Category', 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()')]);\n $this->insert('user',['username'=>'Administrator', 'password_hash'=>'$2y$13$6yoLjvVORp/7EO1u8phYTuWYzhMSM4LVVsebZgcqEKj/EQLvo5nJK',\n 'email'=>'[email protected]',\n 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()'),\n 'status'=>1\n ]\n );\n }", "public function safeUp()\n {\n $this->createTable($this->tableName, [\n 'post_id' => $this->bigInteger()->notNull(),\n 'category_id' => $this->bigInteger()->notNull(),\n ]);\n\n $this->addForeignKey('post_category_post_id_fk', $this->tableName, 'post_id', '{{%post}}', 'id', 'CASCADE', 'CASCADE');\n $this->addForeignKey('post_category_category_id_fk', $this->tableName, 'category_id', '{{%category}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n Schema::table('categories', function(Blueprint $table)\n {\n $table->integer('parent_id', false, true)->nullable()->after('cat_order');\n });\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t//\n\t\tSchema::create('options',function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->boolean('activate_pn');\n\t\t\t$table->string('basic_name');\n\t\t\t$table->string('basic_pass');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\t$o = new Option;\n\t\t$o->activate_pn = 0;\n\t\t$o->save();\n\t}", "public function up() {\n\t\t$this->dbforge->add_field(array(\n\t\t\t'id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t\t'auto_increment' => TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t),\n\t\t\t'path' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t)\n\t\t));\n\t\t$this->dbforge->add_key('id', TRUE);\n\t\t$this->dbforge->add_key('path');\n\t\t$this->dbforge->create_table('categories');\n\n\t\t// Table structure for table 'event_categories'\n\t\t$this->dbforge->add_field(array(\n\t\t\t'event_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t),\n\t\t\t'category_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t),\n\t\t));\n\t\t$this->dbforge->add_key('event_id', TRUE);\n\t\t$this->dbforge->add_key('category_id', TRUE);\n\t\t$this->dbforge->create_table('event_categories');\n\t}", "public function up()\n {\n $this->createTable('usuario_refeicao', [\n 'id' => $this->primaryKey(),\n 'usuario_id' => $this->integer(),\n 'refeicao_id' => $this->integer(),\n 'alimento_id' => $this->integer(),\n 'data_consumo' => $this->date(),\n 'horario_consumo' => $this->time(),\n 'quantidade' => $this->double(5,2),\n 'created_at' => $this->integer(),\n 'updated_at' => $this->integer() \n ]);\n\n $this->addForeignKey('fk_usuariorefeicao_usuario_id', 'usuario_refeicao', 'usuario_id', \n 'user', 'id', 'CASCADE');\n $this->addForeignKey('fk_usuariorefeicao_refeicao_id', 'usuario_refeicao', 'refeicao_id', \n 'refeicoes', 'id', 'CASCADE');\n $this->addForeignKey('fk_usuariorefeicao_alimento_id', 'usuario_refeicao', \n 'alimento_id', 'alimentos', 'id', 'CASCADE');\n }" ]
[ "0.80062383", "0.791459", "0.791459", "0.791459", "0.757202", "0.75622094", "0.7528509", "0.74991167", "0.7495741", "0.7454034", "0.74464583", "0.74359256", "0.7432558", "0.7428393", "0.7419358", "0.73787934", "0.7376999", "0.7371375", "0.7365399", "0.735214", "0.733067", "0.731318", "0.73000735", "0.72975737", "0.7293577", "0.7292687", "0.7292686", "0.7285842", "0.7285298", "0.72741294", "0.7273737", "0.7266575", "0.72638303", "0.7263254", "0.72569364", "0.72517437", "0.72504115", "0.7244981", "0.72417915", "0.72387975", "0.7220378", "0.72201097", "0.720609", "0.72052515", "0.71978176", "0.7191164", "0.7190971", "0.7177984", "0.7177695", "0.7167829", "0.7166038", "0.7166038", "0.71609336", "0.7148497", "0.71373314", "0.713198", "0.7126609", "0.7125546", "0.711902", "0.7106962", "0.7106962", "0.71062446", "0.70977736", "0.709421", "0.70895606", "0.70882374", "0.70869124", "0.7084752", "0.70837325", "0.7080129", "0.70714337", "0.70708585", "0.70685065", "0.70628405", "0.7060998", "0.7060675", "0.7057488", "0.7056217", "0.7055475", "0.70509416", "0.70495844", "0.7048354", "0.70475894", "0.70472157", "0.70440704", "0.70405906", "0.70399207", "0.703879", "0.703471", "0.7033467", "0.703266", "0.70275927", "0.7016271", "0.7011655", "0.70087785", "0.6991397", "0.6986654", "0.69660354", "0.6962863", "0.69594824", "0.695904" ]
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('DROP TABLE estadistica'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}", "public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }", "public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }", "public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }", "public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}", "public function down(){\n $this->dropTable('users');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n {\n Schema::table('attachments', function(Blueprint $table) {\n\n $table->dropColumn('viewable_id');\n $table->dropColumn('viewable_type');\n\n\n });\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}", "public function down()\n\t{\n\t\t// nothing to do here.\n\t}", "public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }", "public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}", "public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}", "public function down() \n {\n \n }", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n {\n $this->table('contents')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('education');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}", "public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}", "public function down()\n {\n\tSchema::drop('quizzes');\n }", "public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "public function down ()\n {\n }", "abstract public function down();", "abstract public function down();", "abstract public function down();", "public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }", "public function down() {\n\n\t}", "public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }", "public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }", "public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }", "public function down(): void\n {\n // Remove your data\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function down()\n {\n\tSchema::drop('activities');\n }", "public function down()\n {\n //return false;\n\t\t\n\t\t$TABLE_NAME = 'Haber';\n $this->dropTable($TABLE_NAME);\n\t\t\n\t\t$TABLE_NAME = 'HaberKategori';\n $this->dropTable($TABLE_NAME);\n }", "public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }", "public function down()\n {\n }", "public function down()\n {\n }", "public function down()\n\t{\n\t\tDB::table('professor')->where('professor_id', '=', 1)->delete();\n\t\tDB::table('professor')->where('professor_id', '=', 2)->delete();\n\t\tDB::query('ALTER TABLE professor AUTO_INCREMENT = 1');\n\n\t\t//\n\t}", "public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n\t\t//return false;\n\t}", "public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}", "public function change()\n {\n $this->schema->table('recurring_expenses',function($table){\n $table->date('end_repeat')->nullable();\n $table->boolean('ended')->default(false);\n $table->enum('repeat',['0','1','7','14','30','365'])->nullable();\n });\n\n $this->schema->table('expenses',function($table){\n $table->dropColumn('end_repeat');\n $table->dropColumn('repeat');\n $table->integer('parent_id')->nullable();\n $table->foreign('parent_id')->references('id')->on('expenses')->onDelete('cascade');\n });\n }", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }", "public function down()\n\t{\n\t\t$this->dropForeignKey('FK_task_creator','tbl_task');\n\n\t\t$this->dropTable('tbl_task');\n\t}", "public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}", "public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }", "public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}", "protected abstract function do_down();", "public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }", "public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}", "public function safeDown()\n {\n $this->down();\n }", "public function safeDown()\n {\n $this->down();\n }", "public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}", "public function down () {\n\t\treturn $this->rename_column ('headline', 'title', 'string', array ('limit' => 72));\n\t}", "public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}", "public function safeDown()\r\n {\r\n $this->down();\r\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function down()\n {\n $this->table('mail_contents')->drop()->save();\n }", "public function down() {\n\t}", "public function down() {\n\t}", "public function down() {\n\t}", "public function down()\n {\n Schema::dropIfExists('reunion');\n }", "public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('article_category');\n\t}", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }", "public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}", "public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}", "public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}", "public function down()\n\t{\n\t\tSchema::drop(Config::get('sentry::sentry.table.users_metadata'));\n\t}", "protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_350001418F5EA509');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8B8F5EA509');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA148F5EA509');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0E8F5EA509');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CF46CD258');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8BF46CD258');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14F46CD258');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7F46CD258');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9A21BD112');\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_35000141A21BD112');\n $this->addSql('ALTER TABLE contacte DROP FOREIGN KEY FK_C794A022A21BD112');\n $this->addSql('ALTER TABLE demande DROP FOREIGN KEY FK_2694D7A5A21BD112');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14A6CC7B2');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7A21BD112');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EE455FCC0');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EBDDFA3C9');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EDC304035');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9E3797A94');\n $this->addSql('ALTER TABLE personne DROP FOREIGN KEY FK_FCEC9EFA76ED395');\n $this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');\n $this->addSql('DROP TABLE absence');\n $this->addSql('DROP TABLE classe');\n $this->addSql('DROP TABLE classe_personne');\n $this->addSql('DROP TABLE contacte');\n $this->addSql('DROP TABLE cours');\n $this->addSql('DROP TABLE demande');\n $this->addSql('DROP TABLE matiere');\n $this->addSql('DROP TABLE matiere_classe');\n $this->addSql('DROP TABLE news');\n $this->addSql('DROP TABLE note');\n $this->addSql('DROP TABLE personne');\n $this->addSql('DROP TABLE personne_matiere');\n $this->addSql('DROP TABLE reset_password_request');\n $this->addSql('DROP TABLE salle');\n $this->addSql('DROP TABLE seance');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\tSchema::drop('stor_mem');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE19FCD424');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE product_image');\n $this->addSql('DROP TABLE family_page_container');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE time_line');\n $this->addSql('ALTER TABLE family DROP FOREIGN KEY FK_A5E6215B727ACA70');\n $this->addSql('DROP INDEX IDX_A5E6215B727ACA70 ON family');\n $this->addSql('ALTER TABLE family ADD page_content_id INT NOT NULL, DROP parent_id, DROP has_uniques_prices, DROP has_seasonal_products');\n $this->addSql('ALTER TABLE family ADD CONSTRAINT FK_A5E6215B8F409273 FOREIGN KEY (page_content_id) REFERENCES page_content (id)');\n $this->addSql('CREATE INDEX IDX_A5E6215B8F409273 ON family (page_content_id)');\n $this->addSql('ALTER TABLE link ADD page_container_id INT DEFAULT NULL, DROP url');\n $this->addSql('ALTER TABLE link ADD CONSTRAINT FK_36AC99F123D5B0C FOREIGN KEY (page_container_id) REFERENCES page_container (id)');\n $this->addSql('CREATE INDEX IDX_36AC99F123D5B0C ON link (page_container_id)');\n $this->addSql('ALTER TABLE product DROP content, DROP order_by, DROP is_generic, DROP type, CHANGE title label VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci');\n $this->addSql('ALTER TABLE unit DROP duration');\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398F5B7AF75');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95C8486F9AC');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6498486F9AC');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660D629F605');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660E308AC6F');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46CFFE9AD6');\n $this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADEE45BDBF');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95CEE45BDBF');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649EE45BDBF');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F464584665A');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C544584665A');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649D60322AC');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46DCD6110');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C5459027487');\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398A76ED395');\n $this->addSql('DROP TABLE address');\n $this->addSql('DROP TABLE format');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE `order`');\n $this->addSql('DROP TABLE order_detail');\n $this->addSql('DROP TABLE picture');\n $this->addSql('DROP TABLE product');\n $this->addSql('DROP TABLE product_theme');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE stock');\n $this->addSql('DROP TABLE suppliers');\n $this->addSql('DROP TABLE theme');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n {\n Schema::dropIfExists('data');\n }", "public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}" ]
[ "0.7950277", "0.78636813", "0.76065636", "0.7493955", "0.7320625", "0.7245268", "0.7187498", "0.71543235", "0.715298", "0.7141911", "0.7135835", "0.71214414", "0.71154845", "0.71057886", "0.7098064", "0.70800334", "0.7078775", "0.70729095", "0.7068331", "0.7066272", "0.7053364", "0.7053364", "0.7042174", "0.7042174", "0.7042174", "0.7041765", "0.7040102", "0.7028846", "0.70253754", "0.7021679", "0.6988633", "0.6986877", "0.6978061", "0.6971848", "0.6944203", "0.6944203", "0.6944203", "0.6942135", "0.6941429", "0.6939214", "0.6935277", "0.69334567", "0.6928689", "0.6924838", "0.6924794", "0.6913486", "0.6902361", "0.6897891", "0.6897845", "0.6897824", "0.6897824", "0.68886673", "0.688262", "0.6874051", "0.6869844", "0.6863713", "0.6858435", "0.68545175", "0.68440175", "0.6842142", "0.6836981", "0.6836124", "0.6834763", "0.68303466", "0.68297166", "0.68282366", "0.6826686", "0.6824025", "0.68185335", "0.6811099", "0.68078107", "0.68056506", "0.68056506", "0.6789167", "0.67755204", "0.67742497", "0.6765081", "0.67597127", "0.67596203", "0.67564446", "0.67564446", "0.67564446", "0.6753443", "0.6753351", "0.6753351", "0.6753351", "0.6752681", "0.674581", "0.6743746", "0.67387754", "0.6733766", "0.67331296", "0.6731279", "0.67302275", "0.6727377", "0.67273724", "0.672722", "0.672607", "0.67173517", "0.67139125", "0.671303" ]
0.0
-1
Return list of template files or errors from data base
function fileList(){ chdir('./../cloud/books/'); //Move to template directory if ($handle = opendir(getcwd())) { //Open dir echo '<ul class="list-group">'; while (false !== ($entry = readdir($handle))) { //While directory not end - return files list if ($entry != "." && $entry != ".DS_Store" && $entry != "..") { //Filter trash if(is_dir($entry)){ //IF dir then return button with folder icon echo '<a href="#" class="list-group-item cat"><i class="fa fa-folder-o" aria-hidden="true"></i> '.$entry.'</a>'; }else{ //else return file button $FileInfo = new SplFileInfo($entry); //Get file info $ext = $FileInfo->getExtension(); //Get file extension if($ext == "png" or $ext == "jpg" or $ext == "bmp") //IF file is image then return button with image icon echo '<a href="/files/cloud/books/'.$entry.'" class="list-group-item file"><i class="fa fa-file-image-o" aria-hidden="true"></i> '.$entry.'</a>'; else //Else return button with file-code icon echo '<a href="/files/cloud/books/'.$entry.'" class="list-group-item file"><i class="fa fa-file-o" aria-hidden="true"></i> '.$entry.'</a>'; } } } echo '</ul>'; closedir($handle); //Close dir } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTemplates()\n {\n $finder = Finder::create()\n ->files()\n ->name('*.sql')\n ->in($this->rootDir.'/../templates')\n ;\n\n $templates = [];\n\n /** @var SplFileInfo $file */\n foreach ($finder as $file) {\n $templates[] = $file->getRelativePathname();\n }\n\n return $templates;\n }", "function getTemplateFiles() {\r\n\r\n\t \t$templatePath = JPATH_SITE . '/components/com_fabrik/tmpl/form/';\r\n\t \t$aFiles = array();\r\n\t \tforeach ($this->_aTables as $listModel) {\r\n\t \t\t$table = $listModel->getTable();\r\n\t \t\t$formModel = $listModel->getForm();\r\n\t \t\t$form = $formModel->getForm();\r\n\t \t\tif (!in_array('table/' . $table->template, $aFiles)) {\r\n\t \t\t\t$aFiles[] = 'table/' . $table->template;\r\n\t \t\t}\r\n\t \t\tif ($form->form_template != '') {\r\n\t \t\t\tif (is_dir($templatePath . $form->form_template)) {\r\n\t \t\t\t\tif (!in_array('form/' . $form->form_template . '/elements.html', $aFiles)) {\r\n\t \t\t\t\t\t$aFiles[] = 'form/' . $form->form_template . '/elements.html';\r\n\t \t\t\t\t}\r\n\t \t\t\t\tif (!in_array('form/' . $form->form_template . '/form.html', $aFiles)) {\r\n\t \t\t\t\t\t$aFiles[] = 'form/' . $form->form_template . '/form.html';\r\n\t \t\t\t\t}\r\n\t \t\t\t} else {\r\n\t \t\t\t\tif (!in_array('form/' . $form->form_template, $aFiles)) {\r\n\t \t\t\t\t\t$aFiles[] = 'form/' . $form->form_template;\r\n\t \t\t\t\t}\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t\tif ($form->view_only_template != '') {\r\n\t \t\t\tif (is_dir($templatePath . $form->view_only_template)) {\r\n\t \t\t\t\tif (!in_array('viewonly/' . $form->view_only_template . '/elements.html', $aFiles)) {\r\n\t \t\t\t\t\t$aFiles[] = 'viewonly/' . $form->view_only_template . '/elements.html';\r\n\t \t\t\t\t}\r\n\t \t\t\t\tif (!in_array('viewonly/' . $form->view_only_template . '/form.html', $aFiles)) {\r\n\t \t\t\t\t\t$aFiles[] = 'viewonly/' . $form->view_only_template . '/form.html';\r\n\t \t\t\t\t}\r\n\t \t\t\t} else {\r\n\t \t\t\t\tif (!in_array('viewonly/' . $form->view_only_template, $aFiles)) {\r\n\t \t\t\t\t\t$aFiles[] = 'viewonly/' . $form->view_only_template;\r\n\t \t\t\t\t}\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t}\r\n\t \t$xml = \"<files>\\n\";\r\n\t \tforeach ($aFiles as $file) {\r\n\t\t\t$xml .= \"\\t<file>tmpl/$file</file>\\n\";\r\n\t \t}\r\n\t \t$this->_aFiles = $aFiles;\r\n\t \t$xml .= \"</files>\\n\";\r\n\t \treturn $xml;\r\n\t }", "private function find_templates () {\r\n\t\t$results = array();\r\n\r\n\t\t$files = WooDojo_Utils::glob_php( '*.php', GLOB_MARK, $this->templates_dir );\r\n\r\n\t\tif ( is_array( $files ) && count( $files ) > 0 ) {\r\n\t\t\tforeach ( $files as $k => $v ) {\r\n\t\t\t\t$data = $this->get_template_data( $v );\r\n\t\t\t\tif ( is_object( $data ) && isset( $data->title ) ) {\r\n\t\t\t\t\t$results[$v] = $data->title;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $results;\r\n\t}", "public function getTemplates (){\n $dir = conf::pathHtdocs() . \"/templates\";\n $templates = file::getFileList($dir, array('dir_only' => true));\n\n $ary = array ();\n foreach ($templates as $val){\n $info = $this->getSingleTemplate($val);\n if (empty($info)) {\n continue;\n }\n $ary[] = $info;\n }\n return $ary;\n }", "public function getTemplatesFromDB();", "function getTemplates() {\n\n // Lets load the data if it doesn't already exist\n if (empty($this->_data)) {\n\n // constructs the query\n $query = ' SELECT * '\n . ' FROM #__templateck';\n\n // retrieves the data\n $this->_data = $this->_getList($query);\n }\n\n return $this->_data;\n }", "function _get_templates()\n\t{\n\t\t$location = FILESYSTEM_PATH .'modules/customcats/templates/cattemplates/';\n\t\t$filelist=array();\n\t\tif ($handle = opendir($location))\n\t\t{\n\t\t\twhile (false !== ($file = readdir($handle)))\n\t\t\t{\n\t\t\t\tif ($file != \".\" && $file != \"..\" && $file!=\".svn\" && $file!=\"index.htm\")\n\t\t\t\t{\n\t\t\t\t\t$filelist[]=$file;\n\t\t\t\t}\n\t\t\t}\n \t\t\tclosedir($handle);\n\t\t}\n\t\treturn $filelist;\n\t}", "function ListTemplates()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tglobal $Config;\r\n\t\t\t\r\n\t\t\t$sql = \"select * from templates order by TemplateDisplayName asc\" ; \r\n\t\t\treturn $this->get_results($sql);\t\t\r\n\t }", "function templates()\n {\n return [];\n }", "public function getTemplateList() {\n\t\t$aArgs = func_get_args();\n\t\t$aRet = call_user_func_array( array( $this, 'getTemplates' ), $aArgs );\n\t\treturn implode( '|', $aRet );\n\t}", "function templates()\r\n\t{\r\n\t\t$websitepath = $this->website_path;\r\n\t\t$theme = $this->theme;\r\n\t\t$directory = $_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.'';\r\n\t\tif(file_exists($directory))\r\n\t\t{\r\n\t\t\tif ($handle = opendir($_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.'')) { \r\n\t\t\t\t$i = 0;\r\n\t\t\t\twhile (false !== ($file = readdir($handle)))\r\n\t\t\t\t{ \r\n\t\t\t\t\tif ($file != \".\" && $file != \"..\")\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(!is_dir($_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file.''))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$myFile = $_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file;\r\n\t\t\t\t\t\t\t$fh = fopen($myFile, 'r');\r\n\t\t\t\t\t\t\t$theData = fread($fh, 5000);\r\n\t\t\t\t\t\t\tfclose($fh);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$pos = strrpos($theData, \"{{{{{KSD Template\");\r\n\t\t\t\t\t\t\tif ($pos === false) { // note: three equal signs\r\n\t\t\t\t\t\t\t\t//die(\"Not a template.\");\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$array1 = explode(\"}}}}}\",$theData);\r\n\t\t\t\t\t\t\t\t$array2 = explode(\"{{{{{\",$array1[0]);\r\n\t\t\t\t\t\t\t\t$data = $array2[1];\r\n\t\t\t\t\t\t\t\t$array3 = explode(\",\",$data);\r\n\t\t\t\t\t\t\t\t$filearray[$i]['file'] = $file; \r\n\t\t\t\t\t\t\t\t$filearray[$i]['name'] = $array3[1]; \r\n\t\t\t\t\t\t\t\t$i++;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}// END while\t\r\n\t\t\t\tclosedir($handle);\r\n\t\t\t} \r\n\t\t} else {\r\n\t\t\techo(\"$directory <br />NOT EXISTS\");\r\n\t\t}\r\n\t\treturn $filearray;\r\n\t}", "function getTemplateFiles()\r\n{\r\n\t$directory = \"models/site-templates/\";\r\n\t$languages = glob($directory . \"*.css\");\r\n\t//print each file name\r\n\treturn $languages;\r\n}", "public function getTemplateCssFiles() {\n $view = $this->getConfiguration()->getView();\n if ($view === NULL) {\n throw new ElefundsException('There is no template set in your configuration file. Please refer to the documentation or use one of the sample templates.', 1348051662593);\n } else {\n return $view->getCssFiles();\n }\n }", "function getTemplateFiles() // used in admin_configuration.php\r\n\r\n{\r\n\r\n\t$directory = \"models/site-templates/\";\r\n\r\n\t$languages = glob($directory . \"*.css\");\r\n\r\n\t//print each file name\r\n\r\n\treturn $languages;\r\n\r\n}", "protected function getConfigFiles()\n {\n $files = $this->asList('templates');\n $valid = array_filter($files, 'is_file');\n if (count($valid) !== count($files)) {\n // At least one path does not point to an existing file.\n $notExisting = array_diff($files, $valid);\n $message = 'The following mail template configuration files do not exist: ' . implode(', ', $notExisting);\r\n throw new Zend_Application_Resource_Exception($message);\n }\n return $files;\n }", "public function getTemplateJavascriptFiles() {\n $view = $this->getConfiguration()->getView();\n if ($view === NULL) {\n throw new ElefundsException('There is no template set in your configuration file. Please refer to the documentation or use one of the sample templates.', 1348051662593);\n } else {\n return $view->getJavascriptFiles();\n }\n }", "public function getAllTemplates(){ //return all templates in database to the select to choose from templates\n return TemplatesResource::collection(TemplateProject::all());\n }", "public static function getTemplatesUsed()\n {\n return static::$allTemplates;\n }", "function getTemplateFiles() {\n $directory = \"models/site-templates/\";\n $languages = glob($directory . \"*.css\");\n //print each file name\n return $languages;\n}", "function Get_admin_system_emails_tmpl_names()\r\n {\r\n $CI = &get_instance();\r\n $CI->load->model('mail_model');\r\n //read the whole info about templates and get template names for admin only\r\n $templates_info = $CI->mail_model->Get_system_email_data('ADMIN_TEMPLATES_NAMES');\r\n return $templates_info;\r\n }", "function scan_templates_for_translations () {\r\n $this->CI->load->helper( 'file' );\r\n $filename = config_item( 'dummy_translates_filename' );\r\n\r\n // Clean Pattern for new file\r\n $clean_pattern = \"<?php\\n\";\r\n\r\n // Emptying file\r\n write_file( $filename, $clean_pattern );\r\n\r\n $path = realpath( config_item( 'current_template_uri' ) );\r\n $directory = new RecursiveDirectoryIterator( $path );\r\n $iterator = new RecursiveIteratorIterator( $directory );\r\n\r\n // Regex for no deprecated twig templates\r\n $regex = '/^((?!DEPRECATED).)*\\.twig$/i';\r\n $file_iterator = new RegexIterator( $iterator, $regex, RecursiveRegexIterator::GET_MATCH );\r\n\r\n $files = 0;\r\n $arr_strings = array();\r\n\r\n foreach( $file_iterator as $name => $object ) {\r\n $files++;\r\n\r\n // Mega regex for Quoted String tokens with escapable quotes\r\n // http://www.metaltoad.com/blog/regex-quoted-string-escapable-quotes\r\n $pattern = '/{%\\s?trans\\s?((?<![\\\\\\\\])[\\'\"])((?:.(?!(?<![\\\\\\\\])\\1))*.?)\\1/';\r\n $current_file = fopen( $name, 'r' );\r\n\r\n while ( ( $buffer = fgets( $current_file ) ) !== false ) {\r\n if ( preg_match_all( $pattern, $buffer, $matches ) ) {\r\n foreach( $matches[ 2 ] as $match ) {\r\n // Escaping quotes not yet escaped\r\n $match = preg_replace( '/(?<![\\\\\\\\])(\\'|\")/', \"\\'\", $match );\r\n array_push( $arr_strings, \"echo _( '$match' );\\n\" );\r\n }\r\n }\r\n }\r\n\r\n fclose( $current_file );\r\n }\r\n\r\n // Remove duplicates\r\n $arr_strings = array_unique( $arr_strings );\r\n write_file( $filename, implode( $arr_strings ), 'a' );\r\n\r\n $result = array(\r\n 'templates' => $files,\r\n 'strings' => count( $arr_strings ),\r\n 'output' => $filename,\r\n 'lint' => check_php_file_syntax( $filename )\r\n );\r\n\r\n return $result;\r\n }", "public function getEmailTemplates()\n {\n try {\n return json_decode($this->filesystem->get($this->storagePath));\n } catch (Exception $e) {\n return [];\n }\n }", "function Get_user_system_emails_tmpl_names()\r\n {\r\n $CI = &get_instance();\r\n $CI->load->model('mail_model');\r\n //read the whole info about templates and get template names for users only\r\n $templates_info = $CI->mail_model->Get_system_email_data('USER_TEMPLATES_NAMES');\r\n return $templates_info;\r\n }", "public function viewProvider()\n {\n $config = $this->getMartyConfig();\n $templateDir = $config['templateDir'];\n $templates = [];\n $it = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($templateDir));\n /** @var \\SplFileInfo $file */\n foreach ($it as $file) {\n if ($file->isFile() && $file->getExtension() == 'tpl') {\n $templateName = substr($file->getPathname(), strlen($templateDir) + 1);\n $templateId = str_replace(['/', '.tpl'], ['.', ''], $templateName);\n $templates[$templateId] = [$templateName];\n }\n }\n\n return $templates;\n }", "public function index() {\n $templates = Template::all();\n return $templates;\n }", "public function GetSavedTemplates() {\n\t\t$templates = &drupal_static(__FUNCTION__, NULL, $this->reset);\n\n\t\tif (!isset($templates)) {\n\t\t\t$templates = db_select('{'.ACQUIA_COMPOSER_TEMPLATES_TABLE.'}', 'ac')\n\t\t\t\t->fields('ac')\n\t\t\t\t->execute()\n\t\t\t\t->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\tif (!count($templates)) {\n\t\t\t\t$templates = array();\n\t\t\t}\n\t\t}\n\t\treturn $templates;\n\t}", "public static function getAll_files() {\n $db = DBInit::getInstance();\n\n $statement = $db->prepare(\"SELECT id, file_name, uploaded, user FROM files\");\n $statement->execute();\n\n return $statement->fetchAll();\n }", "public function getTemplates(){\n\t\n\t\tif( empty($this->_templates) ){\n\t\n\t\t\t$query\t= $this->_db->getQuery(true);\n\t\t\t\n\t\t\t$query->select( 't.tmpl_id AS value, t.tmpl_name AS text' );\n\t\t\t$query->from( '#__zbrochure_templates AS t' );\n\t\t\t$query->where( 't.tmpl_published = 1' );\n\t\t\t\n\t\t\t$this->_db->setQuery($query);\n\t\t\t$this->_templates = $this->_db->loadObjectList();\n\n\t\t}\n\t\t\n\t\treturn $this->_templates;\n\t\n\t}", "protected function templatesSelectList(){\n $selectList = array('' => 'Default (Vertical List)');\n foreach( $this->templateAndDirectoryList() AS $fileSystemHandle => $path ){\n if( strpos($fileSystemHandle, '.') !== false ){\n $selectList[ $fileSystemHandle ] = substr($this->getHelper('text')->unhandle($fileSystemHandle), 0, strrpos($fileSystemHandle, '.'));\n }else{\n $selectList[ $fileSystemHandle ] = $this->getHelper('text')->unhandle($fileSystemHandle);\n }\n }\n return $selectList;\n }", "public function formatTemplateFiles()\n {\n $name = str_replace(\":\", \".\", $this->getName());\n $list = parent::formatTemplateFiles();\n array_unshift(\n $list,\n $this->context->parameters[\"appDir\"] . \"/templates/$name.$this->view.latte\"\n );\n return $list;\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/idolisr.php',\n 'sources_custom/hooks/modules/members/idolisr.php',\n 'sources_custom/miniblocks/main_stars.php',\n 'sources_custom/miniblocks/side_recent_points.php',\n 'themes/default/templates_custom/POINTS_GIVE.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_STARS.tpl',\n 'themes/default/templates_custom/BLOCK_SIDE_RECENT_POINTS.tpl',\n );\n }", "protected function getAllFiles() {\n $sql = \"SELECT * FROM satdatameta\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $results = $stmt->fetchAll();\n return $results;\n }", "public function get_templates()\n {\n $template = new MailTemplate();\n return $template->findAll();\n }", "public function getAllSMSTemplates()\n {\n $selectTempsql = 'SELECT temp_id, temp_name FROM ' . _DB_PREFIX_ . 'onehop_sms_templates';\n $selectTempsql .= ' WHERE 1 Order By temp_name ASC';\n $templateRes = Db::getInstance()->ExecuteS($selectTempsql);\n return $templateRes;\n }", "function fileaccess_gettemplatehtml($directory)\r\n{\r\n\t#Deze staat onder de root als er sprake is van een template dat niet verandert bij verschillende tagen\r\n\t#Wanneer er wel taalverschillen zijn dan zijn er subdirectories met de naam van de talen en die worden \r\n\t#afgezocht naar template.htm. Vanzelfsprekend wordt enkel de html file geopend van de taal die actief is.\r\n\t\r\n\t#Zit er een template.htm of html file in de root\r\n\tif(file_exists($directory.\"/template.htm\"))\r\n\t{\r\n\t\t$templatefilepath=$directory.\"/template.htm\";\r\n\t}\r\n\telseif(file_exists($directory.\"/template.html\"))\r\n\t{\r\n\t\t$templatefilepath=$directory.\"/template.html\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\t#Geen templatefile in de root => taal ophalen en nakijken of er een taaldirectory is\r\n\t\trequire_once $_SERVER['DOCUMENT_ROOT'].\"/core/logic/parameters.php\";\r\n\t\t$languagestring = getlanguage();\r\n\t\t\r\n\t\t#het templatepad moet dan /templates/$directory/$languagestring/template.htm of html zijn\r\n\t\t$templatedirectory = $directory.\"/\".$languagestring;\r\n\r\n\t\tif(file_exists($templatedirectory.\"/template.htm\"))\r\n\t\t{\r\n\t\t\t$templatefilepath=$directory.\"/\".$languagestring.\"/template.htm\";\r\n\t\t}\r\n\t\telseif(file_exists($templatedirectory.\"/template.html\"))\r\n\t\t{\r\n\t\t\t$templatefilepath=$directory.\"/\".$languagestring.\"/template.htmL\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthrow new Exception(\"Unable to find template.htm / template.html under $directory\");\r\n\t\t}\r\n\t}\r\n\t\r\n\t#Op dit punt is de uitvoering gestopt wegens een exception of is de templatefile bekend.\r\n\t#Nu moet de htmlingelezen worden en teruggegeven.\r\n\t$filehandler = fopen($templatefilepath,'r',0);\r\n\t$html = fread($filehandler,filesize($templatefilepath));\r\n\t#De HTML is ingeladen en wordt teruggegeven naar het templatesysteem voor verdere verwerking.\r\n\treturn $html;\r\n}", "public function getTemplateNames() {\n\t\treturn array_keys(self::$_config->template->toArray());\n\t}", "function GetDocumentTemplates()\n\t{\n\t\t$result = $this->sendRequest(\"GetDocumentTemplates\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function getPrintTemplates(){\r\n require $this->sRessourcesFile;\r\n if (in_array(\"print_templates\", $this->aSelectedFields)){\r\n $aParams['sSchemaVmap'] = array('value' => $this->aProperties['schema_vmap'], 'type' => 'schema_name');\r\n $aParams['group_id'] = array('value' => $this->aValues['my_vitis_id'], 'type' => 'number');\r\n $oPDOresult = $this->oConnection->oBd->executeWithParams($aSql['getGroupPrintTemplates'], $aParams);\r\n\t\t$sListPrintTemplateId = \"\";\r\n\t\t$aListPrintTemplateName = array();\r\n\t\twhile($aLigne=$this->oConnection->oBd->ligneSuivante ($oPDOresult)) {\r\n\t\t\tif ($sListPrintTemplateId == \"\"){\r\n\t\t\t\t$sListPrintTemplateId = $aLigne[\"printtemplate_id\"];\r\n\t\t\t}else{\r\n\t\t\t\t$sListPrintTemplateId .= \"|\".$aLigne[\"printtemplate_id\"];\r\n\t\t\t}\r\n $aListPrintTemplateName[] = $aLigne[\"name\"];\r\n\t\t}\r\n\t\t$oPDOresult=$this->oConnection->oBd->fermeResultat();\r\n $this->aFields['print_templates'] = $sListPrintTemplateId;\r\n $this->aFields['print_templates_label'] = implode(',', $aListPrintTemplateName);\r\n }\r\n }", "public function errors()\n\t{\n\t\treturn $this->morphMany(DatafileError::class, 'datafile_table');\n\t}", "public function readCollectionOfPossibleTemplatesToBeInstalledFromFileSystem(){\n\t\t$rootTemplateFoldersToBeMapped = array();\n\t\t$rootTemplateFoldersToBeMapped = $this->searchFolderForTemplatesToBeMapped($this->absoluteRootTemplatesBasePath);\n\t\t//Get all Extension Templates below Root Folders\n\t\t$templateFoldersToBeMapped = array();\n\t\tforeach($rootTemplateFoldersToBeMapped as $rootTemplateFolder) {\n\t\t\t$extensionTempateFoldersToBeMappedFromThisRootTemplate = $this->searchFolderForTemplatesToBeMapped($this->absoluteRootTemplatesBasePath . $rootTemplateFolder . '/' . $this->subFolderNameForExtensionTemplateStructure . '/');\n\n\t\t\tforeach($extensionTempateFoldersToBeMappedFromThisRootTemplate as $extensionTempateFoldersToBeMappedFromThisRootTemplate) {\n\t\t\t\t$templateFoldersToBeMapped[] = $rootTemplateFolder . '/' . $this->subFolderNameForExtensionTemplateStructure . '/' . $extensionTempateFoldersToBeMappedFromThisRootTemplate;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//merge extension and root template folders\n\t\t$templateFoldersToBeMapped = array_merge(\n\t\t\t$rootTemplateFoldersToBeMapped, \n\t\t\t$templateFoldersToBeMapped\n\t\t);\n\t\t\n\t\treturn $templateFoldersToBeMapped;\n\t}", "public function retrieveMessageTemplates()\n {\n return $this->start()->uri(\"/api/message/template\")\n ->get()\n ->go();\n }", "public function getTemplates()\n {\n return [\n// 'paths' => [\n// 'auth' => [__DIR__ . '/../templates/auth'],\n//\n// 'app' => [__DIR__ . '/../templates/app'],\n// 'error' => [__DIR__ . '/../templates/error'],\n// 'layout' => [__DIR__ . '/../templates/layout'],\n// ],\n ];\n }", "public function getAllFilesRobot() {\n $sql = \"SELECT * FROM archivo_organizado\";\n $result = $this->_db->prepare($sql);\n $result->execute();\n\n if(!is_null($result->errorInfo()[2]))\n return array('error' => $result->errorInfo()[2]);\n else\n return $result->fetchAll(PDO::FETCH_ASSOC);\n }", "protected function _loadTemplates()\n {\n $this->_tpl = array();\n $dir = Solar_Class::dir($this, 'Data');\n $list = glob($dir . '*.php');\n foreach ($list as $file) {\n \n // strip .php off the end of the file name to get the key\n $key = substr(basename($file), 0, -4);\n \n // load the file template\n $this->_tpl[$key] = file_get_contents($file);\n \n // we need to add the php-open tag ourselves, instead of\n // having it in the template file, becuase the PEAR packager\n // complains about parsing the skeleton code.\n // \n // however, only do this on non-view files.\n if (substr($key, 0, 4) != 'view') {\n $this->_tpl[$key] = \"<?php\\n\" . $this->_tpl[$key];\n }\n }\n }", "function getTemplates( $cwd = '.' ) {\n\n // New list\n $templates = array();\n\n // Use cache\n if ( !is_file( \"{$cwd}/tmp/cache/templates.cache\" ) ) {\n\n // Handle themes here\n $list = browse( \"{$cwd}/templates/\", false, true, false );\n\n // Loop\n foreach ( $list as $dir ) {\n\n // Definitions?\n if ( is_file( \"{$cwd}/templates/{$dir}/manifest.json\" ) ) {\n\n // Get json\n $loadedFile = json_decode( file_get_contents( \"{$cwd}/templates/{$dir}/manifest.json\" ), true );\n\n // Verify List - Do not append unless manifest is correct\n if ( !empty( $loadedFile[ 'name' ] ) && is_file( \"{$cwd}/templates/{$dir}/{$loadedFile['template']}\" ) ) {\n\n // This is JSON from the template\n $templates[ $dir ] = $loadedFile;\n\n // Add full path to the variable\n $templates[ $dir ][ 'path' ] = \"/templates/{$dir}\";\n\n }\n\n }\n\n }\n\n // Sort them ascending\n asort( $templates );\n\n // Store cache\n file_put_contents( \"{$cwd}/tmp/cache/templates.cache\", json_encode( $templates ) );\n\n } else {\n\n return json_decode( file_get_contents( \"{$cwd}/tmp/cache/templates.cache\" ), true );\n\n }\n\n return $templates;\n\n }", "function getAllPageTemplates() {\n global $wpdb;\n return $wpdb->get_col(\"SELECT DISTINCT meta_value FROM wp_postmeta WHERE meta_key = '_wp_page_template'\"); \n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/jestr.php',\n 'sources_custom/forum/cns.php',\n 'lang_custom/EN/jestr.ini',\n 'themes/default/templates_custom/EMOTICON_IMG_CODE_THEMED.tpl',\n 'forum/pages/modules_custom/topicview.php',\n 'sources_custom/hooks/systems/config/jestr_avatar_switch_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_emoticon_magnet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_leet_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes.php',\n 'sources_custom/hooks/systems/config/jestr_name_changes_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_piglatin_shown_for.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes.php',\n 'sources_custom/hooks/systems/config/jestr_string_changes_shown_for.php',\n );\n }", "public function list_tables(){\n if (!$this->select_db($this->_currentDB))\n \t return FALSE;\n \t$tables=array();\n \t$table_exts=array($this->_index_ext,$this->_data_ext,$this->_frame_ext);\n \t$dbpath=$this->_db_root_dir.$this->_currentDB;\n \t$d=dir($dbpath);\n \twhile($tmp=$d->read()){\n $fileInfo = pathinfo($dbpath.'/'.$tmp);\n if(is_file($dbpath.'/'.$tmp) && $fileInfo['extension']=='txt'){\n \t$tmp=str_replace($table_exts,'',$tmp);\n \t\t$tables[]=$tmp;\t\n }\n \t}\n \t$tables=array_unique($tables);\n \treturn $tables;\n }", "public static function failing_files() {\n\t\t$directory = __DIR__ . '/fixtures/fail';\n\n\t\treturn static::get_files_from_dir( $directory );\n\t}", "public function get_errors() {\n $res = array();\n foreach($this->errors as $error) {\n $res[] = $error->errormsg;\n }\n return $res;\n }", "public function getAllTemplates() {\n $pages = Templates::templates()->get();\n\n return response()->json($pages);\n }", "public function getErrors();", "public function getErrors();", "public function getErrors();", "public function getErrors();", "public function get_available_templates($contextid) {\n\n $fs = get_file_storage();\n $files = $fs->get_area_files($contextid, 'mod_surveypro', SURVEYPRO_TEMPLATEFILEAREA, 0, 'sortorder', false);\n if (empty($files)) {\n return array();\n }\n\n $templates = array();\n foreach ($files as $file) {\n $templates[] = $file;\n }\n\n return $templates;\n }", "function fetchFileList() {\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $query = \"SELECT\n id,\n path\n FROM \".$db_table_prefix.\"filelist\";\n\n $stmt = $db->prepare($query);\n\n if (!$stmt->execute()){\n // Error\n return false;\n }\n\n while ($r = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $i = $r['id'];\n $results[$i] = $r['path'];\n }\n $stmt = null;\n\n return $results;\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}", "private function getErrorMessages() {\n\t\tif (empty($this->errorMessages)) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$this->template->setMarker(\n\t\t\t'message_no_permissions',\n\t\t\t$this->doc->spacer(5) .\n\t\t\t\t$GLOBALS['LANG']->getLL('message_no_permission')\n\n\t\t);\n\t\t$errorList = implode('</li>' . LF . '<li>', $this->errorMessages);\n\t\t$this->template->setMarker('error_list', '<li>' . $errorList .'</li>');\n\n\t\treturn $this->template->getSubpart('IMPORT_ERRORS');\n\t}", "public function getPushoverTemplateDropdownValues()\n\t{\n\t\t$templates = [];\n\n\t\t$finder = new FileFinder();\n\t\t$finder->setOption('name_regex', '/^.*\\.ss$/');\n\n $parent = $this->getFormParent();\n\t\t\n if (!$parent) {\n return [];\n }\n\n $pushoverTemplateDirectory = $parent->config()->get('pushover_template_directory');\n $templateDirectory = ModuleResourceLoader::resourcePath($pushoverTemplateDirectory);\n\n if (!$templateDirectory) {\n\t\t\treturn [];\n }\n\t\t\n $found = $finder->find(BASE_PATH . DIRECTORY_SEPARATOR . $templateDirectory);\n\n\t\tforeach ($found as $key => $value) {\n\t\t\t$template = pathinfo($value);\n $absoluteFilename = $template['dirname'] . DIRECTORY_SEPARATOR . $template['filename'];\n\n // Optionally remove vendor/ path prefixes\n $resource = ModuleResourceLoader::singleton()->resolveResource($templateDirectory);\n if ($resource instanceof ModuleResource && $resource->getModule()) {\n $prefixToStrip = $resource->getModule()->getPath();\n } else {\n $prefixToStrip = BASE_PATH;\n }\n $templatePath = substr($absoluteFilename, strlen($prefixToStrip) + 1);\n\n // Optionally remove \"templates/\" prefixes\n if (preg_match('/(?<=templates\\/).*$/', $templatePath, $matches)) {\n $templatePath = $matches[0];\n }\n\n $templates[$templatePath] = $template['filename'];\n }\n return $templates;\n\t}", "public function getCreatedTemplates ()\n {\n // Get all the templates\n $table = DB::select('select id_template, name_template, created_at, icon from ezz_templates');\n return response()->json([\n 'templates' => $table\n ], 200);\n }", "public function getTemplates()\n {\n return [\n 'paths' => [\n 'app' => ['templates/app'],\n 'error' => ['templates/error'],\n 'layout' => ['templates/layout'],\n 'oauth' => ['templates/oauth'],\n ],\n ];\n }", "protected function getTemplateData($template) {\n\t\t// firstly, check for current locale, if it was set\n\t\tif ($this->locale != '') {\n\t\t\t$tdata = $this->getTemplateDataForLocale($template,$this->locale);\n\t\t\t\n\t\t\t// found for this locale. return\n\t\t\tif (is_array($tdata)) {\n\t\t\t\treturn $tdata;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// check for default locale\n\t\t// for example, didn't find for locale `ge` but found for default `en`\n\t\tif ($this->deflocale != '') {\n\t\t\t$tdata = $this->getTemplateDataForLocale($template,$this->deflocale);\n\t\t\t\n\t\t\tif (is_array($tdata)) {\n\t\t\t\treturn $tdata;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// if nothing found for both locales then check in root templates folder\n\t\t// this is normal case for non-internation application where \n\t\t// locales are not used\n\t\t$tdata = $this->getTemplateDataForLocale($template,'');\n\t\t\t\n\t\treturn $tdata;\n\t}", "function getErrors();", "public function getTemplates()\n {\n return [\n 'paths' => [\n 'app' => [__DIR__ . '/../templates/app'],\n 'error' => [__DIR__ . '/../templates/error'],\n 'layout' => [__DIR__ . '/../templates/layout'],\n 'mail' => [__DIR__ . '/../templates/mail'],\n ],\n ];\n }", "function getErrors()\n\t{\n\t\treturn [];\n\t}", "public function optionList()\n {\n return array(\n 'file:', // The template file to be rendered\n );\n }", "private function getInFiles(): array\n {\n $htmlFiles = glob(\n $this->inDir . DIRECTORY_SEPARATOR . '*.{html, htm}',\n GLOB_BRACE\n );\n\n $validFiles = array_filter($htmlFiles, 'is_file');\n\n if (!empty($validFiles)) {\n return $validFiles;\n } else {\n throw new \\Exception(\"No valid file in $this->inDir\");\n }\n }", "abstract public function getTemplateFile();", "function scanPmanTemplates()\n {\n $tp = DB_DAtaObject::Factory('core_template');\n \n foreach ($this->modules() as $m){\n //var_dump($m);\n // templates...\n $ar = $this->scanDir(array(\n 'tdir' => \"Pman/$m/templates\",\n 'subdir' => '',\n 'match' => '/\\.(html|txt|abw)$/',\n 'skipdir' => array('images','css','js'),\n \n ));\n // print_r($ar);\n \n foreach($ar as $pg) {\n \n $temp = $tp->syncTemplatePage(array(\n 'base' =>'Pman.'.$m, \n 'template_dir' => \"Pman/$m/templates\",\n 'template' => $pg\n ));\n if ($temp) {\n $ids[] = $temp->id;\n }\n }\n // should clean up old templates..\n // php files..\n $ar = $this->scanDir(array(\n 'tdir' => \"Pman/$m\",\n 'subdir' => '',\n 'match' => '/\\.(php)$/',\n 'skipdir' => array('templates'),\n \n ));\n \n \n foreach($ar as $pg) {\n \n $temp = $tp->syncPhpGetText(array(\n 'base' =>'Pman.'.$m, \n 'template_dir' => \"Pman/$m\",\n 'template' => $pg\n ));\n if ($temp) {\n $ids[] = $temp->id;\n }\n \n }\n \n \n \n \n \n //$tp->syncTemplatePage($pg);\n }\n $del = DB_DataObject::factory('core_template');\n $del->whereAddIn('!id', $ids, 'int');\n $del->whereAddIn('view_name', $this->modules(), 'string');\n $del->whereAddIn('filetype' , array( 'php', 'html' ), 'string');\n $delids = $del->fetchAll('id');\n if ($delids) {\n DB_DataObject::factory('core_template')->query(\n 'update core_template set is_deleted = 1 where id in('. implode(',', $delids). ')'\n );\n }\n \n }", "public static function list_templates()\n\t{\n\n\t\t$functions = get_class_methods('Controller_Admin_Documents');\n\n\t\t$doc_gen_functions = NULL;\n\t\tforeach ($functions as $key => $function)\n\t\t{\n\t\t\tif (strpos($function, 'action_doc_template') !== FALSE)\n\t\t\t{\n\t\t\t\t$cache = explode('action_doc_', $function);\n\t\t\t\t$doc_gen_functions[] = $cache[1];\n\t\t\t}\n\t\t}\n\n\t\treturn $doc_gen_functions;\n\t}", "function getFormTemplates(){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/formtemplates';\n\t\t$request = $baseUrl . $endpoint;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}", "function getAllFiles() {\n global $pdo;\n $statement = $pdo->prepare('SELECT `sid`, `mime_type`, `name`, `comment` FROM `file`');\n $statement->execute();\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n}", "private static function _getTemplateInfo($template)\n {\n $templates = array();\n $tplPath = BaseSystem::getDataDir('Help').'/tplPaths.inc';\n if (file_exists($tplPath) === TRUE) {\n include $tplPath;\n }\n\n if (isset($templates[$template]) === TRUE) {\n return $templates[$template];\n }\n\n return array();\n\n }", "abstract protected function getTemplateFilenameIterator(): \\Traversable;", "public function getTemplatePathAndFilename() {}", "protected function getTemplatePathAndFilename() {}", "public function allEmailTemplateForDataTable()\n {\n return $this->emailTemplateRepository->getAllEmailTemplateForDataTable();\n }", "public function getErrorList() {\n\t\treturn array();\n\n\t}", "public function errors()\n {\n // return new \\ArrayList($this->errorList.values());\n }", "public function templateData() {\n return array();\n }", "public static function msgTemplatesList(){\n $accessToken = WxApi::accessToken();\n $offset = 0;\n $count = 5;\n $url = 'https://api.weixin.qq.com/cgi-bin/wxopen/template/list?access_token=' . $accessToken;\n $postFields = json_encode(array(\n // \"access_token\" => $accessToken,\n \"offset\" => 0,\n \"count\" => 5,\n ));\n $api = curl_init();\n curl_setopt($api, CURLOPT_URL, $url);\n curl_setopt($api, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($api, CURLOPT_HEADER, false);\n curl_setopt($api, CURLOPT_POST, true);\n curl_setopt($api, CURLOPT_POSTFIELDS, $postFields);\n $listObj = curl_exec($api);\n curl_close($api);\n $listObj = json_decode($listObj);\n if($listObj->errcode != 0){\n return NULL;\n }else{\n return $listObj->list;\n // return json_encode($listObj->list);\n }\n }", "public function getFormTemplates();", "public function index() {\n $data = $this->repository->getAllSmsTemplates();\n return ($data) ? $this->getSuccessJsonResponse ( [ 'message' => $data] ) : $this->getErrorJsonResponse ( [ ], trans ( 'cms::smstemplate.showallError' ) );\n }", "public function index()\n {\n $result = [];\n $modelTask = TaskFactory::getModel('db');\n $resultDB = $modelTask::all();\n if ($resultDB) {\n foreach ($resultDB as $res) {\n $result[] = $res;\n }\n }\n\n $modelTask = TaskFactory::getModel('file');\n $resultFile = $modelTask::all();\n if ($resultFile) {\n foreach ($resultFile as $res) {\n $result[] = $res;\n }\n }\n return $result;\n }", "function getLanguageFiles() // used in admin_configuration.php\r\n\r\n{\r\n\r\n\t$directory = \"models/languages/\";\r\n\r\n\t$languages = glob($directory . \"*.php\");\r\n\r\n\t//print each file name\r\n\r\n\treturn $languages;\r\n\r\n}", "public function retrieveEmailTemplates()\n {\n return $this->start()->uri(\"/api/email/template\")\n ->get()\n ->go();\n }", "public function getTemplates()\n {\n return $this->templates;\n }", "public function getTemplates()\n {\n return $this->templates;\n }", "public function getListeTypeContent () \n {\n $db = $this->getModel('db');\n $sql = \"SHOW TABLES LIKE '\" . $this->table_cms_contenu . \"_%'\";\n $stmt = $db->query($sql);\n for (true; $res = $db->fetch_assoc($stmt); true) {\n $liste_type_content[] = $res['Tables_in_' . Clementine::$config['clementine_db']['name'] . ' (' . $this->table_cms_contenu . '_%)']; \n }\n return $liste_type_content;\n }", "public static function invalidFiles()\n\t{\n\t\treturn array('error'=>'invalid');\n\t}", "function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}", "function GetTemplates($userid=0)\n\t{\n\t\t$this->GetDb();\n\n\t\t$qry = \"SELECT templateid, name, ownerid FROM \" \n\t\t . SENDSTUDIO_TABLEPREFIX \n\t\t . \"templates\";\n\t\t\n\t\tif ($userid) {\n\t\t\t$qry .= \" AS t, \" . SENDSTUDIO_TABLEPREFIX \n\t\t\t . \" usergroups_access AS a \"\n\t\t\t . \" WHERE \"\n\t\t\t . \" a.resourceid = t.templateid AND \" \n\t\t\t . \" a.resourcetype = 'templates' \";\n\t\t\t$qry .= \" OR t.ownerid='\" . $this->Db->Quote($userid) . \"'\";\n\t\t} else {\n\t\t\tif (!$this->TemplateAdmin()) {\n\t\t\t\t$qry .= \" WHERE ownerid='\" . $this->Db->Quote($this->userid) . \"'\";\n\t\t\t\t\n\t\t\t\tif (!empty($this->access['templates'])) {\n\t\t\t\t\t$qry .= \" OR templateid IN (\" . implode(',', $this->access['templates']) . \")\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$qry .= \" OR isglobal='1'\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$qry .= \" ORDER BY LOWER(name) ASC\";\n\n\t\t$templates = array();\n\t\t$result = $this->Db->Query($qry);\n\t\t\n\t\twhile ($row = $this->Db->Fetch($result)) {\n\t\t\t$templates[$row['templateid']] = $row['name'];\n\t\t}\n\n\t\treturn $templates;\n\t}", "private function get404s() {\n $data = array();\n $row = 0;\n\n if (\\Drupal::moduleHandler()->moduleExists('dblog')) {\n $result = db_select('watchdog', 'w')\n ->fields('w', array('message', 'hostname', 'referer', 'timestamp'))\n ->condition('w.type', 'page not found', '=')\n ->condition('w.timestamp', REQUEST_TIME - 3600, '>')\n ->condition('w.message', array(\n \"UPGRADE.txt\",\n \"MAINTAINERS.txt\",\n \"README.txt\",\n \"INSTALL.pgsql.txt\",\n \"INSTALL.txt\",\n \"LICENSE.txt\",\n \"INSTALL.mysql.txt\",\n \"COPYRIGHT.txt\",\n \"CHANGELOG.txt\",\n ), 'NOT IN')\n ->orderBy('w.timestamp', 'DESC')\n ->range(0, 10)\n ->execute();\n\n foreach ($result as $record) {\n $data[$row]['message'] = $record->message;\n $data[$row]['hostname'] = $record->hostname;\n $data[$row]['referer'] = $record->referer;\n $data[$row]['timestamp'] = $record->timestamp;\n $row++;\n }\n }\n\n return $data;\n }", "function fetch_templates( $module_id = false ) // fetch templates for module or all or global\n\t{\n\t\tif( $module_id ) {\n\t\t\t$this->db->where( 'module_id', $module_id );\n\t\t}\n\t\t$query=$this->db->get( 'templates' );\n\t\t$this->db->flush_cache();\n\t\treturn $query->result_array();\n\t}", "public function get_list_errors()\n\t{\n\t\treturn $this->errors;\n\t}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/google_search.php',\n 'lang_custom/EN/google_search.ini',\n 'sources_custom/blocks/side_google_search.php',\n 'sources_custom/blocks/main_google_results.php',\n 'themes/default/templates_custom/BLOCK_SIDE_GOOGLE_SEARCH.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_GOOGLE_SEARCH_RESULTS.tpl',\n 'themes/default/css_custom/google_search.css',\n 'pages/comcode_custom/EN/_google_search.txt',\n );\n }", "public function formatTemplateFiles()\n\t{\n\t\t$ret = parent::formatTemplateFiles();\n\t\t$name = $this->getName();\n\t\t$presenter = str_replace(\":\", \"/\", $this->name);\n\n\t\t$path = $this->getLayoutPath();\n\t\tif ($path) {\n\t\t\t$ret = array_merge(array(\n\t\t\t\t\"$path/$presenter/$this->view.latte\",\n\t\t\t\t\"$path/$presenter.$this->view.latte\",\n\t\t\t), $ret);\n\t\t}\n\t\treturn $ret;\n\t}", "private function mergeData()\n {\n\n $files = $this->files;\n $folders = $this->folders;\n $this->templates = [];\n\n if($this->deletedTemplates) {\n\n if ($folders) {\n foreach ($folders as $item) {\n if ($item->is_dir) {\n $this->templates[] = $item;\n } else {\n $this->folderReferenceFiles[] = $item;\n $this->templates[] = $this->fileFindById($item->reference_id);\n }\n }\n }\n\n } else {\n\n if ($folders) {\n foreach ($folders as $item) {\n if ($item->is_dir) {\n $this->templates[] = $item;\n } else {\n $this->folderReferenceFiles[] = $item;\n }\n }\n }\n\n if($files) {\n foreach($files as $file) {\n $file['parent_id'] = $this->findParentIdByRefId($file->id);\n $file['ancestors'] = $this->getFileAncestors($file->id);\n $this->templates[] = $file;\n }\n }\n }\n\n if(!$this->limit) {\n return $this->templates;\n }\n $this->templates = Paginator::make($this->templates, $this->folders->getTotal(), $this->folders->getPerPage());\n return true;\n }", "public function getErrorList() : array {\n\t\t$file = func_get_arg( 0 );\n\t\tswitch ( $file ) {\n\t\t\tcase 'SlowMetaQueryUnitTest.success.inc':\n\t\t\t\treturn [];\n\n\t\t\tcase 'SlowMetaQueryUnitTest.fail.inc':\n\t\t\t\treturn [\n\t\t\t\t\t7 => 1,\n\t\t\t\t\t14 => 1,\n\t\t\t\t\t27 => 1,\n\t\t\t\t\t37 => 1,\n\t\t\t\t\t47 => 1,\n\t\t\t\t\t59 => 1,\n\t\t\t\t\t78 => 1,\n\t\t\t\t\t94 => 1,\n\t\t\t\t\t98 => 1,\n\t\t\t\t\t105 => 1,\n\t\t\t\t];\n\t\t}\n\t\treturn [];\n\t}", "public function getTemplateFile();", "public function select_all()\r\n {\r\n\r\n $sql = \"SELECT * FROM \".ERROR_MESSAGSES_TABLE;\r\n\r\n $stmt = $this->conn->prepare($sql);\r\n\r\n if($stmt)\r\n {\r\n $stmt->execute();\r\n\r\n $res = $stmt->get_result();\r\n\r\n while ($row = $res->fetch_assoc()){\r\n \r\n $data[] = $row;\r\n }\r\n\r\n return $data;\r\n \r\n $stmt->close();\r\n }\r\n else\r\n {\r\n $this->myfile = fopen(\"DatabaseErrLog.txt\", \"a\") or die(\"Unable to open file!\");\r\n\r\n $txt = \"Failed prepare statement to select all records from \".ERROR_MESSAGSES_TABLE.\" - \".date(\"Y-d-m h:i:s\", time()).PHP_EOL;\r\n\r\n fwrite($this->myfile, $txt);\r\n \r\n fclose($this->myfile);\r\n }\r\n }" ]
[ "0.65550166", "0.63738954", "0.63034105", "0.62913644", "0.6211011", "0.6165265", "0.6149354", "0.6093235", "0.60354024", "0.5989646", "0.59763205", "0.59640527", "0.5950454", "0.5887699", "0.5817202", "0.5807475", "0.5804953", "0.57978374", "0.56372887", "0.5622289", "0.5615364", "0.558939", "0.5583479", "0.5578478", "0.5538596", "0.5524464", "0.55180895", "0.55129135", "0.54987156", "0.5496509", "0.5490725", "0.5482906", "0.5478104", "0.5470187", "0.54494965", "0.5427168", "0.542505", "0.5417308", "0.54167795", "0.5416038", "0.54125124", "0.5408595", "0.5395146", "0.5375285", "0.5373859", "0.53716433", "0.5363633", "0.53611207", "0.5358567", "0.5358409", "0.5356324", "0.53449744", "0.53449744", "0.53449744", "0.53449744", "0.53383833", "0.5333648", "0.533193", "0.5323636", "0.5298717", "0.5292274", "0.5291492", "0.52908725", "0.5290528", "0.52870923", "0.5273764", "0.5270783", "0.5263574", "0.5260615", "0.5259839", "0.5259541", "0.52439386", "0.52426463", "0.52423126", "0.5238411", "0.5236889", "0.5235922", "0.5233346", "0.52266634", "0.52237064", "0.52234155", "0.52211666", "0.52203375", "0.52195317", "0.52092236", "0.52045953", "0.52029", "0.52029", "0.5200621", "0.51994", "0.5192942", "0.5192572", "0.51922524", "0.5191728", "0.51906335", "0.5188905", "0.5188335", "0.51878524", "0.51870877", "0.5185885", "0.5178414" ]
0.0
-1
Register and load the widget
function wpb_load_widget() { register_widget( 'dmv_widget' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wpb_load_widget() {\n register_widget( 'lrq_widget' );\n }", "public static function register() {\n\t register_widget( __CLASS__ );\n\t}", "public function register_widget() {\n register_widget( 'WPP_Widget' );\n }", "function abc_load_widget()\n{\n register_widget('awesome_bmi_widget');\n}", "public static function a_widget_init() {\n\t\t\treturn register_widget(__CLASS__);\n\t\t}", "static function register_widget() {\n\t\t\t$classname = get_called_class();\n\t\t\tregister_widget( $classname );\n\t\t}", "function cm_load_widget_r() {\n\tregister_widget( 'cm_widget_r' );\n}", "public function _register_widgets()\n {\n }", "function gardenia_load_widget() {\n\tregister_widget( 'gardenia_widget' );\n}", "function widget_load() {\n\t\tregister_widget('ilgelo_wSocial');\n\t\tregister_widget('ilgelo_wTwitter');\n\t\tregister_widget('ilgelo_banner');\n\t}", "function duende_load_widget() {\n\tregister_widget( 'duende_widget' );\n}", "function load_widget() {\n\n\t\tregister_widget( 'WordpressConnectWidgetActivityFeed' );\n\t\tregister_widget( 'WordpressConnectWidgetComments' );\n\t\tregister_widget( 'WordpressConnectWidgetFacepile' );\n\t\tregister_widget( 'WordpressConnectWidgetLikeBox' );\n\t\tregister_widget( 'WordpressConnectWidgetLikeButton' );\n\t\tregister_widget( 'WordpressConnectWidgetLiveStream' );\n\t\tregister_widget( 'WordpressConnectWidgetLoginButton' );\n\t\tregister_widget( 'WordpressConnectWidgetRecommendations' );\n\t\tregister_widget( 'WordpressConnectWidgetSendButton' );\n\n\t}", "function hotpro_load_widget() {register_widget( 'data_hotpro_widget' );}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "public function widgets(){\n\t\t//register_widget(\"sampleWidget\");\n\t}", "function rs_load_widget()\n{\n\tregister_widget('rs_Widget_Agenda');\n}", "function aw_add_load_widget() {\r\n\t\tregister_widget( 'AW_AddFeed' );\r\n\t}", "function example_load_widgets()\n{\n\tregister_widget('GuildNews_Widget');\n}", "function wpb_load_widget()\n{\n register_widget( 'WC_External_API_Widget' );\n}", "function cwcg_load_widget() {\n register_widget( 'cwcg_test_grid_widget' );\n}", "function load_widget_plugin_name() {\n register_widget( 'widget_plugin_name' );\n}", "protected function registerWidget()\n {\n\t\t$id = $this->options['id'];\n $gridSelector = $this->gridSelector;\n\t\t\n\t\t$view = $this->getView();\n\t\t\n IsotopeAsset::register($view);\n $js = [];\n \n $options = Json::encode($this->clientOptions);\n $js[] = \"var isotopeContainer$id = $('$gridSelector');\";\n $js[] = \"var isotope$id = isotopeContainer$id.isotope($options);\";\n\n $view->registerJs(implode(\"\\n\", $js),$view::POS_READY);\n\t\t\n\t\tif (!empty($this->cssFile)) {\n\t\t\tcall_user_func_array([$view, \"registerCssFile\"], $this->cssFile);\n\t\t} \t\t\n }", "function pre_load_widget() {\n register_widget( 'events_widget' );\n register_widget( 'fundys_widget' );\n}", "function ois_load_widgets() {\r\n register_widget( 'OptinSkin_Widget' );\r\n}", "function wpb_load_widget() {\r\n\tregister_widget( 'wpb_widget' );\r\n}", "function wpb_load_widget()\n{\n register_widget('wpb_widget');\n}", "function d7_schema_info_widget_load_widget() {\n\tregister_widget( 'd7_schema_info_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function whichet_load_widget() {\n\tregister_widget( 'WHICHet_widget' );\n\tadd_action( 'wp_enqueue_script', 'WHICHet_scripts' );\n}", "function hw_load_widget() {\n\tregister_widget( 'hw_cal_widget' );\n\tregister_widget( 'hw_custom_post_list_widget' );\n}", "function register_ib_act_widget() {\n\tregister_widget( 'IB_Act_Widget_Widget' );\n}", "function load_type_widget() {\n register_widget( 'custom_type_widget' );\n}", "public function register_widgets() {\n\t\t// Its is now safe to include Widgets files\n\t\t$this->include_widgets_files();\n\n\t\t// Register Widgets\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Hello_World() );\n\t}", "function register_widget($widget)\n {\n }", "function SetWidget() {\n\t\t\n\t\t\tif ( !function_exists('register_sidebar_widget') ) \n\t\t\treturn;\n\t\t\t\n\t\t\t// This registers our widget so it appears with the other available\n\t\t\t// widgets and can be dragged and dropped into any active sidebars.\n\t\t\tregister_sidebar_widget(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteo'));\n\t\t\n\t\t\t// This registers our optional widget control form.\n\t\t\tregister_widget_control(array('3B Meteo', 'widgets'), array(\"TreBiMeteo\",'WidgetMeteoControl'), 450, 325);\n\t\t}", "function bootstrap_side_nav_widget_load_widget() {\n\t\tregister_widget( 'bootstrap_side_nav_widget' );\n\t}", "function wpwl_load_widget() {\n register_widget( 'wpwl_widget' );\n}", "public function register_widgets() {\n\t\t// Its is now safe to include Widgets files\n\t\t$this->include_widgets_files();\n\n\t\t// Register Widgets\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Dropdown() );\n\t}", "public static function widget() {\n require_once( 'includes/widget.php' );\n }", "function suhv_widgets()\n{\n register_widget( 'Suhv_Widgets' );\n}", "function register_broker_widget() {\n register_widget( 'Broker_Widget' );\n}", "function ds_social_load_widget() {\n\tregister_widget( 'ds_social_widget' );\n}", "function msdlab_load_contributor_widget() {\n register_widget('MSDLab_Contributor_Widget');\n}", "public function actionLoadWidget() {\n\t\ttry {\n\t\t\tif (($id = Yii::app()->getRequest()->getQuery(\"medcard\")) == null) {\n\t\t\t\tthrow new CException(\"Can't resolve \\\"medcard\\\" identification number as query parameter\");\n\t\t\t}\n\t\t\tif (Laboratory_Medcard::model()->findByPk($id) == null) {\n\t\t\t\tthrow new CException(\"Unresolved laboratory's medcard identification number \\\"{$id}\\\"\");\n\t\t\t}\n\t\t\t$widget = $this->getWidget(\"AutoForm\", [\n\t\t\t\t\"model\" => new Laboratory_Form_Direction(\"laboratory.treatment.register\", [\n\t\t\t\t\t\"medcard_id\" => $id\n\t\t\t\t])\n\t\t\t]);\n\t\t\t$this->leave([\n\t\t\t\t\"component\" => $widget,\n\t\t\t\t\"status\" => true\n\t\t\t]);\n\t\t} catch (Exception $e) {\n\t\t\t$this->exception($e);\n\t\t}\n\t}", "public function addWidget()\r\n {\r\n }", "function register()\n {\n // Incluimos el widget en el panel control de Widgets\n wp_register_sidebar_widget( 'widget_ultimosp', 'Últimos post por autor', array( 'Widget_ultimosPostPorAutor', 'widget' ) );\n\n // Formulario para editar las propiedades de nuestro Widget\n wp_register_widget_control('widget_ultimos_autor', 'Últimos post por autor', array( 'Widget_ultimosPostPorAutor', 'control' ) );\n }", "function lastfm_load_widget() {\n\tregister_widget( 'lastfm_widget' );\n}", "function load_twitticker_widgets() {\n\tregister_widget( 'twitticker_widget' );\n}", "function register_dc_widget() {\n\t\tregister_widget( 'dc_linked_image' );\n\t\tregister_widget( 'dc_widget_link_text' );\n\t}", "function green_widget_twitter_load() {\n\tregister_widget( 'green_widget_twitter' );\n}", "public static function init()\n {\n add_action( 'widgets_init', array(__CLASS__, 'register') );\n }", "function wpzh_load_widget() {\n register_widget( 'sliderHTML2' ); \n}", "public function register($widget)\n {\n }", "function wpc_load_widget()\n{\n register_widget('expat_category_widget');\n}", "function twitterfollowbutton_load_widgets() {\r\n\tregister_widget( 'twitterfollowbutton_Widget' );\r\n}", "function FM_WebCam_WidgetInit() {\r\n register_widget('FM_WebCam_Widget');\r\n }", "public function register() {\n if( ! $this->activated( 'media_widget' ) ) return;\n\n $media_widget = new MediaWidget();\n $media_widget->register();\n }", "function wpb_load_widget() {\n register_widget( 'recent_post_widget' );\n }", "function custom_register_widget()\n{\n register_widget('oferta_widget');\n register_widget('events_widget');\n register_widget('group_list_widget');\n}", "public static function init() {\n //Register widget settings...\n self::update_dashboard_widget_options(\n self::wid, //The widget id\n array( //Associative array of options & default values\n 'username' => '',\n\t\t\t\t'apikey' => '',\n\t\t\t\t'project_id' => '',\n ),\n true //Add only (will not update existing options)\n );\n\n //Register the widget...\n wp_add_dashboard_widget(\n self::wid, //A unique slug/ID\n __( 'Rankalyst Statistik', 'affiliatetheme-backend' ),//Visible name for the widget\n array('AT_Rankalyst_Widget','widget'), //Callback for the main widget content\n array('AT_Rankalyst_Widget','config') //Optional callback for widget configuration content\n );\n }", "function copyright_load_widget() {\n register_widget( 'copyright_widget' );\n}", "function WeblizarTwitterWidget() {\r\n\tregister_widget( 'WeblizarTwitter' );\r\n}", "function load_tag_widget() {\n register_widget( 'custom_tag_widget' );\n}", "public static function register()\n {\n register_sidebar( array(\n 'name' => 'Widget Area 1',\n 'id' => 'widget_1',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ) );\n }", "function MWX__load_widgets() {\n register_widget( 'widget_MWX__list_pages' );\n}", "function registerBBwidget(){\r\n\tregister_widget('BbWidgetArea');\r\n\t\r\n\t}", "function ds_social_links_load_widget() {\n\tregister_widget( 'ds_social_links_widget' );\n}", "public function getWidget();", "function profit_header_load_widget()\n{\n register_widget('profits_header_widget');\n}", "function register_service_widget() {\n register_widget( 'Services_Widget' );\n}", "function widget_wrap()\n{\n\tregister_widget('ag_pag_familie_w');\n\tregister_widget('ag_social_widget_container');\n\tregister_widget('ag_agenda_widget');\n}", "public function init()\n {\n // Initialize widget.\n }", "function registerWidgets( ) {\r\n\t\t\twp_register_sidebar_widget( 'iluvwalking-com-widget', __( 'ILuvWalking.com Stats' ), array( &$this, 'widgetOutput' ) );\r\n\t\t\twp_register_widget_control( 'iluvwalking-com-widget', __( 'ILuvWalking.com Stats' ), array( &$this, 'widgetControlOutput' ) );\r\n\t\t}", "function montheme_register_widget() {\n register_widget(YoutubeWidget::class);\n register_sidebar([\n 'id' => 'homepage',\n 'name' => __('Sidebar Accueil', 'montheme'),\n 'before_widget' => '<div class=\"p-4 %2$s\" id=\"%1$s\"',\n 'after_widget' => '</div>',\n 'before_title' => ' <h4 class=\"fst-italic\">',\n 'after_title' => '</h4>'\n ]);\n}", "static function init() {\n\t\t\t$classname = get_called_class();\n\t\t\tadd_action( 'widgets_init', $classname . '::register_widget' );\n\t\t\tadd_shortcode( $classname, $classname . '::register_shortcode' );\n\t\t}", "public function register_widgets() {\n\t\t// Its is now safe to include Widgets files\n\t\t$this->include_widgets_files();\n\n\t\t// Register Widgets\n\t\t\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Main_Slider() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Call_To_Action_Text() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Noble_Cause() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Call_To_Action_Image() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Project_Facts() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Pillers_Forest() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Fancy_Heading() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Blog_Listing() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Main_Gallery() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Default_Sub_Header() );\n\n\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Call_To_Action_Banner() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Woo_Listing() );\t\t \n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Events_Listing() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Events_Call_To_Action() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Call_To_Action_Contact() );\n\t\t \\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Islamic_Centre_Newsletter() );\n\t}", "function AviaWidgetLoader()\n\t{\n\t\treturn avia_widget_loader::instance();\n\t}", "public function widgets_init() {\n\t\t// Set widgets_init action function.\n\t\tadd_action( 'widgets_init', array( $this, 'register_sidebars' ) );\n\t\tregister_widget( 'DX\\MOP\\Student_Widget' );\n\t}", "function load_postmeta_widget(){\n register_widget( 'postmeta_widget' );\n}", "function dl_widget_init() {\n\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Página de Contacto',\n\t\t'id'\t\t\t=> 'contact-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Barra Lateral',\n\t\t'id'\t\t\t=> 'sidebar-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Search Menu',\n\t\t'id'\t\t\t=> 'menu-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\n}", "function register_widgets() {\n\t if ( ! is_dir( $this->addon->dir . 'include/widgets/' ) ) { return; }\n\t $widget_files = scandir( $this->addon->dir . 'include/widgets/' );\n\t $widget_slug = array();\n\n\t foreach ( $widget_files as $widget_file ) {\n\t\t if ( preg_match( '/^class\\.([^.]*?)\\.php/' , $widget_file , $widget_slug ) === 1 ) {\n\t\t\t require_once( $this->addon->dir . 'include/widgets/' . $widget_file );\n\t\t\t register_widget( 'SLPWidget_' . $widget_slug[1] );\n\t\t }\n\t }\n }", "function load_archive_widget() {\n register_widget( 'custom_archive_widget' );\n}", "function dpla_search_widget_load() {\n wp_register_script('add-dpla-widget-dcplumer-js', 'http://www.dcplumer.com/dpla/dpla-search-widget-dcplumer.js', '', null,'');\n wp_enqueue_script('add-dpla-widget-dcplumer-js');\n}", "function register_Zappy_Feed_Burner_Widget() {\n register_widget('Zappy_Feed_Burner_Widget');\n}", "public static function init () : void\n {\n add_action(\"widgets_init\", function ()\n {\n self::unregister_widget();\n self::register_widget();\n self::register_sidebar();\n });\n }", "function register_btc_widget() {\r\n register_widget( 'BTC_Live_Rate_Widget' );\r\n}", "function register_zijcareebuilderjobswidget() {\n register_widget( 'ZijCareerBuilderJobs' );\n}", "function ecll_load() {\n\tadd_action( 'elementor/widgets/widgets_registered', 'ecll_register_elementor_widgets' );\n\tadd_action( 'elementor/frontend/after_register_scripts', 'ecll_widget_scripts' );\n}", "public function register_widgets() {\n\t\t// Its is now safe to include Widgets files\n\t\t$this->include_widgets_files();\n\n\t\t// Register Widgets\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Be_Counter() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Be_Posts() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Subhead_Bodycopy() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Heading_Media_BodyCopy() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Sidebar() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Useful_Links_Info() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Content_Filter() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Accordion_Navigation_Tabs() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Secondary_CTAs() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Alert_Banner() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Resources_Widgets() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Card_Lrg() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Be_Promo() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Be_Latest_Resources() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Be_Popular_Results() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Be_Top_Faq() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Be_Card_Carousel() );\n\t\t\\Elementor\\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\\Repeater_resources_widget());\n\n\t}", "function register_widget_control($name, $control_callback, $width = '', $height = '', ...$params)\n {\n }", "function register_browse_widget() {\n\tregister_widget(\"browse_index_widget\");\t\n}", "function register_service_box()\n{\n register_widget( 'CtaWidget' );\n}", "public function registerClientScript()\n {\n $view = $this->getView();\n KCFinderWidgetAsset::register($view);\n $this->clientOptions['kcfUrl'] = Yii::$app->assetManager->getPublishedUrl((new KCFinderAsset)->sourcePath);\n\n if ($this->iframe) {\n $this->clientOptions['iframeModalId'] = $this->getIFrameModalId();\n }\n\n $clientOptions = Json::encode($this->clientOptions);\n $view->registerJs(\"jQuery('#{$this->buttonOptions['id']}').KCFinderInputWidget($clientOptions)\");\n }", "function G3Client_RegisterWidgets(){\n register_widget('G3Client_RandomPhotoWidget');\n}", "function load_dashboard_widget() {\n\t\tadd_action('wp_dashboard_setup', array($this,'dashboard_widget'));\n\t}", "function oa_social_login_init_widget ()\r\n{\r\n return register_widget('Widget_Login');\r\n}", "private function initializeWidgetIdentifier() {}", "function featured_news_load_widget() {register_widget( 'featured_news_widget' );}", "function nabi_widgets_init() {\n\n\t// Language Selector Widget\n\tregister_sidebar( array(\n\t\t'name' => 'Language Widget',\n\t\t'id' => 'languagewidget',\n\t\t'before_title' => ''\n\t) );\n\n\t// Second nav additionnal content Widget\n\tregister_sidebar( array(\n\t\t'name' => 'Second Nav Widget',\n\t\t'id' => 'secondnavwidget',\n\t\t'before_title' => ''\n\t) );\n\n}" ]
[ "0.8110661", "0.7967675", "0.78804576", "0.7738934", "0.7702892", "0.7682854", "0.76820266", "0.76244855", "0.7621846", "0.76101273", "0.7574632", "0.74874914", "0.741399", "0.7409604", "0.7409604", "0.7344513", "0.731742", "0.729245", "0.726935", "0.72691077", "0.724296", "0.7219335", "0.7199558", "0.7199408", "0.7183758", "0.7168517", "0.71638155", "0.7160979", "0.7160979", "0.7136273", "0.7133111", "0.7099006", "0.7091803", "0.7058631", "0.702741", "0.7022185", "0.7001532", "0.69591916", "0.6958921", "0.6953284", "0.69112545", "0.69104826", "0.68628067", "0.68597823", "0.6840972", "0.6837807", "0.6819483", "0.6814876", "0.68100005", "0.6789808", "0.6789086", "0.6774221", "0.67596924", "0.67484593", "0.67413217", "0.67365426", "0.6717635", "0.6705349", "0.6703211", "0.66827685", "0.6679338", "0.6670568", "0.6642273", "0.66188973", "0.66180396", "0.6614019", "0.6612155", "0.660056", "0.65701485", "0.65662587", "0.65588653", "0.6558782", "0.65545636", "0.6530287", "0.6521329", "0.6510038", "0.6508301", "0.6507851", "0.6504648", "0.6492724", "0.64913106", "0.6488492", "0.6485774", "0.648405", "0.6479296", "0.6470534", "0.6456639", "0.64536947", "0.6450023", "0.6429137", "0.6421397", "0.6411936", "0.640065", "0.6397862", "0.63918227", "0.63891155", "0.63846684", "0.63841426", "0.6356556", "0.63515353" ]
0.8054664
1
Sets up the fixture, for example, opens a network connection. This method is called before a test is executed.
protected function setUp() { $this->object = new Sql(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }", "public function setUp() {\n\t\t$options = [\n\t\t\t'db' => [\n\t\t\t\t'adapter' => 'Connection',\n\t\t\t\t'connection' => $this->_connection,\n\t\t\t\t'fixtures' => $this->_fixtures\n\t\t\t]\n\t\t];\n\n\t\tFixtures::config($options);\n\t\tFixtures::save('db');\n\t}", "protected function setUp()\n {\n $this->fixture = new Record();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->load();\n }", "protected function setUp()\n {\n\t global $sys_datacite_username, $sys_datacite_password, $sys_datacite_url ;\n\n\t $this->client = new DataCiteClient($sys_datacite_username, $sys_datacite_password);\n $this->client->setDataciteUrl($sys_datacite_url);\n }", "protected function setUp()\n {\n $this->fixture = new Configuration();\n }", "public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }", "public function setUp()\n {\n parent::setUp();\n $this->prepareForTests();\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 setUp(): void\n {\n $servername = '18.222.31.30';\n $username = 'phpclient';\n $password = 'leftoverkillerphp';\n $dbname = 'leftover_killer';\n self::$RecipeModel = new GetRecipeDetails($servername, $username, $password, $dbname);\n }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "protected function setUp() {\n parent::setUp ();\n $this->storage = new Storage();\r\n $this->connectDB();\r\n $this->cleanDB();\r\n $this->createUser();\n $this->storage->connect($this->dbh);\n }", "protected function setUp() {\r\n\t\tparent::setUp ();\r\n\t\t$this->storage = new Storage ( );\r\n\t\t$this->connectDB();\r\n\t\t$this->cleanDB ();\r\n\t\t$this->createUser ();\r\n\t\t$this->storage->connect ( $this->dbh );\n\t}", "public function setUp() {\n $this->fixture= new FreeTdsLookup($this->getClass()->getPackage()->getResourceAsStream('freetds.conf'));\n }", "public static function setUpBeforeClass(): void\r\n {\r\n self::$MemoryTestAsset = new MemoryTestAsset();\r\n\r\n self::$clients = self::$MemoryTestAsset->getClients();\r\n self::$ClientsStorage = self::$MemoryTestAsset->getClientsStorage();\r\n }", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "protected function setUp()\n {\n parent::setUp();\n $config = new LocalConfiguration();\n $this->local = new Local($config);\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t\n\t\t// Set up fixture\n\t\tif($fixtureFile) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(),0,5) != 'tmpdb') {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\t// This code is a bit misplaced; we want some way of the whole session being reinitialised...\n\t\t\tVersioned::reading_stage(null);\n\n\t\t\tsingleton('DataObject')->flushCache();\n\n\t\t\t$dbadmin = new DatabaseAdmin();\n\t\t\t$dbadmin->clearAllData();\n\t\t\t\n\t\t\t// We have to disable validation while we import the fixtures, as the order in\n\t\t\t// which they are imported doesnt guarantee valid relations until after the\n\t\t\t// import is complete.\n\t\t\t$validationenabled = DataObject::get_validation_enabled();\n\t\t\tDataObject::set_validation_enabled(false);\n\t\t\t$this->fixture = new YamlFixture($fixtureFile);\n\t\t\t$this->fixture->saveIntoDatabase();\n\t\t\tDataObject::set_validation_enabled($validationenabled);\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t}", "protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new ControllerFixture([\n\t\t\t'module' => 'module',\n\t\t\t'controller' => 'controller',\n\t\t\t'action' => 'action',\n\t\t\t'args' => [100, 25]\n\t\t]);\n\n\t\t// Used by throwError()\n\t\tTiton::router()->initialize();\n\t}", "protected function setUp(): void\n {\n \tparent::setUp();\n\n \t$this->authorize();\n\n \t$this->loadFixtures([\n \t\t'product'=>ProductFixture::class\n \t]);\n }", "protected function setUp()\n {\n $this->fixture = new NamespaceDescriptor();\n }", "public function setUp()\n {\n $this->fixture = new Finder();\n }", "protected function setUp(): void\n {\n $this->fixture = new TestSubjectDescriptor();\n }", "function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// i18n needs to be set to the defaults or tests fail\n\t\ti18n::set_locale(i18n::default_locale());\n\t\ti18n::set_date_format(null);\n\t\ti18n::set_time_format(null);\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\t\t\n\t\tif(class_exists('RootURLController')) RootURLController::reset();\n\t\tif(class_exists('Translatable')) Translatable::reset();\n\t\tVersioned::reset();\n\t\tDataObject::reset();\n\t\tif(class_exists('SiteTree')) SiteTree::reset();\n\t\tHierarchy::reset();\n\t\tif(Controller::has_curr()) Controller::curr()->setSession(new Session(array()));\n\t\t\n\t\t$this->originalTheme = SSViewer::current_theme();\n\t\t\n\t\tif(class_exists('SiteTree')) {\n\t\t\t// Save nested_urls state, so we can restore it later\n\t\t\t$this->originalNestedURLsState = SiteTree::nested_urls();\n\t\t}\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t$prefix = defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : 'ss_';\n\n\t\t// Set up fixture\n\t\tif($fixtureFile || $this->usesDatabase || !self::using_temp_db()) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(), 0, strlen($prefix) + 5) != strtolower(sprintf('%stmpdb', $prefix))) {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\tsingleton('DataObject')->flushCache();\n\t\t\t\n\t\t\tself::empty_temp_db();\n\t\t\t\n\t\t\tforeach($this->requireDefaultRecordsFrom as $className) {\n\t\t\t\t$instance = singleton($className);\n\t\t\t\tif (method_exists($instance, 'requireDefaultRecords')) $instance->requireDefaultRecords();\n\t\t\t\tif (method_exists($instance, 'augmentDefaultRecords')) $instance->augmentDefaultRecords();\n\t\t\t}\n\n\t\t\tif($fixtureFile) {\n\t\t\t\t$pathForClass = $this->getCurrentAbsolutePath();\n\t\t\t\t$fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);\n\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($fixtureFiles as $fixtureFilePath) {\n\t\t\t\t\t// Support fixture paths relative to the test class, rather than relative to webroot\n\t\t\t\t\t// String checking is faster than file_exists() calls.\n\t\t\t\t\t$isRelativeToFile = (strpos('/', $fixtureFilePath) === false || preg_match('/^\\.\\./', $fixtureFilePath));\n\t\t\t\t\tif($isRelativeToFile) {\n\t\t\t\t\t\t$resolvedPath = realpath($pathForClass . '/' . $fixtureFilePath);\n\t\t\t\t\t\tif($resolvedPath) $fixtureFilePath = $resolvedPath;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$fixture = new YamlFixture($fixtureFilePath);\n\t\t\t\t\t$fixture->saveIntoDatabase();\n\t\t\t\t\t$this->fixtures[] = $fixture;\n\n\t\t\t\t\t// backwards compatibility: Load first fixture into $this->fixture\n\t\t\t\t\tif($i == 0) $this->fixture = $fixture;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->logInWithPermission(\"ADMIN\");\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t\tEmail::send_all_emails_to(null);\n\t\t\n\t\t// Preserve memory settings\n\t\t$this->originalMemoryLimit = ini_get('memory_limit');\n\t}", "public function setUp(): void\n {\n $this->fixture = new Finder();\n }", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}" ]
[ "0.7593145", "0.7171293", "0.69280165", "0.6909619", "0.68903273", "0.6883977", "0.68159807", "0.6802521", "0.67521834", "0.6750625", "0.6744658", "0.67317975", "0.67125857", "0.67070854", "0.67009753", "0.6682683", "0.6682683", "0.6682683", "0.6682683", "0.6682683", "0.6677939", "0.6677724", "0.6672275", "0.6669861", "0.6647876", "0.6646466", "0.6645757", "0.66369176", "0.66188663", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.6617787", "0.66174525", "0.66174525", "0.6617229", "0.6617229", "0.6617229", "0.6617229", "0.6617229", "0.6617229", "0.6617229", "0.6617229", "0.6617229", "0.6617229", "0.6617229", "0.6617229" ]
0.0
-1
Tears down the fixture, for example, closes a network connection. This method is called after a test is executed.
protected function tearDown() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tearDown(): void\n {\n parent::tearDown();\n\n Mockery::close();\n\n unset($this->faker, $this->waqi);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "public function teardown()\n {\n }", "public function _after(TestCase $test)\n {\n $this->unloadFixtures();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($this->client);\n\n m::close();\n }", "protected function tearDown(): void\n {\n self::$driver->close();\n }", "public function tearDown()\n\t{\n\t\tm::close();\n\t}", "protected function tearDown()\n {\n if ($this->databaseTester !== null) {\n if (method_exists($this, 'getTearDownOperation')) {\n $this->getDatabaseTester()->setTearDownOperation($this->getTearDownOperation());\n }\n if (method_exists($this, 'getDataSet')) {\n $this->getDatabaseTester()->setDataSet($this->getDataSet());\n }\n $this->getDatabaseTester()->onTearDown();\n }\n\n $this->databaseTester = null;\n\n set_time_limit(0);\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "function teardown() {\n // close database connection\n $this->conn = null;\n }", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "protected function tearDown(): void\n {\n $this->closeDatabase();\n }", "protected function tearDown() {\n\t\tm::close();\n\t}", "public function tearDown()\n\t{\n\t\t$this->beforeApplicationDestroyed(function () {\n\t\t\tDB::disconnect();\n\t\t});\n\t\n\t\t\tparent::tearDown();\n\t\t\t// \t\tMockery::close();\n\t}", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "protected function tearDown() {\n\t\tparent::tearDown();\n\n\t\t$this->cleanupTestDirectory();\n\t}", "protected function tearDown()\n {\n $this->testData = null;\n parent::tearDown();\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "protected function tearDown(): void\n {\n $client = $this->getProvidedData()[0] ?? null;\n if ($client instanceof Client) {\n $this->logout($client);\n }\n }", "public function teardown()\n {\n parent::teardown();\n }", "protected function doTearDown(): void\n {\n }", "protected function tearDown()\n\t{\n\t\tunset($GLOBALS['__DB__']);\n\n\t\tparent::tearDown();\n\t}", "public function teardown() {\n m::close();\n }", "public function tearDownFixtures()\n {\n if (is_array($this->_fixtures)) {\n /** @var ActiveRecordFixture $object */\n foreach ($this->_fixtures as $object) {\n $object->cleanup();\n }\n }\n }", "protected function tearDown()\n {\n // Make sure any test entities created are deleted\n foreach ($this->testEntities as $entity)\n {\n // Second param is a 'hard' delete which actually purges the data\n $this->entityLoader->delete($entity, true);\n }\n }", "public function teardown()\n {\n m::close();\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "protected function tearDown ()\n {\n $this->downTest();\n\n parent::tearDown();\n }", "public function tearDown()\n {\n $fs = new SymfonyFileSystem();\n $fs->remove($this->fakeTestFileDir);\n\n unset($this->builder);\n unset($this->builder);\n unset($this->fs);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->tearDownTheTestEnvironment();\n }", "protected function tearDown() {\r\n\t\tunset ( $this->configReader );\r\n\t}", "protected function tearDown() {\n\t\t$this->sql->Disconnect(__FILE__, __LINE__);\n\t\tsqlsolution_unlink_sqlite($this->sql);\n\t\t$this->sql = null;\n\t}", "protected function tearDown()\n {\n parent::tearDown();\n\n $this->em->close();\n $this->em = null; // avoid memory leaks\n }", "protected function tearDown()\n {\n $this->testDBConnector->clearDataFromTables();\n }", "public function tearDown() {\n\n\t\tparent::tearDown();\n\t\tMockery::close();\n\t}", "public function tearDown()\n {\n $this->stop();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n m::close();\n }", "public function tearDown()\n {\n m::close();\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function tearDown()\n {\n unset($this->helper);\n }", "public function tearDown()\n\t{\n\t\tunset($this->stub);\n\t}", "protected function tearDown()\n\t {\n\t\tunset($this->object);\n\n\t\t$conn = $this->getConnection();\n\t\t$db = $conn->getConnection();\n\t\t$db->exec(\"DROP TABLE IF EXISTS `MySQLdatabase`;\");\n\n\t\tunset($GLOBALS[\"errstr\"]);\n\t\tunset($GLOBALS[\"stuckerror\"]);\n\t }", "protected function tearDown()\n {\n $this->local = null;\n parent::tearDown();\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tear_down()\n {\n }", "protected function tearDown() {\n $this->dbh = null;\n $this->storage = null;\n parent::tearDown ();\n }", "protected function tearDown()\n {\n $this->kernel->shutdown();\n $this->kernel = null;\n parent::tearDown();\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tear_down()\n {\n }", "public function tearDown()\n\t{\n\t\t\\Orchestra\\Core::shutdown();\n\n\t\tunset($this->user);\n\t\tunset($this->stub);\n\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n unset($this->VenusFuelDepot);\n }", "protected function tearDown()\n\t{\n\t\tunset($this->_instance);\n\t\tparent::tearDown();\n\t}", "public function tearDown()\n {\n parent::tearDown();\n\n if ((bool) getenv('CLEANUP_TEST_DOCKER_SECRETS')) {\n DockerSecretFile::cleanup();\n }\n }", "protected function tearDown()\n\t{\n\t\t$this->restoreFactoryState();\n\t}", "protected function tearDown()\n {\n $this->dataCollector = null;\n parent::tearDown();\n }", "public function tearDown()\n {\n unset($this->app);\n unset($_SERVER['RouteManagerTest@callback']);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown(){\n\t\t$this->container->get('doctrine')->getConnection()->close();\n\t\n\t\tparent::tearDown();\n\t}", "protected function tearDown()\n {\n unset($this->app);\n\n m::close();\n }", "public function tearDown()\n {\n if (null !== $this->ldap) {\n $this->ldap->unbind();\n }\n }", "protected function tearDown(): void\n {\n $this->_connection->dropTable($this->_tableName);\n $this->_connection->resetDdlCache($this->_tableName);\n $this->_connection = null;\n }", "public function tearDown()\n {\n $this->deleteAdminUserFixture();\n }", "public function tearDown()\n {\n $this->flushModelEventListeners();\n parent::tearDown();\n unset($this->app);\n\n /*\n * Restore environment\n */\n if (file_exists(base_path($this->envTestingFile())) && file_exists(base_path('.env.backup'))) {\n $this->restoreEnvironment();\n }\n }", "public function tearDown()\n {\n unset($this->commonDataClassRepository);\n }", "protected function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t\tFragseizeObj::release( $this->uid );\n\t}", "protected function tearDown()\n {\n $this->client = null;\n }", "public function tearDown() \n {\n $this->flushSession();\n \n $this->inactiveUser->delete();\n $this->basicUser->delete();\n $this->contactManager->delete();\n $this->projectManager->delete();\n $this->administrator->delete();\n\n parent::tearDown();\n Mockery::close();\n }", "public function tearDown() {\n // tests using these functions.\n \\mod_forum\\subscriptions::reset_forum_cache();\n\n $this->messagesink->clear();\n $this->messagesink->close();\n unset($this->messagesink);\n\n $this->mailsink->clear();\n $this->mailsink->close();\n unset($this->mailsink);\n }", "public function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\t$this->databaseTester = NULL;\n\t}", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "public function tearDown()\n {\n $this->client = null;\n }", "protected function tearDown()\n {\n $this->helper = null;\n parent::tearDown();\n }", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown() {\n\t}", "protected function tearDown()\n\t{\n\t\t$this->instance = null;\n\t}", "public static function tearDownAfterClass(): void\n {\n if (file_exists(static::$ou)) {\n unlink(static::$ou);\n }\n }", "protected function tearDown()\r\n {\r\n $application = new Application(self::$kernel);\r\n $application->setAutoExit(false);\r\n\r\n $options = array('command' => 'doctrine:database:drop', '--force' => true);\r\n $application->run(new ArrayInput($options));\r\n\r\n parent::tearDown();\r\n\r\n $this->em->close();\r\n $this->em = null;\r\n }", "protected function tearDown()\n {\n $this->deleteTemporaryFiles();\n }", "protected function tearDown()\n {\n parent::tearDown();\n if (!is_null($this->em)) {\n $this->em->getConnection()->close();\n }\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "protected function tearDown(): void\n {\n m::close();\n }", "public function tearDown()\n {\n Resistance::reset();\n }", "protected function tearDown()\n {\n $this->clock = NULL;\n }", "public function tearDown()\n\t{\n\t\tMockery::close();\n\t}", "protected function tearDown()\n\t{\n\t\tparent::tearDown ();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t}" ]
[ "0.7307815", "0.7238275", "0.72227454", "0.7188436", "0.71879613", "0.7149625", "0.71407133", "0.71349216", "0.7120695", "0.71045953", "0.7082413", "0.70795685", "0.7078695", "0.7053677", "0.7049754", "0.7033488", "0.70231533", "0.7015942", "0.70026475", "0.70015645", "0.70009726", "0.6992498", "0.6991574", "0.6982236", "0.6959787", "0.6957327", "0.6957113", "0.69477797", "0.69391286", "0.69353324", "0.6929293", "0.69272804", "0.6924027", "0.6919613", "0.69106525", "0.691015", "0.69076234", "0.69005364", "0.6893594", "0.68902904", "0.68902904", "0.68902904", "0.6890021", "0.6889579", "0.68841285", "0.6863368", "0.68627113", "0.6859154", "0.6859154", "0.6859154", "0.6859154", "0.6859154", "0.68552536", "0.68531847", "0.68531775", "0.68531775", "0.68531775", "0.6852345", "0.6845148", "0.68406034", "0.6839399", "0.6834271", "0.6831154", "0.6829854", "0.681265", "0.68113995", "0.6808372", "0.68079066", "0.6807655", "0.68041337", "0.68016654", "0.67936915", "0.6792264", "0.6789085", "0.67800087", "0.67749995", "0.677085", "0.67707926", "0.6768029", "0.67679065", "0.67620206", "0.67620206", "0.67620206", "0.67620206", "0.67620206", "0.67620206", "0.676071", "0.6760098", "0.6758629", "0.67557335", "0.6754858", "0.6753944", "0.6753944", "0.6753944", "0.6753944", "0.6753944", "0.6753944", "0.6751862", "0.6750142", "0.6749342", "0.67488104" ]
0.0
-1
expense report date wise
public function expenseReportDate(Request $request){ if($request->pdf=='pdf_download'){ echo "<h1>Coming soon</h1>"; }else{ $start=$request->start; $end=$request->end; $company=Company::first(); $data=ExpenseAmount::whereBetween('expense_date',[$start,$end])->with('ExpenseCategorys','Warehouses','users')->get(); return view('report.expense.expense_date_wise',compact('start','end','company','data')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dtexpensegroupreport()\n {\n $search_type = $this->input->post('search_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $head = $this->input->post('head');\n\n $data['date_type'] = $this->customlib->date_type();\n $data['date_typeid'] = '';\n\n if (isset($_POST['search_type']) && $_POST['search_type'] != '') {\n\n $dates = $this->customlib->get_betweendate($_POST['search_type']);\n $data['search_type'] = $_POST['search_type'];\n\n } else {\n\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n\n }\n\n $data['head_id'] = $head_id = \"\";\n if (isset($_POST['head']) && $_POST['head'] != '') {\n $data['head_id'] = $head_id = $_POST['head'];\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n $result = $this->expensehead_model->searchexpensegroup($start_date, $end_date, $head_id);\n\n $m = json_decode($result);\n $currency_symbol = $this->customlib->getSchoolCurrencyFormat();\n $dt_data = array();\n $grand_total = 0;\n if (!empty($m->data)) {\n $grd_total = 0;\n foreach ($m->data as $key => $value) {\n\n $expensedata = explode(',', $value->expense);\n $expense_id = \"\";\n $expense_name = \"\";\n $expense_date = \"\";\n $invoice_no = \"\";\n $expense_amount = \"\";\n foreach ($expensedata as $expensevalue) {\n $expenseexpload = explode('@', $expensevalue);\n\n $expense_id .= $expenseexpload[0];\n $expense_id .= \"<br>\";\n $expense_date .= date($this->customlib->getSchoolDateFormat(), strtotime($expenseexpload[1]));\n $expense_date .= \"<br>\";\n $expense_name .= $expenseexpload[2];\n $expense_name .= \"<br>\";\n $invoice_no .= $expenseexpload[3];\n $invoice_no .= \"<br>\";\n $expense_amount .= $expenseexpload[4];\n $expense_amount .= \"<br>\";\n }\n\n $total_amount = \"<b>\" . $value->total_amount . \"</b>\";\n $grd_total += $value->total_amount;\n $row = array();\n $row[] = $value->exp_category;\n $row[] = $expense_id;\n $row[] = $expense_name;\n $row[] = $expense_date;\n $row[] = $invoice_no;\n $row[] = $expense_amount;\n $dt_data[] = $row;\n\n $amount_row = array();\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = $total_amount;\n $dt_data[] = $amount_row;\n }\n\n $grand_total = \"<b>\" . $currency_symbol . $grd_total . \"</b>\";\n $footer_row = array();\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"<b>\" . $this->lang->line('total') . \"</b>\";\n $footer_row[] = $grand_total;\n $dt_data[] = $footer_row;\n }\n\n $json_data = array(\n \"draw\" => intval($m->draw),\n \"recordsTotal\" => intval($m->recordsTotal),\n \"recordsFiltered\" => intval($m->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }", "public function getTotalExpensesByDate($date)\n\t{\n\t $cid = $this->gasolinereceived_model->getCompanyId();\n\t\t $cid1 = $cid['0']->c_id;\n \n $this->db->select('SUM(exp_amount) as total_exp', FALSE);\n\t\t$this->db->like('date', $date);\n\t\t// $this->db->where('date <=', $date);\n\t\t// $this->db->where('date >=', $date);\n // $this->db->where('date <=', $date2);\n \n\t\t $this->db->where('c_id\t',$cid1);\n\t\t// $this->db->where('pid',$pid);\n\t\t //$this->db->group_by('cc_type'); \n\t\t $query = $this->db->get('expenses')->row_array();\n\t\t $q= $this->db->last_query($query);\n\t\t //print_r($q); die();\n\t return $query['total_exp'];\n\t \n\t}", "function quantizer_expenses_general_report($start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerGeneralExpenses($start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function expense(Request $request)\n {\n\n $d=DB::table('expense'); // define for filter\n\n $from_date=\"\"; $to_date=\"\";\n if($request->from_date!=\"\"){\n // $Fdate=str_replace(\"/\",\"-\",$request->from_date);\n $from_date =Date('Y-m-d',strtotime($request->from_date)); \n }\n if($request->to_date !=\"\"){\n // $Tdate=str_replace(\"/\",\"-\",$request->to_date);\n $to_date =Date('Y-m-d',strtotime($request->to_date)); \n }\n \n\n if($from_date!=\"\" && $to_date!=\"\"){\n $d->whereBetween('date',[$from_date,$to_date]); \n }\n $type=0;\n if($request->type!=\"\"){\n $d->where('type',$request->type); \n $type=$request->type;\n }\n $category=\"\";\n if($request->category!=\"\"){\n $d->where('category',$request->category); \n $category=$request->category;\n }\n\n $month_array=array('1'=>'Jan','2'=>'Feb','3'=>'Mar','4'=>'Apr','5'=>'May','6'=>'Jun','7'=>'Jul','8'=>'Aug','9'=>'Sep','10'=>'Oct','11'=>'Nov','12'=>'Dec'); \n \n $incomes=DB::table('expense')\n ->where('type',1)\n ->where('customer_name',request()->user()->name)\n ->select(DB::raw('sum(total_amount) as total_amount'), DB::raw('MONTH(created_at) as month'))\n ->groupBy('month')\n ->get()\n ->keyBy('month');\n\n \n $expenses=DB::table('expense')\n ->where('type',2)\n ->where('customer_name',request()->user()->name)\n ->select(DB::raw('sum(total_amount) as total_amount'), DB::raw('MONTH(created_at) as month'))\n ->groupBy('month')\n ->get()\n ->keyBy('month');\n\n $incomeexp_percent=DB::table('expense')\n ->where('customer_name',request()->user()->name)\n ->select(DB::raw('count(*) as total'), DB::raw('category as category'), DB::raw('MONTH(created_at) as month'))\n ->groupBy('category','month')\n ->get();\n \n $total_amount_income=[];\n $total_amount_income1=[];\n \n $total_amount_expense=[];\n $total_amount_expense1=[];\n \n foreach ($incomes as $key => $income) {\n $total_amount_income[$key] = $income->total_amount;\n }\n \n foreach ($expenses as $key => $expense) {\n $total_amount_expense[$key] = $expense->total_amount;\n }\n\n for($i = 1; $i <= 12; $i++)\n {\n $month[$i]=$month_array[$i];\n\n if(!empty($total_amount_income[$i])){\n $total_amount_income1[$i] = $total_amount_income[$i]; \n }else{\n $total_amount_income1[$i] = 0; \n }\n\n if(!empty($total_amount_expense[$i])){\n $total_amount_expense1[$i] = $total_amount_expense[$i]; \n }else{\n $total_amount_expense1[$i] = 0; \n }\n }\n $sum=[];\n foreach($incomeexp_percent as $key=>$percent) {\n $sum[$key]=$percent->total;\n }\n $total_category=array_sum($sum); \n\n $data=$d->orderBy('id','desc')->get();\n $autocomplete=Expense::distinct('category')->select('category')->get();\n return view('user_expense_report',['data'=>$data,'from_date'=>$from_date,'to_date'=>$to_date,'type'=>$type,'autocomplete'=>$autocomplete,'category'=>$category,'month'=>$month,'total_amount_income1'=>$total_amount_income1,'total_amount_expense1'=>$total_amount_expense1,'incomeexp_percent'=>$incomeexp_percent,'total_category'=>$total_category]);\n }", "public function get_sales_man_daily_work_report($date){\n\t\t $this->db->select('empployee.e_id,empployee.e_emplouee_id,assign_work.w_d_id,assign_work.date')->from('assign_work');\n\t\t $this->db->join('empployee', 'empployee.e_id = assign_work.work_employee_id ', 'left');\n\t\t $this->db->order_by('empployee.role_id',8);\n\t\t $this->db->where('empployee.status',1);\n\t\t $this->db->where('assign_work.date',$date);\n\t\t $return=$this->db->get()->result_array();\n\t\t $work_details=$data_work='';\n\t\t foreach($return as $list){\n\t\t\t $emp_work=$this->get_employee_work_dailay_details($list['date'],$list['e_id'],$list['w_d_id']);\n\t\t\t $data[$list['e_id']]=$list;\n\t\t\t $data[$list['e_id']]['work']=isset($emp_work)?$emp_work:'';\n\t\t\t \n\t\t }\n\t\t if(!empty($data)){\n\t\t\t return $data;\n\t\t }\n\t}", "function getDailyReport($date = null)\n{\n//SELECT COUNT(0)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `invoice_count`,\n//`b`.`tran_date` AS `tran_date`,(\n//SELECT COUNT(`0_debtor_trans_details`.`id`)\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND\n//(`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_count`,(\n//SELECT SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_invoice_amount`,(\n//SELECT SUM(`0_debtor_trans`.`alloc`)\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `total_amount_recieved`,(\n//SELECT (SUM((`0_debtor_trans`.`ov_amount` + `0_debtor_trans`.`ov_gst`)) - SUM(`0_debtor_trans`.`alloc`))\n//FROM `0_debtor_trans`\n//WHERE ((`0_debtor_trans`.`type` = 10) AND (`0_debtor_trans`.`tran_date` = '$date'))) AS `pending_amount`,(\n//SELECT (SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`unit_price`)) -\n//SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`discount_amount`)))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_service_charge`,(\n//SELECT SUM((`0_debtor_trans_details`.`quantity` * `0_debtor_trans_details`.`user_commission`))\n//FROM (`0_debtor_trans`\n//LEFT JOIN `0_debtor_trans_details` ON((`0_debtor_trans`.`trans_no` = `0_debtor_trans_details`.`debtor_trans_no`)))\n//WHERE ((`0_debtor_trans_details`.`debtor_trans_type` = 10) AND (`0_debtor_trans`.`type` = 10) AND\n//(`0_debtor_trans`.`tran_date` = '$date'))) AS `total_commission`,(\n//SELECT SUM(ABS(`0_gl_trans`.`amount`))\n//FROM `0_gl_trans`\n//WHERE ((`0_gl_trans`.`type` = 12) AND (`0_gl_trans`.`account` = 1200) AND\n//(`b`.`tran_date` = '$date'))) AS `total_collection`\n//FROM ((`0_debtor_trans` `a`\n//JOIN `0_gl_trans` `b` ON((`a`.`trans_no` = `b`.`type_no`)))\n//JOIN `0_debtor_trans_details` `c` ON((`a`.`trans_no` = `c`.`debtor_trans_no`)))\n//WHERE ((`c`.`debtor_trans_type` = 10) AND (`a`.`type` = 10)) and `b`.`tran_date` = '$date'\n//GROUP BY `b`.`tran_date`\n//ORDER BY `b`.`tran_date`\";\n//\n//// if ($date) {\n//// $sql .= \" and tran_date='$date' \";\n//// }\n////\n//// $sql .= \" order by tran_date desc LIMIT 10\";\n//\n//\n//// print_r($sql); die;\n//\n// $result = db_query($sql, \"Transactions could not be calculated\");\n//\n// $table_html = \"\";\n//\n// $i = 0;\n//\n// while ($myrow = db_fetch($result)) {\n//\n// $class = 'class=\"oddrow\"';\n// if ($i % 2 == 0)\n// $class = 'class=\"evenrow\"';\n//\n// $table_html .= \"<tr $class>\";\n// $table_html .= \"<td>\" . $myrow['tran_date'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['invoice_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: center'>\" . $myrow['total_service_count'] . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_service_charge'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_invoice_amount'], user_price_dec()) . \"</td>\";\n// $table_html .= \"<td style='text-align: right'>\" . number_format2($myrow['total_collection'], user_price_dec()) . \"</td>\";\n// $table_html .= \"</tr>\";\n// $i++;\n// }\n// return $table_html;\n\n}", "public function dtincomegroupreport()\n {\n $search_type = $this->input->post('search_type');\n $date_from = $this->input->post('date_from');\n $date_to = $this->input->post('date_to');\n $head = $this->input->post('head');\n\n if (isset($search_type) && $search_type != '') {\n\n $dates = $this->customlib->get_betweendate($search_type);\n $data['search_type'] = $_POST['search_type'];\n\n } else {\n\n $dates = $this->customlib->get_betweendate('this_year');\n $data['search_type'] = '';\n\n }\n $data['head_id'] = $head_id = \"\";\n if (isset($_POST['head']) && $_POST['head'] != '') {\n $data['head_id'] = $head_id = $_POST['head'];\n }\n\n $start_date = date('Y-m-d', strtotime($dates['from_date']));\n $end_date = date('Y-m-d', strtotime($dates['to_date']));\n\n $data['label'] = date($this->customlib->getSchoolDateFormat(), strtotime($start_date)) . \" \" . $this->lang->line('to') . \" \" . date($this->customlib->getSchoolDateFormat(), strtotime($end_date));\n $incomeList = $this->income_model->searchincomegroup($start_date, $end_date, $head_id);\n $m = json_decode($incomeList);\n $currency_symbol = $this->customlib->getSchoolCurrencyFormat();\n $dt_data = array();\n $grand_total = 0;\n if (!empty($m->data)) {\n $grd_total = 0;\n foreach ($m->data as $key => $value) {\n\n $incomedata = explode(',', $value->income);\n $income_id = \"\";\n $income_name = \"\";\n $income_date = \"\";\n $invoice_no = \"\";\n $income_amount = \"\";\n $total_amount = 0;\n foreach ($incomedata as $incomevalue) {\n $incomeexpload = explode('@', $incomevalue);\n $income_id .= $incomeexpload[0];\n $income_id .= \"<br>\";\n $income_name .= $incomeexpload[1];\n $income_name .= \"<br>\";\n $income_date .= date($this->customlib->getSchoolDateFormat(), strtotime($incomeexpload[3]));\n $income_date .= \"<br>\";\n $invoice_no .= $incomeexpload[2];\n $invoice_no .= \"<br>\";\n $income_amount .= $incomeexpload[4];\n $income_amount .= \"<br>\";\n }\n $total_amount = \"<b>\" . $value->total_amount . \"</b>\";\n $grd_total += $value->total_amount;\n $row = array();\n $row[] = $value->income_category;\n $row[] = $income_id;\n $row[] = $income_name;\n $row[] = $income_date;\n $row[] = $invoice_no;\n $row[] = $income_amount;\n $dt_data[] = $row;\n\n $amount_row = array();\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = \"\";\n $amount_row[] = $total_amount;\n $dt_data[] = $amount_row;\n }\n\n $grand_total = \"<b>\" . $currency_symbol . $grd_total . \"</b>\";\n $footer_row = array();\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"\";\n $footer_row[] = \"<b>\" . $this->lang->line('total') . \"</b>\";\n $footer_row[] = $grand_total;\n $dt_data[] = $footer_row;\n }\n\n $json_data = array(\n \"draw\" => intval($m->draw),\n \"recordsTotal\" => intval($m->recordsTotal),\n \"recordsFiltered\" => intval($m->recordsFiltered),\n \"data\" => $dt_data,\n );\n echo json_encode($json_data);\n }", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,\n\t\t\tCAST(sum(total_price) AS DECIMAL(16,2)) as total_sale\");\n\t\t$this->db->select('CAST(sum(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"CAST(SUM(total_price) - SUM(`quantity`*`supplier_rate`) AS DECIMAL(16,2)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\n\t\t$this->db->where('a.date >=', $start_date); \n\t\t$this->db->where('a.date <=', $end_date); \n\n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "function get_acquisition_value(){\n\n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \"DATE_FORMAT(tblAcquire.acquire_date,'%b') as month, sum(trelVintageHasAcquire.total_price) as total\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" Month \";\n $where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" acquire_date ASC \";\n $rst = $obj ->get_extended($where,$columns,$group, $sort);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"acquisition report failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n\n}", "public function retrieve_dateWise_profit_report($start_date,$end_date)\n\t{\n\t\t$dateRange = \"a.date BETWEEN '$start_date%' AND '$end_date%'\";\n\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,sum(total_price) as total_sale\");\n\t\t$this->db->select('sum(`quantity`*`supplier_rate`) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"(SUM(total_price) - SUM(`quantity`*`supplier_rate`)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\t\t$this->db->where($dateRange, NULL, FALSE); \n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\n\t\treturn $query->result_array();\n\t}", "public function byDate(Request $request)\n {\n // Default return today's expense\n $myUser = Auth::user();\n if (isset($request->start_date) && isset($request->end_date)) {\n $start_date = $request->start_date;\n $end_date = $request->end_date;\n } elseif (isset($request->start_date)) {\n $start_date = $request->start_date;\n $end_date = date('Y-m-d');\n } else {\n $start_date = date('Y-m-d');\n $end_date = date('Y-m-d');\n }\n $myExpense = Expense::selectRaw('expense_date, sum(amount) as total_amount')\n ->whereBetween('expense_date', [ $start_date, $end_date ])\n ->where('user_id', $myUser->id)\n ->orderby('expense_date')\n ->groupby('expense_date')\n ->get();\n\n return view('report.bydate')\n ->with('expenseList', $myExpense)\n ->with('start_date', $start_date)\n ->with('end_date', $end_date);\n }", "public function date_range_report()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->data['company_list'] = $this->reports_personnel_schedule_model->company_list();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/date_range_report',$this->data);\n\t}", "public function show_sales_review_date()\n {\n $query = $this->db->query(\"SELECT `date`,`product_id`,`type`,`weight`, SUM(`amount`) as amoun,SUM(`price`) as price FROM `sales` WHERE DATE(`date`)=CURDATE() GROUP BY `product_id`\");\n return $query->result();\n }", "public function expenses_report()\n {\n $expensecategories = ExpenseCategory::select('id','name')->where('status',0)->get();\n\n return view('reports.expenses',compact('expensecategories'));\n }", "public function fillDailyTReport(Request $request)\n {\n $CIH = new CashInHand();\n $TF = new TermFee();\n $STA = new Stationary();\n $AD = new Admission();\n $COS = new Course();\n $exp = new Expense();\n $OI = new OtherIncome();\n\n //fees\n $ncTF = $TF->getMonthlyTF($request->Fdate, $request->Tdate, 'nc_term_tbl');//NC all monthly term fee\n $bcTF = $TF->getMonthlyTF($request->Fdate, $request->Tdate, 'bc_term_tbl');//BC all monthly term fee\n $ncEF = $TF->getMonthlyEF($request->Fdate, $request->Tdate, 'nc_exam_tbl');//NC all monthly exam fee\n $bcEF = $TF->getMonthlyEF($request->Fdate, $request->Tdate, 'bc_exam_tbl');//BC all monthly exam fee\n $ncExtF = $TF->getMonthlyExtF($request->Fdate, $request->Tdate, 'nc_exam_tbl');//NC all monthly extra curricular fee\n $bcExtF = $TF->getMonthlyExtF($request->Fdate, $request->Tdate, 'bc_exam_tbl');//BC all monthly extra curricular fee\n\n //stationary\n $stationary = $STA->getMonthlySta($request->Fdate, $request->Tdate);//get all monthly stationary\n\n //Other income\n $otherIncm = $OI->getMonthlyOI($request->Fdate, $request->Tdate);//get all monthly other income\n\n //admission & refund\n $admRefM = $AD->getMonthlyAdmRef($request->Fdate, $request->Tdate);//get all monthly admission & refund\n $admDisMexp = $AD->getMonthlydiscount($request->Fdate, $request->Tdate);//get all monthly discount expense\n\n //courses\n $cosM = $COS->getMonthlyCos($request->Fdate, $request->Tdate);//get all monthly course fee\n\n //expenses\n $expM = $exp->getMonthlyExp($request->Fdate, $request->Tdate);//get all monthly expenses\n\n //total income\n $totIncome = $CIH->getTotalIncome($request->Fdate, $request->Tdate);//get total income\n //total expense\n $totExpense = $CIH->getTotalExpense($request->Fdate, $request->Tdate);//get total expense\n\n return array($ncTF, $bcTF, $ncEF, $bcEF, $ncExtF, $bcExtF, $stationary, $otherIncm, $admRefM, $cosM, $admDisMexp, $expM, $totIncome, $totExpense);\n }", "public function show_other_expense_review_by_date($date_from,$date_to)\n {\n $query = $this->db->query(\"SELECT `date`,GROUP_CONCAT(`purpose`) as purpose, GROUP_CONCAT(`amount`) as amount, SUM(`amount`) as rowtotal FROM `expense` WHERE DATE(`date`) BETWEEN STR_TO_DATE('$date_from', '%Y-%m-%d') AND STR_TO_DATE('$date_to', '%Y-%m-%d') GROUP BY `date` \");\n return $query->result();\n }", "public function getSelectedDayLoanDetails($selectedDate) {\n\n\n date_default_timezone_set(\"Asia/Calcutta\");\n $time = date('H:i:s');\n $today = date('Y-m-d H:i:s');\n\n $numOfInstallments = DefaultData::getNumOfInstlByPeriodAndType($this->loan_period, $this->installment_type);\n $first_installment_date = '';\n $paid_aditional_interrest = 0;\n $INSTALLMENT = new Installment(NULL);\n $total_paid_installment = 0;\n\n foreach ($INSTALLMENT->getInstallmentByLoan($this->id) as $installment) {\n $paid_aditional_interrest += $installment[\"additional_interest\"];\n $total_paid_installment = $total_paid_installment + $installment[\"paid_amount\"];\n }\n\n $loan_amount = $numOfInstallments * $this->installment_amount;\n $actual_due = $loan_amount - $total_paid_installment;\n\n //daily installment\n if ($this->installment_type == 30) {\n\n $FID = new DateTime($this->effective_date);\n $FID->modify('+1 day');\n $first_installment_date = $FID->format('Y-m-d ' . $time);\n\n\n $start = new DateTime($first_installment_date);\n $first_date = $start->format('Y-m-d ' . $time);\n\n $x = 0;\n $total_installment_amount = 0;\n $ins_total = 0;\n $total_paid = 0;\n $od_amount_all_array = array();\n\n $od_array = array();\n $last_od = array();\n $od_total = array();\n $last_od_balance = array();\n $od_balance_amount = array();\n\n while ($x < $numOfInstallments) {\n if ($numOfInstallments == 4) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 30) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 8) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 60) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 2) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 1) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 90) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 12) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 3) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 100) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 13) {\n $modify_range = '+7 day';\n }\n\n $date = $start->format('Y-m-d ' . $time);\n\n $paid_amount = 0;\n $od_amount = 0;\n $od_amount_all = 0;\n $balance = 0;\n $loan_proccesign_fee_paid = 0;\n $total_od_paid = 0;\n $paid_all_amount_before_ins_date = 0;\n $paid_all_od_before_ins_date = 0;\n $last_od_amount = 0;\n $od_interest = 0;\n\n $customer = $this->customer;\n $CUSTOMER = new Customer($customer);\n $route = $CUSTOMER->route;\n $center = $CUSTOMER->center;\n $installment_amount = $this->installment_amount;\n\n $FID = new DateTime($date);\n $FID->modify($modify_range);\n $day_remove = '-1 day';\n $FID->modify($day_remove);\n $second_installment_date = $FID->format('Y-m-d ' . $time);\n $amount = $this->installment_amount;\n\n $INSTALLMENT = new Installment(NULL);\n $ALl_AMOUNT = $INSTALLMENT->getAmountByLoanId($this->id);\n\n foreach ($INSTALLMENT->CheckInstallmetByPaidDate($date, $this->id) as $paid) {\n $paid_amount += $paid['paid_amount'];\n }\n\n foreach ($INSTALLMENT->getPaidAmountByBeforeDate($date, $this->id) as $before_payment_amount) {\n $paid_all_amount_before_ins_date += $before_payment_amount['paid_amount'];\n $paid_all_od_before_ins_date += $before_payment_amount['additional_interest'];\n }\n\n if (PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date)) {\n $start->modify($modify_range);\n } else {\n\n\n $ins_total += $amount;\n $total_paid += $paid_amount;\n $last_od_amount = (float) end($od_amount_all_array);\n\n $balance = $actual_due;\n\n $OD = new OD(NULL);\n $OD->loan = $this->id;\n $AllOd = $OD->allOdByLoan();\n\n\n //get daily loan od amount \n if (!$AllOd || PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date) || $ALl_AMOUNT[0] >= $ins_total) {\n \n } else {\n if ($AllOd) {\n foreach ($AllOd as $key => $allod) {\n\n if (strtotime($allod['od_date_start']) <= strtotime($date) && strtotime($date) <= strtotime($allod['od_date_end']) && (-1 * ($allod['od_interest_limit'])) > $balance) {\n\n if (strtotime($date) >= strtotime($selectedDate)) {\n break;\n }\n\n $ODDATES = new DateTime($date);\n $ODDATES->modify(' +23 hours +59 minutes +58 seconds');\n\n $od_date_morning = $ODDATES->format('Y-m-d H:i:s');\n\n $paid_all_amount_before_ins_date1 = 0;\n $before_payment_amounts1 = $INSTALLMENT->getPaidAmountByBeforeDate($od_date_morning, $this->id);\n\n foreach ($before_payment_amounts1 as $before_payment_amount1) {\n $paid_all_amount_before_ins_date1 += $before_payment_amount1['paid_amount'];\n }\n\n $od_interest = $this->getOdIntereset1(-$ins_total + $paid_all_amount_before_ins_date1, $allod['od_interest_limit']);\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array), 2));\n\n if ($od_amount_all > 0 || $paid_all_od_before_ins_date == $last_od_amount) {\n\n array_push($od_amount_all_array, $od_amount_all);\n }\n }\n }\n }\n }\n\n $total_installment_amount += $installment_amount;\n\n if (strtotime($selectedDate) <= strtotime($date)) {\n break;\n }\n\n $start->modify($modify_range);\n $x++;\n\n //end of the installment\n if ($numOfInstallments == $x) {\n\n $ODDATES = new DateTime($date);\n $ODDATES->modify('+23 hours +59 minutes +58 seconds');\n $od_date_morning = $ODDATES->format('Y-m-d H:i:s');\n\n //check log ends with od or installment\n $last_od_date = date('D/M/Y', strtotime($od_date_morning));\n $last_installment_date = date('D/M/Y', strtotime($date));\n\n if ($last_od_date == $last_installment_date) {\n $last_loop_od = $od_interest;\n } else {\n $last_loop_od = 0;\n }\n\n //get installment end date\n $INSTALLMENT_END = new DateTime($date);\n $INSTALLMENT_END->modify('+1 day');\n $installment_end = $INSTALLMENT_END->format('Y-m-d H:i:s');\n\n //get 5 years ahead date from installment end date\n $INSTALLMENT_UNLIMITED_END = new DateTime($date);\n $INSTALLMENT_UNLIMITED_END->modify('+1725 day');\n $installment_unlimited_end = $INSTALLMENT_UNLIMITED_END->format('Y-m-d H:i:s');\n\n\n $start = strtotime($date);\n $end = strtotime(date(\"Y/m/d\"));\n $days_between = floor(abs($end - $start) / 86400) - 1;\n $od = $OD->allOdByLoanAndDate($date, $balance);\n $y = 0;\n\n $od_date_start1 = new DateTime($date);\n $od_date_start1->modify('+47 hours +59 minutes +58 seconds');\n\n $defult_val = $days_between;\n $od_amount_all_array_1 = array();\n\n while ($y <= $defult_val) {\n\n if ($od['od_date_start'] <= $od_date_start1) {\n $od_dates = '+1 day';\n }\n\n $od_date = $od_date_start1->format('Y-m-d H:i:s');\n\n //getting echo $od_date; before of date from current od date\n $OLDODDATE = new DateTime($od_date);\n $od_date_remove1 = '-23 hours -59 minutes -58 seconds';\n\n $OLDODDATE->modify($od_date_remove1);\n $old_od_date = $OLDODDATE->format('Y-m-d H:i:s');\n\n if (strtotime($selectedDate) < strtotime($old_od_date) || strtotime($selectedDate) < strtotime($od_date) || strtotime($od['od_date_end'] . $time) < strtotime($old_od_date)) {\n break;\n }\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array), 2));\n\n if ($od_amount_all > 0 || $paid_all_od_before_ins_date == $last_od_amount) {\n\n array_push($od_amount_all_array_1, $od_amount_all);\n }\n\n $od_date_start1->modify($od_dates);\n\n $y++;\n }\n\n $last_od_amount = (float) end($od_amount_all_array_1);\n }\n }\n }\n //weekly installment\n } else if ($this->installment_type == 4) {\n\n $FID = new DateTime($this->effective_date);\n $FID->modify('+7 day');\n $first_installment_date = $FID->format('Y-m-d ' . $time);\n\n\n $start = new DateTime($first_installment_date);\n $first_date = $start->format('Y-m-d ' . $time);\n\n $x = 0;\n $total_installment_amount = 0;\n $ins_total = 0;\n $total_paid = 0;\n $od_amount_all_array = array();\n $od_array = array();\n $last_od = array();\n $od_total = array();\n $last_od_balance = array();\n $od_balance_amount = array();\n\n while ($x < $numOfInstallments) {\n if ($numOfInstallments == 4) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 30) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 8) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 60) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 2) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 1) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 90) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 12) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 3) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 100) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 13) {\n $modify_range = '+7 day';\n }\n\n $date = $start->format('Y-m-d ' . $time);\n\n $paid_amount = 0;\n $od_amount = 0;\n $od_amount_all = 0;\n $balance = 0;\n $loan_proccesign_fee_paid = 0;\n $total_od_paid = 0;\n $paid_all_amount_before_ins_date = 0;\n $paid_all_od_before_ins_date = 0;\n\n\n $customer = $this->customer;\n $CUSTOMER = new Customer($customer);\n $route = $CUSTOMER->route;\n $center = $CUSTOMER->center;\n $installment_amount = $this->installment_amount;\n\n $FID = new DateTime($date);\n $FID->modify($modify_range);\n $day_remove = '-1 day';\n $FID->modify($day_remove);\n $second_installment_date = $FID->format('Y-m-d ' . $time);\n $amount = $this->installment_amount;\n $od_night = date(\"Y/m/d\");\n\n $INSTALLMENT = new Installment(NULL);\n $ALl_AMOUNT = $INSTALLMENT->getAmountByLoanId($this->id);\n\n foreach ($INSTALLMENT->CheckInstallmetByPaidDate($date, $this->id) as $paid) {\n $paid_amount += $paid['paid_amount'];\n }\n\n if (PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date)) {\n $start->modify($modify_range);\n } else {\n\n $last_od_amount = (float) end($od_amount_all_array);\n $ins_total += $amount;\n $total_paid += $paid_amount;\n\n $balance = $total_paid_installment - $ins_total;\n\n\n $OD = new OD(NULL);\n $OD->loan = $this->id;\n $od = $OD->allOdByLoanAndDate($date, $balance);\n\n if (strtotime(date(\"Y/m/d\")) < strtotime($date) || PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date) || $ALl_AMOUNT[0] >= $ins_total) {\n \n } else {\n if ($od !== false) {\n\n $od_interest = $this->getOdIntereset(-$ins_total + $paid_all_amount_before_ins_date, $od['od_interest_limit']);\n\n $y = 0;\n $od_date_start = new DateTime($date);\n $defult_val = 6;\n\n while ($y <= $defult_val) {\n\n if ($defult_val <= 6 && $this->od_date <= $od_date_start) {\n $od_dates = '+1 day';\n }\n\n $od_date = $od_date_start->format('Y-m-d H:i:s');\n\n //// od dates range\n $ODDATES = new DateTime($od_date);\n $ODDATES->modify($od_dates);\n\n $od_date_remove = '-1 day -23 hours -59 minutes -58 seconds';\n\n $ODDATES->modify($od_date_remove);\n $od_night = $ODDATES->format('Y-m-d H:i:s');\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array)));\n\n\n if (strtotime($od_date) >= strtotime($selectedDate)) {\n break;\n }\n array_push($od_amount_all_array, $od_interest);\n\n\n $od_date_start->modify($od_dates);\n $y++;\n }\n $last_od_amount = (float) end($od_amount_all_array);\n }\n }\n }\n\n if ($selectedDate . \" \" . $time == $date) {\n $total_installment_amount += $installment_amount;\n if (strtotime(date(\"Y/m/d\")) < strtotime($date) || strtotime($selectedDate) < strtotime($date)) {\n break;\n }\n } else {\n if (strtotime(date(\"Y/m/d\")) < strtotime($date) || strtotime($selectedDate) < strtotime($date)) {\n break;\n }\n $total_installment_amount += $installment_amount;\n }\n\n\n $start->modify($modify_range);\n $x++;\n\n if ($numOfInstallments == $x) {\n //get installment end date\n $INSTALLMENT_END = new DateTime($date);\n $INSTALLMENT_END->modify('+7 day');\n $installment_end = $INSTALLMENT_END->format('Y-m-d H:i:s');\n\n //get 5 years ahead date from installment end date\n $INSTALLMENT_UNLIMITED_END = new DateTime($date);\n $INSTALLMENT_UNLIMITED_END->modify('+1725 day');\n $installment_unlimited_end = $INSTALLMENT_UNLIMITED_END->format('Y-m-d H:i:s');\n\n\n $start = strtotime($date);\n $end = strtotime(date(\"Y/m/d\"));\n\n $days_between = floor(abs($end - $start) / 86400) - 1;\n\n $z = 0;\n\n $od_date_start1 = new DateTime($od_night);\n $od_date_start1->modify('+1 day +23 hours +59 minutes +58 seconds');\n $defult_val = $days_between;\n\n //if having od after installment end\n if ($od !== false) {\n\n $last_od_date = date('D/M/Y', strtotime($od_night));\n $last_installment_date = date('D/M/Y', strtotime($date));\n\n if ($last_od_date == $last_installment_date) {\n $last_loop_od = $od_interest;\n } else {\n $last_loop_od = 0;\n }\n\n// $od_amount_all_array_1 = array();\n\n while ($z <= $defult_val) {\n\n if ($od['od_date_start'] <= $od_date_start1) {\n $od_dates = '+1 day';\n }\n\n\n $od_date1 = $od_date_start1->format('Y-m-d H:i:s');\n\n //getting brfore of date from current od date\n $OLDODDATE = new DateTime($od_date1);\n $od_date_remove1 = '-23 hours -59 minutes -58 seconds';\n\n $OLDODDATE->modify($od_date_remove1);\n $old_od_date = $OLDODDATE->format('Y-m-d H:i:s');\n\n if (strtotime($selectedDate) <= strtotime($od_date1)) {\n break;\n }\n\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array)));\n\n// if ($od_amount_all > 0 || $paid_all_od_before_ins_date == $last_od_amount) {\n//\n// array_push($od_amount_all_array_1, $od_amount_all);\n// }\n array_push($od_amount_all_array, $od_interest);\n\n// $last_od_amount = (float) end($od_amount_all_array_1);\n $od_date_start1->modify($od_dates);\n $z++;\n }\n }\n }\n }\n } else if ($this->installment_type == 1) {\n\n $FID = new DateTime($this->effective_date);\n $FID->modify('+1 months');\n $first_installment_date = $FID->format('Y-m-d ' . $time);\n\n\n $start = new DateTime($first_installment_date);\n $first_date = $start->format('Y-m-d ' . $time);\n\n $x = 0;\n $no_of_installments = 0;\n $total_installment_amount = 0;\n $ins_total = 0;\n $total_paid = 0;\n $od_amount_all_array = array();\n $od_array = array();\n $last_od = array();\n $od_total = array();\n $last_od_balance = array();\n $od_balance_amount = array();\n\n while ($x < $numOfInstallments) {\n if ($numOfInstallments == 4) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 30) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 8) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 60) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 2) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 1) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 90) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 12) {\n $modify_range = '+7 day';\n } elseif ($numOfInstallments == 3) {\n $modify_range = '+1 months';\n } elseif ($numOfInstallments == 100) {\n $modify_range = '+1 day';\n } elseif ($numOfInstallments == 13) {\n $modify_range = '+7 day';\n }\n\n $date = $start->format('Y-m-d ' . $time);\n\n $paid_amount = 0;\n $od_amount = 0;\n $od_amount_all = 0;\n $balance = 0;\n $loan_proccesign_fee_paid = 0;\n $total_od_paid = 0;\n $paid_all_amount_before_ins_date = 0;\n $paid_all_od_before_ins_date = 0;\n\n $customer = $this->customer;\n $CUSTOMER = new Customer($customer);\n $route = $CUSTOMER->route;\n $center = $CUSTOMER->center;\n $installment_amount = $this->installment_amount;\n\n $FID = new DateTime($date);\n $FID->modify($modify_range);\n $day_remove = '-1 day';\n $FID->modify($day_remove);\n $second_installment_date = $FID->format('Y-m-d ' . $time);\n $amount = $this->installment_amount;\n\n $INSTALLMENT = new Installment(NULL);\n $ALl_AMOUNT = $INSTALLMENT->getAmountByLoanId($this->id);\n\n foreach ($INSTALLMENT->CheckInstallmetByPaidDate($date, $this->id) as $paid) {\n $paid_amount += $paid['paid_amount'];\n }\n\n $before_payment_amounts = $INSTALLMENT->getPaidAmountByBeforeDate($date, $this->id);\n\n foreach ($before_payment_amounts as $before_payment_amount) {\n $paid_all_amount_before_ins_date += $before_payment_amount['paid_amount'];\n $paid_all_od_before_ins_date += $before_payment_amount['additional_interest'];\n }\n\n if (PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date)) {\n $start->modify($modify_range);\n } else {\n\n $last_od_amount = (float) end($od_amount_all_array);\n $ins_total += $amount;\n $total_paid += $paid_amount;\n\n $balance = $paid_all_od_before_ins_date + $paid_all_amount_before_ins_date - $ins_total - $last_od_amount;\n\n $OD = new OD(NULL);\n $OD->loan = $this->id;\n $od = $OD->allOdByLoanAndDate($date, $balance);\n\n if (PostponeDate::CheckIsPostPoneByDateAndCustomer($date, $customer) || PostponeDate::CheckIsPostPoneByDateAndRoute($date, $route) || PostponeDate::CheckIsPostPoneByDateAndCenter($date, $center) || PostponeDate::CheckIsPostPoneByDateAndAll($date) || PostponeDate::CheckIsPostPoneByDateCenterAll($date) || PostponeDate::CheckIsPostPoneByDateRouteAll($date) || $ALl_AMOUNT[0] >= $ins_total) {\n \n } else {\n if ($od !== false) {\n $y = 0;\n //get how many dates in month\n $dateValue = strtotime($date);\n $year = date(\"Y\", $dateValue);\n $month = date(\"m\", $dateValue);\n\n $daysOfMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year);\n\n $od_date_start = new DateTime($date);\n $defult_val = $daysOfMonth - 1;\n $od_interest = $this->getOdIntereset(-$ins_total + $paid_all_amount_before_ins_date, $od['od_interest_limit']);\n\n while ($y <= $defult_val) {\n\n if ($defult_val <= $daysOfMonth - 1 && $this->od_date <= $od_date_start) {\n $od_dates = '+1 day';\n }\n\n $od_date = $od_date_start->format('Y-m-d');\n\n\n if (strtotime($date) >= strtotime($selectedDate) || strtotime($od_date) >= strtotime($selectedDate)) {\n break;\n }\n $ODDATES = new DateTime($od_date);\n $ODDATES->modify($od_dates);\n\n $od_date_remove = '-1 day -23 hours -59 minutes -58 seconds';\n\n $ODDATES->modify($od_date_remove);\n\n $od_night = $ODDATES->format('Y-m-d H:i:s');\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array), 2));\n\n array_push($od_amount_all_array, $od_amount_all);\n\n $od_date_start->modify($od_dates);\n $y++;\n }\n }\n }\n }\n\n if ($selectedDate . \" \" . $time == $date) {\n $total_installment_amount += $installment_amount;\n if (strtotime(date(\"Y/m/d\")) < strtotime($date) || strtotime($selectedDate) < strtotime($date)) {\n break;\n }\n } else {\n if (strtotime(date(\"Y/m/d\")) < strtotime($date) || strtotime($selectedDate) < strtotime($date)) {\n break;\n }\n $total_installment_amount += $installment_amount;\n }\n\n $start->modify($modify_range);\n $x++;\n\n if ($numOfInstallments == $x) {\n\n //get installment end date\n $INSTALLMENT_END = new DateTime($date);\n $INSTALLMENT_END->modify('+' . $daysOfMonth . ' day');\n $installment_end = $INSTALLMENT_END->format('Y-m-d H:i:s');\n\n //get 5 years ahead date from installment end date\n $INSTALLMENT_UNLIMITED_END = new DateTime($date);\n $INSTALLMENT_UNLIMITED_END->modify('+1725 day');\n $installment_unlimited_end = $INSTALLMENT_UNLIMITED_END->format('Y-m-d H:i:s');\n\n\n $start = strtotime($date);\n $end = strtotime(date(\"Y/m/d\"));\n\n $days_between = floor(abs($end - $start) / 86400) - 1;\n\n $z = 0;\n\n $od_date_start1 = new DateTime($od_night);\n $od_date_start1->modify('+1 day +23 hours +59 minutes +58 seconds');\n\n $defult_val = $days_between;\n\n //if having od after installment end\n if ($od !== false) {\n\n $last_od_date = date('D/M/Y', strtotime($od_night));\n $last_installment_date = date('D/M/Y', strtotime($date));\n\n $od_amount_all_array_1 = array();\n while ($z <= $defult_val) {\n\n if ($od['od_date_start'] <= $od_date_start1) {\n $od_dates = '+1 day';\n }\n\n $od_date1 = $od_date_start1->format('Y-m-d');\n\n //getting brfore of date from current od date\n $OLDODDATE = new DateTime($od_date1);\n\n $od_date_remove1 = '-23 hours -59 minutes -58 seconds';\n\n $OLDODDATE->modify($od_date_remove1);\n\n $old_od_date = $OLDODDATE->format('Y-m-d H:i:s');\n if (strtotime($selectedDate) <= strtotime($old_od_date) || strtotime($od['od_date_end'] . $time) < strtotime($old_od_date)) {\n break;\n }\n $last_od_amount = (float) end($od_amount_all_array_1);\n\n $od_array[] = $od_interest;\n $od_amount_all = json_encode(round(array_sum($od_array), 2));\n\n if ($od_amount_all > 0 || $paid_all_od_before_ins_date == $last_od_amount) {\n\n array_push($od_amount_all_array_1, $od_amount_all);\n }\n\n $od_date_start1->modify($od_dates);\n $z++;\n }\n }\n }\n }\n }\n\n $last_od_amount_balance = $last_od_amount - $paid_aditional_interrest;\n\n if ($last_od_amount_balance > 0) {\n $last_od_amount_balance = $last_od_amount_balance;\n } else {\n $last_od_amount_balance = 0;\n }\n\n $all_arress = ($total_paid_installment) - ($total_installment_amount );\n $system_due = $loan_amount - $total_installment_amount;\n $system_due_num_of_ins = $system_due / $this->installment_amount;\n $actual_due_num_of_ins = $actual_due / $this->installment_amount;\n\n\n if ($this->installment_type == 4 || $this->installment_type == 1) {\n $actual_due = $all_arress + ($last_od_amount - $paid_aditional_interrest);\n }\n return [\n 'date' => $date,\n 'od_amount' => $last_od_amount_balance,\n 'all_arress' => $all_arress,\n 'all_amount' => $balance,\n 'system-due-num-of-ins' => $system_due_num_of_ins,\n 'system-due' => $system_due,\n 'actual-due-num-of-ins' => $actual_due_num_of_ins,\n 'actual-due' => $actual_due,\n 'receipt-num-of-ins' => $total_paid_installment / $this->installment_amount,\n 'receipt' => $total_paid_installment + $paid_aditional_interrest,\n 'arrears-excess-num-of-ins' => ($total_installment_amount - $total_paid_installment) / $this->installment_amount,\n 'arrears-excess' => $total_installment_amount - $total_paid_installment,\n 'installment_amount' => $amount,\n ];\n }", "public function testReport(){\n // $autoTaskTools->checkTask('AutoDaySessReport');\n // $date = array(\n // date_to_int('-',date('Y-m-01', strtotime('-1 month'))),\n // date_to_int('-',date('Y-m-t', strtotime('-1 month'))),\n // );\n\n $reportTools = new ReportTools();\n $reportTools->saveReportList('AutoDaySessReport');\n\n\n $BeginDate = date('Y-m-01', strtotime(date(\"Y-m-d\")));\n $date = array(\n date_to_int('-',$BeginDate),\n date_to_int('-',date('Y-m-d', strtotime(\"$BeginDate +1 month -1 day\"))),\n );\n $month = date('Y-m-01', strtotime('-1 month'));\n $month1 = date('Y-m-t', strtotime('-1 month'));\n dump($month);\n dump($month1);\n $mytime = date(\"Y-01-01\", strtotime(\"-1 year\"));\n dump($mytime);\n $monthEndDays = cal_days_in_month(CAL_GREGORIAN, 12, date(\"Y\", strtotime(\"-1 year\")));\n $year = date(\"Y-12-\".$monthEndDays, strtotime(\"-1 year\"));\n echo 'year:' . $year;\n $monthDays = cal_days_in_month(CAL_GREGORIAN, date('m',strtotime('-1 month')), date('Y'));\n dump($monthDays);\n echo 'n:' . date('n');\n $season = ceil((date('n'))/3)-1;\n echo '<br>上季度起始时间:<br>';\n echo date('Y-m-d H:i:s', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),\"\\n\";\n echo date('Y-m-d H:i:s', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date(\"Y\"))),date('Y'))),\"\\n\";\n //获取第几季度\n // $season = ceil((date('n'))/3);\n // echo date('m', mktime(0, 0, 0,$season*3-3+1,1,date('Y'))),\"\\n\";\n // echo date('Y-m-d', mktime(23,59,59,$season*3,date('t',mktime(0, 0 , 0,$season*3,1,date(\"Y\"))),date('Y'))),\"\\n\";\n dump($season);\n // $daySessReportTools = new DaySessReportTools();\n // $daySessReportTools->getDateList($date);\n // $daySessReportTools->daySessExcelGen($date);\n //\n // $dayErrorReportTools = new DayErrorReportTools();\n // $dayErrorReportTools->dayErrorExcelGen($date);\n // $daySessReportTools->getDateList($date);\n $str = stristr('DaySuccessReport_UID_2017-06-29.xlsx','_',true);\n dump($str);\n $this->display();\n }", "public static function getSalePerDay($i,$month,$year,$branch)\n {\n $str = $i. '-' . $month . '-' . $year;\n $date = date('Y-m-d', strtotime($str));\n $data = DB::table('month_sales')->where('branch_id', $branch)->where('_date', $date)->first();\n\n $with_receipt_total = 0;\n $with_out_receipt_total = 0;\n $credit_total = 0;\n $expense_total = 0;\n $return_total = 0;\n $total_amount = 0;\n $taken_total = 0;\n $deposit_total = 0;\n $is_check = 2;\n $coh = 0;\n\n\n $expense_string = '';\n $firstRec ='' ;\n $lastRec ='' ;\n\n $number_of_check = 0;\n\n if($data != null){\n $json_data = json_decode($data->data,TRUE);\n\n\n $rec_no = [];\n foreach ($json_data['with_receipt'] as $key => $val){\n $total =0;\n if($val['rec_amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['rec_amount'];\n }\n $with_receipt_total = $with_receipt_total + $total ;\n array_push($rec_no,$val['rec_no']);\n\n $number_of_check = $number_of_check + (isset($val['is_check']) ? 1 : 0 );\n }\n\n $firstRec = $rec_no[0];\n $lastRec = $rec_no[count($rec_no) - 1];\n\n foreach ($json_data['without_receipt'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $with_out_receipt_total = $with_out_receipt_total + $total ;\n }\n foreach ($json_data['credit'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $credit_total = $credit_total + $total ;\n }\n foreach ($json_data['expense'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $expense_total = $expense_total + $total ;\n\n $expense_string .= $val['details'].' ';\n\n }\n foreach ($json_data['return'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $return_total = $return_total + $total ;\n }\n\n\n $amount_1000 = ($json_data['amount_1000'] != null) ? json_decode($data->data,TRUE)['amount_1000'] * 1000 : 0;\n $amount_500 = ($json_data['amount_500'] != null) ? json_decode($data->data,TRUE)['amount_500'] * 500 : 0;\n $amount_100 = ($json_data['amount_100'] != null) ? json_decode($data->data,TRUE)['amount_100'] * 100 : 0;\n $amount_50 = ($json_data['amount_50'] != null) ? json_decode($data->data,TRUE)['amount_50'] * 50 : 0;\n $amount_20 = ($json_data['amount_20'] != null || json_decode($data->data,TRUE)['amount_20'] != '') ? json_decode($data->data,TRUE)['amount_20'] * 20 : 0;\n $amount_coins = ($json_data['amount_coins'] != null) ? json_decode($data->data,TRUE)['amount_coins'] : 0;\n $total_amount = $amount_1000 + $amount_500 + $amount_100 + $amount_50 +$amount_20+ $amount_coins;\n $is_check = (isset($json_data['is_check'])) ? json_decode($data->data,TRUE)['is_check'] : $is_check;\n $coh = (isset($json_data['coh'])) ? json_decode($data->data,TRUE)['coh'] : $coh;\n\n foreach (json_decode($data->data,TRUE)['taken'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $taken_total = $taken_total + $total ;\n }\n foreach (json_decode($data->data,TRUE)['deposit'] as $key => $val){\n $total =0;\n if($val['amount'] == 'null'){\n $total= 0;\n }else{\n $total = $val['amount'];\n }\n $deposit_total = $deposit_total + $total ;\n }\n\n }\n\n\n $_data =[\n 'with_receipt_total' =>$with_receipt_total,\n 'with_out_receipt_total' =>$with_out_receipt_total,\n 'credit_total' =>$credit_total,\n 'expense_total' =>$expense_total,\n 'return_total' =>$return_total,\n 'amount_total' =>$total_amount,\n 'taken_total' =>$taken_total,\n 'deposit_total' =>$deposit_total,\n 'data' =>($data != null) ? $data->data : '',\n 'date' =>$date,\n 'is_check'=>$is_check,\n 'coh'=>$coh,\n 'expense_details'=>$expense_string,\n 'rec_no'=>$firstRec.'-'.$lastRec,\n 'number_of_check' =>$number_of_check\n\n\n ];\n\n\n return json_encode($_data);\n\n }", "public function vbd_report_other_datewise()\n\t\t{\n\t\t\t$this->load->view('admin/header');\n\t\t\t$this->load->view('admin/nav');\n\t\t\t$data['get_state']=$this->Mod_report->get_state();\n\t\t\t$data['get_institute']=$this->Mod_report->get_institute();\n\t\t\t$this->load->view('reports/vbd_report_other_datewise',$data);\t\t\n\t\t\t$this->load->view('admin/footer');\t\n\n\t\t}", "public function overAllSummaryReportView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('door_holiday',0)->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // attendent holiday count\n $attendent_holiday_count = DB::table('holiday')->where('attendent_holiday',0)->where('holiday_date',$from)->count();\n // total staff\n $total_staff_count = DB::table('users')->where('trasfer_status',0)->whereNotIn('type',[10])->count();\n // total teacher count \n $total_teacher_count = DB::table('users')->where('trasfer_status',0)->where('type',3)->count();\n // total staff enter into the campus\n $total_staff_enter_into_campus = DB::table('tbl_door_log')->where('type',1)->whereNotIn('user_type',[10])->where('enter_date',$from)->distinct('user_id')->count('user_id');\n\n // total staff leave\n $total_staff_leave_count = DB::table('tbl_leave')->where('final_request_from',$from)->where('status',1)->count();\n $total_teacher_leave_count = DB::table('tbl_leave')\n ->join('users', 'users.id', '=', 'tbl_leave.user_id')\n ->select('tbl_leave.*')\n ->where('users.type', 3)\n ->where('final_request_from',$from)\n ->where('status',1)\n ->count();\n $total_teacher_attendent_in_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->distinct('teacherId')->count('teacherId');\n // total class of this day\n $total_class_count = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->count();\n\n // total teacher attendent class\n $teacher_taken_total_class_class = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->count();\n #--------------------------------- student section------------------------------------#\n $total_student_count = DB::table('student')\n ->join('semister', 'student.semister_id', '=', 'semister.id')\n ->select('student.*')\n ->where('student.year', $from_year)\n ->where('student.status', 0)\n ->where('semister.status',1)\n ->count();\n $total_student_enter_into_campus = DB::table('tbl_door_log')->where('type',2)->where('enter_date',$from)->distinct('student_id')->count('student_id');\n $total_student_enter_into_class = DB::table('student_attendent')->where('created_at',$from)->distinct('studentId')->count('studentId');\n // total hours class of this day\n $total_class_hour_in_routine = DB::table('routine')\n ->join('semister', 'routine.semister_id', '=', 'semister.id')\n ->select('routine.*')\n ->where('routine.year', $from_year)\n ->where('routine.day', $current_day)\n ->where('semister.status',1)\n ->get();\n // total hours class held\n $total_hours_class_held_query = DB::table('teacher_attendent')->where('created_at',$from)->where('status',1)->where('type',3)->get(); \n\n return view('view_report.overAllSummaryReportView')\n ->with('total_staff_count',$total_staff_count)\n ->with('total_teacher_count',$total_teacher_count)\n ->with('total_staff_enter_into_campus',$total_staff_enter_into_campus)\n ->with('total_staff_leave_count',$total_staff_leave_count)\n ->with('total_teacher_leave_count',$total_teacher_leave_count)\n ->with('total_teacher_attendent_in_class',$total_teacher_attendent_in_class)\n ->with('total_class_count',$total_class_count)\n ->with('teacher_taken_total_class_class',$teacher_taken_total_class_class)\n ->with('from',$from)\n ->with('attendent_holiday_count',$attendent_holiday_count)\n ->with('total_student_count',$total_student_count)\n ->with('total_student_enter_into_campus',$total_student_enter_into_campus)\n ->with('total_student_enter_into_class',$total_student_enter_into_class)\n ->with('total_class_hour_in_routine',$total_class_hour_in_routine)\n ->with('total_hours_class_held_query',$total_hours_class_held_query)\n ;\n }", "public function getReportedDate();", "public function expired_report()\n{\n\t$expiration_date=Input::get('expiration_date');\n\tif($expiration_date=='')\n\t{\n\t\t$fecha = date('Y-m-j');\n\t\t$nuevafecha = strtotime ( '+3 month' , strtotime ( $fecha ) ) ;\n\t\t$nuevafecha = date ( 'Y-m-j' , $nuevafecha );\n\t\t$data_items=Item::join('bodega_productos','items.id','=', 'bodega_productos.id_product')\n\t\t->where('items.expiration_date','>',$nuevafecha)\n\t\t->select('items.id'\n\t\t,'items.item_name'\n\t\t,'items.selling_price'\n\t\t,'items.cost_price'\n\t\t,'items.minimal_existence'\n\t\t,'bodega_productos.quantity'\n\t\t,'items.expiration_date')\n\t\t->get();\n\t\t//cambiamos el formato de la fecha\n\t\t$array_Fecha= explode('-',$nuevafecha);\n\t\t$fecha_formateada=$array_Fecha[2].'/'.$array_Fecha[1].'/'.$array_Fecha[0];\n\t\treturn view('report.listProduct_expirate')->with('data_items',$data_items)->with('date_parameters',$fecha_formateada);\n\t}\n\telse\n\t{\n\t\t$date = explode('/', $expiration_date);\n\t\t$ndate = $date[2].'-'.$date[1].'-'.$date[0];\n\t\t$data_items=Item::join('bodega_productos','items.id','=', 'bodega_productos.id_product')\n\t\t->where('items.expiration_date','>',$ndate)\n\t\t->select('items.id'\n\t\t,'items.item_name'\n\t\t,'items.selling_price'\n\t\t,'items.cost_price'\n\t\t,'items.minimal_existence'\n\t\t,'bodega_productos.quantity'\n\t\t,'items.expiration_date')\n\t\t->get();\n\t\treturn view('report.listProduct_expirate')->with('data_items',$data_items)\n\t\t->with('date_parameters',$expiration_date);\n\t}\n\n}", "public function cusreports()\n {\n //\n \t\n\t\t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t\t$rintrest = Input::get('return_intrest');\n\t\t$infound = Input::get('intrests_found');\n\t\t\n\t\tif($rintrest==1){\n\t\t\tif($infound==1){\n\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\telseif($infound==2){\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','=',0)\n\t ->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t else{\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','<>',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','<>',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t}\t\nelseif($rintrest==2){\n\t\t\tif($infound==1){\n\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\telseif($infound==2){\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',1)\n\t ->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t else{\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','<>',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','<>',0)\n\t\t\t ->where('have_intrests','=',1)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t}\t\t\t\nelse{\n\t\t\tif($infound==1){\n\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\n\t\t\telseif($infound==2){\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t ->where('planinterest_date','<=',$end_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',0)\n\t ->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','=',0)\n\t\t\t\t\t\t\t\t\t->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t else{\n\t\t\t\t $loggeduser=$loggeduser=\\App::make('authenticator')->getLoggedUser(); \n if(array_key_exists('_branch',$loggeduser->permissions)){\n \t $intrests=t_interestdetail::where('user_id',$loggeduser->id)\n\t ->where('planinterest_date','>',$start_date)\n\t\t\t\t\t\t\t\t\t ->where('principal_money','<>',0)\n\t\t\t\t\t\t\t\t\t ->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t}\n\t\t\telse{\n\t\t\t $intrests=t_interestdetail::where('planinterest_date','>',$start_date)\n\t\t\t ->where('principal_money','<>',0)\n\t\t\t ->where('have_intrests','=',0)\n\t ->where('planinterest_date','<=',$end_date)->get();\n\t\t\t\n\t\t\t}\n\t\t\t}\t\t\n\t\t}\t\t\t\t\t\t\t\n\t if($intrests->count())\n\t {\n\t \t $timerange=\"本时间段\";\n\t \t$filename=$intrests->first()->id . time();\n\t \\Excel::create($filename, function($excel) use ($intrests,$timerange) {\n $excel->sheet('New sheet', function($sheet) use ($intrests,$timerange) {\n $sheet->loadView('cusreports')\n\t\t\t ->withTimerange($timerange) \n ->withIntrests($intrests) ;\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本时间段无分红明细');\n\t }\n\t \n\t \n }", "public function product_wise_report()\n\t{\n\t\t$today = date('m-d-Y');\n\t\t$this->db->select(\"a.*,b.customer_id,b.customer_name\");\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('customer_information b','b.customer_id = a.customer_id');\n\t\t$this->db->where('a.date',$today);\n\t\t$this->db->order_by('a.invoice_id','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "function export_pnh_sales_report()\r\n\t {\r\n\t \t\r\n\t \t$this->erpm->auth(PNH_EXECUTIVE_ROLE|FINANCE_ROLE);\r\n\t \t\r\n\t \t//ssql to generate franchise list \r\n\t \t$sql_f = \"select pnh_franchise_id,franchise_id,login_mobile1,login_mobile2,franchise_name,b.territory_name,c.town_name \r\n\t \t\t\t\t\t\tfrom pnh_m_franchise_info a \r\n\t \t\t\t\t\t\tjoin pnh_m_territory_info b on a.territory_id = b.id\r\n\t \t\t\t\t\t\tjoin pnh_towns c on c.id = a.town_id \r\n\t \t\t\t\t\t\torder by territory_name,town_name,franchise_name\";\r\n\t \t$res_f = $this->db->query($sql_f);\r\n\t \t\r\n\t \t$fr_sales_list = array();\r\n\t \t$fr_sales_list[] = '';\r\n\t \t$fr_sales_list[] = '\"Paynearhome Franchise Sales Summary Till - '.date('d/m/Y h:i a').'\"';\r\n\t \t$fr_sales_list[] = '';\r\n\t \t$fr_sales_list[] = '';\r\n\t \t$fr_sales_list[] = '\"Slno\",\"Territory\",\"Town\",\"Status\",\"FranciseID\",\"FranchiseName\",\"Contact no\",\"Ordered\",\"Shipped\",\"Invoiced Not Shipped\",\"Cancelled\",\"Paid Till Date\",\"UnCleared\",\"Corrections\",\"Credit Notes Raised\",\"Pending Payment\",\" Before 3 Days\",\"Before 5 Days\",\"Before 7 Day\",\"Before 10 Day\"';\r\n\t \t\r\n\t \t\r\n\t \tif($res_f->num_rows())\r\n\t \t{\r\n\t \t\t$i=0;\r\n\t \t\t// loop through all franchises \r\n\t \t\tforeach($res_f->result_array() as $row_f)\r\n\t \t\t{\r\n\t \t\t\t\r\n\t \t\t\t$fr_sales_det = array();\r\n\t \t\t\t$fr_sales_det[] = ++$i;\r\n\t\t\t\t$fr_sales_det[] = $row_f['territory_name'];\r\n\t\t\t\t$fr_sales_det[] = $row_f['town_name'];\r\n\t \t\t\t$fr_sales_det[] = $row_f['is_suspended']?'Suspended':'Active';\r\n\t\t\t\t$fr_sales_det[] = $row_f['pnh_franchise_id'];\r\n\t \t\t\t$fr_sales_det[] = ucwords($row_f['franchise_name']);\r\n\t \t\t\t\r\n\t\t\t\t$cnos = array($row_f['login_mobile1'],$row_f['login_mobile2']);\r\n\t \t\t\t$fr_sales_det[] = implode('/',array_filter($cnos));\r\n\t\t\t\t\r\n\t \t\t\t// get franchise total sales \r\n\t \t\t\t$ordered_tilldate = @$this->db->query(\"select round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\t\t\t\t\t\t\tfrom king_transactions a \r\n\t\t\t\t\t\t\t\t\tjoin king_orders b on a.transid = b.transid \r\n\t\t\t\t\t\t\t\t join pnh_m_franchise_info c on c.franchise_id = a.franchise_id \r\n\t\t\t\t\t\t\t\t\twhere a.franchise_id = ? \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t$cancelled_tilldate = @$this->db->query(\"select round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\t\t\t\t\t\t\tfrom king_transactions a \r\n\t\t\t\t\t\t\t\t\tjoin king_orders b on a.transid = b.transid \r\n\t\t\t\t\t\t\t\t join pnh_m_franchise_info c on c.franchise_id = a.franchise_id \r\n\t\t\t\t\t\t\t\t\twhere a.franchise_id = ? and b.status = 3 \",$row_f['franchise_id'])->row()->amt*1;\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$shipped_tilldate = @$this->db->query(\"SELECT round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM king_transactions a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_orders b ON a.transid = b.transid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN pnh_m_franchise_info c ON c.franchise_id = a.franchise_id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_invoice d ON d.order_id = b.id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN shipment_batch_process_invoice_link e ON e.invoice_no = d.invoice_no\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND e.shipped =1 AND e.packed =1\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE a.franchise_id = ? AND d.invoice_status = 1 and b.status != 0 \r\n\t\t\t\t\t\t\t\t\t\t \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t$sql = \"select sum(debit_amt-credit_amt) as amt \r\n\t\t\t\t\t\t\tfrom pnh_franchise_account_summary where action_type = 1 and franchise_id = ? \";\r\n\t\t\t\t$active_invoiced = $this->db->query($sql,array($row_f['franchise_id']))->row()->amt*1;\t\t\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t// invoiced not shipped \r\n\t\t\t\t$not_shipped_amount = $this->db->query(\" select sum(t) as amt from (\r\n\t\t\t\t\t\t\t\t\t\t\tselect a.invoice_no,debit_amt as t \r\n\t\t\t\t\t\t\t\t\t\t\t\tfrom pnh_franchise_account_summary a \r\n\t\t\t\t\t\t\t\t\t\t\t\tjoin king_invoice c on c.invoice_no = a.invoice_no and invoice_status = 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\twhere action_type = 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\tand franchise_id = ? \r\n\t\t\t\t\t\t\t\t\t\t\tgroup by a.invoice_no ) as a \r\n\t\t\t\t\t\t\t\t\t\t\tjoin shipment_batch_process_invoice_link b on a.invoice_no = b.invoice_no and shipped = 0 \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\r\n\t\t\t\t$shipped_tilldate = $active_invoiced-$not_shipped_amount;\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t//$cancelled_tilldate = $ordered_tilldate-$shipped_tilldate-$not_shipped_amount;\r\n\t\t\t\t\r\n\t\t\t\t$paid_tilldate = @$this->db->query(\"select sum(receipt_amount) as amt from pnh_t_receipt_info where receipt_type = 1 and status = 1 and franchise_id = ? \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\r\n\t\t\t\t$sql = \"select sum(credit_amt-debit_amt) as amt \r\n\t\t\t\t\t\t\tfrom pnh_franchise_account_summary where action_type = 5 and franchise_id = ? \";\r\n\t\t\t\t$acc_adjustments_val = $this->db->query($sql,array($row_f['franchise_id']))->row()->amt*1;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$sql = \"select sum(credit_amt-debit_amt) as amt \r\n\t\t\t\t\t\t\tfrom pnh_franchise_account_summary where action_type = 7 and franchise_id = ? \";\r\n\t\t\t\t$ttl_credit_note_val = $this->db->query($sql,array($row_f['franchise_id']))->row()->amt;\r\n\t\t\t\t\r\n\t\t\t\t$uncleared_payment = @$this->db->query(\"select sum(receipt_amount) as amt from pnh_t_receipt_info where status = 0 and franchise_id = ? and receipt_type = 1 \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\r\n\t\t\t\t$fr_sales_det[] = $ordered_tilldate;\r\n\t\t\t\t$fr_sales_det[] = $shipped_tilldate;\r\n\t\t\t\t$fr_sales_det[] = $not_shipped_amount;\r\n\t\t\t\t$fr_sales_det[] = $cancelled_tilldate;\r\n\t\t\t\t$fr_sales_det[] = $paid_tilldate;\r\n\t\t\t\t$fr_sales_det[] = $uncleared_payment;\r\n\t\t\t\t$fr_sales_det[] = $acc_adjustments_val;\r\n\t\t\t\t$fr_sales_det[] = $ttl_credit_note_val;\r\n\t\t\t\t$fr_sales_det[] = $shipped_tilldate-($paid_tilldate+$acc_adjustments_val+$ttl_credit_note_val);\r\n\t\t\t\t\r\n\t\t\t\t$past_sales_summ = array(3,5,7,10);\r\n\t\t\t\t\r\n\t\t\t\tforeach($past_sales_summ as $k)\r\n\t\t\t\t{\r\n\t\t\t\t\t$cond = ' and date(e.shipped_on) < date_add(curdate(),INTERVAL -'.$k.' day) ';\r\n\t\t\t\t\t$cond_pay = ' and date(from_unixtime(activated_on)) < date_add(curdate(),INTERVAL -'.$k.' day) ';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shipped_tilldate_byday = @$this->db->query(\"SELECT round(sum((i_orgprice-(i_coup_discount+i_discount))*b.quantity),2) as amt \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM king_transactions a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_orders b ON a.transid = b.transid\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN pnh_m_franchise_info c ON c.franchise_id = a.franchise_id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN king_invoice d ON d.order_id = b.id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN shipment_batch_process_invoice_link e ON e.invoice_no = d.invoice_no\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND e.shipped =1 AND e.packed = 1 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE a.franchise_id = ? AND d.invoice_status = 1 and b.status != 0 $cond \r\n\t\t\t\t\t\t\t\t\t\t\t \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t$paid_tilldate_byday = @$this->db->query(\"select sum(receipt_amount) as amt from pnh_t_receipt_info where receipt_type = 1 and status = 1 and franchise_id = ? \",$row_f['franchise_id'])->row()->amt*1;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$pen_pay_byday = ($shipped_tilldate_byday-($paid_tilldate_byday+$acc_adjustments_val+$ttl_credit_note_val));\r\n\r\n\t\t\t\t\t$fr_sales_det[] = ($pen_pay_byday>0)?$pen_pay_byday:0;\r\n\t\t\t\t\t\r\n\t\t\t\t}\t\t\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t$fr_sales_list[] = '\"'.implode('\",\"',$fr_sales_det).'\"';\r\n\t \t\t}\r\n\t \t} \r\n\t \t\r\n\t \theader('Content-Type: application/csv');\r\n\t\theader('Content-Disposition: attachment; filename=PNH_SALES_REPORT_'.date('d_m_Y_H_i').'.csv');\r\n\t\theader('Pragma: no-cache');\r\n\r\n\t \techo implode(\"\\r\\n\",$fr_sales_list);\r\n\t \t\r\n\t }", "public function product_wise_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.customer_id,b.customer_name\");\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('customer_information b','b.customer_id = a.customer_id');\n\t\t$this->db->where('a.date',$today);\n\t\t$this->db->order_by('a.invoice_id','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "function sales_report_day($date){\n \t\t$this->db->select('products.PRODUCT, SUM(sales.QUANTITY_SOLD) SALES, products.COST_PRICE, products.SALES_PRICE, sales.SALES_DATE');\n \t\t$this->db->from('sales');\n \t\t$this->db->join('products', 'products.PRODUCT_ID=sales.PRODUCT_ID', 'left');\n \t\t$this->db->where('sales.SALES_DATE', $date);\n \t\t$this->db->where('sales.STATUS', 'Confirmed');\n \t\t$this->db->group_by('sales.PRODUCT_ID');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}", "function quantizer_expenses_user_report($user = null, $start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerUsersExpenses($user, $start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function dailyReport()\n {\n return view('backend.invoice.daily-invoice-report');\n }", "public function prodreports()\n {\n //\n $productname = Input::get('productname');\n\t \t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t $product=m_product::where('product_name',$productname)->first();\n\t \n\t \t \n $lastWeek = Carbon::now()->startOfWeek();\n\t $nowdate = Carbon::now(); \n\t $contracts=t_contract::where('product_id',$product->id)\n\t ->where('pay_date','>',$start_date)\n\t ->where('pay_date','<=',$end_date)->get();\n\t if($contracts->count())\n\t {\n\t \t \n\t \t$filename=$product->product_id+time();\n\t \\Excel::create($filename, function($excel) use ($productname, $contracts) {\n $excel->sheet('New sheet', function($sheet) use ($productname, $contracts) {\n $sheet->loadView('pdreport') \n ->withProductname($productname)\n\t ->withContracts($contracts);\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本是时间段此产品下无合同产生');\n\t }\n\t \n\t \n\t \n \n }", "public function index()\n\t{\n\t\t\t$categories = Category::lists('categoryName', 'id');\n\t\t\t$expenseReport = Expense::all()->where('created_at', '=', date('Y-m-d'))->sortByDesc(\"id\");\n\t\t\treturn view('report.expense')->with('expenseReport', $expenseReport)\n\t\t\t->with('categories',$categories);\n\t}", "public function getDate() {\n return ($this->date1_reduced === $this->date2_reduced) ? $this->date1_reduced: $this->date1_reduced . \"- \" . $this->date2_reduced;\n }", "public function achievementsReport() {\n if (userLogedIn()) {\n if(check_access('achievementsReport')){\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 \n $this->load->view(\"admin/achievementsReport\", $data);\n \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 all_sale_date_n($product_id)\n {\n $dates = array();\n $first_date = '';\n $sales = $this->db->get('sale')->result_array();\n foreach ($sales as $i => $row) {\n if($this->session->userdata('title') !== 'vendor' || $this->is_sale_of_vendor($row['sale_id'],$this->session->userdata('vendor_id'))){\n if ($this->product_in_sale($row['sale_id'], $product_id, 'id')) {\n $first_date = $this->get_type_name_by_id('sale', $row['sale_id'], 'sale_datetime');\n break;\n }\n }\n }\n if ($first_date !== '') {\n $current = $first_date;\n $last = time();\n while ($current <= $last) {\n $dates[] = date('Y-m-d', $current);\n $current = strtotime('+1 day', $current);\n }\n }\n return $dates;\n\n }", "public function emp_report(Request $request){\n\t\t$inputs['month'] = date('m');\n\t\t$inputs['year'] = date('Y');\n\t\t$data['inputs'] = $inputs;\n\t\t$fromDate =$inputs['year'].'-'.$inputs['month'].'-'.'1';\n\t\t$toDate=$inputs['year'].'-'.$inputs['month'].'-'.date('t');\n $range = [$fromDate, $toDate]; \n\t\t//$reviews = ProjectReview::where('user_id',Auth::user()->id)->get();\n\t\t//if(Auth::user()->role == 6){\n $data = $this->prepare_report(Auth::user()->id, date('m'), date('Y'));\n $data['month'] = $inputs['month'];\n\t \t$data['year'] = $inputs['year'];\n\t\t $eod_project = Eod::where('user_id',Auth::user()->id)->whereBetween('date', $range)->distinct('project_id')->pluck('project_id');\n // dd($eod_project);\n\t\t\n\t\t if(!is_null($eod_project))\n\t\t { \n\t\t\t$data['emp_projects'] = Project::whereIn('id',$eod_project)\n\t\t\t //->join('project_reviews','project_reviews.project_id','=','projects.id')\n\t\t\t // ->whereBetween('emp_update_month', $range)\n ->get();\n\t\t }\n\t // }\n\t // if(Auth::user()->role == 4){\n\t // \t $data = $this->prepare_report(Auth::user()->id, date('m'), date('Y'));\n // $data['month'] = $inputs['month'];\n\t // \t$data['year'] = $inputs['year'];\n\t\t // $eod_project = Eod::where('user_id',Auth::user()->id)->whereBetween('date', $range)->distinct('project_id')->pluck('project_id');\n // // dd($eod_project);\n\t\t\n\t\t // if(!is_null($eod_project))\n\t\t // { \n\t\t\t// $data['emp_projects'] = Project::whereIn('id',$eod_project)\n\t\t\t// //->join('project_reviews','project_reviews.project_id','=','projects.id')\n\t\t\t// // ->whereBetween('emp_update_month', $range)\n // ->get();\n\t\t // }\n\t // }\n\t\t\n \t//print_r($data['emp_projects']);die();\n // foreach($data['emp_projects'] as $project)\n // {\n \n // \t $data['projects_review'] = ProjectReview::where('user_id',Auth::user()->id)->where('project_id',$project->project_id)->first();\n // \t // print_r($data['projects_review']);die();\n \t\n // }\n\n \t//print_r($data['projects_review']);\n\t\treturn view('common.reports.emp_report', $data); \n\t}", "function report()\n {\n if ($this->acl->otentikasi2($this->title) == TRUE){\n $cur = $this->input->post('ccurrency');\n $start = $this->input->post('start');\n $end = $this->input->post('end');\n\n $data['currency'] = $cur;\n $data['start'] = tglin($start);\n $data['end'] = tglin($end);\n $data['rundate'] = tglin(date('Y-m-d'));\n $data['log'] = $this->decodedd->log;\n\n // Property Details\n $data['company'] = $this->properti['name'];\n\n $result = null;\n foreach ($this->model->report($cur,$start,$end)->result() as $res) {\n $result[] = array (\"id\"=>$res->id, \"no\"=>$res->no, \"notes\"=>$res->notes, \"dates\"=>tglin($res->dates), \n \"currency\"=>$res->currency, \"from\"=>$this->get_acc($res->from), \"to\"=>$this->get_acc($res->to), \n \"posted\"=>$res->approved, \"amount\"=>$res->amount);\n }\n $data['result'] = $result; $this->output = $data;\n }else { $this->reject_token(); }\n $this->response('content');\n }", "public function get_profit_and_loss(Request $request)\n {\n \t$expense = AccountHead::where('name', 'expense')->first();\n \t$income = AccountHead::where('name', 'income')->first();\n \t$liability = AccountHead::where('name', 'liability')->first();\n \t$asset = AccountHead::where('name', 'asset')->first();\n\n \t$organization_id = Session::get('organization_id');\n\n \t$start_date = $request->start_date;\n\t \t$end_date = $request->end_date;\n\n \t$pre_entry = AccountEntry::select('account_entries.id',DB::raw('MIN(account_entries.date) as pre_date')) \n ->where('account_entries.organization_id', $organization_id) \n ->first();\n\n /* start_date is changed to $pre_entry->pre_date */\n\n $total_profit = $this->total_account_sp($organization_id, $income->id, \"income\", $pre_entry->pre_date, $request->end_date);\n\n \t$total_loss = $this->total_account_sp($organization_id, $expense->id, \"expense\", $pre_entry->pre_date, $request->end_date);\n\n \t$total_liability = $this->total_account_sp($organization_id, $liability->id, \"liability\", $pre_entry->pre_date, $end_date);\n\n \t$total_asset = $this->total_account_sp($organization_id, $asset->id, \"asset\", $pre_entry->pre_date, $end_date);\n\n $pre_balance_income = $this->total_account_sp($organization_id,$income->id, \"income\", $pre_entry->pre_date, $request->start_date);\n\n $pre_balance_expense = $this->total_account_sp($organization_id,$income->id, \"expense\", $pre_entry->pre_date, $request->start_date);\n\n /*$liabilities_array = array();\n\n\t \t$liabilities_array = $this->traverse_group($liability->id, $start_date, $end_date, \"parent\", \"opening_stock\", 'NULL', $liabilities_array);\t \n\n\t \t$liabilities_result = array();\n\t \t$liabilities_id = array(); \t \t\n\n\t \tforeach($liabilities_array as $liability) {\n\n\t\t\tif (!in_array($liability['id'], $liabilities_id)) {\n\t\t\t\n\t\t\t\tif($liability['name'] == 'Capital A/C')\n\t\t\t\t{\n\t\t\t\t\t$liability['name'] ='Opening Stock';\n\t\t\t\t\t$liabilities_result[] = $liability;\n\t\t\t \t\t$liabilities_id[] = $liability['id'];\n\t\t\t\t}\n\t\t\t}\n\t \t}*/\t \t\n\t \t\n\t \t//$liabilities = Custom::tree($liabilities_result);\n\t \t//dd($liabilities_result);\n\t \t//Log::info(' liablity tree?'.json_encode($liabilities));\n\n\n \t$expenses_array = array();\n \n \t$expenses_array = array_merge($this->traverse_group($expense->id, $pre_entry->pre_date, $request->end_date, \"parent\", \"expense\", 'NULL', $expenses_array), $this->traverse_group($expense->id, $pre_entry->pre_date, $request->end_date, \"group\", \"expense\", 'NULL', $expenses_array));\n\n\t\t//$expenses_array_new = array_merge($liabilities_result,$expenses_array);\n\n\t\t//dd($expenses_array);\n\n \t$expense_result = array();\n\n \t$expense_id = array();\n\t foreach($expenses_array as $expense) {\n\n\t if (!in_array($expense['id'], $expense_id)) {\n \t \t\t\n\t $expense_result[] = $expense;\n\t $expense_id[] = $expense['id'];\n\t \n\t }\n\t }\t \n\n \t$expense = Custom::tree($expense_result);\n\n\n \t/*$assets_array = array();\n\n\t \t$assets_array = array_merge($this->traverse_group($asset->id, $start_date, $end_date, \"parent\", \"asset\", 'NULL', $assets_array), $this->traverse_group($asset->id, $start_date, $end_date, \"group\", \"asset\", 'NULL', $assets_array));\t \t\n\n\t \t$assets_result = array();\n\t \t$assets_id = array();\n\n\t\t foreach($assets_array as $asset) {\n\n\t\t\tif (!in_array($asset['id'], $assets_id)) {\n\n\t\t\t\tif($asset['name'] == 'Other Current Asset')\n\t\t\t\t{\n\t\t\t\t\t$asset['name'] ='Closing Stock';\n\t\t\t\t\t$asset['parent'] = null;\n\t\t\t\t\t$assets_result[] = $asset;\n\t\t\t \t \t$assets_id[] = $asset['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t }\n\n\t \t$assets = Custom::tree($assets_result);*/\n\n\t \t\n \t$incomes_array = array();\n\n \t$incomes_array = array_merge($this->traverse_group($income->id, $pre_entry->pre_date, $request->end_date, \"parent\", \"income\", 'NULL', $incomes_array), $this->traverse_group($income->id, $pre_entry->pre_date, $request->end_date, \"group\", \"income\", 'NULL', $incomes_array));\n\n \t//$incomes_array_new = array_merge($assets_result,$incomes_array);\n\n \t$income_result = array();\n\n \t$income_id = array();\n\n \t$pre_income = isset($pre_balance_income[0]->closing_balance) ? $pre_balance_income[0]->closing_balance : 0;\n\n \tforeach($incomes_array as $income) {\n \tif (!in_array($income['id'], $income_id)) {\n \t\t$income_result[] = $income;\n \t\t$income_id[] = $income['id'];\n \t}\n \t}\n \t\n\n \t$income = Custom::tree($income_result);\n\n \t$profit = isset($total_profit[0]->closing_balance) ? $total_profit[0]->closing_balance : 0;\n\n \t$loss = isset($total_loss[0]->closing_balance) ? $total_loss[0]->closing_balance : 0;\n\n \t$report = null;\n\n \tif(($profit > $loss) && (abs($profit) - abs($loss)) != 0) {\n $report = 'profit';\n //$loss = abs($profit) + abs($loss);\n \t} else if(($profit < $loss) && (abs($profit) - abs($loss)) != 0) {\n $report = 'loss';\n //$profit = abs($profit) + abs($loss);\n \t}\n\n \t$statement = array(\"incomes\" => $profit, 'expenses' => $loss, 'report' => $report, 'report_amount' => abs($profit - $loss), 'profit' => $profit, 'loss' => $loss );\n\n\n \t\treturn response()->json(array('total_profit' => $total_profit, 'total_loss' => $total_loss, 'statement' => $statement, 'expense' => $expense, 'income' => $income, 'profit' => $profit, 'loss' => $loss));\n }", "public function getDateFin();", "function report()\n {\n if ($this->acl->otentikasi2($this->title) == TRUE){\n\n $vendor = $this->input->post('cvendor');\n $cur = $this->input->post('ccurrency');\n \n $start = $this->input->post('start');\n $end = $this->input->post('end');\n $acc = $this->input->post('cacc');\n\n $data['currency'] = strtoupper($cur);\n $data['start'] = tglin($start);\n $data['end'] = tglin($end);\n $data['rundate'] = tglin(date('Y-m-d'));\n $data['log'] = $this->decodedd->log;\n\n// $data['purchase_returns'] = $this->model->report($cur,$vendor,$start,$end,$acc)->result();\n \n $reports = null;\n foreach ($this->model->report($cur,$vendor,$start,$end,$acc)->result() as $res) {\n $reports[] = array (\"id\"=>$res->id, \n \"date\"=> tglin($res->dates),\n \"no\"=> \"PR-00\".$res->no,\n \"account\"=>floatval($res->price),\n \"vendor\"=>$res->prefix.' '.$res->name,\n \"amount\"=>floatval($res->total-$res->tax),\n \"tax\"=>floatval($res->tax),\n \"cost\"=>floatval($res->costs),\n \"balance\"=>floatval($res->total-$res->costs),\n \"status\"=> $this->xstatus($res->status)\n ); \n }\n \n $total = $this->model->total($cur,$vendor,$start,$end,$acc);\n $data['total'] = floatval($total['total'] - $total['tax']);\n $data['tax'] = floatval($total['tax']);\n $data['costs'] = floatval($total['costs']);\n $data['balance'] = floatval($total['total'] + $total['costs']);\n $data['items'] = $reports;\n \n $this->output = $data;\n \n }else { $this->reject_token('Invalid Token or Expired..!'); }\n $this->response('content');\n \n }", "public function prepare_report($emp, $month, $year){\n\n // echo $emp.' '.$month.' '.$year;\n\t\t$start = date('Y-m-d', strtotime(\"$year-$month-01\")); \n\t $end = date('Y-m-t', strtotime($start));\n\t\t$data['attendance'] = calculate_attendance($emp,$start,$end);\n\t\t\n\t\t//array_walk($data['attendance'], function(&$key, $b) { ucwords(str_replace('_', ' ', $key)) }); \n\t\t$data['at_labels'] = json_encode(['Present','Absent','Half Day','Uninformed Leave','Sandwich Leave','Late Login']); \n\t\t$data['at_values'] = json_encode(array_values($data['attendance'])); \n\t\t\n\t\t$project_data = Project::join('project_assignation','projects.id','project_assignation.project_id')\n\t\t\t\t\t\t\t\t->join('users','project_assignation.employee_id','users.id')\n\t\t\t\t\t\t\t\t->join('eods','eods.user_id','users.id')\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t ->select('projects.project_name','projects.id', DB::Raw('SUM(eods.today_hours) as pr_time'))\n\n\t\t\t\t\t\t\t\t->where('users.id', $emp)\n\t\t\t\t\t\t\t\t->whereMonth('eods.date', $month)\t\n\t\t\t\t\t\t\t\t->whereYear('eods.date', $year)\t \t \t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t->whereRaw('eods.project_id = projects.id')\n\t\t\t\t\t\t\t\t->groupBy('projects.project_name','projects.id')\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t->get(); \n\n\n\t \n\t\t\n\t\t\t$sum = array_sum(array_column($project_data->toArray(),'pr_time')); \n\n\t\t\t$data['projects'] = $project_data;\n\t\t\tforeach($project_data as $project){\n\t\t\t\t$labels[] = $project->project_name;\n\t\t\t\t$cdata[] = number_format(($project->pr_time*100) / $sum, 2); \n\t\t\t\t//$sdata[] = array('label'=> $project->project_name,'data'=>number_format(($project->pr_time*100) / $sum, 2),'backgroundColor'=>'green','borderColor'=>'red') ;\n\t\t\t\t$sdata[] = array('label'=>$project->project_name,'y'=>number_format(($project->pr_time*100) / $sum, 2));\n\t\t\t}\n\t\t\t\n\n\t\t\tif(!empty($labels) && !empty($cdata)){\n\t\t $data['labels'] = json_encode($labels);\n\t\t $data['cdata'] = json_encode($cdata);\n\t\t $data['sdata'] = json_encode($sdata); \n\t\t\t} \n\t\t\t//print_r($data['sdata']);\n\n\t\t return $data; \n\t}", "function sales_report($mode, $startDate = 0, $endDate = 0, $sort = 0, $statusFilter = 0, $filter = 0, $details, $ordersIn, $salesConsultant) {\n // if set then both have to be valid startDate and endDate\n $this->mode = $mode;\n $this->tax_include = DISPLAY_PRICE_WITH_TAX;\n\t $this->details = $details;\n\t $this->ordersIn = $ordersIn;\n\t $this->salesConsultant = $salesConsultant;\n\n //$this->statusFilter = $statusFilter;\n\t $this->statusFilter = \"\";\n\t if(!empty($statusFilter) || $statusFilter!=0) {\n\t \t$this->statusFilter = explode(\"_\",$statusFilter);\n\t }\n \n // get date of first sale\n $firstQuery = tep_db_query(\"select UNIX_TIMESTAMP(min(date_purchased)) as first FROM \" . TABLE_ORDERS);\n $first = tep_db_fetch_array($firstQuery);\n $this->globalStartDate = mktime(0, 0, 0, date(\"m\", $first['first']), date(\"d\", $first['first']), date(\"Y\", $first['first']));\n \n $statusQuery = tep_db_query(\"select * from orders_status\");\n $i = 0;\n while ($outResp = tep_db_fetch_array($statusQuery)) {\n $status[$i] = $outResp;\n $i++;\n }\n\t $this->status = $status;\n \n if ($startDate == 0 or $startDate < $this->globalStartDate) {\n // set startDate to globalStartDate\n $this->startDate = $this->globalStartDate;\n } else {\n $this->startDate = $startDate;\n }\n if ($this->startDate > mktime(0, 0, 0, date(\"m\"), date(\"d\"), date(\"Y\"))) {\n $this->startDate = mktime(0, 0, 0, date(\"m\"), date(\"d\"), date(\"Y\"));\n }\n\n if ($endDate > mktime(0, 0, 0, date(\"m\"), date(\"d\") + 1, date(\"Y\"))) {\n // set endDate to tomorrow\n $this->endDate = mktime(0, 0, 0, date(\"m\"), date(\"d\") + 1, date(\"Y\"));\n } else {\n $this->endDate = $endDate;\n }\n if ($this->endDate < $this->startDate + 24 * 60 * 60) {\n $this->endDate = $this->startDate + 24 * 60 * 60;\n }\n\n $this->actDate = $this->startDate;\n\t \n\t \n\t // query for order count\n\t $this->queryOrderCnt = \"SELECT count(o.orders_id) as order_cnt FROM \" . TABLE_ORDERS . \" o\";\n\t \n\t //this is to check sales consultant based report\t\t \n\t if($this->ordersIn == 1) {\n\t \t\t\n\t\t\t$this->queryItemCnt_2 = \"SELECT p.products_model, op.products_quantity, (op.final_price*op.products_quantity) as psum, o.date_purchased FROM \" . TABLE_ORDERS . \" o JOIN \" . TABLE_ORDERS_PRODUCTS . \" op ON o.orders_id = op.orders_id JOIN \".TABLE_PRODUCTS .\"p ON op.products_id = p.products_id \";\n\t\t\t\n\t\t\t$this->queryShipping = \"SELECT ot.value as shipping, o.date_purchased FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND ot.class='ot_shipping') \";\n\t\t\t$this->queryGstTotal = \"SELECT ot.value as gst_total FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND ot.class='ot_gst_total') \";\n\t\t\t$this->queryDiscountTotal = \"SELECT ot.value as discount_total FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND (ot.class = 'ot_customer_discount' OR ot.class='ot_gv')) \";\t\t\t\n\t\t\t$this->querySubtotal = \"SELECT ot.value as subtotal, o.date_purchased, o.last_modified FROM orders o LEFT JOIN orders_total ot ON (ot.orders_id = o.orders_id AND (ot.class = 'ot_grand_subtotal' OR ot.class='ot_subtotal')) \";\n\t\t\t$this->queryOrderProCostCnt = \"SELECT SUM(opc.labour_cost*opc.products_quantity) as pcl_cost, SUM(opc.overhead_cost*opc.products_quantity) as pco_cost, SUM(opc.material_cost*opc.products_quantity) as pcm_cost, count(distinct(o.orders_id)) FROM orders_products_costs opc LEFT JOIN orders o ON opc.orders_id = o.orders_id \";\n\t\t\t\n\t\t\t\n\t\t\t$this->queryItemCnt = \"SELECT pd.products_tax_class_id, pd.products_model, o.orders_id,o.customers_id, o.customers_name, o.customers_company, o.purchase_number, o.last_modified, \to.date_purchased, o.orders_status, o.order_assigned_to, a.entry_company_tax_id as customer_number, op.products_id as pid, op.orders_products_id, op.products_quantity, op.final_price, op.products_name as pname, sum(op.products_quantity) as pquant, sum(op.final_price * op.products_quantity) as psum, op.products_tax as ptax, count(distinct(o.orders_id)) FROM orders o JOIN orders_products op ON op.orders_id = o.orders_id LEFT JOIN products pd ON pd.products_id = op.products_id LEFT JOIN address_book a ON a.customers_id = o.customers_id \";\t\t\t\t\t\t\n\t\t\t$this->queryAttr = \"SELECT count(op.products_id) as attr_cnt, o.orders_id, opa.orders_products_id, opa.products_options, opa.products_options_values, opa.options_values_price, opa.price_prefix from orders_products_attributes opa LEFT JOIN orders o ON opa.orders_id = o.orders_id LEFT JOIN orders_products op ON op.orders_products_id = opa.orders_products_id \";\n\t\t\t\t\t\t\n\t\t\t$this->queryProCost_2 = \"select opc.*, o.date_purchased from orders_products_costs opc LEFT JOIN orders o ON opc.orders_id = o.orders_id \";\n\t\t\t$this->queryProCost = \"select pc.categories_id, opc.* from products_to_categories pc, orders_products_costs opc where pc.products_id=opc.products_id and opc.orders_id IN \";\t\t\t\t\t \n\t\t\t\n\t } else {\n\t \t\t\t \t\t\t\t \n\t\t\t // query for shipping\n\t\t\t $this->queryShipping = \"SELECT ot.value as shipping, o.date_purchased, o.customers_id FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_TOTAL . \" ot WHERE ot.orders_id = o.orders_id AND ot.class = 'ot_shipping'\";\t\t\t \n\t\t\t // query for GST total\n\t\t\t $this->queryGstTotal = \"SELECT ot.value as gst_total FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_TOTAL . \" ot WHERE ot.orders_id = o.orders_id AND ot.class = 'ot_gst_total'\";\n\t\t\t //query for discount\n\t\t\t $this->queryDiscountTotal = \"SELECT ot.value as discount_total FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_TOTAL . \" ot WHERE ot.orders_id = o.orders_id AND (ot.class = 'ot_customer_discount' OR ot.class='ot_gv')\";\t\t\t \n\t\t\t //query for subtotal\n\t\t\t $this->querySubtotal = \"SELECT ot.value as subtotal, o.date_purchased, o.last_modified, o.customers_id, a.entry_zone_id FROM orders o, orders_total ot, address_book a WHERE ot.orders_id = o.orders_id AND (ot.class = 'ot_grand_subtotal' OR ot.class='ot_subtotal') AND o.customers_id = a.customers_id \";\n\t\t\t \n\t\t\t //products count query\t\t\t \n\t\t\t $this->queryOrderProCostCnt = \"SELECT (opc.labour_cost*opc.products_quantity) as pcl_cost, (opc.overhead_cost*opc.products_quantity) as pco_cost, (opc.material_cost*opc.products_quantity) as pcm_cost, o.date_purchased, o.customers_id FROM orders_products_costs opc, orders o WHERE opc.orders_id=o.orders_id \";\n\t\t\t \n\t\t\t \n\t\t\t $this->queryItemCnt_2 = \"SELECT p.products_model, op.products_quantity, (op.final_price*op.products_quantity) as psum, o.date_purchased FROM \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_PRODUCTS . \" op, \" . TABLE_PRODUCTS . \" p WHERE o.orders_id = op.orders_id AND op.products_id = p.products_id \";\n\t\t\t \n\t\t\t //Orders products query \n\t\t\t $this->queryItemCnt = \"SELECT pd.products_tax_class_id, pd.products_model, o.orders_id,o.customers_id, o.customers_name, o.customers_company, \n\t\t\t\t\t\t\t\t\t\to.purchase_number, o.last_modified, o.date_purchased, \n\t\t\t\t\t\t\t\t\t\to.orders_status, o.order_assigned_to, a.entry_company_tax_id as customer_number, op.products_id as pid, \n\t\t\t\t\t\t\t\t\t\top.orders_products_id, op.products_quantity, op.final_price, op.products_name as pname, sum(op.products_quantity) as pquant, \n\t\t\t\t\t\t\t\t\t\tsum(op.final_price * op.products_quantity) as psum, op.products_tax as ptax FROM \" . TABLE_ORDERS . \" o, \n\t\t\t\t\t\t\t\t\t\t\" . TABLE_ORDERS_PRODUCTS . \" op, \" . TABLE_ADDRESS_BOOK . \" a, \" . TABLE_PRODUCTS . \" pd \n\t\t\t\t\t\t\t\t\t\tWHERE o.orders_id = op.orders_id and o.customers_id = a.customers_id and op.products_id = pd.products_id\";\n\t\t\t // query for attributes\n\t\t\t $this->queryAttr = \"SELECT count(op.products_id) as attr_cnt, o.orders_id, opa.orders_products_id, opa.products_options, opa.products_options_values, opa.options_values_price, opa.price_prefix from \" . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . \" opa, \" . TABLE_ORDERS . \" o, \" . TABLE_ORDERS_PRODUCTS . \" op WHERE o.orders_id = opa.orders_id AND op.orders_products_id = opa.orders_products_id\";\t\n\t\t\t \t\t\t\t\n\t\t\t //products cost\n\t\t\t $this->queryProCost = \"select pc.categories_id, opc.* from products_to_categories pc, orders_products_costs opc where pc.products_id=opc.products_id and opc.orders_id IN \";\t\t\t \n\t\t\t $this->queryProCost_2 = \"select opc.*, o.date_purchased from orders_products_costs opc, orders o where opc.orders_id=o.orders_id \";\t\t\t\t \n\t\n\t}\n\t\n\t\n switch ($sort) {\n case '0':\n //$this->sortString = \" \"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc \";\n break;\n case '1':\n //$this->sortString = \" order by pname asc \"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, pname asc \";\n break;\n case '2':\n //$this->sortString = \" order by pname desc\"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, pname desc\";\n break;\n case '3':\n //$this->sortString = \" order by pquant asc, pname asc\"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, pquant asc, pname asc\";\n break;\n case '4':\n //$this->sortString = \" order by pquant desc, pname asc\";\n\t\t //$this->sortString = \" order by pid desc, pname asc\"; //modified Aug 18, 2010\n $this->sortString = \" order by o.orders_id desc, pid desc, pname asc\";\n break;\n case '5':\n\t\t //$this->sortString = \" order by psum asc, pname asc\"; //modified Aug 18, 2010\n $this->sortString = \" order by o.orders_id desc, psum asc, pname asc\";\n break;\n case '6':\n //$this->sortString = \" order by psum desc, pname asc\"; //modified Aug 18, 2010\n\t\t $this->sortString = \" order by o.orders_id desc, psum desc, pname asc\";\n break;\n }\n\n }", "function statRiskStatistics()\n{\n $post = getPostInfo();\n $startTime= isset($post['startdate'])?$post['startdate']:'2016-12-19';//'2016-08-01';//'2016-12-23';\n $endTime = isset($post['enddate'])?$post['enddate']:'2017-01-23';//'2017-01-01';//'2017-01-22';\n $duration = isset($post['granularity'])?$post['granularity']:'week';//'month';//'day'; // day month week\n\n //startdate=2016-12-19&enddate=2017-01-23\n //startdate=2016-08-01&enddate=2017-01-01\n //date_format(`CreateDate`, '%Y-%m-%d') as `day`\n //WEEK(`CreateDate`) as `week`\n\n $condition = '';\n if (isset($post['paymentMethod']) && trim($post['paymentMethod']))\n {\n $paymentMethod = trim($post['paymentMethod']);\n if (!empty($condition)) {\n $condition .= \" AND `PaymentMethod`='{$paymentMethod}' \";\n } else {\n $condition = \" `PaymentMethod`='{$paymentMethod}' \";\n }\n }\n if (isset($post['shopperInteraction']) && trim($post['shopperInteraction']))\n {\n $shopperInteraction = trim($post['shopperInteraction']);\n if (!empty($condition)) {\n $condition .= \" AND `Shopper`='{$shopperInteraction}' \";\n } else {\n $condition = \" `Shopper`='{$shopperInteraction}' \";\n }\n }\n if (isset($post['countryFilter']) && trim($post['countryFilter']))\n {\n $countryFilter = trim($post['countryFilter']);\n if (!empty($condition)) {\n $condition .= \" AND `Country`='{$countryFilter}' \";\n } else {\n $condition = \" `Country`='{$countryFilter}' \";\n }\n }\n\n $data = [];\n if ($duration == 'day') {\n $endTime = date('Y-m-d', strtotime(\"$endTime -1 day\"));\n $dateArr = parseDate($startTime, $endTime);\n\n //$sql = \"\n //SELECT COUNT(DISTINCT `MerchantAccount`) AS totalCount,\n // date_format(`CreateDate`, '%Y-%m-%d') as `day`\n //FROM `payment`\n //WHERE `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}'\n //GROUP BY `day`\";\n //$totalInfo = DB::fetchAll(DB_NUMBER, $sql);\n //$totalNew = [];\n //foreach($totalInfo as $total)\n //{\n // $totalNew[$total['day']] = $total;\n //}\n\n if (!empty($condition)) {\n $condition .= \" AND `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}' \";\n } else {\n $condition = \" `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}' \";\n }\n\n $sql = \"\n SELECT SUM(`totalCount`) AS totalCount,SUM(`riskTransactionCount`) AS riskTransactionCount,\n SUM(`authorisedCount`) AS authorisedCount,SUM(`authorisedEurAmount`) AS authorisedEurAmount,\n SUM(`refusedByRiskCount`) AS refusedByRiskCount,SUM(`refusedByRiskEurAmount`) AS refusedByRiskEurAmount,\n SUM(`refusedByBankCount`) AS refusedByBankCount,SUM(`refusedByBankEurAmount`) AS refusedByBankEurAmount,\n SUM(`chargebackCount`) AS chargebackCount,SUM(`cancelledByRiskCount`) AS cancelledByRiskCount,\n SUM(`cancelledByRiskAmount`) AS cancelledByRiskAmount,SUM(`chargebackEurAmount`) AS chargebackEurAmount,\n SUM(`fraudNotificationsEurAmount`) AS fraudNotificationsEurAmount,\n SUM(`fraudNotificationsCount`) AS fraudNotificationsCount,date_format(`CreateDate`, '%Y-%m-%d') as `day`\n FROM `risk`\n WHERE $condition\n GROUP BY `day`\";\n $pageInfo = DB::fetchAll(DB_NUMBER, $sql);\n $pageNew = [];\n if ($pageInfo) {\n foreach($pageInfo as $item)\n {\n $pageNew[$item['day']] = $item;\n }\n $days = getLineDay($startTime, $endTime);\n foreach($days as $day)\n {\n $data[] = [\n \"date\" => $day,\n \"totalCount\" => (int)(isset($pageNew[$day])?$pageNew[$day]['totalCount']:0),\n \"riskTransactionCount\" => (int)(isset($pageNew[$day])?$pageNew[$day]['riskTransactionCount']:0),\n \"authorisedCount\" => (int)(isset($pageNew[$day])?$pageNew[$day]['authorisedCount']:0),\n \"authorisedEurAmount\" => (int)(isset($pageNew[$day])?$pageNew[$day]['authorisedEurAmount']:0),\n \"refusedByRiskCount\" => (int)(isset($pageNew[$day])?$pageNew[$day]['refusedByRiskCount']:0),\n \"refusedByRiskEurAmount\"=> (int)(isset($pageNew[$day])?$pageNew[$day]['refusedByRiskEurAmount']:0),\n \"refusedByBankCount\" => (int)(isset($pageNew[$day])?$pageNew[$day]['refusedByBankCount']:0),\n \"refusedByBankEurAmount\"=> (int)(isset($pageNew[$day])?$pageNew[$day]['refusedByBankEurAmount']:0),\n \"chargebackCount\" => (int)(isset($pageNew[$day])?$pageNew[$day]['chargebackCount']:0),\n \"cancelledByRiskCount\" => (int)(isset($pageNew[$day])?$pageNew[$day]['cancelledByRiskCount']:0),\n \"cancelledByRiskAmount\" => (int)(isset($pageNew[$day])?$pageNew[$day]['cancelledByRiskAmount']:0)\n ];\n }\n }\n } else if ($duration == 'month') {\n $endTime = date('Y-m-d', strtotime(\"$endTime -1 day\"));\n $dateArr = parseDate($startTime, $endTime);\n\n //$sql = \"\n //SELECT COUNT(DISTINCT `MerchantAccount`) AS totalCount,\n // date_format(`CreateDate`, '%Y-%m-01') as `month`\n //FROM `payment`\n //WHERE `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}'\n //GROUP BY `month`\";\n //$totalInfo = DB::fetchAll(DB_NUMBER, $sql);\n //$totalNew = [];\n //foreach($totalInfo as $total)\n //{\n // $totalNew[$total['month']] = $total;\n //}\n\n if (!empty($condition)) {\n $condition .= \" AND `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}' \";\n } else {\n $condition = \" `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}' \";\n }\n\n $sql = \"\n SELECT SUM(`totalCount`) AS totalCount,SUM(`riskTransactionCount`) AS riskTransactionCount,\n SUM(`authorisedCount`) AS authorisedCount,SUM(`authorisedEurAmount`) AS authorisedEurAmount,\n SUM(`refusedByRiskCount`) AS refusedByRiskCount,SUM(`refusedByRiskEurAmount`) AS refusedByRiskEurAmount,\n SUM(`refusedByBankCount`) AS refusedByBankCount,SUM(`refusedByBankEurAmount`) AS refusedByBankEurAmount,\n SUM(`chargebackCount`) AS chargebackCount,SUM(`cancelledByRiskCount`) AS cancelledByRiskCount,\n SUM(`cancelledByRiskAmount`) AS cancelledByRiskAmount,SUM(`chargebackEurAmount`) AS chargebackEurAmount,\n SUM(`fraudNotificationsEurAmount`) AS fraudNotificationsEurAmount,\n SUM(`fraudNotificationsCount`) AS fraudNotificationsCount,date_format(`CreateDate`, '%Y-%m-01') as `month`\n FROM `risk`\n WHERE $condition\n GROUP BY `month`\";\n $pageInfo = DB::fetchAll(DB_NUMBER, $sql);\n $pageNew = [];\n if ($pageInfo) {\n foreach($pageInfo as $item)\n {\n $pageNew[$item['month']] = $item;\n }\n $months = getLineMonth($startTime, $endTime);\n foreach($months as $month)\n {\n $data[] = [\n \"date\" => $month,\n \"totalCount\" => (int)(isset($pageNew[$month])?$pageNew[$month]['totalCount']:0),\n \"riskTransactionCount\" => (int)(isset($pageNew[$month])?$pageNew[$month]['riskTransactionCount']:0),\n \"authorisedCount\" => (int)(isset($pageNew[$month])?$pageNew[$month]['authorisedCount']:0),\n \"authorisedEurAmount\" => (int)(isset($pageNew[$month])?$pageNew[$month]['authorisedEurAmount']:0),\n \"refusedByRiskCount\" => (int)(isset($pageNew[$month])?$pageNew[$month]['refusedByRiskCount']:0),\n \"refusedByRiskEurAmount\"=> (int)(isset($pageNew[$month])?$pageNew[$month]['refusedByRiskEurAmount']:0),\n \"refusedByBankCount\" => (int)(isset($pageNew[$month])?$pageNew[$month]['refusedByBankCount']:0),\n \"refusedByBankEurAmount\"=> (int)(isset($pageNew[$month])?$pageNew[$month]['refusedByBankEurAmount']:0),\n \"chargebackCount\" => (int)(isset($pageNew[$month])?$pageNew[$month]['chargebackCount']:0),\n \"cancelledByRiskCount\" => (int)(isset($pageNew[$month])?$pageNew[$month]['cancelledByRiskCount']:0),\n \"cancelledByRiskAmount\" => (int)(isset($pageNew[$month])?$pageNew[$month]['cancelledByRiskAmount']:0)\n ];\n }\n }\n } else if ($duration == 'week') {\n //SELECT STR_TO_DATE(CONCAT(YEARWEEK('2017-1-23'), ' Monday'), '%X%V %W')\n //SELECT STR_TO_DATE('201652 Monday', '%X%V %W')\n $dateArr = parseDate($startTime, $endTime);\n\n //$sql = \"\n //SELECT COUNT(DISTINCT `MerchantAccount`) AS totalCount, WEEK(`CreateDate`) as `weekday`,\n // STR_TO_DATE(CONCAT(YEARWEEK(`CreateDate`), ' Monday'), '%X%V %W') AS `day`\n //FROM `payment`\n //WHERE `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}'\n //GROUP BY `weekday`\";\n //$totalInfo = DB::fetchAll(DB_NUMBER, $sql);\n //$totalNew = [];\n //foreach($totalInfo as $total)\n //{\n // $totalNew[$total['day']] = $total;\n //}\n\n if (!empty($condition)) {\n $condition .= \" AND `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}' \";\n } else {\n $condition = \" `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}' \";\n }\n\n $sql = \"\n SELECT SUM(`totalCount`) AS totalCount,SUM(`riskTransactionCount`) AS riskTransactionCount,\n SUM(`authorisedCount`) AS authorisedCount,SUM(`authorisedEurAmount`) AS authorisedEurAmount,\n SUM(`refusedByRiskCount`) AS refusedByRiskCount,SUM(`refusedByRiskEurAmount`) AS refusedByRiskEurAmount,\n SUM(`refusedByBankCount`) AS refusedByBankCount,SUM(`refusedByBankEurAmount`) AS refusedByBankEurAmount,\n SUM(`chargebackCount`) AS chargebackCount,SUM(`cancelledByRiskCount`) AS cancelledByRiskCount,\n SUM(`cancelledByRiskAmount`) AS cancelledByRiskAmount,SUM(`chargebackEurAmount`) AS chargebackEurAmount,\n SUM(`fraudNotificationsEurAmount`) AS fraudNotificationsEurAmount,\n SUM(`fraudNotificationsCount`) AS fraudNotificationsCount,WEEK(`CreateDate`) as `weekday`,\n STR_TO_DATE(CONCAT(YEARWEEK(`CreateDate`), ' Monday'), '%X%V %W') AS `day`\n FROM `risk`\n WHERE $condition\n GROUP BY `weekday`\";\n $pageInfo = DB::fetchAll(DB_NUMBER, $sql);\n $pageNew = [];\n if ($pageInfo) {\n foreach($pageInfo as $item)\n {\n $pageNew[$item['day']] = $item;\n }\n $weeks = getLineWeek($startTime, $endTime);\n foreach($weeks as $week)\n {\n $data[] = [\n \"date\" => $week,\n \"totalCount\" => (int)(isset($pageNew[$week])?$pageNew[$week]['totalCount']:0),\n \"riskTransactionCount\" => (int)(isset($pageNew[$week])?$pageNew[$week]['riskTransactionCount']:0),\n \"authorisedCount\" => (int)(isset($pageNew[$week])?$pageNew[$week]['authorisedCount']:0),\n \"authorisedEurAmount\" => (int)(isset($pageNew[$week])?$pageNew[$week]['authorisedEurAmount']:0),\n \"refusedByRiskCount\" => (int)(isset($pageNew[$week])?$pageNew[$week]['refusedByRiskCount']:0),\n \"refusedByRiskEurAmount\"=> (int)(isset($pageNew[$week])?$pageNew[$week]['refusedByRiskEurAmount']:0),\n \"refusedByBankCount\" => (int)(isset($pageNew[$week])?$pageNew[$week]['refusedByBankCount']:0),\n \"refusedByBankEurAmount\"=> (int)(isset($pageNew[$week])?$pageNew[$week]['refusedByBankEurAmount']:0),\n \"chargebackCount\" => (int)(isset($pageNew[$week])?$pageNew[$week]['chargebackCount']:0),\n \"cancelledByRiskCount\" => (int)(isset($pageNew[$week])?$pageNew[$week]['cancelledByRiskCount']:0),\n \"cancelledByRiskAmount\" => (int)(isset($pageNew[$week])?$pageNew[$week]['cancelledByRiskAmount']:0)\n ];\n }\n }\n } else {\n return '[]';\n }\n return $data;\n}", "public function getDateDebut();", "public function getSalesReport($month,$day,$year,$fromTime_hour,$fromTime_minutes,$fromTime_seconds,$toTime_hour,$toTime_minutes,$toTime_seconds,$username,$module) {\n\necho \"\n<style type='text/css'>\ntr:hover { background-color:yellow; color:black;}\na { text-decoration:none; color:black; }\n</style>\";\n\n$dateSelected = $month.\"_\".$day.\"_\".$year;\n$fromTimez = $fromTime_hour.\":\".$fromTime_minutes.\":\".$fromTime_seconds;\n$toTimez = $toTime_hour.\":\".$toTime_minutes.\":\".$toTime_seconds;\n\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT upper(pr.completeName) as completeName,pc.description,pc.sellingPrice,pc.quantity,pc.discount,pc.total,pc.cashUnpaid,pc.cashPaid,pc.chargeBy FROM patientRecord pr,registrationDetails rd,patientCharges pc WHERE pr.patientNo = rd.patientNo and rd.registrationNo = pc.registrationNo and pc.dateCharge = '$dateSelected' and (pc.timeCharge between '$fromTimez' and '$toTimez') and title='$module' group by pc.itemNo order by completeName asc \");\n\necho \"<table border=1 cellpadding=0 cellspacing=0>\";\necho \"<tr>\";\necho \"<th>&nbsp;Name&nbsp;</th>\";\necho \"<th>&nbsp;Description&nbsp;</th>\";\necho \"<th>&nbsp;Price&nbsp;</th>\";\necho \"<th>&nbsp;QTY&nbsp;</th>\";\necho \"<th>&nbsp;Disc&nbsp;</th>\";\necho \"<th>&nbsp;Total&nbsp;</th>\";\necho \"<th>&nbsp;Unpaid&nbsp;</th>\";\necho \"<th>&nbsp;Paid&nbsp;</th>\";\necho \"<th>&nbsp;Charge By&nbsp;</th>\";\necho \"</tr>\";\n$this->sales_total=0;\n$this->sales_unpaid=0;\n$this->sales_paid=0;\nwhile($row = mysqli_fetch_array($result))\n {\necho \"<tr>\";\necho \"<td>&nbsp;\".$row['completeName'].\"&nbsp;</td>\";\necho \"<td>&nbsp;\".$row['description'].\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['sellingPrice'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['quantity'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['discount'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['total'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['cashUnpaid'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['cashPaid'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".$row['chargeBy'].\"&nbsp;</td>\";\n$this->sales_total+=$row['total'];\n$this->sales_paid+=$row['cashPaid'];\n$this->sales_unpaid+=$row['cashUnpaid'];\necho \"</tr>\";\n }\necho \"</table>\";\necho \"<br>Total Sales:&nbsp;\".$this->sales_total;\necho \"<br>Total Unpaid:&nbsp;\".$this->sales_unpaid;\necho \"<br>Total Paid&nbsp;\".$this->sales_paid;\n\n}", "public function index(){\n\t\t/*$exdate = date('Y-m-d');\n\t\t$docexpire_list = Document::whereRaw(\"(expiry_date - INTERVAL 30 DAY)<='\".$exdate.\"'\")\n\t\t\t->join('users','users.id','=','documents.user_id')\n\t\t\t->join('profile','profile.user_id','=','documents.user_id')\n\t\t\t->select(DB::raw('CONCAT(first_name, \" \", last_name) AS name,employee_code,document_title,expiry_date'))\n\t\t\t->get();\n\t\t//$empdepend_expire_count = Dependent::whereRaw(\"(expiry_date - INTERVAL 30 DAY)<='\".$exdate.\"'\")->count();\t\n\t\t\t\n\t\t$col_data=array();\n $col_heads = array(\n trans('messages.Employee Code'),\n trans('messages.Name'),\n trans('messages.Document'),\n trans('messages.Expiry Date'));\n\t\t\t\t\n\t\tforeach ($docexpire_list as $doc){\n $col_data[] = array(\n $doc->employee_code ? $doc->employee_code : '' ,\n $doc->name,\n $doc->document_title,\n Helper::showDate($doc->expiry_date)\n );\n }\n\n Helper::writeResult($col_data);\n\t\t\n\t\t$col_data2=array();\n $col_heads2 = array(\n trans('messages.Employee Code'),\n trans('messages.Employee'),\n\t\t\t\ttrans('messages.Relative Name'),\n\t\t\t\ttrans('messages.Relationship'),\n\t\t\t\ttrans('messages.Expiry Date'));\n\t\t$empdepend_list = Dependent::whereRaw(\"(expiry_date - INTERVAL 30 DAY)<='\".$exdate.\"'\")\n\t\t\t->join('users','users.id','=','dependents.user_id')\n\t\t\t->join('profile','profile.user_id','=','dependents.user_id')\n\t\t\t->select(DB::raw('CONCAT(first_name, \" \", last_name) AS name,employee_code,dependents.name as vrname,relation,expiry_date'))\n\t\t\t->get();\t\t\n\t\tforeach ($empdepend_list as $edep){\n $col_data2[] = array(\n $edep->employee_code ? $edep->employee_code : '' ,\n $edep->name,\n $edep->vrname,\n\t\t\t\t\t$edep->relation,\n\t\t\t\t\tHelper::showDate($doc->expiry_date)\n );\n }\n\n Helper::writeResult($col_data2);*/\n\t\t\n\t\t$exdate = date('Y-m-d');\n\t\t$docexpire_list = Document::whereRaw(\"(expiry_date - INTERVAL 30 DAY)<='\".$exdate.\"'\")\n\t\t\t->join('users','users.id','=','documents.user_id')\n\t\t\t->join('profile','profile.user_id','=','documents.user_id')\n\t\t\t->select(DB::raw('CONCAT(first_name, \" \", last_name) AS name,employee_code,document_title,expiry_date,documents.user_id'))\n\t\t\t->get();\n\t\t//$empdepend_expire_count = Dependent::whereRaw(\"(expiry_date - INTERVAL 30 DAY)<='\".$exdate.\"'\")->count();\t\n\t\t\t\n\t\t$col_data=array();\n $col_heads = array(\n\t\t\t\ttrans('messages.Option'),\n trans('messages.Employee Code'),\n trans('messages.Employee'),\n trans('messages.Type'),\n\t\t\t\ttrans('messages.Name'),\n trans('messages.Expiry Date'));\n\t\t\t\t\n\t\tforeach ($docexpire_list as $doc){\n $col_data[] = array(\n\t\t\t\t\t'<div class=\"btn-group btn-group-xs\">'.\n '<a href=\"employee/'.$doc->user_id.'#document\" class=\"btn btn-default btn-xs\" data-toggle=\"tooltip\" title=\"View\"> <i class=\"fa fa-eye\"></i></a> '.'</div>',\n $doc->employee_code ? $doc->employee_code : '' ,\n $doc->name,\n\t\t\t\t\t'Document',\n $doc->document_title,\n Helper::showDate($doc->expiry_date)\n );\n }\n\t\t$empdepend_list = Dependent::whereRaw(\"(expiry_date - INTERVAL 30 DAY)<='\".$exdate.\"'\")\n\t\t\t->join('users','users.id','=','dependents.user_id')\n\t\t\t->join('profile','profile.user_id','=','dependents.user_id')\n\t\t\t->select(DB::raw('CONCAT(first_name, \" \", last_name) AS name,employee_code,dependents.name as vrname,relation,expiry_date,dependents.user_id'))\n\t\t\t->get();\t\t\n\t\tforeach ($empdepend_list as $edep){\n $col_data[] = array(\n\t\t\t\t\t'<div class=\"btn-group btn-group-xs\">'.\n '<a href=\"employee/'.$edep->user_id.'#dependent\" class=\"btn btn-default btn-xs\" data-toggle=\"tooltip\" title=\"View\"> <i class=\"fa fa-eye\"></i></a> '.'</div>',\n $edep->employee_code ? $edep->employee_code : '' ,\n $edep->name,\n\t\t\t\t\t'Dependent',\n $edep->vrname.'('.$edep->relation.')',\n\t\t\t\t\tHelper::showDate($edep->expiry_date)\n );\n }\n\t\tHelper::writeResult($col_data);\t\t\n\n return view('expirelist',compact(\n 'docexpire_count','col_heads'\n ));\n }", "public function sales_report(){\n ini_set(\"memory_limit\",\"512M\");\n $data['sideMenuData'] = fetch_non_main_page_content();\n $tenant_id = $this->tenant_id;\n $executive = array('' => 'Select');\n foreach ($this->reportsModel->get_sales_executive($tenant_id)->result() as $item) {\n $executive[$item->user_id] = $item->user_name;\n }\n $data['executive'] = $executive;\n if (!empty($_POST)) {\n $sales_executive_id = $this->input->post('sales_exec');\n $start = $this->input->post('start_date');\n $end = $this->input->post('end_date');\n $all_data = $this->reportsModel->salesrep($tenant_id,$sales_executive_id,$start,$end);\n $data['final_data']=$all_data;\n }\n if($this->input->post('start_date')=='' || $this->input->post('end_date')==''){\n $data['error']='Kindly Select The Date Range!!';\n }\n $data['page_title'] = 'Reports';\n $data['main_content'] = 'reports/sales_reports';\n $this->load->view('layout', $data);\n }", "public function daily_report($txtFromDate,$txtToDate,$ddlYear)\n\t{\n\t\t$this->db->where('td_fee_collection.col_date>=', $txtFromDate);\n\t\t$this->db->where('td_fee_collection.col_date<=', $txtToDate);\n\t\t$this->db->where('td_fee_collection.year', $ddlYear);\n\t\t// $this->db->group_by('td_fee_collection.stud_id');\n\t\t// $this->db->select('td_fee_collection.* , td_fee_subfunds.fee_head_id as feehead_id');\n\t\t// $this->db->from('td_fee_collection');\n\t\t// $this->db->join('td_fee_subfunds', 'td_fee_subfunds.fee_id = td_fee_collection.fee_id', 'INNER');\n\t\t// $this->db->limit(3);\n\t\t$query=$this->db->get('td_fee_collection');\n\t\treturn $query->result();\n\t}", "public function reportDatewiseAttendentView(Request $request)\n {\n $year = trim($request->year) ;\n $shift = trim($request->shift);\n $dept = trim($request->dept);\n $semister = trim($request->semister);\n $section = trim($request->section);\n $date_form = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($date_form));\n $date_to = trim($request->to); \n $to = date (\"Y-m-d\", strtotime($date_to));\n $result = DB::table('student')->where('year',$year)->where('shift_id',$shift)->where('dept_id', $dept )->where('semister_id',$semister)->where('section_id',$section)->orderBy('roll','asc')->get();\n // count holiday\n $count_holiday = DB::table('holiday')\n ->where('year',$year)\n ->whereBetween('holiday_date', [$from, $to])->count();\n // total day caluclation\n $date1 = date_create($from);\n $date2 = date_create($to);\n //difference between two dates\n $diff = date_diff($date1,$date2);\n $total_day = $diff->format(\"%a\")+1;\n $shift_name = DB::table('shift')->where('id',$shift)->first();\n $dept_name = DB::table('department')->where('id',$dept)->first();\n $semister_name = DB::table('semister')->where('id',$semister)->first();\n $section_name = DB::table('section')->where('id',$section)->first();\n return view('report.reportDatewiseAttendentView')->with('result',$result)->with('count_holiday',$count_holiday)->with('total_day',$total_day)->with('from',$from)->with('to',$to)->with('year',$year)->with('shift_name',$shift_name)->with('dept_name',$dept_name)->with('semister_name',$semister_name)->with('section_name',$section_name)->with('shift',$shift)->with('dept',$dept)->with('semister',$semister)->with('section',$section)->with('date_form',$date_form)->with('date_to',$date_to); \n\n }", "public function getThrendsDaily(Request $request) {\n\n\n if (($request->has('fr') && $request->has('to')) && (is_iso_date($request->input('fr')) && is_iso_date($request->input('to')))) {\n\n $this->dr->fr = carbonCheckorNow($request->input('fr'));\n $this->dr->to = carbonCheckorNow($request->input('to'));\n\n if ($this->dr->fr->gt($this->dr->to))\n return 'fr is gt to';\n\n $len = $this->dr->to->diffInDays($this->dr->fr);\n } else {\n\n $date = carbonCheckorNow($request->input('date'));\n $len = 6;\n if ($request->has('len') && $request->input('len')>0 && $request->input('len')<90)\n $len = $request->input('len');\n\n $this->dr->to = $date;\n $this->dr->fr = $date->copy()->subDays($len);\n } \n\n $datas = [];\n\n\n // return $this->dr->to->diffInDays($this->dr->fr);\n\n // return $this->dr->fr;\n // return $this->dr->fr->copy()->subDay();\n\n $dailysales = $this->repo\n // ->skipCache()\n ->getAllByDr($this->dr->fr->copy()->subDay(), $this->dr->to, ['sales', 'branchid', 'date']);\n\n // $branchs = \\App\\Models\\Boss\\Branch::select(['code', 'descriptor', 'id'])->active()->orderBy('code')->get();\n $branchs = \\App\\Models\\Branch::select(['code', 'descriptor', 'id'])->whereIn('id', collect($dailysales->pluck('branchid'))->unique()->toArray())->orderBy('code')->get();\n\n foreach($branchs as $key => $branch) {\n $datas[$key]['code'] = $branch->code;\n $datas[$key]['descriptor'] = $branch->descriptor;\n\n $to_date = $this->dr->to->copy();\n for ($i=0; $i<=$len+1; $i++) {\n $to = $to_date->copy()->subDay($i);\n \n $datas[$key]['dss'][$i]['date'] = $to;\n\n $filtered = $dailysales->filter(function ($item) use ($to, $branch) {\n return ($item->branchid == $branch->id) && ($item->date->format('Y-m-d') == $to->format('Y-m-d'))\n ? $item : null;\n });\n\n $f = $filtered->first();\n\n $datas[$key]['dss'][$i]['sales'] = is_null($f) ? NULL : $f->sales;\n }\n }\n\n\n // return $datas;\n\n\n foreach($datas as $j => $data) {\n foreach($data['dss'] as $k => $ds) {\n if ($k==0 && is_null($datas[$j]['dss'][$k]['sales'])) {\n $prev_sales = NULL;\n } else {\n if (($k)<=$len)\n $prev_sales = is_null($datas[$j]['dss'][($k+1)]['sales']) ? 0 : $datas[$j]['dss'][($k+1)]['sales'];\n else\n $prev_sales = 0;\n }\n $datas[$j]['dss'][$k]['prev_sales'] = $prev_sales;\n $datas[$j]['dss'][$k]['diff'] = $datas[$j]['dss'][$k]['sales'] - $prev_sales;\n $datas[$j]['dss'][$k]['pct'] = $prev_sales>0 ? ($datas[$j]['dss'][$k]['diff']/$prev_sales)*100 : 0;\n }\n }\n\n foreach($datas as $l => $data) {\n unset($datas[$l]['dss'][$len+1]);\n }\n\n // return $datas;\n\n /*\n if (!in_array($request->user()->id, ['41F0FB56DFA811E69815D19988DDBE1E', '11E943EA14DDA9E4EAAFBD26C5429A67'])) {\n\n $email = [\n 'body' => $request->user()->name.' '.$this->dr->fr->format('Y-m-d').' '.$this->dr->to->format('Y-m-d')\n ];\n\n \\Mail::queue('emails.notifier', $email, function ($m) {\n $m->from('[email protected]', 'GI App - Boss');\n $m->to('[email protected]')->subject('Sales Trend');\n });\n }\n */\n\n\n $view = view('report.trends-all-daily')\n ->with('datas', $datas);\n return $this->setViewWithDR($view);\n\n return $datas[0]['dss'];\n }", "public function deposit_report_by_collection(Request $request){\n\n $companydetails=company::all();\n $depositordetail=Depositor::where('d_active_status',1)->get();\n \n $depositors = $request->depositors;\n view()->share('depositors',$depositors);\n\n $fromdate = $request->fromDate;\n view()->share('fromdate',$fromdate);\n\n $todate = $request->toDate;\n view()->share('todate',$todate);\n\n Session::put('depositors',$depositors); \n Session::put('fromdate',$fromdate); \n Session::put('todate',$todate); \n\n// if (Session::put('fromdate',$fromdate) && Session::put('todate',$todate) && Session::put('depositors',$depositors)) {\nif ( $request->toDate && $request->fromDate && $request->depositors) {\n\n $deposit_collection = DB::table('depositcollections')\n ->whereBetween('d_c_date', [$fromdate, $todate])\n ->where('deposit_number_collection',[$depositors])\n ->select('depositcollections.*')\n ->orderBy('d_c_date', 'ASC')\n ->get();\n $deposit_sum = $deposit_collection->sum('d_collection_amount');\n return view('admin.collection.deposit_reportBy_collection',[\n 'companydetails'=>$companydetails,\n 'depositordetail'=>$depositordetail,\n 'deposit_collection'=>$deposit_collection,\n 'deposit_sum'=>$deposit_sum,\n \n \n\n ]);\n\n\n } \n\n $deposit_collection = DB::table('depositcollections')\n \n ->where('deposit_number_collection',[$depositors])\n ->select('depositcollections.*')\n ->orderBy('d_c_date', 'ASC')\n ->get();\n \n \n\n\n $deposit_sum = $deposit_collection->sum('d_collection_amount');\n\n\n\n return view('admin.collection.deposit_reportBy_collection',[\n 'companydetails'=>$companydetails,\n 'depositordetail'=>$depositordetail,\n 'deposit_collection'=>$deposit_collection,\n 'deposit_sum'=>$deposit_sum,\n \n \n\n ]);\n \n}", "function fetch_daily_sales_report(){\n \t\t$this->db->select('products.PRODUCT, SUM(sales.QUANTITY_SOLD) SALES, products.COST_PRICE, products.SALES_PRICE, sales.SALES_DATE');\n \t\t$this->db->from('sales');\n \t\t$this->db->join('products', 'products.PRODUCT_ID=sales.PRODUCT_ID', 'left');\n \t\t$this->db->where('sales.SALES_DATE', date('Y-m-d'));\n \t\t$this->db->where('sales.STATUS','Confirmed');\n \t\t$this->db->group_by('sales.PRODUCT_ID');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}", "public function retrieve_dateWise_profit_report_count($start_date,$end_date)\n\t{\n\t\t$this->db->select(\"a.date,a.invoice,b.invoice_id,sum(total_price) as total_sale\");\n\t\t$this->db->select('sum(`quantity`*`supplier_rate`) as total_supplier_rate', FALSE);\n\t\t$this->db->select(\"(SUM(total_price) - SUM(`quantity`*`supplier_rate`)) AS total_profit\");\n\n\t\t$this->db->from('invoice a');\n\t\t$this->db->join('invoice_details b','b.invoice_id = a.invoice_id');\n\n\t\t$this->db->where('a.date >=', $start_date); \n\t\t$this->db->where('a.date <=', $end_date); \n\n\t\t$this->db->group_by('b.invoice_id');\n\t\t$this->db->order_by('a.invoice','desc');\n\t\t$query = $this->db->get();\n\t\treturn $query->num_rows();\n\t}", "public function retrieve_product_sales_report()\n\t{\n\t\t$today = date('Y-m-d');\n\t\t$this->db->select(\"a.*,b.product_name,b.product_model,c.date,c.total_amount,d.customer_name\");\n\t\t$this->db->from('invoice_details a');\n\t\t$this->db->join('product_information b','b.product_id = a.product_id');\n\t\t$this->db->join('invoice c','c.invoice_id = a.invoice_id');\n\t\t$this->db->join('customer_information d','d.customer_id = c.customer_id');\n\t\t$this->db->where('c.date',$today);\n\t\t$this->db->order_by('c.date','desc');\n\t\t$this->db->limit('500');\n\t\t$query = $this->db->get();\t\n\t\treturn $query->result_array();\n\t}", "public function stock_report_bydate($product_id,$date,$limit,$page)\n\t{\t\n\n\t\t$this->db->select(\"a.product_name,a.product_id,a.price,a.product_model,sum(b.sell) as 'totalSalesQnty',sum(b.Purchase) as 'totalPurchaseQnty'\");\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('stock_history b','b.product_id = a.product_id');\n\t\tif(empty($product_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1,'b.vdate <= ' => $date));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//Single product information \n\t\t\t$this->db->where(array('a.status'=>1,'b.vdate <= ' => $date,'a.product_id'=>$product_id));\t\n\t\t}\n\t\t\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_id','desc');\n\t\t$this->db->limit($limit, $page);\n\t\t$query = $this->db->get();\n\n\t\t//$this->db->last_query(); //Testing purpose\n\t\treturn $query->result_array();\n\t}", "function get_SalesDatewise(){\n $CoID = $this->session->userdata('CoID') ;\n $WorkYear = $this->session->userdata('WorkYear') ; \n\n // $WorkYear = '2019-20';\n\n $sql=\"\";$f=\"\";$t=\"\";\n $dt=date(\"d-m-yy\");\n $current_month = date(\"m\");\n $current_year = date(\"yy\");\n $w=explode(\"-\",$WorkYear);\n $WY = '20'.$w[1];\n\n if((int)$WY > (int)$current_year)\n {\n $f = date(\"$current_year-$current_month-01\", strtotime($dt));\n $t = date(\"$current_year-$current_month-t\", strtotime($dt));\n }\n else{\n $f = date(\"$WY-03-01\", strtotime($dt));\n $t = date(\"$WY-03-t\", strtotime($dt));\n }\n\n $sql = \"\n select\n sm.BillNo,\n DATE_FORMAT(sm.BillDate,'%d-%m-%Y') as BillDate,\n pm.PartyName as PartyName,\n sm.PartyCode,\n sm.Area as AreaName,\n ac.ACTitle as BrokerName,\n sm.BrokerID,\n sm.BillAmt,\n sd.Qty,\n sd.NetWt,\n sd.Rate,\n sm.EWayBillNo,\n pm.PartyGSTNo as GSTNo\n from\n SaleMast sm, SaleDetails sd, ACMaster ac, PartyMaster pm\n where sm.CoID=sd.CoID \n AND sm.WorkYear=sd.WorkYear \n AND sm.BillNo=sd.BillNo\n\n AND sd.CoID=ac.CoID \n AND sm.WorkYear=ac.WorkYear \n AND sm.BrokerID=ac.ACCode\n\n AND sm.CoID=pm.CoID \n AND sm.WorkYear=pm.WorkYear \n AND sm.PartyCode=pm.PartyCode \n \n and sm.BillDate BETWEEN '$f' AND '$t'\n AND sm.CoID ='$CoID'\n AND sm.WorkYear = '$WorkYear'\n order by sm.BillDate desc\n \";\n $query = $this->db->query($sql)->result_array();\n\n \n if(empty($query))\n {\n $sql = \" \n select\n sm.BillNo,\n DATE_FORMAT(sm.BillDate,'%d-%m-%Y') as BillDate,\n pm.PartyName as PartyName,\n sm.PartyCode,\n sm.Area as AreaName,\n ac.ACTitle as BrokerName,\n sm.BrokerID,\n sm.BillAmt,\n sd.Qty,\n sd.NetWt,\n sd.Rate,\n sm.EWayBillNo,\n pm.PartyGSTNo as GSTNo\n from\n SaleMast sm, SaleDetails sd, ACMaster ac, PartyMaster pm\n where sm.CoID=sd.CoID \n AND sm.WorkYear=sd.WorkYear \n AND sm.BillNo=sd.BillNo\n\n AND sm.CoID=ac.CoID \n AND sm.WorkYear=ac.WorkYear \n AND sm.BrokerID=ac.ACCode\n\n AND sm.CoID=pm.CoID \n AND sm.WorkYear=pm.WorkYear \n AND sm.PartyCode=pm.PartyCode \n \n AND sm.CoID ='$CoID'\n AND sm.WorkYear = '$WorkYear' limit 1\n \n \";\n $query = $this->db->query($sql);\n $ea=array(\"empty\");\n\n foreach ($query->list_fields() as $field)\n {\n array_push($ea, $field);\n }\n \n return array($ea,$f,$t);\n }\n return array($query,$f,$t);\n }", "public function report() {\n $data = [];\n if ($this->input->post('submit')) {\n $report_data['from_date'] = $this->input->post('form_from_date');\n $report_data['to_date'] = $this->input->post('form_to_date');\n if ($this->input->post('form_summarized')) {\n $data['summarized_report'] = $this->account_model->getSummarizedReport($report_data);\n } else {\n $data['report'] = $this->account_model->getReport($report_data);\n }\n } else {\n if ($this->session->has_userdata('financialyear')) {\n $data['financialyear'] = $this->session->userdata('financialyear');\n }\n }\n $this->view('report', $data);\n }", "function sales_report_day_general($report){\n \t\t$this->db->select('products.PRODUCT, products.COST_PRICE, products.SALES_PRICE, sales.SALES_DATE, sales.ORDER_NO, sales.QUANTITY_SOLD, staff.NAME, sales.STATUS');\n \t\t$this->db->from('sales');\n \t\t$this->db->join('products', 'products.PRODUCT_ID=sales.PRODUCT_ID', 'left');\n \t\t$this->db->join('staff', 'sales.STAFF_ID=staff.STAFF_ID', 'left');\n\n \t\tif($report['SALES_DATE']==\"\" and isset($report['MONTH'])){\n \t\t\t$this->db->where('MONTH(sales.SALES_DATE)', $report['MONTH']);\n \t\t\t$this->db->where('YEAR(sales.SALES_DATE)', date('Y'));\n \t\t}\n \t\telseif(isset($report['SALES_DATE']) and $report['MONTH']==\"\"){\n \t\t\t$this->db->where('sales.SALES_DATE', $report['SALES_DATE']);\n \t\t}\n \t\t\n \t\t$this->db->order_by('sales.STAFF_ID', 'DESC');\n \t\t$this->db->order_by('staff.NAME', 'DESC');\n \t\t$this->db->where('sales.STATUS', 'Confirmed');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}", "public function reportClient (Request $request, $id) {\n \n $date = Carbon::now();\n $clientSales = Client::selectRaw('sum(details_sales.subtotal) total')\n ->where('clients.id','=',$id)\n ->leftJoin('sales', 'clients.id', '=', 'sales.id_client')\n ->leftJoin('details_sales', 'details_sales.id_sale', '=', 'sales.id')\n ->get();\n \n \n $clientSalesLast30Days = Client::selectRaw('day(sales.created_at) day ,sum(details_sales.subtotal) total')\n ->where('clients.id',$id)\n ->leftJoin('sales', 'clients.id', '=', 'sales.id_client')\n ->leftJoin('details_sales','details_sales.id_sale','=','sales.id')\n ->where('sales.created_at', '>=', $date->subdays(30))\n ->groupBy('day')\n ->get();\n \n // $clientSalesLastYear = Client::where('clients.id',$id)\n // ->leftJoin('sales', 'clients.id', '=', 'sales.id_client')\n // ->whereYear('sales.created_at', $date->year - 1)->count();\n \n $sales_months_year = Client::selectRaw('month(sales.created_at) month, sum(details_sales.subtotal) total')\n ->where('clients.id',$id)\n ->leftJoin('sales', 'clients.id', '=', 'sales.id_client')\n ->leftJoin('details_sales','details_sales.id_sale','=','sales.id')\n ->whereYear('sales.created_at', $date->year )\n ->groupBy('month')\n ->get();\n \n $days = [];\n\n $months = [\n 'Enero',\n 'Febrero',\n 'Marzo',\n 'Abril',\n 'Mayo',\n 'Junio',\n 'Julio',\n 'Agosto',\n 'Septiembre',\n 'Octubre',\n 'Noviembre',\n 'Diciembre',\n ];\n\n for($i = 0; $i < 12; $i++) {\n $filter = (array_filter(json_decode($sales_months_year, true), function($v) use($i) {\n //dd($i);\n return $v['month'] == $i+1;\n }, ARRAY_FILTER_USE_BOTH));\n \n if($filter) {\n $months[$i] = [\n 'month' => $months[$i],\n 'total' => $filter[0]['total']\n ];\n }else {\n $months[$i] = [\n 'month' => $months[$i],\n 'total' => 0\n ];\n }\n \n }\n\n for($i = 1; $i < 30; $i++) {\n $filter = (array_filter(json_decode($clientSalesLast30Days, true), function($v) use($i) {\n //dd($i);\n return $v['day'] == $i;\n }, ARRAY_FILTER_USE_BOTH));\n \n if($filter) {\n $days[] = [\n 'day' => $filter[0]['day'],\n 'total' => $filter[0]['total']\n ];\n }else {\n $days[] = [\n 'day' => $i,\n 'total' => 0\n ];\n }\n \n }\n \n return response([\n \"total_sales\" => $clientSales[0]['total'],\n \"total_last_30_days_sales\" => $days,\n \"total_year_sales\" => $months\n ], 200);\n }", "public function getCDateAttnDeptWise_new()\n {\n $orgid = isset($_REQUEST['refno']) ? $_REQUEST['refno'] : 0;\n $att = isset($_REQUEST['att']) ? $_REQUEST['att'] : 0;\n $date = isset($_REQUEST['date']) ? $_REQUEST['date'] : '';\n $dept = isset($_REQUEST['dept']) ? $_REQUEST['dept'] : '';\n $datafor = isset($_REQUEST['datafor']) ? $_REQUEST['datafor'] : '';\n $zone = getTimeZone($orgid);\n date_default_timezone_set($zone);\n $date =date('Y-m-d',strtotime($date));\n $time = date('H:i:s');\n $data = array();\n $cdate = date('Y-m-d');\n\t \n\t $dept_cond='';\n\t $dept_cond1 ='';\n\t if($dept!=0)\n\t {\n\t\t $dept_cond = ' and Dept_id='.$dept;\n\t\t $dept_cond1 = ' and Department='.$dept;\n\t }\n\t \n //today attendance\n\t\t if($datafor=='present'){\n\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE `AttendanceDate`=? \".$dept_cond.\" and OrganizationId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) order by `name`\",\n\t\tarray($date,$orgid));\n $data['present'] = $query->result();\n\t\t\t\n\t\t\t }else if($datafor=='absent'){\n\t\t\t\t /*\n //---managing off (weekly and holiday)\n $dt = $date; \n // day of month : 1 sun 2 mon --\n $dayOfWeek = 1 + date('w', strtotime($dt));\n $weekOfMonth = weekOfMonth($dt);\n $week = '';\n $query = $this->db->query(\"SELECT `WeekOff` FROM `WeekOffMaster` WHERE `OrganizationId` =? AND `Day` = ?\", array(\n $orgid,\n $dayOfWeek\n ));\n if ($row = $query->result()) {\n $week = explode(\",\", $row[0]->WeekOff);\n }\n if ($week[$weekOfMonth - 1] == 1) {\n $data['absentees'] = '';\n } else {\n $query = $this->db->query(\"SELECT `DateFrom`, `DateTo` FROM `HolidayMaster` WHERE OrganizationId=? and (? between `DateFrom` and `DateTo`) \", array(\n $orgid,\n $dt\n ));\n if ($query->num_rows() > 0) {\n //-----managing off (weekly and holiday) - close \n $query = $this->db->query(\"SELECT CONCAT(FirstName,' ',LastName) as name,'-' as TimeIn,'-' as TimeOut ,'Absent' as status from EmployeeMaster where `OrganizationId` =$orgid and EmployeeMaster.archive=1 and EmployeeMaster.Id not in(select AttendanceMaster.`EmployeeId` from AttendanceMaster where `AttendanceDate`='$date' and `OrganizationId` =$orgid) and CAST('$time' as time) > (select TimeIn from ShiftMaster where ShiftMaster.Id=shift) order by `name`\", array(\n $orgid,\n $date,\n $orgid\n ));\n $data['absentees'] = $query->result();\n } \n }*/\n\t\t\t//////////abs\n\t\n\t\t\t\n\t\t\t\n\t\t\tif($date!=date('Y-m-d')){// for other deay's absentees\n\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , '-' as `TimeOut` ,'-' as TimeIn FROM `AttendanceMaster` WHERE `AttendanceDate`=? and OrganizationId=? and (AttendanceStatus=2 or AttendanceStatus=6 or AttendanceStatus=7 ) \". $dept_cond .\" order by `name`\", array($date,$orgid));\n\t\t\t\t$this->db->close();\n\t\t\t\t$data['absent'] = $query->result();\n\t\t\t}else{ // for today's absentees\n\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , '-' as `TimeOut` ,'-' as TimeIn FROM `AttendanceMaster` WHERE `AttendanceDate`=? and OrganizationId=? \nand AttendanceStatus in (2,6,7) \". $dept_cond .\" order by `name`\",array($date,$orgid));\n\t\t\t$temp=array();\n $temp = $query->result();\n\t\t\t\n\t\t\t$query = $this->db->query(\"SELECT CONCAT(FirstName,' ',LastName) as name, '-' as `TimeOut` ,'-' as TimeIn\n\t\t\t\t\t\tFROM `EmployeeMaster` \n\t\t\t\t\t\tWHERE `OrganizationId` =?\n\t\t\t\t\t\tAND ARCHIVE =1 \". $dept_cond1.\" \n\t\t\t\t\t\tAND Id NOT \n\t\t\t\t\t\tIN (\n\t\t\t\t\t\tSELECT EmployeeId\n\t\t\t\t\t\tFROM AttendanceMaster\n\t\t\t\t\t\tWHERE AttendanceDate = ?\n\t\t\t\t\t\tAND `OrganizationId` =?\n\t\t\t\t\t\t)\n\t\t\t\t\t\tAND (\n\t\t\t\t\t\tSELECT `TimeIn` \n\t\t\t\t\t\tFROM `ShiftMaster` \n\t\t\t\t\t\tWHERE `Id` = Shift\n\t\t\t\t\t\tAND TimeIn < ?\n\t\t\t\t\t\t)\",array($orgid,$date,$orgid,$time));\n\t\t\t\t\t\t$data['absent']= array_merge($temp,$query->result());\n\t\t\t}\n\t}else if($datafor=='latecomings'){\n\t//\techo \"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and `AttendanceDate`='$date' \".$dept_cond.\" and OrganizationId='$orgid' and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) order by `name`\";\n //////// today_late\n $query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and `AttendanceDate`=? \".$dept_cond.\" and OrganizationId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) order by `name`\", array(\n $date,\n $orgid\n ));\n $data['lateComings'] = $query->result();\n\t}else if($datafor=='earlyleavings'){\t\t\n ////////today_early\n\t\t\n /* $query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (time(TimeOut) < (select time(TimeOut) from ShiftMaster where ShiftMaster.Id=shiftId) and TimeOut!='00:00:00' ) and `AttendanceDate`=? \".$dept_cond.\" and OrganizationId=? and AttendanceStatus in (1,3,4,5,8) order by `name`\", array( $date, $orgid ));\n $data['earlyLeavings'] = $query->result(); */\n\t\t\t\n\t\t $query = $this->db->query(\"select Shift,Id , FirstName , LastName from EmployeeMaster where OrganizationId = $orgid and Id IN (select EmployeeId from AttendanceMaster where OrganizationId = $orgid and AttendanceDate='$date' and TimeIn != '00:00:00' $dept_cond ) AND is_Delete=0 order by FirstName\");\n\t\t $res = array();\n\t\t $cond = '';\n foreach ($query->result() as $row) {\n $ShiftId = $row->Shift;\n $EId = $row->Id;\n $query = $this->db->query(\"select TimeIn,TimeOut,shifttype from ShiftMaster where Id = $ShiftId\");\n if ($data123 = $query->row()) {\n $shiftout = $data123->TimeOut;\n $shiftout1 = $date. ' '.$data123->TimeOut;\n\t\t\t\tif($data123->shifttype==2)\n\t\t\t\t{\n\t\t\t\t\t$nextdate = date('Y-m-d',strtotime($date . \"+1 days\"));\n\t\t\t\t\t $shiftout1 = $nextdate.' '.$data123->TimeOut;\n\t\t\t\t}\n $shift = substr($data123->TimeIn, 0, 5) . ' - ' . substr($data123->TimeOut, 0, 5);\n $ct = date('H:i:s');\n \n if ($cdate == $date)\n $cond = \" and TimeOut !='00:00:00'\";\n $query333 = $this->db->query(\"select SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out from AttendanceMaster where EmployeeId =$EId and if(timeoutdate = '0000-00-00' , TimeOut < '$shiftout' , CONCAT(timeoutdate,' ' ,TimeOut) < '$shiftout1' ) and AttendanceDate='$date'\" . $cond);\n\t\t\t\t\t\n\t\t\t\t\t\n if ($row333 = $query333->row()) {\n $a = new DateTime($row333->TimeOut);\n $b = new DateTime($data123->TimeOut);\n $interval = $a->diff($b);\n $data['earlyby'] = $interval->format(\"%H:%I\");\n $data['timeout'] = substr($row333->TimeOut, 0, 5);\n $data['name'] = $row->FirstName . ' ' . $row->LastName;\n $data['shift'] = $shift;\n $data['TimeIn'] = $row333->TimeIn;\n $data['TimeOut'] = $row333->TimeOut;\n $data['CheckOutLoc'] = $row333->CheckOutLoc;\n $data['checkInLoc'] = $row333->checkInLoc;\n $data['latit_in'] = $row333->latit_in;\n $data['longi_in'] = $row333->longi_in;\n $data['latit_out'] = $row333->latit_out;\n $data['longi_out'] = $row333->longi_out;\n $data['status'] = $row333->status;\n $data['date'] = $date;\n $res[] = $data;\n }\n \n }\n }\n\t\t $data['earlyLeavings'] =\t $res; \n \t}\n echo json_encode($data, JSON_NUMERIC_CHECK);\n }", "public function store(Request $request)\n {\n //Add New Daily Expenses Entry Start\n if($request->input('expense_name') != null){\n $add_daily_expenses = New DailyExpenses([\n 'name' => $request->input('expense_name'),\n 'expense_amount' => $request->input('expense_amount'),\n 'month' => date('M'),\n 'year' => date('Y'),\n ]); \n $add_daily_expenses->save();\n return \\Redirect::back();\n }\n //Add New Daily Expenses Entry End\n\n //Edit Daily Expenses Entry Start\n if($request->input('edited_daily_expense_id') != null){\n\n $requested_id = DailyExpenses::where('id','=',$request->input('edited_daily_expense_id'))->first();\n\n $requested_id->name = $request->input('edited_daily_expense_name');\n $requested_id->expense_amount = $request->input('edited_daily_expense_amount');\n $requested_id->save();\n return \\Redirect::back();\n }\n //Edit Daily Expenses Entry End\n\n //Delete Daily Expenses Entry Start\n if($request->input('delete_expense_id') != null){\n\n $delete_requested_id = DailyExpenses::where('id','=',$request->input('delete_expense_id'))->first();\n $delete_requested_id->delete();\n return \\Redirect::back(); \n }\n //Delete Daily Expenses Entry End\n\n\n\n //Daily Expenses Items Monthly PDF Report Start\n if($request->input('daily_expense_pdf_month') != null){\n\n $inc = 1;\n\n $DailyExpenses_report = DailyExpenses::where([\n ['month', '=', $request->input('daily_expense_pdf_month')],\n ['year', '=', $request->input('daily_expense_pdf_year')],\n ])->get();\n\n $params = [\n 'title' => 'Daily Expenses Report ',\n 'inc' => $inc,\n 'DailyExpenses_report' => $DailyExpenses_report,\n 'month' => $request->input('daily_expense_pdf_month'),\n 'year' => $request->input('daily_expense_pdf_year'),\n ];\n \n\n return view('AdminPages.DailyExpensesSystem.month_report')->with($params);\n $pdf = \\PDF::loadView('AdminPages.DailyExpensesSystem.month_report', $params)->setPaper('a4', 'landscape'); \n return $pdf->download('Payment_To_Vendor_Paid_Report='.$request->input('payment_to_vendor_paid_items_pdf_month').'-'.$request->input('payment_to_vendor_paid_items_pdf_year').'.pdf');\n }\n // Daily Expenses Items Monthly PDF Report End\n\n\n\n\n\n\n }", "function calculateDates()\n\t\t\t{\n\t\t\t\t$dates = [ 'mailshot_1_date'=>'+7 day', 'mailshot_2_date' => '+14 day',\n\t\t\t\t\t'employer_engagement_start'=>' +14 day', 'employer_engagement_end'=>'-9 week', 'self_place_deadline'=>'-7 week',\n\t\t\t\t\t 'matching_end'=>'-7 week'];\n\n\t\t\t\t$placement = ['employer_engagement_end'=>'-9 week', 'self_place_deadline' =>'-7 week','matching_end' =>'-7 week'];\n\t\t\t\tif (!empty($_POST)) {\n\t\t\t\t\tif ($this->input->post('campaign_place_start_date')) {\n\t\t\t\t\t\t$start = new DateTime();\n\t\t\t\t\t\t$start->setTimestamp( strtotime($this->input->post('campaign_start_date')));\n\t\t\t\t\t\t$place_start = new DateTime();\n\t\t\t\t\t\t$place_start->setTimestamp( strtotime($this->input->post('campaign_place_start_date')));\n\t\t\t\t\t\t$place_end = new DateTime();\n\t\t\t\t\t\t$place_end->setTimestamp(strtotime($this->input->post('campaign_place_end_date')));\n\t\t\t\t\t\t$array = [];\n\t\t\t\t\t\t\tforeach ($dates as $k => $day){\n\t\t\t\t\t\t\t\tif(in_array($k,(array_keys($placement)))){\n\t\t\t\t\t\t\t\t\t$array[$k] = date ('d/m/Y',strtotime( $day));\n\t\t\t\t\t\t\t\t}\n else {\n $array[$k] = date('d/m/Y', strtotime( $day));\n }\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\techo json_encode($array, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "public function dailyLog()\n\t{\n\t\t$from = Input::get('start');\n\t\t$to = Input::get('end');\n\t\t$pendingOrAll = Input::get('pending_or_all');\n\t\t$error = '';\n\t\t$accredited = array();\n\t\t//\tCheck radiobutton for pending/all tests is checked and assign the 'true' value\n\t\tif (Input::get('tests') === '1') {\n\t\t $pending='true';\n\t\t}\n\t\t$date = date('Y-m-d');\n\t\tif(!$to){\n\t\t\t$to=$date;\n\t\t}\n\t\t$toPlusOne = date_add(new DateTime($to), date_interval_create_from_date_string('1 day'));\n\t\t$records = Input::get('records');\n\t\t$testCategory = Input::get('section_id');\n\t\t$testType = Input::get('test_type');\n\t\t$labSections = TestCategory::lists('name', 'id');\n\t\tif($testCategory)\n\t\t\t$testTypes = TestCategory::find($testCategory)->testTypes->lists('name', 'id');\n\t\telse\n\t\t\t$testTypes = array(\"\"=>\"\");\n\t\t\n\t\tif($records=='patients'){\n\t\t\tif($from||$to){\n\t\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($date)||strtotime($to)>strtotime($date)){\n\t\t\t\t\t\t$error = trans('messages.check-date-range');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$visits = Visit::whereBetween('created_at', array($from, $toPlusOne))->get();\n\t\t\t\t}\n\t\t\t\tif (count($visits) == 0) {\n\t\t\t\t \tSession::flash('message', trans('messages.no-match'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$visits = Visit::where('created_at', 'LIKE', $date.'%')->orderBy('patient_id')->get();\n\t\t\t}\n\t\t\tif(Input::has('word')){\n\t\t\t\t$date = date(\"Ymdhi\");\n\t\t\t\t$fileName = \"daily_visits_log_\".$date.\".doc\";\n\t\t\t\t$headers = array(\n\t\t\t\t \"Content-type\"=>\"text/html\",\n\t\t\t\t \"Content-Disposition\"=>\"attachment;Filename=\".$fileName\n\t\t\t\t);\n\t\t\t\t$content = View::make('reports.daily.exportPatientLog')\n\t\t\t\t\t\t\t\t->with('visits', $visits)\n\t\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t \treturn Response::make($content,200, $headers);\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn View::make('reports.daily.patient')\n\t\t\t\t\t\t\t\t->with('visits', $visits)\n\t\t\t\t\t\t\t\t->with('error', $error)\n\t\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t\t}\n\t\t}\n\t\t//Begin specimen rejections\n\t\telse if($records=='rejections')\n\t\t{\n\t\t\t$specimens = Specimen::where('specimen_status_id', '=', Specimen::REJECTED);\n\t\t\t/*Filter by test category*/\n\t\t\tif($testCategory&&!$testType){\n\t\t\t\t$specimens = $specimens->join('tests', 'specimens.id', '=', 'tests.specimen_id')\n\t\t\t\t\t\t\t\t\t ->join('test_types', 'tests.test_type_id', '=', 'test_types.id')\n\t\t\t\t\t\t\t\t\t ->where('test_types.test_category_id', '=', $testCategory);\n\t\t\t}\n\t\t\t/*Filter by test type*/\n\t\t\tif($testCategory&&$testType){\n\t\t\t\t$specimens = $specimens->join('tests', 'specimens.id', '=', 'tests.specimen_id')\n\t\t\t\t \t\t\t\t\t ->where('tests.test_type_id', '=', $testType);\n\t\t\t}\n\n\t\t\t/*Filter by date*/\n\t\t\tif($from||$to){\n\t\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($date)||strtotime($to)>strtotime($date)){\n\t\t\t\t\t\t$error = trans('messages.check-date-range');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$specimens = $specimens->whereBetween('time_rejected', \n\t\t\t\t\t\tarray($from, $toPlusOne))->get(array('specimens.*'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$specimens = $specimens->where('time_rejected', 'LIKE', $date.'%')->orderBy('id')\n\t\t\t\t\t\t\t\t\t\t->get(array('specimens.*'));\n\t\t\t}\n\t\t\tif(Input::has('word')){\n\t\t\t\t$date = date(\"Ymdhi\");\n\t\t\t\t$fileName = \"daily_rejected_specimen_\".$date.\".doc\";\n\t\t\t\t$headers = array(\n\t\t\t\t \"Content-type\"=>\"text/html\",\n\t\t\t\t \"Content-Disposition\"=>\"attachment;Filename=\".$fileName\n\t\t\t\t);\n\t\t\t\t$content = View::make('reports.daily.exportSpecimenLog')\n\t\t\t\t\t\t\t\t->with('specimens', $specimens)\n\t\t\t\t\t\t\t\t->with('testCategory', $testCategory)\n\t\t\t\t\t\t\t\t->with('testType', $testType)\n\t\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t \treturn Response::make($content,200, $headers);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn View::make('reports.daily.specimen')\n\t\t\t\t\t\t\t->with('labSections', $labSections)\n\t\t\t\t\t\t\t->with('testTypes', $testTypes)\n\t\t\t\t\t\t\t->with('specimens', $specimens)\n\t\t\t\t\t\t\t->with('testCategory', $testCategory)\n\t\t\t\t\t\t\t->with('testType', $testType)\n\t\t\t\t\t\t\t->with('error', $error)\n\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t\t}\n\t\t}\n\t\t//Begin test records\n\t\telse\n\t\t{\n\t\t\t$tests = Test::whereNotIn('test_status_id', [Test::NOT_RECEIVED]);\n\t\t\t\n\t\t\t/*Filter by test category*/\n\t\t\tif($testCategory&&!$testType){\n\t\t\t\t$tests = $tests->join('test_types', 'tests.test_type_id', '=', 'test_types.id')\n\t\t\t\t\t\t\t ->where('test_types.test_category_id', '=', $testCategory);\n\t\t\t}\n\t\t\t/*Filter by test type*/\n\t\t\tif($testType){\n\t\t\t\t$tests = $tests->where('test_type_id', '=', $testType);\n\t\t\t}\n\t\t\t/*Filter by all tests*/\n\t\t\tif($pendingOrAll=='pending'){\n\t\t\t\t$tests = $tests->whereIn('test_status_id', [Test::PENDING, Test::STARTED]);\n\t\t\t}\n\t\t\telse if($pendingOrAll=='all'){\n\t\t\t\t$tests = $tests->whereIn('test_status_id', \n\t\t\t\t\t[Test::PENDING, Test::STARTED, Test::COMPLETED, Test::VERIFIED]);\n\t\t\t}\n\t\t\t//For Complete tests and the default.\n\t\t\telse{\n\t\t\t\t$tests = $tests->whereIn('test_status_id', [Test::COMPLETED, Test::VERIFIED]);\n\t\t\t}\n\t\t\t/*Get collection of tests*/\n\t\t\t/*Filter by date*/\n\t\t\tif($from||$to){\n\t\t\t\tif(strtotime($from)>strtotime($to)||strtotime($from)>strtotime($date)||strtotime($to)>strtotime($date)){\n\t\t\t\t\t\t$error = trans('messages.check-date-range');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$tests = $tests->whereBetween('time_created', array($from, $toPlusOne))->get(array('tests.*'));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tests = $tests->where('time_created', 'LIKE', $date.'%')->get(array('tests.*'));\n\t\t\t}\n\t\t\t\t\n\t\t\tif(Input::has('word')){\n\t\t\t\t$date = date(\"Ymdhi\");\n\t\t\t\t$fileName = \"daily_test_records_\".$date.\".doc\";\n\t\t\t\t$headers = array(\n\t\t\t\t \"Content-type\"=>\"text/html\",\n\t\t\t\t \"Content-Disposition\"=>\"attachment;Filename=\".$fileName\n\t\t\t\t);\n\t\t\t\t$content = View::make('reports.daily.exportTestLog')\n\t\t\t\t\t\t\t\t->with('tests', $tests)\n\t\t\t\t\t\t\t\t->with('testCategory', $testCategory)\n\t\t\t\t\t\t\t\t->with('testType', $testType)\n\t\t\t\t\t\t\t\t->with('pendingOrAll', $pendingOrAll)\n\t\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t \treturn Response::make($content,200, $headers);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn View::make('reports.daily.test')\n\t\t\t\t\t\t\t->with('labSections', $labSections)\n\t\t\t\t\t\t\t->with('testTypes', $testTypes)\n\t\t\t\t\t\t\t->with('tests', $tests)\n\t\t\t\t\t\t\t->with('counts', $tests->count())\n\t\t\t\t\t\t\t->with('testCategory', $testCategory)\n\t\t\t\t\t\t\t->with('testType', $testType)\n\t\t\t\t\t\t\t->with('pendingOrAll', $pendingOrAll)\n\t\t\t\t\t\t\t->with('accredited', $accredited)\n\t\t\t\t\t\t\t->with('error', $error)\n\t\t\t\t\t\t\t->withInput(Input::all());\n\t\t\t}\n\t\t}\n\t}", "public function calculateStageDate(){\n $rallyService = parent::getService('rally','rally');\n $teamService = parent::getService('team','team');\n $leagueService = parent::getService('league','league');\n \n $allRallies = $rallyService->getAllRallies();\n foreach($allRallies as $rally):\n $date = new DateTime($rally['date']);\n foreach($rally['Stages'] as $key => $stage):\n if($key!=0){\n $date->add(new DateInterval('PT15M'));\n }\n $stage->set('date',$date->format('Y-m-d H:i:s'));\n if($date->format('Y-m-d H:i:s')<date('Y-m-d H:i:s')){\n $stage->set('finished',1);\n }\n $stage->save();\n// var_dump($stage->toArray());exit;\n endforeach;\n endforeach;\n echo \"pp\";exit;\n }", "public function getRemittanceReport($month,$day,$year,$fromTime_hour,$fromTime_minutes,$fromTime_seconds,$toTime_hour,$toTime_minutes,$toTime_seconds,$username,$module) {\n\necho \"\n<style type='text/css'>\ntr:hover { background-color:yellow; color:black;}\na { text-decoration:none; color:black; }\n</style>\";\n\n$dateSelected = $month.\"_\".$day.\"_\".$year;\n$fromTimez = $fromTime_hour.\":\".$fromTime_minutes.\":\".$fromTime_seconds;\n$toTimez = $toTime_hour.\":\".$toTime_minutes.\":\".$toTime_seconds;\n\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\nif($module == \"PHARMACY\" || $module == \"CSR\") {\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT upper(pr.completeName) as completeName,pc.description,pc.sellingPrice,pc.quantity,pc.discount,pc.total,pc.cashUnpaid,pc.cashPaid,pc.chargeBy FROM patientRecord pr,registrationDetails rd,patientCharges pc WHERE pr.patientNo = rd.patientNo and rd.registrationNo = pc.registrationNo and pc.dateCharge = '$dateSelected' and (pc.departmentStatus_time between '$fromTimez' and '$toTimez') and inventoryFrom='$module' and departmentStatus='dispensedBy_$username' group by pc.itemNo order by completeName asc \");\n}else {\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT upper(pr.completeName) as completeName,pc.description,pc.sellingPrice,pc.quantity,pc.discount,pc.total,pc.cashUnpaid,pc.cashPaid,pc.chargeBy FROM patientRecord pr,registrationDetails rd,patientCharges pc WHERE pr.patientNo = rd.patientNo and rd.registrationNo = pc.registrationNo and pc.dateCharge = '$dateSelected' and (pc.departmentStatus_time between '$fromTimez' and '$toTimez') and title='$module' and departmentStatus='remittedBy_$username' group by pc.itemNo order by completeName asc \");\n}\n\n\necho \"<table border=1 cellpadding=0 cellspacing=0>\";\necho \"<tr>\";\necho \"<th>&nbsp;Name&nbsp;</th>\";\necho \"<th>&nbsp;Description&nbsp;</th>\";\necho \"<th>&nbsp;Price&nbsp;</th>\";\necho \"<th>&nbsp;QTY&nbsp;</th>\";\necho \"<th>&nbsp;Disc&nbsp;</th>\";\necho \"<th>&nbsp;Total&nbsp;</th>\";\necho \"<th>&nbsp;Unpaid&nbsp;</th>\";\necho \"<th>&nbsp;Paid&nbsp;</th>\";\necho \"<th>&nbsp;Charge By&nbsp;</th>\";\necho \"</tr>\";\n$this->sales_total=0;\n$this->sales_unpaid=0;\n$this->sales_paid=0;\nwhile($row = mysqli_fetch_array($result))\n {\necho \"<tr>\";\necho \"<td>&nbsp;\".$row['completeName'].\"&nbsp;</td>\";\necho \"<td>&nbsp;\".$row['description'].\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['sellingPrice'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['quantity'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['discount'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['total'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['cashUnpaid'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".number_format($row['cashPaid'],2).\"&nbsp;</td>\";\necho \"<td>&nbsp;\".$row['chargeBy'].\"&nbsp;</td>\";\n$this->sales_total+=$row['total'];\n$this->sales_paid+=$row['cashPaid'];\n$this->sales_unpaid+=$row['cashUnpaid'];\necho \"</tr>\";\n }\necho \"</table>\";\necho \"<br>Total Sales:&nbsp;\".$this->sales_total;\necho \"<br>Total Unpaid:&nbsp;\".$this->sales_unpaid;\necho \"<br>Total Paid&nbsp;\".$this->sales_paid;\n\n}", "public function get_ledger_report(Request $request)\n\t{\t \n\t $organization_id = Session::get('organization_id');\n\t $start_date \t= $request->start_date;\n\t $end_date \t= $request->end_date;\n\t $ledger_id \t= $request->id;\n\t $group_name \t= $request->group_name;\n\n\t $prev_date = date('Y-m-d', strtotime($start_date .' -1 day'));\n\n\t //dd($start_date);\n\n\t $account_ledger_name = AccountLedger::where('id', $ledger_id)->first()->name;\n\n\t $ledger = AccountLedger::select('account_ledgers.id', 'account_ledgers.display_name AS ledger', 'account_ledgers.opening_balance','account_ledgers.opening_balance_type', 'account_ledgers.updated_at', 'account_ledgers.opening_balance_date')\n ->where('account_ledgers.id', $ledger_id)\n ->first();\n\n /*get organization first transaction date */\n\n $pre_entry = AccountEntry::select('account_entries.id',DB::raw('MIN(account_entries.date) as pre_date'))\n ->leftjoin('account_vouchers','account_vouchers.id', '=' ,'account_entries.voucher_id')\n ->leftjoin('account_transactions','account_transactions.entry_id', '=' ,'account_entries.id')\n ->leftjoin('account_ledgers AS debit_ledger','debit_ledger.id', '=' ,'account_transactions.debit_ledger_id')\n ->leftjoin('account_ledgers AS credit_ledger','credit_ledger.id', '=' ,'account_transactions.credit_ledger_id') \n ->where('account_entries.organization_id', $organization_id)\n ->where('debit_ledger.id',$ledger_id)\n ->orWhere('credit_ledger.id',$ledger_id)\n ->first();\n\n /*end*/\n\n \t$opening_balance = $this->ledger_closing_sp($ledger_id, Carbon::parse($pre_entry->pre_date)->subDay()->toDateString(), Carbon::parse($pre_entry->pre_date)->subDay()->toDateString(),$group_name); \n\n \t/*its changed*/\n \t$closing_balance = $this->ledger_closing_sp($ledger_id, $pre_entry->pre_date, $end_date,$group_name);\n \t/*end*/\n\n\n \t/* previous opening amount */\n\n\t\t$pre_balance = $this->ledger_closing_sp($ledger_id, $pre_entry->pre_date, $prev_date,$group_name);\n\n\t\t/*end*/\n\t\t\n\t\t//dd($pre_balance);\n\n if($account_ledger_name == 'sales' || $account_ledger_name == 'opening_equity' || $group_name == 'Sundry Debtors' || $group_name == 'Sundry creditors' || $group_name =='Duties &amp; Taxes')\n\t\t{\n\t\t\t//dd('1');\n\t\t\t$ledger_statement = DB::select(\"SELECT \n\t\t\t account_entries.id,\n\t\t\t account_transactions.id AS voucher_acc_id,\n\t\t\t account_entries.voucher_no,\n\t\t\t account_vouchers.code AS voucher_code,\n\t\t\t account_vouchers.id AS voucher_master_id,\n\t\t\t account_vouchers.display_name AS voucher_type,\n\t\t\t debit_ledger.display_name AS debit_account,\n\t\t\t credit_ledger.display_name AS credit_account,\n\t\t\t \n\t\t\t IF(debit_ledger.id = \".$ledger_id.\",sum(account_transactions.amount), '0.00') AS debit,\n\t\t\t IF(credit_ledger.id = \".$ledger_id.\",sum(account_transactions.amount), '0.00') AS credit,\n\t\t\t account_entries.date,\n\t\t\t account_vouchers.name AS voucher_master\n\t\t\tFROM\n\t\t\t account_entries\n\t\t\t LEFT JOIN account_vouchers \n\t\t\t ON account_vouchers.id = account_entries.voucher_id \n\t\t\t LEFT JOIN account_transactions \n\t\t\t ON account_entries.id = account_transactions.entry_id \n\t\t\t LEFT JOIN account_ledgers AS debit_ledger \n\t\t\t ON debit_ledger.id = account_transactions.debit_ledger_id \n\t\t\t LEFT JOIN account_ledgers AS credit_ledger \n\t\t\t ON credit_ledger.id = account_transactions.credit_ledger_id \n\t\t\tWHERE account_entries.organization_id = \".$organization_id.\" \n\t\t\t AND (debit_ledger.id = \".$ledger_id.\" OR credit_ledger.id = \".$ledger_id.\") AND (DATE BETWEEN '\".$start_date.\"' AND '\".$end_date.\"')\n\t\t\t AND account_entries.status = 1 AND account_vouchers.name != 'stock_journal'\n\t\t\t GROUP BY account_entries.id\n\t\t\t \");\n\t\t}else\n\t\t{\n\t\t\t//dd('2');\n\t $ledger_statement = DB::select(\"SELECT \n\t\t\t account_entries.id,\n\t\t\t account_transactions.id AS voucher_acc_id,\n\t\t\t account_entries.voucher_no,\n\t\t\t account_vouchers.code AS voucher_code,\n\t\t\t account_vouchers.id AS voucher_master_id,\n\t\t\t account_vouchers.display_name AS voucher_type,\n\t\t\t debit_ledger.display_name AS debit_account,\n\t\t\t credit_ledger.display_name AS credit_account,\n\t\t\t \n\t\t\t IF(debit_ledger.id = \".$ledger_id.\", sum(account_transactions.amount), '0.00') AS debit,\n\t\t\t IF(credit_ledger.id = \".$ledger_id.\",sum(account_transactions.amount), '0.00') AS credit,\n\t\t\t account_entries.date,\n\t\t\t account_vouchers.name AS voucher_master\n\t\t\tFROM\n\t\t\t account_entries\n\t\t\t LEFT JOIN account_vouchers \n\t\t\t ON account_vouchers.id = account_entries.voucher_id \n\t\t\t LEFT JOIN account_transactions \n\t\t\t ON account_entries.id = account_transactions.entry_id \n\t\t\t LEFT JOIN account_ledgers AS debit_ledger \n\t\t\t ON debit_ledger.id = account_transactions.debit_ledger_id \n\t\t\t LEFT JOIN account_ledgers AS credit_ledger \n\t\t\t ON credit_ledger.id = account_transactions.credit_ledger_id \n\t\t\tWHERE account_entries.organization_id = \".$organization_id.\" \n\t\t\t AND (debit_ledger.id = \".$ledger_id.\" OR credit_ledger.id = \".$ledger_id.\") AND (DATE BETWEEN '\".$start_date.\"' AND '\".$end_date.\"')\n\t\t\t AND account_entries.status = 1\n\t\t\t GROUP BY account_entries.id\n\t\t\t \");\n\t }\n\t \n //dd($ledger_statement);\n\n return response()->json(array('opening_balance' => $opening_balance, 'ledger_statement' => $ledger_statement, 'closing_balance' => $closing_balance, 'opening_date' => $request->start_date, 'closing_date' => $end_date, 'ledger' => $ledger,'account_ledger_name' => $account_ledger_name,'pre_balance' => $pre_balance));\n\t}", "public function monthly_sales_report()\n\t{\n\t\t$query1 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tdate,\n\t\t\t\tEXTRACT(MONTH FROM date) as month, \n\t\t\t\tCOUNT(invoice_id) as total\n\t\t\tFROM \n\t\t\t\tinvoice\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\t$query2 = $this->db->query(\"\n\t\t\tSELECT \n\t\t\t\tpurchase_date,\n\t\t\t\tEXTRACT(MONTH FROM purchase_date) as month, \n\t\t\t\tCOUNT(purchase_id) as total_month\n\t\t\tFROM \n\t\t\t\tproduct_purchase\n\t\t\tWHERE \n\t\t\t\tEXTRACT(YEAR FROM purchase_date) >= EXTRACT(YEAR FROM NOW())\n\t\t\tGROUP BY \n\t\t\t\tEXTRACT(YEAR_MONTH FROM purchase_date)\n\t\t\tORDER BY\n\t\t\t\tmonth ASC\n\t\t\")->result();\n\n\t\treturn [$query1,$query2];\n\t}", "function generateFinancialReport($accountType){\n\t\t$count = 0;\n\t\t$urlms = $this->urlms;\n\t\t$fundingAccount = $this->findFundingAccount($accountType);\n\t\t\n\t\t// echo a table with appropriate columns in it\n\t\techo \"\n\t\t<div class=\\\"container\\\">\n\t\t\t<h3>\".$accountType.\"</h3> \n\t\t<table class=\\\"table table-hover\\\" style=\\\"width: 100%;\\\">\n\t\t\n\t\t<thread>\n\t\t<tr>\n\t\t<th>Type</th>\n\t\t<th>Amount</th>\n\t\t<th>Date</th>\n\t\t\n\t\t</tr>\n\t\t</thread>\n\t\t<tbody>\";\n\t\t\n\t\t// get the account's expenses and generate a row in the table for each expense, with correct information\n\t\t$expenses = $fundingAccount->getExpenses();\n\t\tforeach ($expenses as $e){\n\t\t\t$count ++;\n\t\t\techo \"<tr>\n\t\t\t\t\t<td>\" .$e->getType().\"</td>\n\t\t\t\t\t<td>$\". number_format($e->getAmount(), 2, \".\" , \",\" ) .\"</td>\n\t\t\t\t\t<td>\" . $e->getDate() . \"</td>\n\t\t\t\t</tr>\";}\n\t\t\techo \"</tbody></table>\";\n\t\t\t$_SESSION['fundingAccount'] = $fundingAccount;\n\t\t\t$_SESSION['urlms'] = $urlms;\n\t\t\t?>\n\t\t\t<!-- Section for editing an expense -->\n\t\t\t<html>\n\t\t\t<div class=\"container\">\n\t\t\t\t<form action=\"../controller/InfoUpdater.php\" method=\"get\">\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<br>\n\t\t\t\t\t<h3>Edit Expense</h3>\n\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"editExpense\" />\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"ExpenseType\">Expense Type</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"expensename\" id=\"expenseName\" aria-describedby=\"nameHelp\" placeholder=\"Enter Expense Type\"> \n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter old type of expense.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"newExpenseType\">New Expense Type</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"newexpensename\" id=\"expenseName\" aria-describedby=\"nameHelp\" placeholder=\"Enter New Expense Type\"> \n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter new type of expense.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"newAmount\">New Amount</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"newexpenseamount\" id=\"expenseAmount\" aria-describedby=\"nameHelp\" placeholder=\"Enter New Expense Amount\"> \n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter new amount of expense.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t<div class=\"col-sm-6\">\n\t\t\t\t\t\t\t\t<label for=\"ExpenseType\">New Date</label> \n\t\t\t\t\t\t\t\t<input type=\"text\" class=\"form-control\" name=\"newexpensedate\" id=\"expenseName\" aria-describedby=\"nameHelp\" placeholder=\"Enter Expense Date\"> \n\t\t\t\t\t\t\t\t<small id=\"nameHelp\" class=\"form-text text-muted\">Enter new date of expense.</small> <br>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t<input class=\"btn btn-danger\" type=\"submit\" value=\"Edit expense!\" />\n\t\t\t\t</div>\n\t\t\t\t\t<br>\n\t\t\t\t</form>\n\t\t\t\t\n\t\t\t\t<div class=\"row\">\n\t\t\t\t\t<div class=\"col-sm-2\">\n\t\t\t\t\t\t<a href=\"../view/FundingView.php\" style=\"color: white; text-decoration: none;\">\n\t\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-danger\" data-toggle=\"tooltip\"\n\t\t\t\t\t\t\t\tdata-placement=\"bottom\" title=\"Go back to homepage\">Back</button>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</html><?php\n\t\treturn $count;\n\t}", "public function ctrreports()\n {\n //\n $productname = Input::get('productname');\n\t \t$start_date = Input::get('start_date');\n\t\t$end_date = Input::get('end_date');\n\t $product=m_product::where('product_name',$productname)->first();\n\t \n\t \t \n $contracts=t_contract::where('product_id',$product->id)\n\t ->where('pay_date','>',$start_date)\n\t ->where('pay_date','<=',$end_date)->get();\n\t\t$productname='本周'.$productname;\t\t\t\t \n\t if($contracts->count())\n\t {\n\t \t \n\t \t$filename=$product->product_name . time();\n\t \\Excel::create($filename, function($excel) use ($productname, $contracts) {\n $excel->sheet('New sheet', function($sheet) use ($productname, $contracts) {\n $sheet->loadView('ctrreports') \n ->withProductname($productname)\n\t ->withContracts($contracts);\n\n });\n\n })->download('xls'); \n\t\t }\n\t else {\n\t\t\t\n\t\t\treturn Redirect::back()->withInput()->withErrors('本时间段此产品下无合同产生');\n\t }\n\t \n\t \n\t \n \n }", "public function reportTotalClassHeldSummaryView(Request $request)\n {\n $from_date = trim($request->from); \n $from = date (\"Y-m-d\", strtotime($from_date));\n $explode = explode('-',$from);\n $from_year = $explode[0];\n $get_current_day = date(\"l\",strtotime($from));\n $current_year = date('Y');\n if($get_current_day =='Saturday'){\n $current_day = 1 ;\n }\n if($get_current_day =='Sunday'){\n $current_day = 2 ;\n }\n if($get_current_day =='Monday'){\n $current_day = 3 ;\n }\n if($get_current_day =='Tuesday'){\n $current_day = 4 ;\n }\n if($get_current_day =='Wednesday'){\n $current_day = 5 ;\n }\n if($get_current_day =='Thursday'){\n $current_day = 6 ;\n }\n if($get_current_day =='Friday'){\n $current_day = 7 ;\n }\n if($from > $this->rcdate1){\n echo 'f1';\n exit();\n }\n // get door holiday\n $holiday_count = DB::table('holiday')->where('holiday_date',$from)->count();\n if($holiday_count > 0){\n echo 'f2';\n exit();\n }\n if($from_year != $current_year){\n echo 'f3';\n exit();\n }\n // get all shift\n $result = DB::table('shift')->get();\n return view('view_report.reportTotalClassHeldSummaryView')->with('result',$result)->with('get_current_day',$get_current_day)->with('from',$from)->with('current_day',$current_day)->with('from_year',$from_year);\n }", "function expense_tracker_excel()\n{\n\t\t$this->layout=\"\";\n\t\t$filename=\"Expense Tracker\";\n\t\theader (\"Expires: 0\");\n\t\theader (\"Last-Modified: \" . gmdate(\"D,d M YH:i:s\") . \" GMT\");\n\t\theader (\"Cache-Control: no-cache, must-revalidate\");\n\t\theader (\"Pragma: no-cache\");\n\t\theader (\"Content-type: application/vnd.ms-excel\");\n\t\theader (\"Content-Disposition: attachment; filename=\".$filename.\".xls\");\n\t\theader (\"Content-Description: Generated Report\" );\n\n\t\t\t$from = $this->request->query('f');\n\t\t\t$to = $this->request->query('t');\n\n\t\t\t\t$from = date(\"Y-m-d\", strtotime($from));\n\t\t\t\t$to = date(\"Y-m-d\", strtotime($to));\n\n\t\t\t$s_role_id = (int)$this->Session->read('role_id');\n\t\t\t$s_society_id = (int)$this->Session->read('society_id');\n\t\t\t$s_user_id = (int)$this->Session->read('user_id');\t\n\n\t\t$this->loadmodel('society');\n\t\t$conditions=array(\"society_id\" => $s_society_id);\n\t\t$cursor=$this->society->find('all',array('conditions'=>$conditions));\n\t\tforeach($cursor as $collection)\n\t\t{\n\t\t$society_name = $collection['society']['society_name'];\n\t\t}\n\n$excel=\"<table border='1'>\n<tr>\n<th style='text-align:center;' colspan='8'>$society_name Society</th>\n</tr>\n<tr>\n<th style='text-align:left;'>Voucher #</th>\n<th style='text-align:left;'>Posting Date</th>\n<th style='text-align:left;'>Due Date</th>\n<th style='text-align:left;'>Date of Invoice</th>\n<th style='text-align:left;'>Expense Head</th>\n<th style='text-align:left;'>Invoice Reference</th>\n<th style='text-align:left;'>Party Account Head</th>\n<th style='text-align:left;'>Amount</th>\n</tr>\";\n\t\t$total = 0;\n\t\t$this->loadmodel('expense_tracker');\n\t\t$conditions=array(\"society_id\"=>$s_society_id);\n\t\t$cursor3 = $this->expense_tracker->find('all',array('conditions'=>$conditions));\n\t\tforeach($cursor3 as $collection)\n\t\t{\n\t\t\t$receipt_id = $collection['expense_tracker']['receipt_id'];\n\t\t\t$posting_date = $collection['expense_tracker']['posting_date'];\n\t\t\t$due_date = $collection['expense_tracker']['due_date'];\n\t\t\t$invoice_date = $collection['expense_tracker']['invoice_date'];\n\t\t\t$expense_head = (int)$collection['expense_tracker']['expense_head'];\n\t\t\t$invoice_reference = $collection['expense_tracker']['invoice_reference'];\n\t\t\t$party_account_head = (int)$collection['expense_tracker']['party_head'];\n\t\t\t$amount = $collection['expense_tracker']['amount'];\n\n\t\t\t\t$result5 = $this->requestAction(array('controller' => 'hms', 'action' => 'ledger_account_fetch2'),array('pass'=>array($expense_head)));\n\t\t\t\tforeach($result5 as $collection3)\n\t\t\t\t{\n\t\t\t\t$ledger_name = $collection3['ledger_account']['ledger_name'];\n\t\t\t\t}\n\n\t\t\t\t\t$result6 = $this->requestAction(array('controller' => 'hms', 'action' => 'ledger_sub_account_fetch'),array('pass'=>array($party_account_head)));\n\t\t\t\t\tforeach($result6 as $collection4)\n\t\t\t\t\t{\n\t\t\t\t\t$party_name = $collection4['ledger_sub_account']['name'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\tif($posting_date >= $from && $posting_date <= $to)\n\t\t{\n\t\t\t$total = $total+$amount;\n$excel.=\"<tr>\n<td style='text-align:right;'>$receipt_id</td>\n<td style='text-align:left;'>$posting_date</td>\n<td style='text-align:left;'>$due_date</td>\n<td style='text-align:left;'>$invoice_date</td>\n<td style='text-align:left;'>$ledger_name</td>\n<td style='text-align:left;'>$invoice_reference</td>\n<td style='text-align:left;'>$party_name</td>\n<td style='text-align:right;'>$amount</td>\n</tr>\";\n}}\n$excel.=\"<tr>\n<th colspan='7' style='text-align:right;'>Total</th>\n<th>$total</th>\n</tr>\n</table>\";\n\t\necho $excel;\n}", "private function gASummary($date_from,$date_to) {\n $service_account_email = '[email protected]'; \n // Create and configure a new client object.\n $client = new \\Google_Client();\n $client->setApplicationName(\"Analytics Reporting\");\n $analytics = new \\Google_Service_Analytics($client);\n $cred = new \\Google_Auth_AssertionCredentials(\n $service_account_email,\n array(\\Google_Service_Analytics::ANALYTICS_READONLY),\n \"-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDAUT0xOyseXwTo\\nMRchra9QmsRYGUZ8+rdGihcAXrt3AqDq4/sKRaIe5gvte+C3bwHV8fI42nz0axRN\\n8WJo7lT7TzZweuAFTv+yuH/yHvNQlPAHMDCars7QTTGf8XcUHO5cq9yYA0FD2/gg\\nWAwU9V34RjL0fvEFHPii9zOZoPMtrNsMwxQcKSw2cs9TZ+grwfp5r/pRbUbPlUYg\\n/3B87jk5FjG9NKO7eRW2Pu7zf7pPZw067EMdAcGpZO7Gnzc21T1f3qj0JR0V7ooh\\nQcxiGCUIUbkKMYOuj/Rb5uQhnfb8ERehxfGFAg9FSiYbPZqag2d/adbmt32hQEKW\\nvud0nU4HAgMBAAECggEAHmy7wY4axDNEE3ewsSNJGPdjGIznGd6QIBi4itZx0eIY\\nkxB+JqHdhAXg3TE728k0ASTFrTjji8dk7u/BIdiSmS9u7VyDFFPrH9sQYr2CwLzP\\nPFPjXJVLIqkTsLoCnKv3CbIms+XP7WxfVL6ZKrempiB07zkl6CktLJrvDt7nmdH4\\nevtrk7aKxpESJUQQVgs5CULH5gIQow/qx5rDHjAaLIsbIlmUXOBZQ4yO77/Lub8u\\nZe6GDBZGeqHqA1yzKgYQiFu/TqAmtsNbtDYfm8dUY/Tkxv/RhJDCJRlpE7Vhq5zD\\nBdrnjW/IWlMVZV0SFLgvkIZ8KMBhvJi6TARzhEXcAQKBgQDswarwvnXmbGCzi4Qh\\ntJ84VeSqzOib4Gp4wzC5WyWHdQdgVb4Ob/HpI69zswwB112W7GbRy/eiUZz7Cg8Q\\nak+3ZbIVeLTlNcJApa0sNEBft+ps7Ww9hajPpTOEhtuSQu9Hx5GXgj65a6a3l+gG\\n9DPGkZC0dLXMrSgWDFZMmtLtPQKBgQDP8uYyy3mhg9owkAhgr1gdSdLJxQ/13o+Y\\nozOWHvBjoF84k/0iLDOqGxuqwBaZBf1ov5W9TS4CeyEfECaCSYc87gThcsKngeZM\\n2fSICIkmOHh24WXamEENQqmKvMXQ8g9HGKzo0TL+r9/iDrrsfo0nCPVEC2A/QBU9\\nBB5YQ9SkkwKBgQDDXSAwXgmt5Vp6bbLPmVsVQpNZeZKsJafWFMMdAKBcQW6fyMD2\\n6tsE1cSOxX0v+8YnptVFY3jpQU03PdqmYgN7w3gLDbq/tPehHtViN4+zLHFOBzCd\\nJ7Df/2MehaWj8IXAhmaWTgxyNumwb7IwIsyimzV8Ix5tUalVYELKHavVxQKBgCkO\\nMMq4h4QO7yYFWdIU7FWj/Jzfbj5BuaIOHqI164oP4JzgAusbRPwBrB2zHQMLPrPO\\nl3avZTUSMEDcxG2WrL+n0ojcSngd2mUz5uZwoPtNzOLTr3NP+g/vKF/+0yNklwWX\\nZpP0sZe9C3urItaMSbv6NcpAYLk8IrVQOdl9Ut9HAoGACt0YP/MLOlnn/S/qyn5+\\npQhuIsnv3rNa7yZrhfn0u+jdLNk4ubmc/A6Z4Yc/hqQEV/UOwfSwAAlHAZgdUWYi\\nvL6VfVaDxX5goKnWxnuvErFH1Zg+3Lem+moBzXXpb0EPxMXsAgXWe6j8YuZReXXu\\nOLoW4l5DW4h2ZmxxWr/D/Jc=\\n-----END PRIVATE KEY-----\\n\"\n ); \n $client->setAssertionCredentials($cred);\n if($client->getAuth()->isAccessTokenExpired()) {\n $client->getAuth()->refreshTokenWithAssertion($cred);\n }\n $optParams = [\n 'dimensions' => 'ga:date',\n 'sort'=>'-ga:date'\n ] ; \n $results = $analytics->data_ga->get(\n 'ga:140884579',\n $date_from,\n $date_to,\n 'ga:sessions,ga:users,ga:pageviews,ga:bounceRate,ga:hits,ga:avgSessionDuration',\n $optParams\n );\n \n $rows = $results->getRows();\n $rows_re_align = [] ;\n foreach($rows as $key=>$row) {\n foreach($row as $k=>$d) {\n $rows_re_align[$k][$key] = $d ;\n }\n } \n $optParams = array(\n 'dimensions' => 'rt:medium'\n );\n try {\n $results1 = $analytics->data_realtime->get(\n 'ga:140884579',\n 'rt:activeUsers',\n $optParams);\n // Success. \n } catch (apiServiceException $e) {\n // Handle API service exceptions.\n $error = $e->getMessage();\n }\n $active_users = $results1->totalsForAllResults ;\n return [\n 'data'=> $rows_re_align ,\n 'summary'=>$results->getTotalsForAllResults(),\n 'active_users'=>$active_users['rt:activeUsers']\n ] ;\n }", "public function CalSPBuDueDate($BUSPDate = '')\n\t{\n\t\t$ResArr = array();\t\n\t\t\n\t\t/*\n\t\t$MaxSql= \" SELECT DATE(MAX(bill_d_pay_date)) AS LastpayDate FROM bills_details WHERE bill_d_bu_sp_id = \".$BUSPID.\" AND bill_d_bu_or_sp = \".$BuOrSp.\" \";\n\t\t\t\t\n\t\t\t\t$MaxData = Yii::app()->db->createCommand($MaxSql)->queryRow();\n\t\t\t\t\n\t\t\t\t$Type = $BcType == 0 ? 'days' : ( $BcType == 1 ? 'months' : 'years' );\n\t\t\t\t\n\t\t\t\tif($MaxData['LastpayDate']!= null){\n\t\t\t\t\t\n\t\t\t\t\t$StrDate = $MaxData['LastpayDate'];\n\t\t\t\t}else{\n\t\t\t\t\t//$StrDate = strtotime($BU_Date);\n\t\t\t\t\t$StrDate = $BUSPDate;\n\t\t\t\t}*/\n\t\t\n\t\t$DueDate = $BUSPDate;\n\t\t\n\t\t//$DueDate = date('Y-m-d', strtotime('+'.$BcDur.' '.$Type.'', strtotime($StrDate)) );\n\t\t\n\t\t\n\t\t\n\t\t//------------------------------\n\t\t$GracePeriod = 0;$DelayFees = 0;\n\t\t$AdSql= \" SELECT * FROM ad_setting WHERE (ad_setting_name = 'GracePeriod' OR ad_setting_name = 'DelayFees' )\";\n\t\t$AdData = Yii::app()->db->createCommand($AdSql)->queryAll();\n\t\tforeach ($AdData as $key => $row) {\n\t\t\t\t\t\n\t\t\tif($row['ad_setting_name'] == 'GracePeriod'){$GracePeriod = $row['ad_setting_val'];}\n\t\t\tif($row['ad_setting_name'] == 'DelayFees') {$DelayFees = $row['ad_setting_val'];}\n\t\t}\t\n\t\t//-------------------------------\n\t\t$NDate = date('Y-m-d', strtotime('+'.$GracePeriod.' days ', strtotime($DueDate)) );\n\t\t$PDate = date('Y-m-d', strtotime('-'.$GracePeriod.' days ', strtotime(date('Y-m-d'))));\n\t\t\n\t\tif ($DueDate == date('Y-m-d')) {\n\t\t\t\n\t\t\t$ResArr = array('DueDate'=>$DueDate,'class'=>'ToDay');\n\t\n\t\t}elseif($DueDate > date('Y-m-d')){\n\t\t\t\t\n\t\t\t$ResArr = array('DueDate'=>$DueDate,'class'=>'NoPay');\n\t\t\n\t\t}elseif(($PDate < $DueDate && $DueDate <= date('Y-m-d'))||$NDate == date('Y-m-d')){\n\t\t\t\n\t\t\t$ResArr = array('DueDate'=>$DueDate,'class'=>'GracePeriod');\n\t\t\n\t\t}elseif(date('Y-m-d') > $NDate){\n\t\t\t\n\t\t\t$ResArr = array('DueDate'=>$DueDate,'class'=>'DelayFees','delay'=>$DelayFees);\n\t\t}\n\t\t\n\t\treturn $ResArr;\n\t}", "public function index(){\n\t \t@$this->loadModel(\"Dashboard\");\n global $session;\n $dashData = array();\n $dashData = $this->model->getDashboardStat();\n $this->view->oticketcount = $dashData['otcount'];\n $this->view->aticketcount = $dashData['atcount'];\n $this->view->oschedule = $dashData['oschedule'];\n $this->view->oworksheet = $dashData['oworksheet'];\n $this->view->clients = $dashData['clients'];\n $this->view->pendings = $dashData['openPend'];\n $this->view->cproducts = $dashData['cproducts'];\n $lastmonth = (int)date(\"n\")-1;\n $curmonth = date(\"n\");\n\n $this->view->monthreport = $this->model->getMonthlyReportFinance(\" Month(datecreated) ='\".$curmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->lastmonthreport = $this->model->getLastMonthlyReportFinance(\" Month(datecreated) ='\".$lastmonth.\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n $this->view->thisquarter = $this->model->getThisQuaterReportFinance(\" Quarter(datecreated) ='\".self::date_quarter().\"' AND Year(datecreated)='\".date(\"Y\").\"'\");\n global $session;\n \n if($session->empright == \"Super Admin\"){\n\t\t $this->view->render(\"dashboard/index\");\n\t\t }elseif($session->empright == \"Customer Support Services\" || $session->empright == \"Customer Support Service\"){\n\t\t $this->view->render(\"support/index\");\n\t\t \n\t\t }elseif($session->empright == \"Customer Support Engineer\" || $session->empright == \"Customer Service Engineer\"){\n @$this->loadModel(\"Itdepartment\");\n global $session;\n $datan =\"\";\n $uri = new Url(\"\");\n //$empworkdata = $this->model->getWorkSheetEmployee($id,\"\");\n \n $ptasks = Worksheet::find_by_sql(\"SELECT * FROM work_sheet_form WHERE cse_emp_id =\".$_SESSION['emp_ident'] );\n // print_r($ptasks);\n //$empworkdata['worksheet'];\n $x=1;\n $datan .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Prod ID</th><th>Status</th><th>Emp ID</th><th>Issue</th><th>Date Generated </th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($ptasks){\n \n foreach($ptasks as $task){\n $datan .= \"<tr><td>$x</td><td>$task->prod_id</td><td>$task->status </td><td>$task->cse_emp_id</td><td>$task->problem</td><td>$task->sheet_date</td><td><a href='\".$uri->link(\"itdepartment/worksheetdetail/\".$task->id.\"\").\"'>View Detail</a></td><td></td></tr>\";\n $x++;\n }\n }else{\n $datan .=\"<tr><td colspan='8'></td></tr>\";\n } \n $datan .=\"</tbody></table>\";\n \n $mysched =\"<div id='transalert'>\"; $mysched .=(isset($_SESSION['message']) && !empty($_SESSION['message'])) ? $_SESSION['message'] : \"\"; $mysched .=\"</div>\";\n \n $psched = Schedule::find_by_sql(\"SELECT * FROM schedule WHERE status !='Closed' AND emp_id =\".$_SESSION['emp_ident'].\" ORDER BY id DESC\" );\n //print_r($psched);\n //$empworkdata['worksheet'];\n $x=1;\n $mysched .=\"<table width='100%'>\n <thead><tr>\n \t<th>S/N</th><th>Machine</th><th>Issue</th><th>Location</th><th>Task Type</th><th>Task Date </th><th></th><th></th><th></th>\n </tr>\n </thead>\n <tbody>\";\n if($psched){\n \n foreach($psched as $task){\n $mysched .= \"<tr><td>$x</td><td>$task->prod_name</td><td>$task->issue </td>\"; \n $machine = Cproduct::find_by_id($task->prod_id);\n \n $mysched .= \"<td>$machine->install_address $machine->install_city</td><td>$task->maint_type</td><td>$task->s_date</td><td>\";\n \n if($task->status == \"Open\"){\n $mysched .=\"<a scheddata='{$task->id}' class='acceptTask' href='#'>Accept Task</a>\";\n }\n if($task->status == \"In Progress\"){\n $mysched .=\"<a href='\".$uri->link(\"itdepartment/worksheetupdateEmp/\".$task->id.\"\").\"'>Get Work Sheet</a>\";\n }\n \n $mysched .=\"\n \n <div id='myModal{$task->id}' class='reveal-modal'>\n <h2>Accept Task </h2>\n <p class='lead'>Click on the button below to accept task! </p>\n <form action='?url=itdepartment/doAcceptTask' method='post'>\n <input type='hidden' value='{$task->id}' name='mtaskid' id='mtaskid' />\n <p><a href='#' data-reveal-id='secondModal' class='secondary button acceptTast' >Accept</a></p>\n </form>\n <a class='close-reveal-modal'>&#215;</a>\n</div>\n\n\n \n \n </td><td></td><td></td></tr>\";\n $x++;\n }\n }else{\n $mysched .=\"<tr><td colspan='8'>There is no task currently</td></tr>\";\n } \n $mysched .=\"</tbody></table>\";\n \n $this->view->oldtask = $datan;\n $this->view->schedule = $mysched;\n $this->view->mee = $this->model->getEmployee($_SESSION['emp_ident']);\n $this->view->render(\"itdepartment/staffaccount\");\n\t\t }else{\n\t\t $this->view->render(\"login/index\",true);\n\t\t }\n\t\t\n\t}", "public function reportDatewiseAttendentForm()\n {\n $year = DB::table('student')->distinct()->get(array('year'));\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n $semister = DB::table('semister')->where('status',1)->get();\n return view('report.reportDatewiseAttendentForm')\n ->with('year',$year)\n ->with('shift',$shift)\n ->with('dept',$dept)\n ->with('semister',$semister);\n }", "public function get_attendance($id,$start,$end){\n \t $id = \"CB0\".$id;\n $attendance = AttendanceData::whereEmployee_id($id)\n ->whereDate('attendance_date','>=', $start) \n ->whereDate('attendance_date','<=', $end) \n ->orderBy('attendance_date','ASC')\n ->get(['attendance_date','status']); \n\t\t\t\n\t\t\t\n\t\t\t// print_r($attendance); \n\t\t\t// die; \n\t\t\t\n\t\t\tif(empty($attendance)){\n\t\t\t\t$data['present'] = 0;\n\t\t\t\t$data['leaves'] = 0;\n\t\t\t\t$data['half_day'] = 0;\n\t\t\t\t$data['ui'] = 0;\n\t\t\t\t$data['sandwich_leave'] = 0;\n\t\t\t\treturn $data;\n\t\t\t}\n\t\t\t\n $attendance = $attendance->toArray(); \n \n $startdate = strtotime($start); \n $enddate = strtotime('+' . (date('t',$startdate) - 1). ' days',$startdate);\n $currentdate = $startdate;\n $p = $ab = $ui = $hd = $sw = 0; \n $sw_status = false;\n $holydays = ['Sun','Sat'];\n while ($currentdate <= $enddate){\n $day = date('D', $currentdate);\n $date = date('Y-m-d', $currentdate);\n if(in_array($day, $holydays)){ \n ++$p;\n }else{ \n $found_key = array_search(date('Y-m-d', $currentdate), array_column($attendance, 'attendance_date'));\n if(!empty($found_key) || $found_key===0){ \n $status = $attendance[$found_key]['status'];\n\n if($day==\"Fri\" && ($status==\"AB\" || $status==\"UI\"))\n $sw_status =true; \n switch($status){\n case 'P': \n ++$p;\n break;\n case 'AB':\n ++$ab;\n break;\n case 'UI':\n ++$ui;\n break;\n case 'HD':\n ++$hd;\n $p = ($p + 0.5); \n break;\n }\n if($day==\"Mon\" && ($sw_status==true) && ($status==\"AB\" || $status==\"UI\")){\n ++$sw; \n $sw_status =false; \n $p = $p-2;\n $ab = $ab+2; \n }\n }else{\n $check_holyday = Holiday::whereDate('date',$date)->first(); \n if(!empty($check_holyday))\n ++$p; \n }\n }\n $currentdate = strtotime('+1 day', $currentdate);\n } \n //echo \"<br> $id P => $p HD => $hd AB => $ab UI => $ui \";\n $data['present'] = $p;\n $data['leaves'] = $ab;\n $data['half_day'] = $hd;\n $data['ui'] = $ui;\n $data['sandwich_leave'] = $sw;\n\t\t\treturn $data;\n }", "public function contractreports()\n {\n //\n $contractid = Input::get('contractid');\n\t $begintime = Input::get('begintime');\n\t $endtime = Input::get('endtime');\n \n\t $contract=t_contract::where('contract_id',$contractid)->first();\n\t $product=m_product::where('product_id',$contract->product_id)->first();\n\t \n\t $sale=m_employee::find($contract->sales_id);\n\t $position=m_position::where('employee_id',$sale->id)->first();\n\t $parents = $position->ancestors()->get(); \n return \\View::make('reports.contracts')->withProduct($product)\n\t ->withParents($parents)\n\t\t\t\t\t\t\t\t\t\t\t ->withPosition($position)\n\t ->withContract($contract);\n \n\n }", "public function expenseGraphData()\n {\n $expenses = Expense::all();\n $supplierPayments = $expenses->where('expensable_type', Expenses::GOOD_RECEIVE)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n $doctorPayments = $expenses->where('expensable_type', Expenses::SCHEDULE_PAYMENT)\n ->sortBy('date')->groupBy('date')->map(function ($row) {\n return [\n 'x' => $row->first()['date'],\n 'y' => $row->sum('amount')\n ];\n })->values()->all();\n\n return ResponseHelper::findSuccess('Expense Graph Data', [\n 'supplierPaymentsGraphData' => $supplierPayments,\n 'doctorPaymentsGraphData' => $doctorPayments,\n ]);\n }", "function quantizer_expenses_management_report($cost_center = null, $management = null, $start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerExpenses($cost_center, $management, $start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\t\t\t\r\n\t\t\t/*echo \"<pre>\";\r\n\t\t\tprint_r($resultado);\r\n\t\t\techo \"</pre>\";*/\r\n\t\t\t\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "function companydates(){\n $this->auth(COMP_ADM_LEVEL);\n $contest_id = $this->uri->segment(3);\n $data = $this->_getCompanyDataByContestId($contest_id);\n if($this->session->userdata('role_level') > SUPPORT_ADM_LEVEL){\n $data['editable'] = TRUE;\n } else {\n $data['editable'] = FALSE;\n }\n $this->load->view('admin/company_admin/v_dates', $data);\n }", "public function actionIndex()\n {\n if(empty($ordersMonth)){\n $begin = new \\DateTime( date('Y-m-d h:i:s').' -3 weeks' );\n $end = new \\DateTime( date('Y-m-d h:i:s').' +1 day' );\n } else {\n $begin = new \\DateTime( date($ordersMonth.'-01 h:i:s') );\n $end = new \\DateTime( date($ordersMonth.'-t h:i:s'));\n }\n\n $interval = \\DateInterval::createFromDateString('1 day');\n $period = new \\DatePeriod($begin, $interval, $end);\n $orderStats = [];\n foreach ( $period as $dt ){\n $beginOfDay = $dt->setTime(0,0,1)->format( \"Y-m-d H:i:s\\n\" );\n $endOfDay = $dt->setTime(23,59,59)->format( \"Y-m-d H:i:s\\n\" );\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['all'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['done'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>5])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['cancelled'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>1])->sum('order_amount');\n $orderStats[$dt->format(\"Y-m-d H:i:s\")]['new'] = SCOrders::find()->where(['between', 'order_time', $beginOfDay, $endOfDay])->andWhere(['source_ref'=>'ymrkt'])->andWhere(['statusID'=>3])->sum('order_amount');\n }\n\n return $this->render('index', ['orderStats'=>$orderStats, 'begin'=>$begin->format( \"Y-m-d H:i:s\\n\" ), 'end'=>$end->format( \"Y-m-d H:i:s\\n\" )]);\n }", "function export_salesfortally()\r\n\t\t{\r\n\t\t\t$this->erpm->auth(FINANCE_ROLE);\r\n\t\t\t\r\n\t\t\t$stdate=$this->input->post('stdate')?$this->input->post('stdate'):date('Y-m-d');\r\n\t\t\t$endate=$this->input->post('endate')?$this->input->post('endate'):date('Y-m-d');\r\n\t\t\t$sales_by = $this->input->post('endate')?$this->input->post('sales_by'):'';\r\n\t\t\t\r\n\t\t\tif($_POST)\r\n\t\t\t\t$this->erpm->do_gen_salesreportfortally($stdate,$endate,$sales_by);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$data['sales_by'] = $sales_by;\r\n\t\t\t$data['stdate'] = $stdate;\r\n\t\t\t$data['endate'] = $endate;\r\n\t\t\t$data['title'] = 'Export Sales Report for Tally Import';\r\n\t\t\t$data['page'] = 'export_salesfortally';\r\n\t\t\t$this->load->view('admin',$data);\r\n\t\t}", "function wc_marketplace_date2() {\n global $wmp;\n $wmp->output_report_date2();\n }", "function getRevenueData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n \n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$i]['time'][]=$arrData;\n $arrRes[$i]['count']=$count;\n }\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes[$key]['dates']=$arrData;\n $arrRes[$key]['count']=$count;\n }\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function get_earningby_date($date){\n\t$this->db->select('SUM(amount) AS amount, date_served');\n\t$this->db->from('earning_table');\n\t// $this->db->join('totals','totals.amounts=earning_table.amount');\n\t$this->db->group_by('date_served');\n\t$query=$this->db->get();\n\treturn $query->result();\n\t\n}", "public function getIndex()\n {\n \t$dateRange = Carbon::now();\n \n\n //Get past Last Month = 4 Week Lag\n $endIniLag = $dateRange->copy()->subWeek(4);\n $dateNow = Carbon::now();\n\n //Get past Last Month = 5 Week Lag\n $endPastLag = $dateRange->copy()->subWeek(5);\n $iniPastLag = $dateRange->copy()->subWeek(1);\n\n \t //Get past Last week = Week 1\n $endIniWeek1 = $dateNow;\n $IniWeek1 = $dateRange->copy()->subWeek(4);\n\n //Get past 2 week = Week 2\n $endIniWeek2 = $dateRange->copy()->subWeek(1);\n $IniWeek2 = $dateRange->copy()->subWeek(5);\n\n //Get past 3 week = Week 3\n $endIniWeek3 = $dateRange->copy()->subWeek(2);\n $IniWeek3 = $dateRange->copy()->subWeek(6);\n\n //Get past 4 week = Week 4\n $endIniWeek4 = $dateRange->copy()->subWeek(3);\n $IniWeek4 = $dateRange->copy()->subWeek(7);\n\n $user_id=Auth::user()->id;\n\n \n //Count variables\n $countEmployee=0;\n $countPortfolio=0;\n $countEvaluation=0;\n\n $job_portfolio=array();\n $job_site=array();\n $manager_id=0;\n $manager_list=array();\n \n \n //Square Feet\n $sumSquareFeet=0; \n\n\n $job_list_str=\"\";\n $job_list_array=array();\n $comment_list=array();\n\n \t\t\t\t\t\t\n //Get user role\n $role_user=Auth::user()->getRole();\n\n $total_expense_lag=0;\n $total_bill_lag=0;\n $total_labor_tax_lag=0;\n $total_budget_monthly_lag=0;\n\n $total_expense_lag_past=0;\n $total_bill_lag_past=0;\n $total_labor_tax_lag_past=0;\n $total_budget_monthly_lag_past=0;\n\n $total_expense_week1=1;\n $total_labor_tax_week1=0;\n $total_budget_monthly_week1=0;\n\n $total_expense_week2=0;\n $total_labor_tax_week2=0;\n $total_budget_monthly_week2=0;\n\n $total_expense_week3=0;\n $total_labor_tax_week3=0;\n $total_budget_monthly_week3=0;\n\n $total_expense_week4=0;\n $total_labor_tax_week4=0;\n $total_budget_monthly_week4=0;\n\n $total_budget_monthly=0;\n\n $total_evaluation=0;\n $total_evaluation_no=0;\n $total_evaluation_user=0;\n\n $total_evaluation_past=0;\n $total_evaluation_no_past=0;\n\n $total_evaluation_param=array(\n 'param1' => 0,\n 'param2' => 0,\n 'param3' => 0,\n 'param4' => 0,\n 'param5' => 0,\n );\n\n $total_supplies=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_supplies_past=array(\n 'expense' => 0,\n 'budget_monthly' => 0,\n );\n\n $total_salies_wages_amount=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_salies_wages_amount_past=array(\n 'expense' => 0,\n 'labor_tax' => 0,\n );\n\n $total_hours=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n $total_hours_past=array(\n 'used' => 0,\n 'budget' => 0,\n );\n\n \n if($role_user==Config::get('roles.AREA_MANAGER')){\n \n $manager_id=Auth::user()->getManagerId();\n\n //List of porfolio\n $job_portfolio = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 0)\n ->get();\n\n\n //List Site \n $job_site = DB::table('job')\n ->where('manager', $manager_id)\n ->where('is_parent', 1)\n ->get();\n\n //Count Employee \n $countEmployee = User::CountManagerEmployee($manager_id);\n\n //Count Portfolio\n $countPortfolio = Job::CountPortfolio($manager_id);\n\n\n //4 Week Lag - Ini\n $jobList = DB::table('expense')\n ->select(DB::raw('DISTINCT(expense.job_number) as \"job_number\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get(); \n\n foreach ($jobList as $value) {\n $job_list_array[]=$value->job_number; \n } \n\n $job_list_str=implode(\",\", $job_list_array); \n\n\n $sumSquareFeetQuery = DB::table('job')\n ->select(DB::raw('SUM(square_feet) as \"total_feet\"'))\n ->whereIn('job_number', $job_list_array)\n ->get();\n\n foreach ($sumSquareFeetQuery as $value) {\n $sumSquareFeet=$value->total_feet; \n }\n\n\n $query_expense_lag = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag as $value) {\n $total_expense_lag=$value->total_amount; \n }\n\n $query_bill_lag = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag as $value) {\n $total_bill_lag=$value->total_amount; \n }\n\n $query_labor_tax_lag = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endIniLag->format('Y-m-d'))\n ->where('date', '<=', $dateNow->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag as $value) {\n $total_labor_tax_lag=$value->total_amount; \n }\n\n $query_budget_monthly_lag = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag as $value) {\n $total_budget_monthly_lag=$value->total_amount; \n }\n\n //4 Week Lag - End\n\n //4 Week Lag Past - Ini\n\n $query_expense_lag_past= DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endPastLag->format('Y-m-d'))\n ->where('posting_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag_past as $value) {\n $total_expense_lag_past=$value->total_amount; \n }\n\n $query_bill_lag_past = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag_past as $value) {\n $total_bill_lag_past=$value->total_amount; \n }\n\n\n $query_labor_tax_lag_past = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endPastLag->format('Y-m-d'))\n ->where('date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag_past as $value) {\n $total_labor_tax_lag_past=$value->total_amount; \n if($total_labor_tax_lag_past==0 || $total_labor_tax_lag_past==null)\n $total_labor_tax_lag_past=0; \n }\n\n $query_budget_monthly_lag_past = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag_past as $value) {\n $total_budget_monthly_lag_past=$value->total_amount; \n if($total_budget_monthly_lag_past==0 || $total_budget_monthly_lag_past==null)\n $total_budget_monthly_lag_past=0; \n }\n\n //4 Week Past Lag - End \n\n\n // Monthly budget calculation \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_budget_monthly=$value->total_amount; \n }\n\n\n //Last Week = Week 1 - Ini\n $total_expense_week1=$total_expense_lag; \n if($total_expense_week1==0 || $total_expense_week1==null)\n $total_expense_week1=0;\n \n $total_labor_tax_week1=$total_labor_tax_lag; \n if($total_labor_tax_week1==0 || $total_labor_tax_week1==null)\n $total_labor_tax_week1=0;\n \n\n //Last Week = Week 1 - End\n\n //Week 2 - Ini\n\n $total_expense_week2=$total_expense_lag_past; \n if($total_expense_week2==0 || $total_expense_week2==null)\n $total_expense_week2=0; \n \n $total_labor_tax_week2=$total_labor_tax_lag_past; \n if($total_labor_tax_week2==0 || $total_labor_tax_week2==null)\n $total_labor_tax_week2=0; \n \n //Week 2 - End\n\n //Week 3 - Ini \n $query_expense_week3 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek3->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week3 as $value) {\n $total_expense_week3=$value->total_amount; \n if($total_expense_week3==0 || $total_expense_week3==null)\n $total_expense_week3=0; \n } \n\n $query_labor_tax_week3 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '>', $IniWeek3->format('Y-m-d'))\n ->where('labor_tax.date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week3 as $value) {\n $total_labor_tax_week3=$value->total_amount; \n if($total_labor_tax_week3==0 || $total_labor_tax_week3==null)\n $total_labor_tax_week3=0; \n }\n\n //Week 3 - End\n\n //Week 4 - Ini \n $query_expense_week4 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek4->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week4 as $value) {\n $total_expense_week4=$value->total_amount; \n if($total_expense_week4==0 || $total_expense_week4==null)\n $total_expense_week4=0; \n } \n\n $query_labor_tax_week4 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '>', $IniWeek4->format('Y-m-d'))\n ->where('labor_tax.date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week4 as $value) {\n $total_labor_tax_week4=$value->total_amount; \n if($total_labor_tax_week4==0 || $total_labor_tax_week4==null)\n $total_labor_tax_week4=0; \n }\n\n //Week 4 - End\n\n\n //Last Week = Supplies(Account Number=4090) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('budget_monthly.account_number', 4090)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_supplies['budget_monthly']=$value->total_amount; \n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_supplies['expense']=$value->total_amount; \n if($total_supplies['expense']==0 || $total_supplies['expense']==null)\n $total_supplies['expense']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_supplies_past['expense']=$value->total_amount; \n if($total_supplies_past['expense']==0 || $total_supplies_past['expense']==null)\n $total_supplies_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Labor & Tax(Account Number=4000, 4275, 4278, 4277, 4280, 4276 ) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_labor_tax_week1 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '>', $IniWeek1->format('Y-m-d'))\n ->where('labor_tax.date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week1 as $value) {\n $total_salies_wages_amount['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount['labor_tax']==0 || $total_salies_wages_amount['labor_tax']==null)\n $total_salies_wages_amount['labor_tax']=0;\n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_salies_wages_amount['expense']=$value->total_amount; \n if($total_salies_wages_amount['expense']==0 || $total_salies_wages_amount['expense']==null)\n $total_salies_wages_amount['expense']=0;\n }\n\n $query_labor_tax_week2 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week2 as $value) {\n $total_salies_wages_amount_past['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount_past['labor_tax']==0 || $total_salies_wages_amount_past['labor_tax']==null)\n $total_salies_wages_amount_past['labor_tax']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_salies_wages_amount_past['expense']=$value->total_amount; \n if($total_salies_wages_amount_past['expense']==0 || $total_salies_wages_amount_past['expense']==null)\n $total_salies_wages_amount_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('date', '>', $IniWeek1->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['budget']=$value->total_amount; \n }\n\n //Last Week = Budget - Billable Hours - End \n\n //Past Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('date', '>', $IniWeek2->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['budget']=$value->total_amount; \n }\n\n //Past Week = Budget - Billable Hours - End \n \n\n \n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/\n\n }elseif($role_user==Config::get('roles.DIR_POS')){\n $manager_list = DB::table('users')\n -> where('manager_id', '!=', 0)\n -> where('active', 1)\n -> orderBy('manager_id', 'asc')\n -> get();\n\n $manager_list_array = array();\n\n foreach ($manager_list as $manager) {\n $manager_list_array[]=$manager->manager_id;\n }\n\n //Add Corporate and None Managers - 90 Corporate - 91 None\n $manager_list_array[]=90;\n $manager_list_array[]=91;\n\n\n //List of porfolio\n $job_portfolio = DB::table('job')\n ->whereIn('manager', $manager_list_array)\n ->where('is_parent', 0)\n ->get();\n\n\n //List Site \n $job_site = DB::table('job')\n ->whereIn('manager', $manager_list_array)\n ->where('is_parent', 1)\n ->get();\n\n //Count Managers Employee \n $countEmployee = User::CountManagerListEmployee($manager_list_array);\n\n //Count Same role\n $countEmployeeRole = User::CountRoleListEmployee(Config::get('roles.DIR_POS'), Auth::user()->id);\n\n //Count Managers\n $countManager = User::CountManagerList();\n\n $countEvaluation= $countEmployeeRole+ $countManager;\n\n\n //Count Portfolio\n $countPortfolio = Job::CountPortfolioList($manager_list_array);\n\n\n //4 Week Lag - Ini\n $jobList = DB::table('expense')\n ->select(DB::raw('DISTINCT(expense.job_number) as \"job_number\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get(); \n\n foreach ($jobList as $value) {\n $job_list_array[]=$value->job_number; \n } \n\n $job_list_str=implode(\",\", $job_list_array); \n\n\n $sumSquareFeetQuery = DB::table('job')\n ->select(DB::raw('SUM(square_feet) as \"total_feet\"'))\n ->whereIn('job_number', $job_list_array)\n ->get();\n\n foreach ($sumSquareFeetQuery as $value) {\n $sumSquareFeet=$value->total_feet; \n }\n\n\n $query_expense_lag = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endIniLag->format('Y-m-d'))\n ->where('posting_date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag as $value) {\n $total_expense_lag=$value->total_amount; \n }\n\n $query_bill_lag = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_bill_lag as $value) {\n $total_bill_lag=$value->total_amount; \n }\n\n\n $query_labor_tax_lag = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endIniLag->format('Y-m-d'))\n ->where('date', '<=', $dateNow->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag as $value) {\n $total_labor_tax_lag=$value->total_amount; \n }\n\n $query_budget_monthly_lag = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag as $value) {\n $total_budget_monthly_lag=$value->total_amount; \n }\n\n //4 Week Lag - End\n\n //4 Week Lag Past - Ini\n\n $query_expense_lag_past= DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '>', $endPastLag->format('Y-m-d'))\n ->where('posting_date', '<=', $iniPastLag->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_lag_past as $value) {\n $total_expense_lag_past=$value->total_amount; \n }\n\n $query_bill_lag_past = DB::table('billable_hours')\n ->select(DB::raw('SUM((regular_hours+overtime_hours)*pay_rate*1.19) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '>', $endIniWeek3->format('Y-m-d'))\n ->where('work_date', '<=', $iniPastLag->format('Y-m-d'))\n ->where('manager', $manager_id)\n ->get();\n\n foreach ($query_bill_lag_past as $value) {\n $total_bill_lag_past=$value->total_amount; \n }\n\n\n $query_labor_tax_lag_past = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('date', '>', $endPastLag->format('Y-m-d'))\n ->where('date', '<=', $iniPastLag->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_lag_past as $value) {\n $total_labor_tax_lag_past=$value->total_amount; \n if($total_labor_tax_lag_past==0 || $total_labor_tax_lag_past==null)\n $total_labor_tax_lag_past=0; \n }\n\n $query_budget_monthly_lag_past = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly_lag_past as $value) {\n $total_budget_monthly_lag_past=$value->total_amount; \n if($total_budget_monthly_lag_past==0 || $total_budget_monthly_lag_past==null)\n $total_budget_monthly_lag_past=0; \n }\n\n //4 Week Past Lag - End \n\n\n // Monthly budget calculation \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_budget_monthly=$value->total_amount; \n }\n\n \n //Last Week = Week 1 - Ini\n \n $total_expense_week1=$total_expense_lag; \n if($total_expense_week1==0 || $total_expense_week1==null)\n $total_expense_week1=0;\n \n $total_labor_tax_week1=$total_labor_tax_lag; \n if($total_labor_tax_week1==0 || $total_labor_tax_week1==null)\n $total_labor_tax_week1=0;\n \n //Last Week = Week 1 - End\n\n //Week 2 - Ini \n \n \n $total_expense_week2=$total_expense_lag_past; \n if($total_expense_week2==0 || $total_expense_week2==null)\n $total_expense_week2=0; \n \n $total_labor_tax_week2=$total_labor_tax_lag_past; \n if($total_labor_tax_week2==0 || $total_labor_tax_week2==null)\n $total_labor_tax_week2=0; \n \n\n //Week 2 - End\n\n //Week 3 - Ini \n $query_expense_week3 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek3->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week3 as $value) {\n $total_expense_week3=$value->total_amount; \n if($total_expense_week3==0 || $total_expense_week3==null)\n $total_expense_week3=0; \n } \n\n $query_labor_tax_week3 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek3->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek3->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week3 as $value) {\n $total_labor_tax_week3=$value->total_amount; \n if($total_labor_tax_week3==0 || $total_labor_tax_week3==null)\n $total_labor_tax_week3=0; \n }\n\n //Week 3 - End\n\n //Week 4 - Ini \n $query_expense_week4 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek4->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_expense_week4 as $value) {\n $total_expense_week4=$value->total_amount; \n if($total_expense_week4==0 || $total_expense_week4==null)\n $total_expense_week4=0; \n } \n\n $query_labor_tax_week4 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek4->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek4->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week4 as $value) {\n $total_labor_tax_week4=$value->total_amount; \n if($total_labor_tax_week4==0 || $total_labor_tax_week4==null)\n $total_labor_tax_week4=0; \n }\n\n //Week 4 - End\n\n\n //Last Week = Supplies(Account Number=4090) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_budget_monthly = DB::table('budget_monthly')\n ->select(DB::raw('SUM(((monthly_budget*12)/52)*4) as \"total_amount\"'))\n ->join('account', 'budget_monthly.account_number', '=', 'account.account_number')\n ->join('job', 'budget_monthly.job_number', '=', 'job.job_number')\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->where('budget_monthly.account_number', 4090)\n ->get();\n\n foreach ($query_budget_monthly as $value) {\n $total_supplies['budget_monthly']=$value->total_amount; \n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_supplies['expense']=$value->total_amount; \n if($total_supplies['expense']==0 || $total_supplies['expense']==null)\n $total_supplies['expense']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->where('expense.account_number', 4090)\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_supplies_past['expense']=$value->total_amount; \n if($total_supplies_past['expense']==0 || $total_supplies_past['expense']==null)\n $total_supplies_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Labor & Tax(Account Number=4000, 4275, 4278, 4277, 4280, 4276 ) Week 1 & 2 - Ini\n // Monthly budget calculation Supplies \n $query_labor_tax_week1 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week1 as $value) {\n $total_salies_wages_amount['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount['labor_tax']==0 || $total_salies_wages_amount['labor_tax']==null)\n $total_salies_wages_amount['labor_tax']=0;\n }\n\n $query_expense_week1 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week1 as $value) {\n $total_salies_wages_amount['expense']=$value->total_amount; \n if($total_salies_wages_amount['expense']==0 || $total_salies_wages_amount['expense']==null)\n $total_salies_wages_amount['expense']=0;\n }\n\n $query_labor_tax_week2 = DB::table('labor_tax')\n ->select(DB::raw('SUM(budget_amount)+SUM(fica)+SUM(futa)+SUM(suta)+SUM(workmans_compensation)+SUM(medicare) as \"total_amount\"'))\n ->join('account', 'labor_tax.account_number', '=', 'account.account_number')\n ->join('job', 'labor_tax.job_number', '=', 'job.job_number')\n ->where('labor_tax.date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('labor_tax.date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->get();\n\n foreach ($query_labor_tax_week2 as $value) {\n $total_salies_wages_amount_past['labor_tax']=$value->total_amount; \n if($total_salies_wages_amount_past['labor_tax']==0 || $total_salies_wages_amount_past['labor_tax']==null)\n $total_salies_wages_amount_past['labor_tax']=0;\n }\n\n\n $query_expense_week2 = DB::table('expense')\n ->select(DB::raw('SUM(amount) as \"total_amount\"'))\n ->join('account', 'expense.account_number', '=', 'account.account_number')\n ->join('job', 'expense.job_number', '=', 'job.job_number')\n ->where('posting_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('posting_date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->where('financial', 1)\n ->whereIn('expense.account_number', [4000, 4001, 4003, 4004, 4005, 4007, 4010, 4011, 4020, 4275, 4276, 4277, 4278, 4279, 4280])\n ->get();\n\n foreach ($query_expense_week2 as $value) {\n $total_salies_wages_amount_past['expense']=$value->total_amount; \n if($total_salies_wages_amount_past['expense']==0 || $total_salies_wages_amount_past['expense']==null)\n $total_salies_wages_amount_past['expense']=0;\n }\n\n\n //Last Week = Week 1 & 2 Supplies - End \n\n\n //Last Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek1->format('Y-m-d'))\n ->where('date', '>', $IniWeek1->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours['budget']=$value->total_amount; \n }\n\n //Last Week = Budget - Billable Hours - End \n\n //Past Week = Budget - Billable Hours - Ini\n $query_hours = DB::table('billable_hours')\n ->select(DB::raw('SUM(regular_hours) as \"total_amount\"'))\n ->join('job', 'billable_hours.job_number', '=', 'job.job_number')\n ->where('work_date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('work_date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['used']=$value->total_amount; \n }\n\n $query_hours = DB::table('budget')\n ->select(DB::raw('SUM(hours) as \"total_amount\"'))\n ->join('job', 'budget.job_number', '=', 'job.job_number')\n ->where('date', '<=', $endIniWeek2->format('Y-m-d'))\n ->where('date', '>', $IniWeek2->format('Y-m-d'))\n ->whereIn('manager', $manager_list_array)\n ->get();\n\n foreach ($query_hours as $value) {\n $total_hours_past['budget']=$value->total_amount; \n }\n\n //Past Week = Budget - Billable Hours - End \n\n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/ \n\n\n }elseif($role_user==Config::get('roles.SUPERVISOR') || $role_user==Config::get('roles.AREA_SUPERVISOR')){\n\n $primary_job=Auth::user()->gePrimayJob();\n\n $job_query = DB::table('job')\n ->where('job_number', $primary_job)\n ->get();\n\n foreach ($job_query as $value) {\n $manager_id=$value->manager; \n } \n\n\n //Count Employee \n $countEmployee = User::CountManagerEmployee($manager_id);\n $countEmployee--;\n\n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/\n }elseif($role_user==Config::get('roles.EMPLOYEE')){\n /*Evaluation functions - INI*/\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation=$value->total_amount; \n }\n\n $query_evaluation = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1) as \"param1\", SUM(parameter2) as \"param2\", SUM(parameter3) as \"param3\", SUM(parameter4) as \"param4\",SUM(parameter5) as \"param5\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation as $value) {\n $total_evaluation_param['param1']=$value->param1;\n $total_evaluation_param['param2']=$value->param2;\n $total_evaluation_param['param3']=$value->param3; \n $total_evaluation_param['param4']=$value->param4;\n $total_evaluation_param['param5']=$value->param5;\n\n }\n\n $query_evaluation_past = DB::table('evaluation')\n ->select(DB::raw('SUM(parameter1)+SUM(parameter2)+SUM(parameter3)+SUM(parameter4)+SUM(parameter5) as \"total_amount\"'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_past as $value) {\n $total_evaluation_past=$value->total_amount; \n }\n\n\n //Number of evaluations\n $total_evaluation_no = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of evaluations Past\n $total_evaluation_no_past = DB::table('evaluation')\n ->select(DB::raw('id'))\n ->where('created_at', '>', $endPastLag)\n ->where('created_at', '<=', $iniPastLag)\n ->where('evaluate_user_id', Auth::user()->id)\n ->count();\n\n //Number of users evaluated \n $query_evaluation_user = DB::table('evaluation')\n ->select(DB::raw('COUNT(DISTINCT(evaluate_user_id)) as \"total\"'))\n ->where('created_at', '>', $endIniLag)\n ->where('created_at', '<=', $dateNow)\n ->where('user_id', Auth::user()->id)\n ->get();\n\n foreach ($query_evaluation_user as $value) {\n $total_evaluation_user=$value->total; \n }\n\n\n /*Evaluation Functions - END*/ \n\n $comment_list = DB::table('evaluation')\n ->select(DB::raw('*')) \n ->where('description', '!=', '')\n ->where('evaluate_user_id', Auth::user()->id)\n ->orderBy('created_at', 'desc')\n ->paginate(100); \n }\n\n //Normalize data\n\n if($sumSquareFeet==0)\n $sumSquareFeet=1;\n \n\n //New Calculations\n $calc_val=$total_budget_monthly_lag+$total_labor_tax_lag;\n if($calc_val==0)\n $calc_val=1;\n $lag_differencial=(($total_expense_lag+$total_bill_lag)*100)/($calc_val);\n\n $budget_cant=$total_budget_monthly_lag_past+$total_labor_tax_lag_past;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_differencial_past=(($total_expense_lag_past+$total_bill_lag_past)*100)/($budget_cant);\n\n\n\n $expense_calc_week1=$total_expense_week1+$total_bill_lag;\n $expense_calc_week2=$total_expense_week2+$total_bill_lag_past;\n if($expense_calc_week2==0 || $expense_calc_week2==null)\n $expense_calc_week2=1;\n \n $cost_past_week=$lag_differencial_past-$lag_differencial;\n\n $expense_week1=$total_expense_week1+$total_bill_lag;\n $expense_week2=$total_expense_week2+$total_bill_lag_past;\n $expense_week3=$total_expense_week3;\n $expense_week4=$total_expense_week4;\n\n $budget_week1=$total_budget_monthly+$total_labor_tax_week1;\n $budget_week2=$total_budget_monthly+$total_labor_tax_week2;\n $budget_week3=$total_budget_monthly+$total_labor_tax_week3;\n $budget_week4=$total_budget_monthly+$total_labor_tax_week4;\n\n\n $budget_cant=$budget_week1;\n if($budget_cant==0)\n $budget_cant=1;\n $lag_past_week=($expense_week1*100)/($budget_cant);\n\n //$cost_past_week=$total_expense_week1;\n\n\n /*Announcement list - INI*/\n switch ($role_user) {\n case '4':\n $permission_filter='1____';\n break;\n case '6':\n $permission_filter='_1___';\n break;\n case '5':\n $permission_filter='__1__';\n break;\n case '8':\n $permission_filter='___1_';\n break;\n case '9':\n $permission_filter='____1';\n break;\n default:\n $permission_filter='2____';\n break;\n }\n\n $result_announce = DB::table('announce')\n ->select(DB::raw('*'))\n ->where('status', 1)\n ->where('permission', 'like' , $permission_filter)\n ->orderBy('closing_date', 'desc')\n ->paginate(50);\n\n /*Announcement list - END*/\n\n return view('metrics.page', [\n 'user_id' => $user_id, \n 'count_employee' => $countEmployee,\n 'count_portfolio' => $countPortfolio, \n 'count_evaluation' => $countEvaluation, \n 'sum_square_feet' => $sumSquareFeet,\n 'role_user' => $role_user,\n 'manager_list' => $manager_list, \n 'job_portfolio' => $job_portfolio,\n 'job_site' => $job_site, \n 'job_list_str' => $job_list_str,\n 'job_portfolio_id' => 0,\n 'manager_id' => $manager_id,\n 'total_expense_lag' => $total_expense_lag,\n 'total_labor_tax_lag' => $total_labor_tax_lag,\n 'total_budget_monthly_lag' => $total_budget_monthly_lag,\n 'total_bill_lag' => $total_bill_lag,\n 'cost_past_week' => $cost_past_week,\n 'lag_differencial' => $lag_differencial,\n 'lag_differencial_past' => $lag_differencial_past,\n 'lag_past_week' => $lag_past_week,\n 'expense_week1' => $expense_week1,\n 'expense_week2' => $expense_week2,\n 'expense_week3' => $expense_week3,\n 'expense_week4' => $expense_week4,\n 'budget_week1' => $budget_week1,\n 'budget_week2' => $budget_week2,\n 'budget_week3' => $budget_week3,\n 'budget_week4' => $budget_week4,\n 'total_evaluation' => $total_evaluation,\n 'total_evaluation_no' => $total_evaluation_no,\n 'total_evaluation_past' => $total_evaluation_past,\n 'total_evaluation_no_past' => $total_evaluation_no_past,\n 'total_evaluation_user' => $total_evaluation_user,\n 'total_evaluation_param' => $total_evaluation_param,\n 'total_supplies' => $total_supplies,\n 'total_supplies_past' => $total_supplies_past,\n 'total_salies_wages_amount' => $total_salies_wages_amount,\n 'total_salies_wages_amount_past' => $total_salies_wages_amount_past,\n 'total_hours' => $total_hours,\n 'total_hours_past' => $total_hours_past,\n 'result_announce' => $result_announce,\n 'comment_list' => $comment_list \n ]);\n }", "function get_acquisition_qty_by_country(){\n \n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n //$columns = \"DATE_FORMAT(acquire_date,'%b') as Month\";\n $columns = \" tblcountry.country, sum(trelVintageHasAcquire.qty) as qty\";\n //$group = \" trelVintageHasAcquire.acquire_id \";\n $group = \" tblcountry.country \";\n //$where = \" tblAcquire.acquire_date BETWEEN '2014-01-01' AND '2014-12-31'\";\n $sort = \" qty DESC \";\n $limit = '12';\n $rst = $obj ->get_extended($where,$columns,$group, $sort, $limit);\n \n \n if(!$rst){\n $var_result['success']=false;\n $var_result['error']=\"get_acquisition_qty_by_country() failed\";\n return $var_result;\n }\n\n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result;\n \n}", "function get_datatables_invoice()\n {\n $this->company_db = $this->load->database('company_db', TRUE);\n $offset = ($_REQUEST['datatable']['pagination']['page'] - 1)*$_REQUEST['datatable']['pagination']['perpage'];\n $this->_get_datatables_query_invoice();\n if($_REQUEST['datatable']['pagination']['perpage'] != -1)\n $this->company_db->limit($_REQUEST['datatable']['pagination']['perpage'], $offset);\n $query = $this->company_db->get();\n /*$this->_get_datatables_query();\n $query2 = $this->company_db->get();*/\n /* echo \"<pre>\";\n var_dump($query);exit;\n echo \"</pre>\";*/\n\n $this->session->set_userdata('last_pickup_report_query',$this->company_db->last_query());\n\n\n if($query->num_rows() > 0)\n {\n foreach ($query->result() as $row)\n {\n //var_dump($row);exit;\n //$balance = $row->balance;\n\n //var_dump($balance);exit;\n\n\n\n // $now = strtotime(str_replace('/', '-', $_REQUEST['datatable']['pickup_date'])); // or your date as well\n\n $row->invoice_number = \"<span class='invoice'>$row->invoice_number</span>\n <span></span>\";\n $row->name = \"<div style='display:none' class='customer'>$row->customer_id</div><span>$row->name</span>\";\n\n $row->nameShipto = \"<div style='display:none' class='nameShipto'>$row->ShiptoId</div><span>$row->nameShipto</span>\";\n\n $row->total_packages = \"<span class='total_packages'>$row->total_packages</span><span></span>\";\n\n $row->balance = \"<span class='balance'>$row->balance</span><span></span>\";\n\n $row->invoice_date = \"<span class='invoice_date'>$row->invoice_date</span><span></span>\n \";\n // var_dump($row);exit;\n\n /*$your_date = strtotime($row->pickup_date);\n $datediff = $now - $your_date;\n\n $days = round($datediff / (60 * 60 * 24));\n if($days > 2)\n $row->pickup_date = \"<label class='text-danger'>\".date(\"m/d/Y\", strtotime($row->pickup_date)).\"</label>\";\n else if($days > 1)\n $row->pickup_date = \"<label class='text-warning'>\".date(\"m/d/Y\", strtotime($row->pickup_date)).\"</label>\";\n else\n $row->pickup_date = date(\"m/d/Y\", strtotime($row->pickup_date));*/\n\n $row->chk_status = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' id='chk_status_$row->id' value = '$row->id' class = 'chk_status' name='chk_status[]' data-id ='$row->id'>\n <span></span></label>\n \";\n /*if($row->status != \"Done\"){\n } else {\n $row->chk_status = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' id='chk_status_$row->id' value = '$row->id' class = 'chk_status' name='chk_status[]' data-id ='$row->id' checked>\n <span></span></label>\";\n }*/\n\n $row->chk_print = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'>\n <input type='checkbox' class = 'chk_print' name='chk_print[]' data-id ='$row->id' checked>\n <span></span>\n </label>\";\n\n /* if($row->driver_id != '0'){\n\n $row->chk_driver = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' class = 'chk_driver' name='chk_driver[]' data-id ='$row->id' checked>\n <span></span></label>\";\n\n }else{\n\n $row->chk_driver = \"<label class='m-checkbox m-checkbox--solid m-checkbox--brand'><input type='checkbox' class = 'chk_driver' name='chk_driver[]' data-id ='$row->id'>\n <span></span></label>\n \";\n }*/\n\n\n }\n\n return $query->result();\n }\n else\n {\n return false;\n }\n }", "public function getExpenses()\n {\n $query = \"(SELECT up.user_id, concat(up.first_name, ' ', up.last_name) AS expenses_by, e.batch_id, e.created_by, e.expense_currency, SUM(e.expense_amount) AS total, e.expense_date\n FROM `Expenses` e INNER JOIN UserPlus up ON e.created_by = up.user_id WHERE e.expense_currency = 'euro' GROUP BY MONTH(e.expense_date), e.created_by ORDER BY e.created_at ASC)\n UNION\n (SELECT up.user_id, concat(up.first_name, ' ', up.last_name) AS expenses_by, e.batch_id, e.created_by, e.expense_currency, SUM(e.expense_amount) AS total, e.expense_date\n FROM `Expenses` e INNER JOIN UserPlus up ON e.created_by = up.user_id WHERE e.expense_currency = 'pound' GROUP BY MONTH(e.expense_date), e.created_by ORDER BY e.created_at ASC)\";\n if(($result = $this->getQuery($query,true)) != NULL)\n {\n return $result;\n }\n else\n return \"NO\";\n\n }", "public function getCDateAttnDesgWise_new()\n {\n $orgid = isset($_REQUEST['refno']) ? $_REQUEST['refno'] : 0;\n $att = isset($_REQUEST['att']) ? $_REQUEST['att'] : 0;\n $date = isset($_REQUEST['date']) ? $_REQUEST['date'] : '';\n $desg = isset($_REQUEST['desg']) ? $_REQUEST['desg'] : '';\n $datafor = isset($_REQUEST['datafor']) ? $_REQUEST['datafor'] : '';\n $zone = getTimeZone($orgid);\n date_default_timezone_set($zone);\n $date =date('Y-m-d',strtotime($date));\n $time = date('H:i:s');\n $data = array();\n $cdate = date('Y-m-d');\n\t \n\t $desg_cond='';\n\t $desg_cond1='';\n\t \n\t \n\t if($desg!=0)\n\t {\n\t\t $desg_cond=' and Desg_id='.$desg;\n\t\t $desg_cond1 =' and Designation='.$desg;\n\t }\n\t \n //today attendance\n\t\t if($datafor=='present'){\n\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE `AttendanceDate`=? \".$desg_cond.\" and OrganizationId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) AND EmployeeId in (SELECT Id from EmployeeMaster where OrganizationId = $orgid AND Is_Delete = 0 ) order by `name`\",\n\t\tarray($date,$orgid));\n $data['present'] = $query->result();\n\t\t\t\n\t\t\t }else if($datafor=='absent'){/*\n //---managing off (weekly and holiday)\n $dt = $date; \n // day of month : 1 sun 2 mon --\n $dayOfWeek = 1 + date('w', strtotime($dt));\n $weekOfMonth = weekOfMonth($dt);\n $week = '';\n $query = $this->db->query(\"SELECT `WeekOff` FROM `WeekOffMaster` WHERE `OrganizationId` =? AND `Day` = ?\", array(\n $orgid,\n $dayOfWeek\n ));\n if ($row = $query->result()) {\n $week = explode(\",\", $row[0]->WeekOff);\n }\n if ($week[$weekOfMonth - 1] == 1) {\n $data['absentees'] = '';\n } else {\n $query = $this->db->query(\"SELECT `DateFrom`, `DateTo` FROM `HolidayMaster` WHERE OrganizationId=? and (? between `DateFrom` and `DateTo`) \", array(\n $orgid,\n $dt\n ));\n if ($query->num_rows() > 0) {\n //-----managing off (weekly and holiday) - close \n $query = $this->db->query(\"SELECT CONCAT(FirstName,' ',LastName) as name,'-' as TimeIn,'-' as TimeOut ,'Absent' as status from EmployeeMaster where `OrganizationId` =$orgid and EmployeeMaster.archive=1 and EmployeeMaster.Id not in(select AttendanceMaster.`EmployeeId` from AttendanceMaster where `AttendanceDate`='$date' and `OrganizationId` =$orgid) and CAST('$time' as time) > (select TimeIn from ShiftMaster where ShiftMaster.Id=shift) order by `name`\", array(\n $orgid,\n $date,\n $orgid\n ));\n $data['absentees'] = $query->result();\n } \n }*/\n\t\t\t//////////abs\n\t\n\t\t\t\n\t\t\t\n\t\t\tif($date!=date('Y-m-d')){// for other deay's absentees\n\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , '-' as `TimeOut` ,'-' as TimeIn FROM `AttendanceMaster` WHERE `AttendanceDate`=? and OrganizationId=? and (AttendanceStatus=2 or AttendanceStatus=6 or AttendanceStatus=7 ) \".$desg_cond.\" order by `name`\", array($date,$orgid));\n\t\t\t\t$this->db->close();\n\t\t\t\t$data['absent'] = $query->result();\n\t\t\t}else{ // for today's absentees\n\t\t\t\t$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , '-' as `TimeOut` ,'-' as TimeIn FROM `AttendanceMaster` WHERE `AttendanceDate`=? and OrganizationId=? \nand AttendanceStatus in (2,6,7) \".$desg_cond.\" order by `name`\",array($date,$orgid));\n\t\t\t$temp=array();\n $temp = $query->result();\n\t\t\t\n\t\t\t$query = $this->db->query(\"SELECT CONCAT(FirstName,' ',LastName) as name, '-' as `TimeOut` ,'-' as TimeIn\n\t\t\t\t\t\tFROM `EmployeeMaster` \n\t\t\t\t\t\tWHERE `OrganizationId` =?\n\t\t\t\t\t\tAND ARCHIVE =1 \".$desg_cond1.\"\n\t\t\t\t\t\tAND is_Delete = 0 AND Id NOT \n\t\t\t\t\t\tIN (\n\t\t\t\t\t\tSELECT EmployeeId\n\t\t\t\t\t\tFROM AttendanceMaster\n\t\t\t\t\t\tWHERE AttendanceDate = ?\n\t\t\t\t\t\tAND `OrganizationId` =?\n\t\t\t\t\t\t)\n\t\t\t\t\t\tAND (\n\t\t\t\t\t\tSELECT `TimeIn` \n\t\t\t\t\t\tFROM `ShiftMaster` \n\t\t\t\t\t\tWHERE `Id` = Shift\n\t\t\t\t\t\tAND TimeIn < ?\n\t\t\t\t\t\t)\",array($orgid,$date,$orgid,$time));\n\t\t\t\t\t\t$data['absent']= array_merge($temp,$query->result());\n\t\t\t}\n\t\t\t\n\t}else if($datafor=='latecomings'){\n\t//\techo \"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and `AttendanceDate`='$date' \".$desg_cond.\" and OrganizationId='$orgid' and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) order by `name`\";\n //////// today_late\n $query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (time(TimeIn) > (select time(TimeIn) from ShiftMaster where ShiftMaster.Id=shiftId)) and `AttendanceDate`=? \".$desg_cond.\" and OrganizationId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) order by `name`\", array(\n $date,\n $orgid\n ));\n $data['lateComings'] = $query->result();\n\t}else if($datafor=='earlyleavings'){\t\t\n ////////today_early\n /*$query = $this->db->query(\"SELECT (select CONCAT(FirstName,' ',LastName) from EmployeeMaster where id= `EmployeeId`) as name , SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out FROM `AttendanceMaster` WHERE (time(TimeOut) < (select time(TimeOut) from ShiftMaster where ShiftMaster.Id=shiftId) and TimeOut!='00:00:00' ) and `AttendanceDate`=? \".$desg_cond.\" and OrganizationId=? and (AttendanceStatus=1 or AttendanceStatus=3 or AttendanceStatus=4 or AttendanceStatus=5 or AttendanceStatus=8 ) order by `name`\", array( $date, $orgid ));\n $data['earlyLeavings'] = $query->result();*/\n\t\t\t\n\t\t $query = $this->db->query(\"select Shift,Id , FirstName , LastName from EmployeeMaster where OrganizationId = $orgid and Id IN (select EmployeeId from AttendanceMaster where OrganizationId = $orgid and AttendanceDate='$date' and TimeIn != '00:00:00' $desg_cond ) AND is_Delete=0 order by FirstName\");\n\t\t $res = array() ;\n\t\t $cond = '';\n foreach ($query->result() as $row) {\n $ShiftId = $row->Shift;\n $EId = $row->Id;\n $query = $this->db->query(\"select TimeIn,TimeOut,shifttype from ShiftMaster where Id = $ShiftId\");\n if ($data123 = $query->row()) {\n $shiftout = $data123->TimeOut;\n $shiftout1 = $date. ' '.$data123->TimeOut;\n\t\t\t\tif($data123->shifttype==2)\n\t\t\t\t{\n\t\t\t\t\t$nextdate = date('Y-m-d',strtotime($date . \"+1 days\"));\n\t\t\t\t\t $shiftout1 = $nextdate.' '.$data123->TimeOut;\n\t\t\t\t}\n $shift = substr($data123->TimeIn, 0, 5) . ' - ' . substr($data123->TimeOut, 0, 5);\n $ct = date('H:i:s');\n \n if ($cdate == $date)\n $cond = \" and TimeOut !='00:00:00'\";\n $query333 = $this->db->query(\"select SUBSTR(TimeIn, 1, 5) as `TimeIn`, SUBSTR(TimeOut, 1, 5) as `TimeOut` ,'Present' as status,EntryImage,ExitImage,SUBSTR(checkInLoc, 1, 40) as checkInLoc, SUBSTR(CheckOutLoc, 1, 40) as CheckOutLoc,latit_in,longi_in,latit_out,longi_out from AttendanceMaster where EmployeeId =$EId and if(timeoutdate = '0000-00-00' , TimeOut < '$shiftout' , CONCAT(timeoutdate,' ' ,TimeOut) < '$shiftout1' ) and AttendanceDate='$date'\" . $cond);\n\t\t\t\t\t\n\t\t\t\t\t\n if ($row333 = $query333->row()) {\n $a = new DateTime($row333->TimeOut);\n $b = new DateTime($data123->TimeOut);\n $interval = $a->diff($b);\n $data['earlyby'] = $interval->format(\"%H:%I\");\n $data['timeout'] = substr($row333->TimeOut, 0, 5);\n $data['name'] = $row->FirstName . ' ' . $row->LastName;\n $data['shift'] = $shift;\n $data['TimeIn'] = $row333->TimeIn;\n $data['TimeOut'] = $row333->TimeOut;\n $data['CheckOutLoc'] = $row333->CheckOutLoc;\n $data['checkInLoc'] = $row333->checkInLoc;\n $data['latit_in'] = $row333->latit_in;\n $data['longi_in'] = $row333->longi_in;\n $data['latit_out'] = $row333->latit_out;\n $data['longi_out'] = $row333->longi_out;\n $data['status'] = $row333->status;\n $data['date'] = $date;\n $res[] = $data;\n }\n \n }\n }\n\t\t $data['earlyLeavings'] =\t $res; \n\t\t\t\n\t}\t\t\n echo json_encode($data, JSON_NUMERIC_CHECK);\n \n }", "public function stock_report_bydate($product_id,$date,$limit,$page)\n\t{\n\n\t\t$this->db->select(\"\n\t\t\t\ta.product_name,\n\t\t\t\ta.unit,\n\t\t\t\ta.product_id,\n\t\t\t\ta.price,\n\t\t\t\ta.supplier_price,\n\t\t\t\ta.product_model,\n\t\t\t\tc.category_name,\n\t\t\t\tsum(b.quantity) as totalPurchaseQnty,\n\t\t\t\te.purchase_date as purchase_date,\n\t\t\t\te.purchase_id,\n\t\t\t\tf.unit_name\n\t\t\t\");\n\n\t\t$this->db->from('product_information a');\n\t\t$this->db->join('product_purchase_details b','b.product_id = a.product_id','left');\n\t\t$this->db->join('product_category c' ,'c.category_id = a.category_id');\n\t\t$this->db->join('product_purchase e','e.purchase_id = b.purchase_id');\n\t\t$this->db->join('unit f','f.unit_id = a.unit','left');\n\t\t$this->db->join('variant g','g.variant_id = b.variant_id','left');\n\t\t$this->db->join('store_set h','h.store_id = b.store_id');\n\t\t$this->db->where('b.store_id !=',null);\n\t\t$this->db->group_by('a.product_id');\n\t\t$this->db->order_by('a.product_name','asc');\n\n\t\tif(empty($product_id))\n\t\t{\n\t\t\t$this->db->where(array('a.status'=>1));\n\t\t}\n\t\telse{\n\t\t\t//Single product information \n\t\t\t$this->db->where(array('a.status'=>1,'e.purchase_date <= ' => $date,'a.product_id'=>$product_id));\t\n\t\t}\n\n\t\t$this->db->limit($limit, $page);\n\t\t$query = $this->db->get();\n\n\t\treturn $query->result_array();\n\t}", "public function view_attendance() { \r\n date_default_timezone_set(\"Asia/Manila\");\r\n $date= date(\"Y-m-d\");\r\n $year = date('Y', strtotime($date));\r\n $month = date('m', strtotime($date));\r\n $datenow = $year .\"-\". $month;\r\n $set_data = $this->session->userdata('userlogin'); //session data\r\n $data = array('clientID' => $set_data['clientID']\r\n ); \r\n $firstDay = mktime(0,0,0,$month, 1, $year);\r\n $timestamp = $firstDay;\r\n $weekDays = array();\r\n for ($i = 0; $i < 31; $i++) {\r\n $weekDays[] = strftime('%a', $timestamp);\r\n $timestamp = strtotime('+1 day', $timestamp);\r\n } \r\n $records['clientprofile']=$this->Client_Model->clientprofile($data);\r\n $records['weekDays']=$weekDays;\r\n $records['useradmin']=$this->User_Model->usertype();\r\n $records['employeeatendance']=$this->Attendance_Model->viewattendanceemployee($set_data['clientID'], $datenow);\r\n $this->load->view('attendanceemployee', $records);\r\n }", "public function index(Request $request) {\n\n $assets = $this->getAssetData($request);\n\n $allDepTable = [];\n $maxYear = 0;\n foreach ($assets as $asset) {\n $cost = $asset->purchasedCost;\n $lifespan = $asset->lifespan;\n $depValue = ($cost - 0) / $lifespan;\n $depRate = round(($depValue / $cost) * 100, 2);\n\n $depTable = array();\n for ($a = 1; $a <= $lifespan; $a++) {\n $depTable[$a]['rate'] = $depRate;\n $depTable[$a]['cost'] = round($cost);\n $depTable[$a]['less'] = round($depValue);\n $depTable[$a]['newCost'] = $depTable[$a]['cost'] - $depTable[$a]['less'];\n\n $cost -= $depValue;\n }\n $allDepTable[$asset->name]['depreciation'] = $depTable;\n $allDepTable[$asset->name]['start'] = date('F d, Y', strtotime($asset->purchasedDate));\n $allDepTable[$asset->name]['end'] = date('F d, Y', strtotime($asset->purchasedDate . ' + ' . $asset->lifespan . ' years'));\n\n if ($lifespan > $maxYear) {\n $maxYear = $lifespan;\n }\n }\n\n $settings['maxYear'] = $maxYear;\n $settings['filterValue'] = $request->get('filterValue');\n $settings['sortBy'] = $request->get('sortBy');\n $settings['sorting'] = $request->get('sorting');\n $settings['format'] = $request->has('format') ? $request->get('format') : 'year';\n\n// \\Debugbar::info($settings['downloadLink']);\n return view(\"pages.reports.depreciation\")->with(['settings' => $settings, 'records' => $allDepTable]);\n }", "public function generate_report($from_date,$to_date,$type)\n\t{\n\t\t$this->db->where('col_date >=', date(\"Y-m-d\", strtotime($from_date)));\n\t\t$this->db->where('col_date <=', date(\"Y-m-d\", strtotime($to_date)));\n\t\t$this->db->where('type', $type);\n\t\t$query=$this->db->get('td_fee_collection');\n\t\treturn $query->result();\n\t}", "function get_15daysre(){\n// $xdays = 10;\n\n//$dates = array();\n//for ($i = 1; $i <= $xdays; $i++) {\n// $dates[$i] = date('Y-m-d',strtotime(date(\"Y-m-d\", strtotime($date)) . \"-\".$i.\" day\"));\n//}\n// \n $dshamsi = '';\n if(tis_shamsi()){\n $dshamsi = 's';\n }\n global $dbase;\n \n $datex2 = array();\n \n$result = $dbase->query(\"SELECT imp_{$dshamsi}date as dateon,sum(imp_total) as tolx FROM `sob_impexp` where imp_eoe=1 GROUP BY imp_{$dshamsi}date ORDER by imp_{$dshamsi}date DESC LIMIT 15\");\n\n while($row = $dbase->fetch_array($result))\n\t {\n\t\tif(!empty($row['tolx']))\n $datex2[$row['dateon']]['sell'] = $row['tolx'];\n else\n $datex2[$row['dateon']]['sell'] =0; \n\t }\n \n//$row = $dbase->fetch_array($result);\n\n\n //}\n \n \n //foreach($dates as $i => $date2){\n$result2 = $dbase->query(\"SELECT imp_{$dshamsi}date as dateon,sum(imp_total) as tolx FROM `sob_impexp` where imp_eoe=2 GROUP BY imp_{$dshamsi}date ORDER by imp_{$dshamsi}date DESC LIMIT 15\");\n\n while($row2 = $dbase->fetch_array($result2)){\n if(!empty($row2['tolx']))\n $datex2[$row2['dateon']]['buy'] = $row2['tolx'];\n else\n $datex2[$row2['dateon']]['buy'] =0; \n }\n\n \n //}\nreturn $datex2;\n \n \n}", "public function get_trend_data_rows()\n\t{\n\t\t$dates = array();\n\t\t$i_rows = array();\n\t\t$sr_rows = array();\n\t\t$trend_data = array();\n\n\t $current_month = date_create()->format('Y-m-d H:i:s');\n\n\t // echo $current_month_first_day=date_create($current_month)\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\t $current_month_first_day=date_create($current_month)\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n\n $dates[] = $current_month_first_day;\n\n //echo\"</br>\";\n \n // echo $current_month_current_day=date_create($current_month)\n // ->format(\"Y-m-d 23:59:59\");\n\n $current_month_current_day=date_create($current_month)\n ->format(\"Y-m-d 23:59:59\");\t\n\n $dates[] = $current_month_current_day;\n\n //echo\"</br></br>\";\n\n // echo $second_month_first_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $second_month_first_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $second_month_first_day;\n\n //echo\"</br>\";\n\n // echo $second_month_last_day=date_create($current_month)\n // ->modify('-1 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n $second_month_last_day=date_create($current_month)\n ->modify('-1 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $second_month_last_day;\n\n// echo\"</br></br>\";\n\n // echo $third_month_first_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('first day of this month')\n // ->format(\"Y-m-d 00:00:00\");\n\n $third_month_first_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('first day of this month')\n ->format(\"Y-m-d 00:00:00\");\n\n $dates[] = $third_month_first_day;\n\n //echo\"</br>\";\n \t\t\t\n // echo $third_month_last_day=date_create($current_month)\n // ->modify('-2 months')\n // ->modify('last day of this month')\n // ->format(\"Y-m-d 23:59:59\");\n\n\t $third_month_last_day=date_create($current_month)\n ->modify('-2 months')\n ->modify('last day of this month')\n ->format(\"Y-m-d 23:59:59\");\n\n $dates[] = $third_month_last_day;\n\n // echo\"</br>\";\t\n // echo \"<pre>\";\n // print_r($dates);\n\t // echo \"</pre>\";\t\n\t // echo\"</br>\";\t\t\t \n\n for ($i=0; $i <=5 ; $i=$i+2)\n { \t\n \t//echo\"</br>\";\n\n \t$start = new DateTime($dates[$i]);\n \t\n \t//echo\"</br>\";\n\n\t\t$start = date_format($start,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\n\t\t$end = new DateTime($dates[$i+1]);\n\n\t\t//echo\"</br>\";\n\n\t\t$end = date_format($end,\"Y-m-d 00:00:00\");\n\n\t\t//echo\"</br>\";\n\t\t$i_rows[] = date_create($start)->format(\"F Y\");\n\t\t$i_rows[] = date_create($end)->format(\"F Y\");\n\t\t$i_rows[] = $this->trend_insident_data($start,$end);\n \t$sr_rows[] = date_create($start)->format(\"F Y\");\n\t\t$sr_rows[] = date_create($end)->format(\"F Y\");\n \t$sr_rows[] = $this->trend_sr_data($start,$end);\t\n }\n\n // echo \"<pre>\";\n // \tprint_r($i_rows);\n \t\t// echo \"<h4>SR Array</h4>\";\n \t\t// print_r($sr_rows);\n \t\t// echo \"</pre>\";\n\n \t\t$trend_data[] = $i_rows;\n \t\t$trend_data[] = $sr_rows;\n\n\n \t\treturn $trend_data;\n\n\n // // First day of a specific month\n // $d = new DateTime('2010-01-19');\n // $d->modify('first day of this month');\n // echo $d->format('jS, F Y').\"</br>\";\n\n // // alternatively...\n // echo date_create('2010-01-19')\n // ->modify('first day of this month')\n // ->format('jS, F Y');\n\t\t//exit();\n\t}", "static function getTitoloReport($data){\n if(date(\"dmY\",time())==date(\"dmY\",$data))\n return \"Eventi di Oggi - \".date(\"d.m.Y\",$data);\n else if(date(\"dmY\",(time()+86400))==date(\"dmY\",$data))\n return \"Eventi di Domani - \".date(\"d.m.Y\",$data);\n else if(date(\"dmY\",(time()-86400))==date(\"dmY\",$data))\n return \"Eventi di Ieri - \".date(\"d.m.Y\",$data);\n else\n return \"Eventi del \".date(\"d.m.Y\",$data);\n }", "function reports($biz_id,$table,$date,$sum) {\n\t\n\t\t$results = [];\n\t\t$resultsDB = \\DB::table($table)->where('biz_id', $biz_id);\n\n\t\tif(isset($_GET['client_id']) AND $_GET['client_id'] != 'all' AND $table != 'clients') {\n\t\t\t$resultsDB->where('client_id', $_GET['client_id']);\n\t\t}\n\t\t\n\t\tif(isset($_GET['currency'])) {\n\t\t\t$resultsDB->where('currency', $_GET['currency']);\n\t\t}\n\n\t\t$month = clone $resultsDB;\n\t\t$lastmonth = clone $resultsDB;\n\t\t$lastmonth2 = clone $resultsDB;\n\t\t$lastyear = clone $resultsDB;\n\t\t$year = clone $resultsDB;\n\t\t$dates_filtered = clone $resultsDB;\n\n\t\tif(!empty($_GET['date_from'])) {\n\t\t\t$dates_filtered->whereDate($date, '>', $_GET['date_from']);\n\t\t}\n\t\tif(!empty($_GET['date_to'])) {\n\t\t\t$dates_filtered->whereDate($date, '<', $_GET['date_to']);\n\t\t}\n\t\t$results['results'] = $dates_filtered->count();\n\t\t$results['results_sum'] = $dates_filtered->sum($sum);\n\n\t\t$month = $month->whereMonth($date, \\Carbon::now()->format('m'));\n\t\t$lastmonth = $lastmonth->whereMonth($date, \\Carbon::now()->firstOfMonth()->subMonth()->format('m'));\n\t\t$lastmonth2 = $lastmonth2->whereMonth($date, \\Carbon::now()->firstOfMonth()->subMonth(2)->format('m'));\n\t\t$year = $year->whereYear($date, \\Carbon::now()->format('Y'));\n\t\t$lastyear = $lastyear->whereYear($date, \\Carbon::now()->subYear()->format('Y'));\n\n\t\t$results['month'] = $month->count();\n\t\t$results['month_sum'] = $month->sum($sum);\n\t\t$results['lastmonth'] = $lastmonth->count();\n\t\t$results['lastmonth_sum'] = $lastmonth->sum($sum);\n\t\t$results['lastmonth2'] = $lastmonth2->count();\n\t\t$results['lastmonth2_sum'] = $lastmonth2->sum($sum);\n\t\t$results['year'] = $year->count();\n\t\t$results['year_sum'] = $year->sum($sum);\n\t\t$results['lastyear'] = $lastyear->count();\n\t\t$results['lastyear_sum'] = $lastyear->sum($sum);\n\t\t$results['total'] = $resultsDB->count();\n\t\t$results['total_sum'] = $resultsDB->sum($sum);\n\t\t\n \treturn $results;\n\t}", "public function reportTodayAttendent()\n {\n $shift = DB::table('shift')->get();\n $dept = DB::table('department')->where('status',1)->get();\n return view('report.reportTodayAttendent')->with('shift',$shift)->with('dept',$dept);\n }", "public function generateExpenses()\n {\n \t//Iva\n \t$iva_expense = new Expense();\n \t$iva_expense->type = 'iva';\n \t$iva_expense->value = ($this->value * $this->iva_percetage)/100;\n \t$iva_expense->exchange_rate_cop = $this->exchange_rate_cop;\n \t$iva_expense->income_id = $this->id;\n \t$iva_expense->currency_id = $this->currency_id;\n \t$iva_expense->save();\n\n \t//Trsoft utility, se calcula con el valor después de descontar el iva\n\t\t$trsoft_utility_expense = new Expense();\n\t\t$trsoft_utility_expense->type = 'trsoft utility';\n\t\t//En la compra de una licencia la utilidad de trsoft aumenta\n\t\tif($this->type == 'license'){\n\t\t\t$trsoft_utility_expense->value = (\n\t\t\t\t//Valor despues de restarle el iva\n\t\t\t\t($this->value - $iva_expense->value) \n\t\t\t\t//Se calcula el % de utilidad de TrSoft, se separa la utilidad de socios\n\t\t\t\t* (100 - $this->partners_utility)\n\t\t\t)/100;\n\t\t}else if($this->type == 'commission'){\n\t\t\t//Cuando se paga una comisión la utiliad de TrSoft es la establecida\n\t\t\t$trsoft_utility_expense->value = (($this->value - $iva_expense->value) * $this->trsoft_utility)/100;\n\t\t}\n\n\t\t$trsoft_utility_expense->exchange_rate_cop = $this->exchange_rate_cop;\n\t\t$trsoft_utility_expense->state = 'paid out';\n\t\t$trsoft_utility_expense->income_id = $this->id;\n\t\t$trsoft_utility_expense->currency_id = $this->currency_id;\n\t\t$trsoft_utility_expense->save(); \n\n \t//Partners utility, se calcula con el valor después de descontar el iva\n\t\t$partners_utility_expense = new Expense();\n\t\t$partners_utility_expense->type = 'partners utility';\n\t\t$partners_utility_expense->value = (($this->value - $iva_expense->value) * $this->partners_utility)/100;\n\t\t$partners_utility_expense->exchange_rate_cop = $this->exchange_rate_cop;\n\t\t$partners_utility_expense->income_id = $this->id;\n\t\t$partners_utility_expense->currency_id = $this->currency_id;\n\t\t$partners_utility_expense->save(); \t\n\n\t\t//Si es el pago de una comisión se deben generar los egresos\n\t\t//para pago de comisión de traders y desarrollador\n\t\tif($this->type == 'commission'){\n\n\t\t}\n }" ]
[ "0.67331916", "0.66458374", "0.65866214", "0.64653", "0.6350249", "0.63116544", "0.62193227", "0.62185943", "0.6195381", "0.61095643", "0.6077952", "0.6049646", "0.60457355", "0.6018501", "0.5996672", "0.5992983", "0.59608483", "0.5937871", "0.59226084", "0.59129715", "0.5895059", "0.589356", "0.58862233", "0.5881569", "0.5815979", "0.58107954", "0.58100766", "0.5807674", "0.58071375", "0.57977074", "0.5770995", "0.57703257", "0.5759489", "0.5756428", "0.5743974", "0.57401794", "0.5722782", "0.5710718", "0.57102734", "0.57089144", "0.56972486", "0.5682524", "0.56811816", "0.56804264", "0.5674997", "0.56684774", "0.56679714", "0.5664631", "0.5659897", "0.56590873", "0.5649154", "0.5636862", "0.56263083", "0.5620219", "0.5618986", "0.5616114", "0.560225", "0.5601805", "0.5597928", "0.55956465", "0.559281", "0.5586897", "0.55791205", "0.5575081", "0.5571024", "0.5563872", "0.5563307", "0.5552286", "0.55503607", "0.5549759", "0.5548468", "0.5545666", "0.55436456", "0.5540979", "0.55313855", "0.55174875", "0.5516279", "0.55157566", "0.55141765", "0.5506417", "0.55040854", "0.5503378", "0.5502113", "0.5500173", "0.5496613", "0.5494075", "0.54929626", "0.54879045", "0.5487546", "0.5486802", "0.5483653", "0.54762566", "0.54684365", "0.546554", "0.54631424", "0.546171", "0.5458238", "0.5453419", "0.54524463", "0.54508585" ]
0.66466373
1
Get the instance as an array.
public function toArray(): array;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function instanceToArray() : array{\n\n if(!method_exists(self::class,'instance')):\n return [];\n endif;\n\n return self::instance()->toArray();\n }", "public function toArray($instance): array;", "public function getAsArray();", "public function toArray() {\n return (array)$this;\n }", "function asArray(){\n\t\t\t$array = $this->toArray( $this );\n\t\t\treturn $array;\n\t\t}", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray()\n {\n return (array)$this;\n }", "public function toArray() {\n\t\treturn $this->array;\n\t}", "public function as_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}", "public function toArray() {\n return $this->array;\n }", "public function toArray()\n {\n return $this->cast('array');\n }", "public function & toArray()\n\t{\n\t\t$x = new ArrayObject($this->data);\n\t\treturn $x;\n\t}", "public function asArray()\r\n {\r\n return $this->data;\r\n }", "public function getArray() : array {\n return $this->getArrayCopy();\n }", "public function toArray() :array {\n return get_object_vars($this);\n }", "public function asArray()\n {\n return $this->data;\n }", "public function toArray(): array {\n\t\treturn $this->array;\n\t}", "public function toArray() // untested\n {\n return $this->data;\n }", "public function getAsArray()\n\t{\n\t\t\n\t\t$path = $this->get();\n\t\t\n\t\treturn self::toArray($path);\n\t\t\n\t}", "public function toArray() : array{\n return get_object_vars( $this );\n }", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function toArray() {}", "public function asArray()\n {\n return iterator_to_array($this, false);\n }", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray();", "public function asArray(){\n return $this->data;\n }", "public function to_array()\n\t{\n\t\treturn $this->getArrayCopy();\n\t}", "public function toArray()\n\t{\n\t\treturn array();\n\t}", "public function __toArray(): array\n {\n return call_user_func('get_object_vars', $this);\n }", "public function toArray(){\n $this->buildArray();\n return $this->array;\n }", "public function getArray()\n {\n return $this->get(self::_ARRAY);\n }", "public /*array*/ function toArray()\n\t{\n\t\treturn $this->_data;\n\t}", "public function toArray() {\n\t\treturn $this->data;\n\t}", "public function asArray() : array\n {\n return $this->a;\n }", "public function toArray()\n {\n return json_decode(json_encode($this), true);\n }", "public function toArray()\n {\n return json_decode(json_encode($this), true);\n }", "public function toArray() {\n return json_decode(json_encode($this), true);\n }", "public function toArray()\n {\n // TODO: Implement toArray() method.\n }", "public function toArray()\n {\n // TODO: Implement toArray() method.\n }", "public function asArray()\n {\n }", "public function getArray()\n {\n return iterator_to_array($this->getIterator());\n }", "public function __toArray()\n {\n return $this->toArray();\n }", "function toArray(){\r\n\t\treturn $this->data;\r\n\t}", "public function toArray()\n {\n return get_object_vars($this);\n }", "public function toArray(): array\r\n {\r\n return get_object_vars($this);\r\n }", "public function toArray() {\n return get_object_vars($this);\n }", "public function toArray()\n {\n return $this->_data;\n }", "public function toArray()\n {\n return $this->_data;\n }", "public function toArray() : array\n {\n return $this->data;\n }", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "function toArray() {\n\t\treturn get_object_vars($this);\n\t}", "public function getArray()\n {\n return $this->array;\n }", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function toArray() {\n return get_object_vars($this);\n }", "public function AsArray();", "public function toArray()\r\n {\r\n return $this->data;\r\n }", "public function toArray(): array\n {\n // TODO: Implement toArray() method.\n }", "public function toArray(): array\n {\n return $this->data;\n }", "public function toArray(): array\n {\n return $this->data;\n }" ]
[ "0.85852945", "0.8148092", "0.8078163", "0.79248744", "0.7906661", "0.7836803", "0.7836803", "0.7836803", "0.7799238", "0.7780902", "0.7745101", "0.7713653", "0.77060854", "0.7674092", "0.7661095", "0.7654164", "0.7645176", "0.764169", "0.76324755", "0.76228744", "0.7599066", "0.759768", "0.759768", "0.759768", "0.759768", "0.759768", "0.759768", "0.7597103", "0.7597103", "0.7597103", "0.7597103", "0.7597103", "0.7597103", "0.7597103", "0.7597103", "0.7597103", "0.7597103", "0.75662816", "0.7561541", "0.7561541", "0.7561541", "0.7561541", "0.7561541", "0.7561541", "0.7560244", "0.75506544", "0.75353235", "0.75329787", "0.7531777", "0.7524281", "0.752424", "0.7499065", "0.7492839", "0.748162", "0.748162", "0.74745315", "0.74699974", "0.74699974", "0.7466149", "0.7456513", "0.7455585", "0.7454854", "0.7454219", "0.7443394", "0.7434233", "0.74315983", "0.74315983", "0.74308527", "0.7427095", "0.7427095", "0.7427095", "0.7427095", "0.7427095", "0.7427095", "0.7427095", "0.7427095", "0.7427095", "0.7425503", "0.7398783", "0.7398783", "0.7393662", "0.7385883", "0.7383662", "0.7382659", "0.73813254", "0.73813254" ]
0.0
-1
Add a column sortable to column header.
public function sortable(string $column, string $cast);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_sortable_columns()\n {\n }", "protected function get_sortable_columns()\n {\n }", "protected function get_sortable_columns()\n {\n }", "public function get_sortable_columns() {\n return $sortable = array(\n \"col_user\"=>array(\"user_login\",false),\n \"col_groupName\"=>array(\"groupName\",false)\n );\n }", "function get_sortable_columns() {\n\n\t\treturn $sortable_columns = array(\n\t\t\t'title'\t \t=> array( 'title', false ),\t//true means it's already sorted\n\t\t\t'rating'\t=> array( 'rating', false ),\n\t\t\t'director'\t=> array( 'director', false )\n\t\t);\n\t}", "public function get_sortable_columns()\r\n\t{\r\n\t\treturn [\r\n\t\t\t'name' => [ 'name', false ]\r\n\t\t];\r\n\t}", "public function get_sortable_columns()\n {\n return array('name' => array('name', false));\n }", "public function get_sortable_columns() {\n\n\t\treturn $sortable = array(\n\t\t\t// 'name' => array('name'),\n\t\t\t// 'user_id'=>array('user_id')\n\t\t);\n\t}", "function uwwtd_tablesort_header($cell, $header, $ts) {\n if (is_array($cell) && isset($cell['field'])) {\n //Manage the sort field\n if (isset($cell['sorter'])) {\n $order = $cell['sorter'];\n } elseif (isset($cell['field'])) {\n $order = $cell['data'];\n } else {\n $order = $cell['data'];\n }\n\n $title = t('sort by @s', array('@s' => $cell['data']));\n if ((!empty($ts['name']) && $order == $ts['name']) || (!empty($_REQUEST['order']) && $order == $_REQUEST['order'])) {\n $ts['sort'] = (($ts['sort'] == 'asc') ? 'desc' : 'asc');\n $cell['class'][] = 'active';\n $image = theme('tablesort_indicator', array('style' => $ts['sort']));\n } else {\n // If the user clicks a different header, we want to sort ascending initially.\n $ts['sort'] = 'asc';\n $image = '';\n }\n\n $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => array_merge($ts['query'], array('sort' => $ts['sort'], 'order' => $order, 'sort_mod' => isset($cell['sort_mod']) ? $cell['sort_mod'] : 'text')), 'html' => TRUE));\n\n unset($cell['field'], $cell['sort']);\n }\n return $cell;\n}", "function allowColumnReorder($val){\n\t\t$this->headerSortable=$val;\n\t}", "public function get_sortable_columns() {\n\treturn $sortable = array(\n\t\t'channel' => array('channel',false),\n\t\t'source' => array('source',false),\n\t\t'status' => array('status',false),\n\t\t'title' => array('title',false),\n 'pubdate' => array('pubdate',false)\n\t);\n}", "public function getSortColumn();", "protected function get_sortable_columns() {\n\n\t\treturn array(\n\t\t\t'subject' => array( 'subject', false ),\n\t\t\t'date_sent' => array( 'date_sent', false ),\n\t\t);\n\t}", "function dhali_sort_order_column( $columns ) {\n\n\t$columns['sort_order_column'] = __( 'Sort Order', 'dhali' );\n\treturn $columns;\n\n}", "function columns_none_sort($name, $column, $sortedBy, $options)\n\t{\n return sprintf('<th>%s</th>', $name);\n\n\t}", "function sl_shortlink_sortable_columns( $columns ) {\n\t$columns['hits'] = 'shortlink_hits';\n\treturn $columns;\n}", "function reOrderColumnHeaders() {\n\n }", "public function add_sortable( $columns ) {\n\t\t$columns[ 'wp_capabilities' ] = 'wp-custom-role';\n\t\t$columns[ 'blogname' ] = 'wp-custom-blog-name';\n\t\t$columns[ 'primary_blog' ] = 'primary_blog';\n\n\t\treturn $columns;\n\t}", "public function register_sortable_columns( $columns ) {\n $columns['username'] = 'username';\n return $columns;\n }", "function units_sortable_columns( $columns ) {\n\n\t\t$columns['status'] = 'status';\n\n\t\treturn $columns;\n\t}", "function set_custom_contact_sortable_columns( $columns ) {\n $columns['title'] = 'title';\n $columns['email'] = 'email';\n $columns['company'] = 'company';\n\n return $columns;\n}", "function get_sortable_columns() {\n\n\t\t$sortable_columns = array(\n \t\t\t\t\t\t\t\t'code'\t\t\t=>\tarray( 'code', true ),\n\t\t\t\t\t\t //'product_title'\t=>\tarray( 'product_title', true ),\t\t\t\t\t\t \n\t\t\t\t\t\t 'order_date'\t=>\tarray( 'order_date', true ),\n\t\t\t\t\t\t 'order_id'\t\t=>\tarray( 'order_id', true ),\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t);\n\t\treturn apply_filters( 'woo_vou_used_add_sortable_column', $sortable_columns );\n\t}", "public function get_sortable_columns() {\r\n return $sortable = array(\r\n 'col_created_on'=> array('created_on', false),\r\n 'col_type'=> array('type', false),\r\n );\r\n }", "public function addColumns()\n {\n add_filter( 'manage_edit-' . $this->post_type . '_columns', array($this, 'editColumns') ) ; // Add or Remove a Column\n add_action( 'manage_' . $this->post_type . '_posts_custom_column', array($this, 'manageColumns') ); //Show and Modify Column Data\n add_filter( 'manage_edit-' . $this->post_type . '_sortable_columns', array($this, 'sortableColumns') ); // Flags sortable Columns\n add_action( 'load-edit.php', array($this, 'loadSortColumns') );\n }", "function get_sortable_columns()\n {\n $sortable_columns = array(\n 'date_added' => array('date_added', false),\n// 'wp_username' => array('wp_username', false),\n// 'redirect_id' => array('redirect_id', false),\n// 'redirect_destination' => array('redirect_destination', false),\n );\n return $sortable_columns;\n }", "function get_sortable_columns() {\n $sortable_columns = array(\n 'title' => array('title',false), //true means it's already sorted\n 'contact_name' => array('contact_name',false),\n 'date_created' => array('date_created',false)\n );\n return $sortable_columns;\n }", "function payments_table_gateway_column_sortable( $columns ){\r\n //$columns['status'] = array('status', false);\r\n return $columns;\r\n}", "function js_custom_project_admin_sortable_columns( $columns ) {\n\t$columns['project_post_id'] = 'ID';\n\treturn $columns;\n}", "function get_sortable_columns() {\n $sortable_columns = array(\n 'date_published' \t=> array('date_published',false), //true means its already sorted\n 'listing_title' => array('listing_title',false),\n 'quantity' => array('quantity',false),\n 'price' => array('price',false),\n 'status' => array('status',false)\n );\n return $sortable_columns;\n }", "public function set_custom_columns_sortable ( $columns )\n {\n $columns['name'] = 'name';\n $columns['approved'] = 'approved';\n $columns['featured'] = 'featured';\n return ( $columns );\n }", "function get_sortable_columns() {\n $sortable_columns = array(\n 'name' => array('name',false), //true means it's already sorted\n 'job' => array('job',false),\n\t\t\t'linkedin' => array('linkedin',false),\n 'facebook' => array('facebook',false)\n );\n return $sortable_columns;\n }", "public function get_sortable_columns()\n\t{\n\t\treturn array(\n\t\t\t'timestamp' => array( 'timestamp', true ),\n\t\t);\n\t}", "public function get_sortable_columns()\r\n {\r\n return array(\r\n 'name' => array('name', false),\r\n 'sku' => array('sku', false),\r\n 'price' => array('price', false),\r\n 'date' => array('date', false)\r\n );\r\n }", "static function get_sortable_columns(): array {\r\n return [\r\n 'title' => 'Title',\r\n self::qcol('date_till') => self::qcol('date_till')];\r\n }", "public function get_sortable_columns()\n {\n return array(\n 'ID' => array('ID', true),\n 'Orderno' => array('Orderno', true),\n 'Mtid' => array('Mtid', true),\n 'Userid' => array('Userid', true),\n 'UserName' => array('UserName', true)\n );\n }", "public function get_sortable_columns() {\n\t\treturn [\n\t\t\t'uri' => [ 'uri', false ],\n\t\t\t'times_accessed' => [ 'times_accessed', false ],\n\t\t\t'accessed' => [ 'accessed', false ],\n\t\t];\n\t}", "public function get_sortable_columns() {\n\t\treturn array(\n\t\t\t'category' => 'category',\n\t\t\t'due' => 'due',\n\t\t\t'status' => 'status',\n\t\t\t'method' => 'method',\n\t\t);\n\t}", "function get_sortable_columns() {\n\t\t\n\t\t$sortable_columns = array();\n\t\t\n\t\treturn apply_filters('bdpp_style_sortable_columns', $sortable_columns);\n\t}", "function get_sortable_columns()\n {\n $sortable_columns = array(\n \n 'timestamp' => array('timestamp', true),\n );\n\n return $sortable_columns;\n }", "public function admin_column_sortable( $sortable_columns ) {\n\t\t$sortable_columns[ 'location' ] = 'location';\n\t\treturn $sortable_columns;\n\t}", "public function get_sortable_columns() {\n\t\treturn [\n\t\t\t'product' => ['product', false],\n\t\t\t'quantity' => ['quantity', false],\n\t\t\t'price' => ['price', false],\n\t\t\t'total' => ['total', false]\n\t\t];\n\t}", "public function get_sortable_columns() {\n\t\treturn array();\n\t}", "function column_head($page, $pass_array, $sort_by, $column, $order, $default_sort) {\n\tswitch($column) { \n\t\tcase \"firstname\":\t\n\t\t\t\t\t\t$display=\"Assigned To\"; \n\t\t\t\t\t\tbreak;\n\t\tdefault:\t\n\t\t\t\t\t\t$display=display_format($column);\n\t}\n\n\t// This section makes the activated column for sorting link to it's opposite sort direction\n\t\n\t// Make the sort direction toggle\n\tif ($default_sort==\"desc\") {\n\t\t$anti_sort=\"asc\";\n\t} else {\n\t\t$anti_sort=\"desc\";\n\t}\n\t\n\t// Replace the activated column's link with it's opposite sort direction\n\tif ( ($sort_by == $column) && ($order == $default_sort) ) {\n\t\t$sort_pass = $anti_sort;\t\n\t} else {\n\t\t$sort_pass = $default_sort; \n\t} \n\t\n\tif ($sort_by == $column) {\n\t\tif ($sort_pass == \"desc\") {\n\t\t\t$arrow = \"<span id=sort-arrow>&#x25B2;</span>\";\n\t\t} else {\n\t\t\t$arrow = \"<span id=sort-arrow>&#x25BC;</span>\";\n\t\t}\n\t} else {\n\t\t$arrow = \"\";\n\t}\n\t\n\t// Pass through search terms for re-use so that sorting a column doesn't destroy searches\n\tif ( isset($pass_array['search']) ) {\n\t\t$search_section = \"&search=\".$pass_array['search'].\"&key=\".htmlspecialchars($pass_array['key']); \n\t} else {\n\t\t$search_section = \"\";\n\t}\n\n\techo \"\\t\\t\\t\\t\\t<th class=\\\"main-thead-cell\\\"><a href=\\\"\".$page.\".php?sort=\".$column.\"&order=\".$sort_pass.$search_section.\"\\\">\".$arrow.$display.\"</a></th>\\n\";\n\t\n\treturn;\n}", "function get_sortable_columns()\n {\n $sortable_columns = array(\n// 'id' => array('id',false), //true means it's already sorted\n// 'type' => array('type', false),\n// 'name' => array('name', false),\n 'tag' => array('tag', false),\n 'kind' => array('kind', false),\n );\n return $sortable_columns;\n }", "public function addSortableColumn(string $name, string $display = null, iterable $attributes = null): self\n {\n return $this->addColumn(\n function (Tabular $table) use ($name, $display, $attributes) {\n $column = new Column($table, $name);\n $column->setDisplay($display);\n $column->setAttr($attributes ?? []);\n $column->setSortable();\n\n return $column;\n }\n );\n }", "function products_column_headers( $columns ) {\r\n\r\n // Creating the custom column header data\r\n $columns = array(\r\n 'cb' => '<input type=\"checkbox\" />',\r\n 'title' => __('Product Name'),\r\n 'Background Color' => __('Background Color')\r\n );\r\n\r\n // Returning the new columns\r\n return $columns;\r\n\r\n}", "function add_header_columns($columns) \n {\n $columns = array(\n \"cb\" => \"<input type=\\\"checkbox\\\" />\",\n \"shortcode\" => __('Shortcode'),\n \"title\" => __('Title'),\n \"quote\" => __('Quote', $this->localization_domain),\n \"author\" => __('Author'),\n \"date\" => __('Publish Date'),\n );\n return $columns;\n }", "function get_sortable_columns( ) {\r\n\t\treturn apply_filters( 'mla_list_table_get_sortable_columns', self::$default_sortable_columns );\r\n\t}", "private function getHeaders(){\n\t\t$thead=\"\";\n\t\tif(!empty($this->headers)){\n\t\t\t$thead=\"<thead>\";\n\t\t\t$thead.=\"<tr>\";\n\t\t\t$headerNumber=0;\n\t\t\t$fieldNumber=0;\n\t\t\t$count=count($this->headers)-1;\n\t\t\t\n\t\t\t//Busca si hay columnas anteriores a agregar\n\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Busca las columnas declaradas\n\t\t\tforeach($this->headers as $name){\n\t\t\t\tif($this->headerSortable){\n\t\t\t\t\tif($this->order!==\"\"&&!empty($this->order)){\n\t\t\t\t\t\t$order=explode('|',$this->order);\n\t\t\t\t\t\tif(is_array($order)&&$fieldNumber==$order[0]){\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-\".$order[1];\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$classSortable=\"velkan-grid-column-header velkan-grid-column-header-sorted-both\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header class=\\\"$classSortable\\\" onclick=\\\"javascript:{$this->id}Reorder($fieldNumber);\\\" {$this->id}_field_number=\\\"$fieldNumber\\\">$name</th>\";\n\t\t\t\t}else{\n\t\t\t\t\t$thead.=\"<th {$this->id}-column-header>$name</th>\";\n\t\t\t\t}\n\t\t\t\t$fieldNumber++;\n\t\t\t\t$headerNumber++;\n\t\t\t}\n\t\t\t\n\t\t\t//Busca si hay columnas posteriores a agregar\n\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t$thead.=\"<th>{$col[\"header\"]}</th>\";\n\t\t\t\t\t$headerNumber++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"</tr>\";\n\t\t\t\n\t\t\t//Guardamos el numero total de columnas\n\t\t\t$this->cols=$headerNumber;\n\t\t\t\n\t\t\t\n\t\t\t$tfilter=\"\";\n\t\t\t$type=\"\";\n\t\t\tif($this->headerFilterable){\n\t\t\t\t$cols=count($this->fields)-1;\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<=$cols;$i++){\n\t\t\t\t\t$meClass=velkan::$config[\"datagrid\"][\"filters\"][\"inputClass\"];\n\t\t\t\t\t\n\t\t\t\t\t$type=\"\";\n\t\t\t\t\tif(!empty($this->types)){\n\t\t\t\t\t\t$type=$this->types[$i];\n\t\t\t\t\t}\n\t\t\t\t\t$value=\"\";\n\t\t\t\t\tif(!empty($this->filters)){\n\t\t\t\t\t\tforeach($this->filters as $filter){\n\t\t\t\t\t\t\tif($filter[0]==$i){\n\t\t\t\t\t\t\t\t$value=$filter[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$tfilter.=\"<th class='velkan-grid-column-filter'>\";\n\t\t\t\t\t\n\t\t\t\t\tswitch($type){\n\t\t\t\t\t\tcase \"date\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATE));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"datetime\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_DATETIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"time\":\n\t\t\t\t\t\t\t$input=new date_time(array(\"id\"=>\"grid{$this->id}Filter\",\"name\"=>\"grid{$this->id}Filter[]\",\"value\"=>$value,\"pickerType\"=>date_time::$DATETIME_PICKER_TYPE_TIME));\n\t\t\t\t\t\t\t$tfilter.=$input->render(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$tfilter.=\"<input type='search' name='grid{$this->id}Filter[]' $type value=\\\"$value\\\">\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$tfilter.=\"</th>\";\n\t\t\t\t}\n\t\t\t\t$display=($this->ShowFilters?\"\":\"style='display:none'\");\n\t\t\t\t\n\t\t\t\t$filterPrepend=\"\";\n\t\t\t\tif(!empty($this->prependedCols)){\n\t\t\t\t\tforeach($this->prependedCols as $col){\n\t\t\t\t\t\t$filterPrepend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$filterAppend=\"\";\n\t\t\t\tif(!empty($this->appendedCols)){\n\t\t\t\t\tforeach($this->appendedCols as $col){\n\t\t\t\t\t\t$filterAppend.=\"<th>&nbsp;</th>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$tfilter=\"<tr id='grid{$this->id}Filters' $display>{$filterPrepend}{$tfilter}{$filterAppend}</tr>\";\n\t\t\t}\n\t\t\t\n\t\t\tif($type!=\"\"){\n\t\t\t\t$jss=new generalJavaScriptFunction();\n\t\t\t\t$jss->registerFunction(\"applyFormats\");\n\t\t\t}\n\t\t\t\n\t\t\t$thead.=\"$tfilter</thead>\";\n\t\t}\n\t\t\n\t\treturn $thead;\n\t}", "function pgm_list_column_headers($columns){\n $columns = array(\n 'cb'=>'<input type=\"checkbox\" />', //checkbox-HTML empty checkbox\n 'title'=>__('Lists'), //update header name to 'List Name'\n 'shortcode'=>__('Shortcode'),\n );\n\n return $columns;\n}", "static function add_custom_column($post_type,$slug,$label, Callable $display_callback, $sortable = false, $sortable_callback = false){\n\t\tadd_filter(\"manage_\".$post_type.\"_posts_columns\", function($columns) use($slug,$label){\n\t\t\t$columns[$slug] = $label;\n\t\t\treturn $columns;\n\t\t}, 11, 2);\n\t\tif($sortable){\n\t\t\tadd_filter('manage_edit-'.$post_type.'_sortable_columns', function($columns) use($slug){\n\t\t\t\t$columns[$slug] = $slug;\n\t\t\t\treturn $columns;\n\t\t\t});\n\t\t}\n\t\tadd_action(\"manage_\".$post_type.\"_posts_custom_column\", function($column_name,$post_id) use($slug,$display_callback){\n\t\t\tif($column_name == $slug){\n\t\t\t\t$display_callback($post_id);\n\t\t\t}\n\t\t}, 11, 2);\n\t\tif($sortable){\n\t\t\tif(!$sortable_callback){\n\t\t\t\tthrow new \\Exception(\"Sortable callback was not defined\");\n\t\t\t}\n\t\t\tadd_action( 'pre_get_posts', function($query) use($post_type, $sortable_callback){\n\t\t\t\tif(!is_admin()) return;\n\t\t\t\tif(!function_exists(\"get_current_screen\")) return;\n\t\t\t\t$screen = get_current_screen();\n\t\t\t\tif(!$screen instanceof \\WP_Screen) return;\n\t\t\t\tif($screen->id != \"edit-\".$post_type) return;\n\t\t\t\t$sortable_callback($query);\n\t\t\t} );\n\t\t}\n\t}", "public function get_sortable_columns() {\n return $sortable = array(\n 'template_id' => array( 'template_id', true ),\n 'template_name' => array( 'template_name', true ),\n 'create_date' => array( 'create_date', true )\n );\n }", "protected function get_sortable_columns() {\n\t\t$c = array(\n\t\t\t'username' => 'login',\n\t\t\t'email' => 'email',\n\t\t);\n\n\t\treturn $c;\n\t}", "public function get_sortable_columns() {\n\t\t$sortable_columns = array(\n\t\t\t'name' => array( 'name', true ),\n\t\t\t'jumlahsts' => array( 'jumlahsts', true ),\n\t\t\t'expired' => array( 'expired', true ),\n\t\t\t'status' => array( 'status', false )\n\t\t);\n\n\t\treturn $sortable_columns;\n\t}", "function get_sortable_columns() {\n\t\t$sortable_columns = array(\n\t\t\t'id' => array('id', false),\n\t\t\t'company' => array('company', false),\n\t\t\t'transaction_id' => array('transaction_id', false),\n\t\t\t'email' => array('email', false),\n\t\t\t'expiration' => array('expiration', false),\n\t\t\t'accesstourlkey' => array('accesstourlkey', false),\n\t\t\t'webinarpass' => array('webinarpass', false),\n\t\t\t'total' => array('total', false)\n\t\t);\n\t\treturn $sortable_columns;\n\t}", "function pgm_subscriber_column_headers($columns){\n $columns = array(\n 'cb'=>'<input type=\"checkbox\" />', //checkbox-HTML empty checkbox\n 'title'=>__('Subscriber Name'), //update header name to 'Subscriber Name'\n 'email'=>__('Email Address'), //create new header for email\n );\n\n return $columns;\n}", "function get_sortable_columns() {\n\t\t$sortable_columns = array(\n\t\t\t'id' => array( 'id', false ),\n\t\t\t'date' => array( 'date', false ),\n\t\t\t'uploader' => array( 'uploader', false ),\n\t\t\t'uploader_group' => array( 'uploader_group', false ),\n\t\t\t'site' => array( 'site', false ),\n\t\t\t'assessment' => array( 'assessment', false ),\n\t\t);\n\t\treturn $sortable_columns;\n\t}", "public function get_sortable_columns() {\n\n\t\t\t$sortable_columns = array(\n\n\t\t\t\t'topic_name' => array( 'topic_name', true )\n\n\t\t\t);\n\n\n\n\t\t\treturn $sortable_columns;\n\n\t\t}", "protected function renderHeaderCellContent() {\r\n if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {\r\n $sort = $this->grid->dataProvider->getSort();\r\n $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);\r\n\r\n if ($sort->resolveAttribute($this->name) !== false)\r\n $label .= '<span class=\"caret\"></span>';\r\n\r\n echo $sort->link($this->name, $label, array('class' => 'sort-link'));\r\n }\r\n else {\r\n if ($this->name !== null && $this->header === null) {\r\n if ($this->grid->dataProvider instanceof CActiveDataProvider)\r\n echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));\r\n else\r\n echo CHtml::encode($this->name);\r\n }\r\n else\r\n parent::renderHeaderCellContent();\r\n }\r\n }", "public function sortable($sortable_columns)\n {\n $sortable_columns[ $this->slug ] = $this->sortable;\n return $sortable_columns;\n }", "function register_column_headers( $screen, $columns ) {\n\tnew Backend\\List_Table_Compat( $screen, $columns );\n}", "public function sortable_columns( $sortable_columns = array() ) {\n\t\t\t// No sortable columns if downloading talks\n\t\t\tif ( ! empty( $this->downloading_csv ) ) {\n\t\t\t\treturn array();\n\t\t\t}\n\n\t\t\t$sortable_columns['rates'] = array( 'rates_count', true );\n\n\t\t\treturn $sortable_columns;\n\t\t}", "function columns_sortDiff($name, $column, $sortedBy, $options)\n\t{\n if ($options['orderBy'] != $column)\n $type = '';\n else\n $type = '-'. strtolower($options['sortedBy']);\n if((isset($options['searchFields']) && $options['searchFields'] != null) && (isset($options['search']) && $options['search'] != null))\n {\n \treturn sprintf('<th>\n\t\t \t\t\t\t\t%s\n\t\t\t\t\t\t \t<a href=\"?searchFields=%s&search=%s&orderBy=%s&sortedBy=%s&items_per_page=%s&in_trash=%s\"><i class=\"fa fa-sort%s\"></i></a>\n\t\t\t\t\t\t\t</th>', $name, $options['searchFields'], $options['search'], $column, $sortedBy, $options['items_per_page'], $options['in_trash'], $type);\n }\n else\n \treturn sprintf('<th>\n\t\t \t\t\t\t\t%s\n\t\t\t\t\t\t \t<a href=\"?orderBy=%s&sortedBy=%s&items_per_page=%s&in_trash=%s\"><i class=\"fa fa-sort%s\"></i></a>\n\t\t\t\t\t\t\t</th>', $name, $column, $sortedBy, $options['items_per_page'], $options['in_trash'], $type);\n\n\t}", "public function get_sortable_columns() {\n\n\t\t// Build our array of sortable columns.\n\t\t$setup = array(\n\t\t\t'review_title' => array( 'review_title', false ),\n\t\t\t'review_product' => array( 'review_product', false ),\n\t\t\t'review_date' => array( 'review_date', true ),\n\t\t\t'review_score' => array( 'review_score', true ),\n\t\t\t'review_status' => array( 'review_status', true ),\n\t\t);\n\n\t\t// Return it, filtered.\n\t\treturn apply_filters( Core\\HOOK_PREFIX . 'review_table_sortable_columns', $setup );\n\t}", "public function tt_content_drawColHeader($colName, $editParams = '')\n {\n $iconsArr = [];\n // Create command links:\n if ($this->tt_contentConfig['showCommands']) {\n // Edit whole of column:\n if ($editParams && $this->getBackendUser()->doesUserHaveAccess($this->pageinfo, Permission::CONTENT_EDIT) && $this->getBackendUser()->checkLanguageAccess(0)) {\n $iconsArr['edit'] = '<a href=\"#\" onclick=\"'\n . htmlspecialchars(BackendUtility::editOnClick($editParams)) . '\" title=\"'\n . htmlspecialchars($this->getLanguageService()->getLL('editColumn')) . '\">'\n . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';\n }\n }\n $icons = '';\n if (!empty($iconsArr)) {\n $icons = '<div class=\"t3-page-column-header-icons\">' . implode('', $iconsArr) . '</div>';\n }\n // Create header row:\n $out = '<div class=\"t3-page-column-header\">\n\t\t\t\t\t' . $icons . '\n\t\t\t\t\t<div class=\"t3-page-column-header-label\">' . htmlspecialchars($colName) . '</div>\n\t\t\t\t</div>';\n return $out;\n }", "function register_column_headers($screen, $columns)\n {\n }", "public function column_headers( $columns = array() ) {\n\t\t\t$new_columns = array(\n\t\t\t\t'cat_talks' => _x( 'Categories', 'talks admin category column header', 'wordcamp-talks' ),\n\t\t\t\t'tag_talks' => _x( 'Tags', 'talks admin tag column header', 'wordcamp-talks' ),\n\t\t\t);\n\n\t\t\tif ( ! wct_is_rating_disabled() ) {\n\t\t\t\t$new_columns['rates'] = '<span class=\"vers\"><span title=\"' . esc_attr__( 'Average Rating', 'wordcamp-talks' ) .'\" class=\"talk-rating-bubble\"></span></span>';\n\t\t\t}\n\n\t\t\t/**\n\t\t\t *\n\t\t\t * @param array $new_columns the specific columns\n\t\t\t */\n\t\t\t$new_columns = apply_filters( 'wct_admin_column_headers', $new_columns );\n\n\t\t\t$temp_remove_columns = array( 'comments', 'date' );\n\t\t\t$has_columns = array_intersect( $temp_remove_columns, array_keys( $columns ) );\n\n\t\t\t// Reorder\n\t\t\tif ( $has_columns == $temp_remove_columns ) {\n\t\t\t\t$new_columns['comments'] = $columns['comments'];\n\t\t\t\t$new_columns['date'] = $columns['date'];\n\t\t\t\tunset( $columns['comments'], $columns['date'] );\n\t\t\t}\n\n\t\t\t// Merge\n\t\t\t$columns = array_merge( $columns, $new_columns );\n\n\n\t\t\tif ( ! empty( $this->downloading_csv ) ) {\n\t\t\t\tunset( $columns['cb'], $columns['date'] );\n\n\t\t\t\tif ( ! empty( $columns['title'] ) ) {\n\t\t\t\t\t$csv_columns = array(\n\t\t\t\t\t\t'title' => $columns['title'],\n\t\t\t\t\t\t'talk_content' => esc_html_x( 'Content', 'downloaded csv content header', 'wordcamp-talks' ),\n\t\t\t\t\t\t'talk_link' => esc_html_x( 'Link', 'downloaded csv link header', 'wordcamp-talks' ),\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t$columns = array_merge( $csv_columns, $columns );\n\n\t\t\t\t// Replace dashicons to text\n\t\t\t\tif ( ! empty( $columns['comments'] ) ) {\n\t\t\t\t\t$columns['comments'] = esc_html_x( '# comments', 'downloaded csv comments num header', 'wordcamp-talks' );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['rates'] ) ) {\n\t\t\t\t\t$columns['rates'] = esc_html_x( 'Average rating', 'downloaded csv rates num header', 'wordcamp-talks' );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * User this filter to only add columns for the downloaded csv file\n\t\t\t\t *\n\t\t\t\t * @param array $columns the columns specific to the csv output\n\t\t\t\t */\n\t\t\t\t$columns = apply_filters( 'wct_admin_csv_column_headers', $columns );\n\t\t\t}\n\n\t\t\treturn $columns;\n\t\t}", "public function get_sortable_columns() {\r\n\t\t$sortable_columns = array(\r\n\t\t\t'name' => array( 'name', true ),\r\n\t\t\t'city' => array( 'city', false )\r\n\t\t);\r\n\r\n\t\treturn $sortable_columns;\r\n\t}", "public function addColumn($name, $title, $type = 'text', $primary = 0, $hide = 0, $order = '', $fieldname = '', $format = ''){\n if(!empty($name) && !empty($title)){\n $fieldname = ($fieldname == ''?$name:$fieldname);\n $this->_cols[] = array(\t'name' => $name,\n 'title' => $title,\n 'type' => $type,\n 'primary' => $primary,\n 'hidden' => $hide,\n 'order' => $order,\n 'orderactive' => 0,\n 'orderdir' => 'DESC',\n 'fieldName' => $fieldname,\n\t\t\t\t\t\t\t\t\t\t'format' => $format);\n if($hide == 0){\n $this->_colspan(1);\n }\n }\n }", "public function setSortColumnName($value)\n {\n $this->sortColumnName = $value;\n }", "function bab_pm_column_head($value, $sort = '', $current_event = '', $islink = '', $dir = '')\n{\n $o = '<th class=\"small\"><strong>';\n\n if ($islink) {\n $o.= '<a href=\"index.php';\n $o.= ($sort) ? \"?sort=$sort\":'';\n $o.= ($dir) ? a.\"dir=$dir\":'';\n $o.= ($current_event) ? a.\"event=$current_event\":'';\n $o.= a.'step=subscribers\">';\n }\n\n $o .= gTxt($value);\n\n if ($islink) {\n $o .= \"</a>\";\n }\n\n $o .= '</strong></th>';\n\n return $o;\n}", "public function sortByColumn($columnLabel)\n {\n $this->waitLoader();\n $this->getTemplateBlock()->waitForElementNotVisible($this->loader);\n $this->_rootElement->find(sprintf($this->columnHeader, $columnLabel), Locator::SELECTOR_XPATH)->click();\n $this->waitLoader();\n }", "function slb_subscriber_column_headers($columns) {\n\n\t// creating custom column header data\n\t$columns = array(\n\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t'title' => __('Subscriber Name'),\n\t\t'email' => __('Email Address'),\n\t);\n\n\t// returning new columns\n\treturn $columns;\n}", "public function get_sortable_columns() {\n\t\t$sortable_columns = array(\n\t\t\t'transaction_id' \t=> array( 'transaction_id', true ),\n\t\t\t'trade_date' \t\t=> array( 'trade_date', true ),\n\t\t\t'settlement_date' \t=> array( 'settlement_date', true ),\n\t\t\t'transaction_type' \t=> array( 'transaction_type', true ),\n\t\t\t'equity' \t\t\t=> array( 'equity', true ),\n\t\t\t'ticker_symbol' \t=> array( 'ticker_symbol', true ),\n\t\t\t'num_of_shares' \t=> array( 'num_of_shares', true ),\n\t\t\t'price' \t\t\t=> array( 'price', true ),\n\t\t\t'transaction_fees' \t=> array( 'transaction_fees', true ),\n\t\t\t'currency' \t\t\t=> array( 'currency', true ),\n\t\t\t'user_id' \t\t\t=> array( 'user_id', true ),\n\t\t\t'stock_id' \t\t\t=> array( 'stock_id', true ),\n\t\t\t'platform' \t\t\t=> array( 'platform', true ),\n\t\t\t'broker' \t\t\t=> array( 'broker', true ),\n\t\t\t'account_id' \t\t=> array( 'account_id', true ),\n\t\t\t'notes' \t\t\t=> array( 'notes', true ),\n\t\t\t//'exchange_name' => array( 'exchange_name', false )\n\t\t);\n\n\t\treturn $sortable_columns;\n\t}", "private function generate_columns_header($p_edit,&$p_resultat,&$p_result_header)\r\n\t\t{\r\n\t\t\t// Create a new line\r\n\t\t\t$html = '<tr id=\"tr_header_title_'.$this->c_id.'\">';\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Create the first column (checkbox and edit button)\r\n\t\t\t ====================================================================*/\t\r\n\t\t\t$html .= '<td align=\"left\" id=\"header_th_0__'.$this->c_id.'\" class=\"__'.$this->c_theme.'__cell_opt_h\"><div id=\"th0_'.$this->c_id.'\"></div></td>';\r\n\t\t\t$html .= '<td></td>';\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t// Quantify of order clause\r\n\t\t\t$qtt_order = $this->get_nbr_order();\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Display the resize cursor or not\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tif($this->c_mode != __CMOD__)\r\n\t\t\t{\r\n\t\t\t\t$cursor = ' cur_resize';\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$cursor = '';\r\n\t\t\t}\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Browse all columns\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display'])\r\n\t\t\t\t{\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Define order icon\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($this->c_columns[$key_col]['order_by'] != false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// An order clause is defined\r\n\t\t\t\t\t\tif($this->c_columns[$key_col]['order_by'] == __ASC__)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// ASC icon\r\n\t\t\t\t\t\t\t$class_order = ' __'.$this->c_theme.'_ico_sort-ascend __'.$this->c_theme.'_ico';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// DESC icon\r\n\t\t\t\t\t\t\t$class_order = ' __'.$this->c_theme.'_ico_sort-descend __'.$this->c_theme.'_ico';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Display the number of order only if there is more than one order clause\r\n\t\t\t\t\t\t($qtt_order > 1) ? $order_prio = $this->c_columns[$key_col]['order_priority'] : $order_prio = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// No order clause defined\r\n\t\t\t\t\t\t$class_order = '';\r\n\t\t\t\t\t\t$order_prio = '';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Order column\r\n\t\t\t\t\t$html .= '<td class=\"__'.$this->c_theme.'_bloc_empty'.$class_order.'\"><span class=\"__vimofy_txt_mini_ vimofy_txt_top\">'.$order_prio.'</span></td>';\r\n\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Define order icon\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($this->c_mode != __CMOD__)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$onmousedown = 'onmousedown=\"vimofy_resize_column_start('.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t\t$ondblclick = 'ondblclick=\"vimofy_mini_size_column('.$key_col.',\\''.$this->c_id.'\\');\" ';\r\n\t\t\t\t\t\t$lib_redim = $this->hover_out_lib(17,17);\r\n\t\t\t\t\t\t$event = $this->hover_out_lib(40,40).' onmousedown=\"vimofy_move_column_start(event,'.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$onmousedown = '';\r\n\t\t\t\t\t\t$ondblclick = '';\r\n\t\t\t\t\t\t$lib_redim = '';\r\n\t\t\t\t\t\t$event = $this->hover_out_lib(40,40).' onmousedown=\"click_column_order(\\''.$this->c_id.'\\','.$key_col.');\"';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*===================================================================*/\r\n\r\n\t\t\t\t\t// Column title\r\n\t\t\t\t\t$html .= '<td align=\"left\" class=\"__'.$this->c_theme.'__cell_h nowrap\" id=\"header_th_'.$key_col.'__'.$this->c_id.'\"><div '.$event.' class=\"align_'.$this->c_columns[$key_col]['alignment'].' __'.$this->c_theme.'_column_title\" id=\"th'.$key_col.'_'.$this->c_id.'\"><span id=\"span_'.$key_col.'_'.$this->c_id.'\">'.$this->c_columns[$key_col]['name'].'</span></div></td>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t * Display other column\r\n\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\tif($p_edit != false) $html .= '<td style=\"padding:0;margin:0;\"></td>';\r\n\r\n\t\t\t\t\t$html .= '<td '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t$html .= '<td '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__sep_h'.$cursor.'\"></td>';\r\n\t\t\t\t\t$html .= '<td id=\"right_mark_'.$key_col.'_'.$this->c_id.'\" '.$lib_redim.' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$html .= '</tr>';\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Input for search on the column\r\n\t\t\t ====================================================================*/\t\r\n\t\t\t// Create a new line\r\n\t\t\t$html .= '<tr id=\"tr_header_input_'.$this->c_id.'\">';\r\n\t\t\t\r\n\t\t\t// Create the first column (checkbox and edit button)\r\n\t\t\t$html .= '<td align=\"left\" class=\"__'.$this->c_theme.'__cell_opt_h\"><div id=\"thf0_'.$this->c_id.'\" class=\"__'.$this->c_theme.'__vimofy_version\" onclick=\"window.open(\\'vimofy_bugs\\');\">v'.$this->c_software_version.'</div></td>';\r\n\t\t\t\r\n\t\t\t// Id column display counter\r\n\t\t\t$id_col_display = 0;\r\n\t\t\t\r\n\t\t\r\n\t\t\t/**==================================================================\r\n\t\t\t * Browse all columns\r\n\t\t\t ====================================================================*/\t\r\n\t\t\tforeach($this->c_columns as $key_col => $val_col)\r\n\t\t\t{\r\n\t\t\t\tif($val_col['display'])\r\n\t\t\t\t{\r\n\t\t\t\t\tif($id_col_display == 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<td id=\"th_0_c'.$key_col.'_'.$this->c_id.'\"></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$html .= '<td id=\"th_0_c'.($key_col).'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*if(isset($this->c_columns[$key_col]))\r\n\t\t\t\t\t{*/\r\n\t\t\t\t\t\t$onmousedown = 'onmousedown=\"vimofy_resize_column_start('.$key_col.',\\''.$this->c_id.'\\');\"';\r\n\t\t\t\t\t\t$ondblclick = 'ondblclick=\"vimofy_mini_size_column('.$key_col.',\\''.$this->c_id.'\\');\" ';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t\t * Define the filter value\r\n\t\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\t\t$filter_input_value = '';\r\n\t\t\t\t\t\t$state_filter_input = '';\r\n\t\t\t\t\t\tif(isset($val_col['filter']['input']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// A filter was defined by the user\r\n\t\t\t\t\t\t\t$filter_input_value = $val_col['filter']['input']['filter'];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// No filter was defined by the user\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// Check if vimofy was in edit mode\r\n\t\t\t\t\t\t\tif($p_edit != false && !isset($val_col['rw_flag']) || ($p_edit != false && isset($val_col['rw_flag']) && $val_col['rw_flag'] != __FORBIDEN__))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// The vimofy was in edit mode, search all same value in the column\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// Place the cursor on the first row of the recordset\r\n\t\t\t\t\t\t\t\tif($this->c_obj_bdd->rds_num_rows($p_result_header) > 0)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$this->c_obj_bdd->rds_data_seek($p_result_header,0);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// TODO Use a DISTINCT QUERY - Vimofy 1.0\r\n\t\t\t\t\t\t\t\t$key_cold_line = 0;\r\n\t\t\t\t\t\t\t\t$last_value = '';\r\n\t\t\t\t\t\t\t\t$flag_same = false;\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twhile($row = $this->c_obj_bdd->rds_fetch_array($p_result_header))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tif($key_cold_line > 0)\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tif($last_value == $row[$val_col['sql_as']])\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$flag_same = true;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t$flag_same = false;\r\n\t\t\t\t\t\t\t\t\t\t\t// The value is not the same of the previous, stop browsing data \r\n\t\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$flag_same = true;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t$last_value = $row[$val_col['sql_as']];\r\n\t\t\t\t\t\t\t\t\t$key_cold_line = $key_cold_line + 1;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif($flag_same)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$filter_input_value = $last_value;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$filter_input_value = '';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif($p_edit != false && isset($val_col['rw_flag']) && $val_col['rw_flag'] == __FORBIDEN__)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$state_filter_input = 'disabled';\t\t\t\t\t\t\t\t\t// Disable the input because the edition of column is forbiden\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(isset($val_col['filter']))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_on __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(isset($val_col['lov']) && isset($val_col['is_lovable']) && $val_col['is_lovable'] == true)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_lovable __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tif(isset($val_col['lov']))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header_no_icon __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$class_btn_menu = '__'.$this->c_theme.'_menu_header __'.$this->c_theme.'_men_head';\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t/**==================================================================\r\n\t\t\t\t\t\t * Menu button oncontextmenu\r\n\t\t\t\t\t\t ====================================================================*/\t\r\n\t\t\t\t\t\tif($this->c_type_internal_vimofy == false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Principal vimofy, diplay internal vimofy\r\n\t\t\t\t\t\t\t$oncontextmenu = 'vimofy_display_internal_vim(\\''.$this->c_id.'\\',__POSSIBLE_VALUES__,'.$key_col.');return false;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Internal vimofy, doesn't display other internal vimofy\r\n\t\t\t\t\t\t\t$oncontextmenu = 'return false;';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/*===================================================================*/\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '<td id=\"th_1_c'.$key_col.'_'.$this->c_id.'\" class=\"__vimofy_unselectable\" style=\"width:20px;\"><div style=\"width:20px;margin:0;\" '.$this->hover_out_lib(21,21).' oncontextmenu=\"'.$oncontextmenu.'\" class=\"'.$class_btn_menu.'\" onclick=\"vimofy_toggle_header_menu(\\''.$this->c_id.'\\','.$key_col.');\" id=\"th_menu_'.$key_col.'__'.$this->c_id.'\"></div></td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_2_c'.$key_col.'_'.$this->c_id.'\" align=\"left\" class=\"__'.$this->c_theme.'__cell_h\">';\r\n\t\t\t\t\t\t$html .= '<div style=\"margin:0 3px;\"><input value=\"'.str_replace('\"','&quot;',$filter_input_value).'\" class=\"__'.$this->c_theme.'__input_h full_width\" '.$state_filter_input.' id=\"th_input_'.$key_col.'__'.$this->c_id.'\" type=\"text\" style=\"margin: 2px 0;\" size=1 onkeyup=\"if(document.getElementById(\\'chk_edit_c'.$key_col.'_'.$this->c_id.'\\'))document.getElementById(\\'chk_edit_c'.$key_col.'_'.$this->c_id.'\\').checked=true;vimofy_input_keydown(event,this,\\''.$this->c_id.'\\','.$key_col.');\" onchange=\"vimofy_col_input_change(\\''.$this->c_id.'\\','.$key_col.');\"/></div>';\r\n\t\t\t\t\t\tif($p_edit != false)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif($state_filter_input == '')\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '<td style=\"width:10px;padding:0;margin:0;\"><input '.$this->hover_out_lib(76,76).' type=\"checkbox\" id=\"chk_edit_c'.$key_col.'_'.$this->c_id.'\" style=\"height:11px;width:11px;margin: 0 5px 0 2px;display:block;\"/></td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$html .= '<td style=\"width:0;padding:0;margin:0;\"></td>';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$html .= '</td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_3_c'.$key_col.'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t\t\t\t$html .= '<td id=\"th_4_c'.$key_col.'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__sep_h'.$cursor.'\"></td>';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$id_col_display = $id_col_display + 1;\r\n\t\t\t\t//}\r\n\t\t\t}\r\n\t\t\t/*===================================================================*/\r\n\t\t\t\r\n\t\t\t$html .= '<td id=\"th_0_c'.($key_col+1).'_'.$this->c_id.'\" '.$this->hover_out_lib(17,17).' '.$ondblclick.' '.$onmousedown.' class=\"__'.$this->c_theme.'__cell_h_resizable'.$cursor.'\"><div class=\"__'.$this->c_theme.'__cell_resize\"></div></td>';\r\n\t\t\t$html.= '<td><div style=\"width:200px\"></div></td>';\r\n\t\t\t$html .= '</tr>';\r\n\t\t\t/*===================================================================*/\r\n\r\n\t\t\t// Place the cursor on the first row of the recordset\r\n\t\t\tif($this->c_obj_bdd->rds_num_rows($p_resultat) > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->c_obj_bdd->rds_data_seek($p_resultat,0);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\treturn $html;\r\n\t\t}", "public function get_sortable_columns() {\n\t\t$sortable_columns = array(\n\t\t);\n\n\t\treturn $sortable_columns;\n\t}", "public function display_admin_columns() {\n add_filter('manage_edit-comments_columns', array(&$this, 'add_comments_columns'));\n add_action('manage_comments_custom_column', array(&$this, 'add_comment_columns_content'), 10, 2);\n }", "public static function manage_sortable_columns( $columns ) {\n unset( $columns['wpseo-focuskw'] );\n unset( $columns['wpseo-score'] );\n unset( $columns['wpseo-title'] );\n unset( $columns['wpseo-metadesc'] );\n unset( $columns['date'] );\n $columns['expiration'] = 'expiration';\n $columns['registrar'] = 'registrar';\n return $columns;\n }", "public function getColumnSortingUrl($column);", "public function renderHeaderCell()\n\t{\n\t\t$_headerOptions = ['class' => 'serial-column'];\n\t\tif ($this->grid->filterModel !== null && $this->grid->filterPosition !== \\yii\\grid\\GridView::FILTER_POS_HEADER)\n\t\t\t$_headerOptions['rowspan'] = '2';\n\n\t\t$this->headerOptions = ArrayHelper::merge($_headerOptions, $this->headerOptions);\n\t\treturn Html::tag('th', $this->renderHeaderCellContent(), $this->headerOptions);\n\t}", "public function loadSortColumns()\n {\n add_filter( 'request', array( $this, 'sortColumns' ) );\n }", "function header() {\n //\n //Get the fields in this sql \n $cols= $this->fields->get_array();\n //\n //Loop through the fields and display the <tds>\n foreach ($cols as $col) {\n //\n $name= is_null($col->alias) ? $col->to_str():$col->alias;\n echo \"<th>$name</th>\"; \n }\n }", "public function get_sortable_columns()\n {\n $sortable_columns = array();\n\n return $sortable_columns;\n }", "function bab_pm_list_column_head($value, $sort = '', $current_event = '', $islink = '', $dir = '')\n{\n $o = '<th class=\"small\"><strong>';\n\n if ($islink) {\n $o.= '<a href=\"index.php';\n $o.= ($sort) ? \"?sort=$sort\":'';\n $o.= ($dir) ? a.\"dir=$dir\":'';\n $o.= ($current_event) ? a.\"event=$current_event\":'';\n $o.= a.'step=lists\">';\n }\n\n $o .= gTxt($value);\n if ($islink) {\n $o .= \"</a>\";\n }\n $o .= '</strong></th>';\n return $o;\n}", "public function setHeading(string $heading): ModelDataTableColumnInterface;", "function tep_create_sort_heading($sortby, $colnum, $heading) {\n global $PHP_SELF;\n\n $sort_prefix = '';\n $sort_suffix = '';\n\n if ($sortby) {\n $sort_prefix = '<a href=\"' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('page', 'info', 'sort')) . 'page=1&sort=' . $colnum . ($sortby == $colnum . 'a' ? 'd' : 'a')) . '\" title=\"' . tep_output_string(TEXT_SORT_PRODUCTS . ($sortby == $colnum . 'd' || substr($sortby, 0, 1) != $colnum ? TEXT_ASCENDINGLY : TEXT_DESCENDINGLY) . TEXT_BY . $heading) . '\" class=\"productListing-heading\">' ;\n $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-') : '') . '</a>';\n }\n\n return $sort_prefix . $heading . $sort_suffix;\n }", "private function showColumn()\n\t{\n\t\techo '<thead>\n\t\t\t<th></th>';\n\t\t\t\n\t\t\tforeach ($this->col_show as $col)\n\t\t\t\techo '<th>' . $col . '</th>';\n\t\t\n\t\techo '</thead>';\n\t}", "function print_column_headers( $screen, $with_id = true ) {\n\n\t$wp_list_table = new Backend\\List_Table_Compat( $screen );\n\n\t$wp_list_table->print_column_headers( $with_id );\n}", "public function notSortable(): Column\n {\n return $this->notOrderable();\n }", "function addColumn($title, $valuePath, array $options = array()){\n\t\t$defaults = array(\n\t\t\t'editable' => false,\n\t\t\t'type' \t => 'string',\n\t\t\t'element' => false,\n\t\t\t'linkable' => false,\n\t\t\t'total' => false,\n\t\t\t'emptyVal' => null\n\t\t);\n\t\t\n\t\t$options = array_merge($defaults, $options);\n\t\t\n\t\t$titleSlug = Inflector::slug($title);\n\t\t$this->__columns[$titleSlug] = array(\n\t\t\t'title' => $title,\n\t\t\t'valuePath' => $valuePath,\n\t\t\t'options' => $options\n\t\t);\n\t\t\n\t\tif($options['total'] == true){\n\t\t\t$this->__totals[$title] = 0;\n\t\t}\n\t\t\n\t\treturn $titleSlug;\n\t}", "protected function getTableHeader() {\n $newDirection = ($this->sortDirection == 'asc') ? 'desc' : 'asc';\n\n $tableHeaderData = array(\n 'title' => array(\n 'link' => $this->getLink('title', ($this->sortField == 'title') ? $newDirection : $this->sortDirection),\n 'name' => 'Title',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n 'document_type' => array(\n 'link' => $this->getLink('type', $this->sortField == 'document_type' ? $newDirection : $this->sortDirection),\n 'name' => 'Type',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n 'date' => array(\n 'link' => $this->getLink('date', $this->sortField == 'date' ? $newDirection : $this->sortDirection),\n 'name' => 'Date',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n ),\n );\n\t\t\n // insert institution field in 3rd column, if this is search results\n if($this->uri == 'search') {\n $tableHeaderData = array_slice($tableHeaderData, 0, 2, true) +\n array('institution' => array(\n 'link' => $this->getLink('institution', $this->sortField == 'institution' ? $newDirection : $this->sortDirection),\n 'name' => 'Institution',\n 'cssClass' => 'fa-sort-' . $this->sortDirection\n )) +\n array_slice($tableHeaderData, 2, count($tableHeaderData)-2, true);\n }\n\t\t\n return $tableHeaderData;\n }", "public function renderTableHeader()\n {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderHeaderCell();\n }\n $content = Html::tag('tr', implode('', $cells), $this->headerRowOptions);\n if ($this->filterPosition === self::FILTER_POS_HEADER) {\n $content = $this->renderFilters() . $content;\n } elseif ($this->filterPosition === self::FILTER_POS_BODY) {\n $content .= $this->renderFilters();\n }\n\n return \"<thead>\\n\" . $content . \"\\n</thead>\";\n }", "protected function sortableColumns(): array\n {\n return [];\n }", "public function addColumn(ColumnInterface $column);", "public function print_column_headers( $with_id = true ) {\n\t\t\tlist( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();\n\n\t\t\t// *********************\n\t\t\t// *** BEGIN CHANGES ***\n\t\t\t// *********************\n\t\t\t// Code removed.\n\t\t\t// *******************\n\t\t\t// *** END CHANGES ***\n\t\t\t// *******************\n\t\t\tif ( isset( $_REQUEST['orderby'] ) ) {\n\t\t\t\t$current_orderby = sanitize_text_field( wp_unslash( $_REQUEST['orderby'] ) ); // input var okay.\n\t\t\t} else {\n\t\t\t\t$current_orderby = '';\n\t\t\t}\n\n\t\t\tif ( isset( $_REQUEST['order'] ) && 'desc' === sanitize_text_field( wp_unslash( $_REQUEST['order'] ) ) ) { // input var okay.\n\t\t\t\t$current_order = 'desc';\n\t\t\t} else {\n\t\t\t\t$current_order = 'asc';\n\t\t\t}\n\n\t\t\tif ( ! empty( $columns['cb'] ) ) {\n\t\t\t\tstatic $cb_counter = 1;\n\t\t\t\t$columns['cb'] = '<label class=\"screen-reader-text\" for=\"cb-select-all-' . $cb_counter . '\">' . __( 'Select All' ) . '</label>'\n\t\t\t\t . '<input id=\"cb-select-all-' . $cb_counter . '\" type=\"checkbox\" />';\n\t\t\t\t$cb_counter ++;\n\t\t\t}\n\n\t\t\tforeach ( $columns as $column_key => $column_display_name ) {\n\t\t\t\t$class = [ 'manage-column', \"column-$column_key\" ];\n\n\t\t\t\tif ( in_array( $column_key, $hidden ) ) {\n\t\t\t\t\t$class[] = 'hidden';\n\t\t\t\t}\n\n\t\t\t\tif ( 'cb' === $column_key ) {\n\t\t\t\t\t$class[] = 'check-column';\n\t\t\t\t} elseif ( in_array( $column_key, [ 'posts', 'comments', 'links' ] ) ) {\n\t\t\t\t\t$class[] = 'num';\n\t\t\t\t}\n\n\t\t\t\tif ( $column_key === $primary ) {\n\t\t\t\t\t$class[] = 'column-primary';\n\t\t\t\t}\n\n\t\t\t\tif ( isset( $sortable[ $column_key ] ) ) {\n\t\t\t\t\tlist( $orderby, $desc_first ) = $sortable[ $column_key ];\n\n\t\t\t\t\tif ( $current_orderby === $orderby ) {\n\t\t\t\t\t\t$order = 'asc' === $current_order ? 'desc' : 'asc';\n\t\t\t\t\t\t$class[] = 'sorted';\n\t\t\t\t\t\t$class[] = $current_order;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$order = $desc_first ? 'desc' : 'asc';\n\t\t\t\t\t\t$class[] = 'sortable';\n\t\t\t\t\t\t$class[] = $desc_first ? 'asc' : 'desc';\n\t\t\t\t\t}\n\n\t\t\t\t\t// *********************\n\t\t\t\t\t// *** BEGIN CHANGES ***\n\t\t\t\t\t// *********************\n\t\t\t\t\t// Code removed.\n\t\t\t\t\t// *******************\n\t\t\t\t\t// *** END CHANGES ***\n\t\t\t\t\t// *******************\n\t\t\t\t}\n\n\t\t\t\t$tag = ( 'cb' === $column_key ) ? 'td' : 'th';\n\t\t\t\t$scope = ( 'th' === $tag ) ? 'scope=\"col\"' : '';\n\t\t\t\t$id = $with_id ? \"id='$column_key'\" : '';\n\n\t\t\t\tif ( ! empty( $class ) ) {\n\t\t\t\t\t$class = \"class='\" . join( ' ', $class ) . \"'\";\n\t\t\t\t}\n\n\t\t\t\t// *********************\n\t\t\t\t// *** BEGIN CHANGES ***\n\t\t\t\t// *********************\n\t\t\t\techo '<' . esc_attr( $tag ) . ' ' . wp_kses_data( $scope ) . ' ' . wp_kses_data( $id ) . ' ' .\n\t\t\t\t wp_kses_data( $class ) . '>';\n\n\t\t\t\tif ( isset( $sortable[ $column_key ] ) ) {\n\n\t\t\t\t\t?>\n\t\t\t\t\t<a href=\"javascript:void(0)\"\n\t\t\t\t\t onclick=\"jQuery('#wpda_main_form_orderby').val('<?php echo esc_attr( $orderby ); ?>'); jQuery('#wpda_main_form_order').val('<?php echo esc_attr( $order ); ?>'); jQuery('#wpda_main_form').submit();\">\n\t\t\t\t\t\t<span><?php echo wp_kses_data( $column_display_name ); ?></span><span\n\t\t\t\t\t\t\t\tclass=\"sorting-indicator\"></span>\n\t\t\t\t\t</a>\n\t\t\t\t\t<?php\n\n\t\t\t\t} else {\n\t\t\t\t\techo wp_kses(\n\t\t\t\t\t\t$column_display_name,\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'input' => [\n\t\t\t\t\t\t\t\t'id' => [],\n\t\t\t\t\t\t\t\t'type' => [],\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t'label' => [\n\t\t\t\t\t\t\t\t'class' => [],\n\t\t\t\t\t\t\t\t'for' => [],\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\n\t\t\t\techo '</' . esc_attr( $tag ) . '>';\n\n\t\t\t\t// *******************\n\t\t\t\t// *** END CHANGES ***\n\t\t\t\t// *******************\n\t\t\t}\n\t\t}", "function add_admin_header() {\n }", "public function define_sortable_columns( $columns ) {\n\t\t$custom = array(\n\t\t\t'price' => 'price',\n\t\t\t'sku' => 'sku',\n\t\t\t'name' => 'title',\n\t\t);\n\t\treturn wp_parse_args( $custom, $columns );\n\t}", "public function sortableColumns( $columns )\n {\n foreach($this->fields_list as $field => $label):\n $columns[$field] = $field;\n endforeach; \n \n return $columns;\n }", "public function column_headers($columns) {\n\t\t$ent_list = get_option(str_replace(\"-\", \"_\", $this->textdomain) . '_ent_list');\n\t\tif (!empty($ent_list[$this->post_type]['featured_img'])) {\n\t\t\t$columns['featured_img'] = __('Featured Image', $this->textdomain);\n\t\t}\n\t\tforeach ($this->boxes as $mybox) {\n\t\t\tforeach ($mybox['fields'] as $fkey => $mybox_field) {\n\t\t\t\tif (!in_array($fkey, Array(\n\t\t\t\t\t'wpas_form_name',\n\t\t\t\t\t'wpas_form_submitted_by',\n\t\t\t\t\t'wpas_form_submitted_ip'\n\t\t\t\t)) && !in_array($mybox_field['type'], Array(\n\t\t\t\t\t'textarea',\n\t\t\t\t\t'wysiwyg'\n\t\t\t\t)) && $mybox_field['list_visible'] == 1) {\n\t\t\t\t\t$columns[$fkey] = $mybox_field['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$taxonomies = get_object_taxonomies($this->post_type, 'objects');\n\t\tif (!empty($taxonomies)) {\n\t\t\t$tax_list = get_option(str_replace(\"-\", \"_\", $this->textdomain) . '_tax_list');\n\t\t\tforeach ($taxonomies as $taxonomy) {\n\t\t\t\tif (!empty($tax_list[$this->post_type][$taxonomy->name]) && $tax_list[$this->post_type][$taxonomy->name]['list_visible'] == 1) {\n\t\t\t\t\t$columns[$taxonomy->name] = $taxonomy->label;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$rel_list = get_option(str_replace(\"-\", \"_\", $this->textdomain) . '_rel_list');\n\t\tif (!empty($rel_list)) {\n\t\t\tforeach ($rel_list as $krel => $rel) {\n\t\t\t\tif ($rel['from'] == $this->post_type && in_array($rel['show'], Array(\n\t\t\t\t\t'any',\n\t\t\t\t\t'from'\n\t\t\t\t))) {\n\t\t\t\t\t$columns[$krel] = $rel['from_title'];\n\t\t\t\t} elseif ($rel['to'] == $this->post_type && in_array($rel['show'], Array(\n\t\t\t\t\t'any',\n\t\t\t\t\t'to'\n\t\t\t\t))) {\n\t\t\t\t\t$columns[$krel] = $rel['to_title'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $columns;\n\t}", "function addColumnData($heading, $fieldName) \n {\n $xmlRow = new XMLObject( XMLObject_ColumnList::XML_NODE_COL );\n $xmlRow->addElement(XMLObject_ColumnList::XML_ELEMENT_HEADING, $heading );\n $xmlRow->addElement(XMLObject_ColumnList::XML_ELEMENT_FIELDNAME, $fieldName );\n \n $this->addXMLObject( $xmlRow ); \n }" ]
[ "0.66669786", "0.66662127", "0.66662127", "0.6531419", "0.65147686", "0.64952636", "0.64942104", "0.6404457", "0.6368186", "0.6360913", "0.63449246", "0.6340132", "0.63053817", "0.6296234", "0.6254682", "0.625152", "0.624032", "0.6231622", "0.62108856", "0.6207116", "0.61773413", "0.61768126", "0.6160383", "0.61443835", "0.61442626", "0.61264616", "0.61111116", "0.6104508", "0.6075839", "0.606022", "0.6051609", "0.60481477", "0.6035385", "0.6028433", "0.6025347", "0.60227823", "0.60226154", "0.601438", "0.60102904", "0.598119", "0.594748", "0.5942405", "0.5933495", "0.5924014", "0.59190017", "0.59186924", "0.5917962", "0.5916095", "0.588716", "0.5852945", "0.58470577", "0.58331895", "0.5829154", "0.5818931", "0.5815025", "0.5788874", "0.5786807", "0.57771635", "0.5770254", "0.5757095", "0.574061", "0.5718625", "0.57101595", "0.56985456", "0.5666362", "0.56504047", "0.5647511", "0.5638629", "0.5635198", "0.56308365", "0.5622626", "0.56192595", "0.56144994", "0.559455", "0.5587897", "0.5585243", "0.5552329", "0.5547508", "0.5545643", "0.5529728", "0.55271655", "0.54907", "0.5486097", "0.54610896", "0.546098", "0.5460081", "0.54531693", "0.54523724", "0.5438116", "0.54354393", "0.5432345", "0.5428005", "0.54279464", "0.5418527", "0.5411321", "0.54102695", "0.5397333", "0.5387988", "0.53753376", "0.5367397" ]
0.582708
53
Retrieve all input data from request, include query parameters, parsed body and json body.
public function getParams();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRequestData();", "public static function getRequestBody() {}", "abstract public function getRequestBody();", "public function request(){\n\t\t$request = file_get_contents('php://input');\n\t\treturn json_decode($request,true);\n\t}", "public function readHttpRequest(){\n\t\t\t$incomingFormData = file_get_contents('php://input');\n\t\t\t\n\t\t\treturn $incomingFormData;\n\t\t\t}", "protected function parseRequest()\n {\n $this->input = $this->request->getPostList()->toArray();\n }", "public function getRequestData(){\n\t\treturn array( \n \t\t\t'cmd' => $this->getRequestCommand(), \n \t\t\t'params' => $this->getParams() \n\t\t); \n\t}", "public function body()\n {\n $entityBody = file_get_contents('php://input');\n\n foreach ((array)json_decode($entityBody) as $field => $value) {\n $this->requestStack[$field] = $value;\n }\n return json_decode($entityBody);\n }", "public function getRequestData(Request $request) {\n return $request->all();\n }", "function getRequestInfo()\n\t{\n\t\treturn json_decode(file_get_contents('php://input'), true);\n\t}", "public function getJsonRequestParams()\n {\n return json_decode(file_get_contents(\"php://input\"));\n }", "function getRequestData() {\n $data = [];\n $data['method'] = $_SERVER['REQUEST_METHOD'];\n $data['url'] = decodeRequestUri($_SERVER['REQUEST_URI']);\n\n $uri_parts = parse_url($data['url']);\n $path_parts = explode('/', $uri_parts['path']);\n\n // get parts from path\n foreach($path_parts as $idx => $param) {\n if($idx == 1) {\n $data['action'] = !empty($param) ? $param : \"desktop\";\n }\n \n if($idx > 1) {\n $data['params'][$idx - 2] = $param;\n }\n }\n\n // fill params with _GET data\n if(!empty($data['params_get'])) {\n $data['params_get'] = array_merge($data['params_get'], $_GET);\n } else {\n $data['params_get'] = $_GET;\n };\n\n // get login and token\n if(empty($_COOKIE['token'])) {\n $data['login'] = '';\n $data['token'] = '';\n } else {\n $data['login'] = $_COOKIE['login'];\n $data['token'] = $_COOKIE['token'];\n }\n\n // get body data (POST, PUT)\n $data['body'] = file_get_contents('php://input');\n\n return $data;\n}", "public function getInputSource()\n\t{\n\t\t$parsedBody = $this->getParsedBody();\n\t\t\n\t\tif ($this->getRequestMethod() === Request::GET) {\n\t\t\treturn $this->getQueryParams();\n\t\t}\n\t\t\n\t\treturn $parsedBody;\n\t}", "function parse_parameters($data)\n{\n $parameters = array();\n $body_params = array();\n //if we get a GET, then parse the query string\n if($_SERVER['REQUEST_METHOD'] == 'GET') {\n if (isset($_SERVER['QUERY_STRING'])) {\n // make this more defensive\n return $_GET;\n }\n } else {\n // Otherwise it is POST, PUT or DELETE.\n // At the moment, we only deal with JSON\n //$data = file_get_contents(\"php://input\");\n $body_params = json_decode($data, TRUE);\n print_r($body_params);\n }\n\n foreach ($body_params as $field => $value) {\n $parameters[$field]= $value;\n }\n return $parameters;\n}", "public static function all() {\n\t\tswitch($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'GET':\n\t\t\t\treturn $_GET;\n\t\t\t\tbreak;\n\n\t\t\tcase 'POST':\n\t\t\t\treturn $_POST;\n\t\t\t\tbreak;\n\n\t\t\tcase 'PUT':\n\t\t\tcase 'DELETE':\n\t\t\t\treturn static::getInputVars();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function getRequestData()\n {\n return json_decode($this->requestData);\n }", "public function getData()\n {\n return $this->getRequestParams();\n }", "public function getData()\n {\n return $this->getRequestParams();\n }", "private function inputs(){\n\t\tswitch($_SERVER['REQUEST_METHOD']){ // Make switch case so we can add additional \n\t\t\tcase \"GET\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"GET\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"POST\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"POST\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"PUT\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"PUT\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tcase \"DELETE\":\n\t\t\t\t$this->_request = $this->cleanInputs($_REQUEST); //or $_GET\n\t\t\t\t$this->_method = \"DELETE\";\n\t\t\t\t//$this->logRequest();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->response('Forbidden',403);\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function requestData() {\n\t\t// Set up cURL \n\t\t$curl = curl_init($this->query); \n\t\tcurl_setopt($curl, CURLOPT_POST, false); \n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t\t\n\t\treturn $this->parseAPIResponse($response);\n\t}", "public static function all()\n {\n return $_REQUEST;\n }", "private function getRequest() {\n return json_decode(request()->getContent(), true);\n }", "static function getBodyData(): array {\n $data = json_decode(file_get_contents('php://input'), true);\n return !is_null($data)? $data:array();\n }", "public function getBody() : array\n {\n if ($this->requestMethod == \"GET\") {\n $result = array(); \n foreach ($_GET as $key => $value) {\n $result[$key] = $value;\n }\n return $result;\n }\n\n if ($this->requestMethod == \"POST\") {\n $result = array();\n foreach ($_POST as $key => $value) {\n $result[$key] = filter_input(INPUT_POST, $key, FILTER_SANITIZE_SPECIAL_CHARS);\n }\n\n return $result;\n }\n\n return $body;\n }", "function getData()\r\n {\r\n //if POST or PUT get the data wiht file_get_contents\r\n if ($this->request === \"POST\" || $this->request === \"PUT\") {\r\n $this->preCleanData = JSON_decode(file_get_contents(\"php://input\"));\r\n //else get the ID from $_get\r\n } else if ($this->request === \"GET\" || $this->request === \"DELETE\") {\r\n if (isset($_GET['ID'])) {\r\n $this->data = $_GET['ID'];\r\n return;\r\n } else {\r\n return;\r\n }\r\n }\r\n $this->cleanData();\r\n }", "protected function getRequestData()\n {\n return \\Includes\\Utils\\ArrayManager::filterByKeys(\n \\XLite\\Core\\Request::getInstance()->getData(),\n array('paymentStatus', 'shippingStatus', 'adminNotes')\n );\n }", "private function getRequestData()\n {\n $request = Shopware()->Front()->Request();\n\n return array(\n 'Class' => get_class($request),\n 'Module' => $request->getModuleName(),\n 'Controller' => $request->getControllerName(),\n 'Action' => $request->getActionName(),\n 'IP' => $request->getClientIp(),\n 'Http host' => $request->getHttpHost(),\n 'Request uri' => $request->getRequestUri(),\n 'Scheme' => $request->getScheme(),\n 'Server' => $request->getServer(),\n 'Base url' => $request->getBaseUrl(),\n 'Base url (raw)' => $request->getBaseUrl(true),\n 'Parameters' => $request->getParams(),\n 'Path information' => $request->getPathInfo(),\n 'Base path' => $request->getBasePath(),\n 'Header' => (function_exists('getallheaders')) ? getallheaders() : array(),\n );\n }", "public function getRequestParams();", "public function get_request_arguments();", "static function body()\n\t{\n\t\treturn file_get_contents('php://input');\n\t}", "public function readHttpRequest() {\n $incomingFormData = file_get_contents('php://input');\n\n return $incomingFormData;\n }", "private function getInput() : void {\n\t\t$input = @file_get_contents('php://input');\n\n\t\t// Check if input is json encoded\n\t\t$decode = json_decode($input, true);\n\t\tif (json_last_error() == JSON_ERROR_NONE) {\n\t\t\t$input = $decode;\n\t\t}\n\n\t\tif (!is_array($input)) {\n\t\t\t$input = (array) $input;\n\t\t}\n\n\t\t$get = $_SERVER['QUERY_STRING'] ?? '';\n\t\t$get = explode('&', $get);\n\t\tforeach ($get as $item) {\n\t\t\t$item = explode('=', $item);\n\t\t\tif (count($item) !== 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$this->input[$item[0]] = $item[1];\n\t\t}\n\n\t\t$this->input = array_merge($this->input, $input);\n\t}", "protected function processRequestInput(Request $request)\n {\n $input = $request->all();\n \n return $input;\n }", "protected function getRequestBody()\n\t{\n\t\treturn $this->request->getContent();\n\t}", "function handle_request_body_params() {\n // Merges HTTP Request body with the instance parameters,\n // instance params have priority for security reasons\n $body = $this->get_request_body();\n $params = $body ? $this->decode($body) : null;\n $this->params = xUtil::array_merge(xUtil::arrize($params), $this->params);\n }", "public function processcontact()\n\t{\n\t\t$input = Request::all();\n\n\t\treturn $input;\n\t}", "protected function getRequestData()\n {\n if ($this->requestData) {\n return $this->requestData;\n }\n\n $body = $this->getRequest()->getRawBody();\n try {\n $data = Zend_Json::decode($body);\n } catch (Zend_Exception $e) {\n $this->setErrorResponse('Broken JSON provided with request');\n }\n\n $this->requestData = $data;\n\n return $this->requestData;\n }", "public function get_body_params()\n {\n }", "public static function requestPayload() {\n return json_decode(file_get_contents('php://input'), true);\n }", "public function getParsedBody();", "function getParameters(){\n // Parse incoming query and variables\n return (isset($_SERVER['CONTENT_TYPE']) && strpos($_SERVER['CONTENT_TYPE'], 'application/json') !== false) \n ? json_decode( file_get_contents('php://input'), true) \n : $_REQUEST;\n\n}", "private static function getData()\n {\n static $data = null;\n\n // Only parse once\n if ($data === null) {\n $content_type = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : null;\n if ($pos = strpos($content_type, ';')) {\n $content_type = substr($content_type, 0, $pos);\n }\n\n switch ($content_type) {\n case 'multipart/form-data':\n default:\n $data = $_REQUEST;\n break;\n case 'application/x-www-form-urlencoded':\n parse_str(file_get_contents('php://input'), $data);\n break;\n case 'application/json':\n $data = json_decode(file_get_contents('php://input'), true);\n break;\n case 'application/xml':\n case 'text/xml':\n $data = (array)simplexml_load_string(file_get_contents('php://input'));\n $data = array_map('trim', $data);\n break;\n }\n }\n\n return $data;\n }", "public function getParsedBody() {}", "private function body()\n {\n return json_decode($this->request->all()[\"job\"], true);\n }", "private function getParams (Request $request)\n {\n // Step 1: Filter\n $datas = array_filter($request->getParsedBody(), function ($key) {\n return in_array($key, ['username', 'password']);\n }, ARRAY_FILTER_USE_KEY);\n return $datas;\n }", "protected function loadRequestData(Request $request)\n {\n try {\n $content = (string)$request->getContent();\n if (!empty($content)) {\n return \\Safe\\json_decode($content, true);\n } else {\n $content = $request->query->all();\n return $content;\n }\n } catch (\\Exception $exception) {\n return [];\n }\n }", "public function parseGetData(): array {\n $data = (array)$this->getRequest()->getQuery();\n $data = $this->sanitizeData($data);\n\n return $data;\n }", "function getInput(){\n return json_decode(file_get_contents('php://input'), true);\n }", "public static function getBody() {\r\n return @file_get_contents('php://input');\r\n }", "public function processRequest();", "private function parseIncomingParams() {\r\n\t\t$parameters = array ();\r\n\t\t\r\n\t\t// First of all, pull the GET vars\r\n\t\tif (isset ( $_SERVER ['QUERY_STRING'] )) {\r\n\t\t\tparse_str ( $_SERVER ['QUERY_STRING'], $parameters );\r\n\t\t}\r\n\t\t\r\n\t\t// Now how about PUT/POST bodies? These override what we got from GET\r\n\t\t$body = file_get_contents ( \"php://input\" );\r\n\t\t$content_type = false;\r\n\t\tif (isset ( $_SERVER ['CONTENT_TYPE'] )) {\r\n\t\t\t$content_type = $_SERVER ['CONTENT_TYPE'];\r\n\t\t}\r\n\t\tswitch ($content_type) {\r\n\t\t\tcase \"application/json\" :\r\n\t\t\t\t{\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\t$body_params = json_decode ( $body );\r\n\t\t\t\t\t\tif ($body_params) {\r\n\t\t\t\t\t\t\tforeach ( $body_params as $param_name => $param_value ) {\r\n\t\t\t\t\t\t\t\t$parameters [$param_name] = $param_value;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$this->format = \"json\";\r\n\t\t\t\t\t} catch (Exception $exception) {\r\n\t\t\t\t\t\t$errorResponse = array();\r\n\t\t\t\t\t\t$errorResponse['response'] = App_Constant::$TEXT_ERROR_RESPONSE;\r\n\t\t\t\t\t\t$errorResponse['message'] = App_Constant::$ERROR_FAIL_DB_IMPROPER_CLIENT_REQUEST;\r\n\t\t\t\t\t\treturn $errorResponse;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tdefault :\r\n\t\t\t\t// we could parse other supported formats here\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t$this->parameters = $parameters;\r\n\t}", "protected function getAllRequest()\n {\n\n $resourcePath = '/links';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\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 }", "function parse_incoming()\n {\n\t\t//-----------------------------------------\n\t\t// Attempt to switch off magic quotes\n\t\t//-----------------------------------------\n\n\t\t@set_magic_quotes_runtime(0);\n\n\t\t$this->get_magic_quotes = @get_magic_quotes_gpc();\n\t\t\n \t//-----------------------------------------\n \t// Clean globals, first.\n \t//-----------------------------------------\n \t\n\t\t$this->clean_globals( $_GET );\n\t\t$this->clean_globals( $_POST );\n\t\t$this->clean_globals( $_COOKIE );\n\t\t$this->clean_globals( $_REQUEST );\n \t\n\t\t# GET first\n\t\t$input = $this->parse_incoming_recursively( $_GET, array() );\n\t\t\n\t\t# Then overwrite with POST\n\t\t$input = $this->parse_incoming_recursively( $_POST, $input );\n\t\t\n\t\t$this->input = $input;\n\t\t\n\t\t$this->define_indexes();\n\n\t\tunset( $input );\n\t\t\n\t\t# Assign request method\n\t\t$this->input['request_method'] = strtolower($this->my_getenv('REQUEST_METHOD'));\n\t}", "public function get_body()\n {\n return json_decode(file_get_contents('php://input'), TRUE);\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "protected function parseRequestInput()\n {\n $requestInput = null;\n\n if (in_array($this->getMethod(), [self::METHOD_DELETE, self::METHOD_PUT, self::METHOD_POST], true))\n {\n if (empty($_REQUEST) && isset($_SERVER['CONTENT_TYPE'], $_SERVER['CONTENT_LENGTH']) && (int)$_SERVER['CONTENT_LENGTH'])\n {\n $input = file_get_contents('php://input');\n\n switch ($_SERVER['CONTENT_TYPE'])\n {\n case 'application/json':\n {\n $requestInput = json_decode($input, true, 512, JSON_THROW_ON_ERROR);\n break;\n }\n case 'multipart/form-data':\n case 'application/x-www-form-urlencoded':\n {\n parse_str($input, $requestInput);\n break;\n }\n default: $requestInput = $input;\n }\n }\n }\n return $requestInput;\n }", "public static function getRequestBodyStream() {}", "function readInputData() {\n\t\t$this->_metadataFormImplem->readInputData();\n\t\t$this->readUserVars(array('categories', 'seriesId', 'seriesPosition'));\n\t\tListbuilderHandler::unpack($request, $this->getData('categories'));\n\t}", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "private function _getRequestParams()\n {\n return array_merge(\n $this->CI->input->post(),\n $this->CI->input->get()\n );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "function populate_from_request();", "private static function getRawInputs(): array\n {\n $inputParams = [];\n\n if (in_array(self::$__method, ['PUT', 'PATCH', 'DELETE'])) {\n\n $input = file_get_contents('php://input');\n\n if (self::$server->contentType()) {\n switch (self::$server->contentType()) {\n case 'application/x-www-form-urlencoded':\n parse_str($input, $inputParams);\n break;\n case 'application/json':\n $inputParams = json_decode($input);\n break;\n default :\n $inputParams = parse_raw_http_request($input);\n break;\n }\n }\n }\n\n return (array) $inputParams;\n }", "public function formParams() {\n\t\tswitch($this->method()) {\n\t\tcase 'GET':\n\t\tcase 'DELETE':\n\t\tcase 'HEAD':\n\t\tcase 'OPTIONS':\n\t\tcase 'TRACE':\n\t\t\t$query_str = $this->queryString();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// TODO Validate Content-Type\n\t\t\t$query_str = $this->getBody();\n\t\t}\n\t\tparse_str($query_str, $result);\n\t\treturn $result;\n\t}", "private function findRequestParameters(Request $request)\n {\n //We get parameters from POST or GET\n $parameters = array_merge($request->query->all(), $request->request->all());\n\n //We merge raw data if there is any\n //Need for Internet Explorer 8 ajax calls\n if ($request->getContent()) {\n parse_str($request->getContent(), $body_data);\n $firstKey = key($body_data);\n reset($body_data);\n if (is_array($body_data) && $body_data[$firstKey] != \"\") {\n $parameters = array_merge($parameters, $body_data);\n }\n else {\n $body_data = $this->jsonDecode($request->getContent(), true);\n if (is_array($body_data)) {\n $parameters = array_merge($parameters, $body_data);\n }\n }\n }\n\n return $parameters;\n }", "abstract protected function getRequiredRequestParameters();", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "function parseIncoming(){\r\n\t\t# THIS NEEDS TO BE HERE!\r\n\t\t$this->get_magic_quotes = @get_magic_quotes_gpc();\r\n\r\n \t\tif(is_array($_GET)){\r\n\t\t\twhile(list($k, $v) = each($_GET)){\r\n\t\t\t\tif(is_array($_GET[$k])){\r\n\t\t\t\t\twhile(list($k2, $v2) = each($_GET[$k])){\r\n\t\t\t\t\t\t$this->input[$this->parseCleanKey($k)][$this->parseCleanKey($k2)] = $this->parseCleanValue($v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$this->input[$this->parseCleanKey($k)] = $this->parseCleanValue($v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Overwrite GET data with post data\r\n\t\tif(is_array($_POST)){\r\n\t\t\twhile(list($k, $v) = each($_POST)){\r\n\t\t\t\tif(is_array($_POST[$k])){\r\n\t\t\t\t\twhile(list($k2, $v2) = each($_POST[$k])){\r\n\t\t\t\t\t\t$this->input[$this->parseCleanKey($k)][$this->parseCleanKey($k2)] = $this->parseCleanValue($v2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$this->input[$this->parseCleanKey($k)] = $this->parseCleanValue($v);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->input['requestMethod'] = strtolower($_SERVER['REQUEST_METHOD']);\r\n//\t\techo '<pre>'.print_r($this->input, 1).'</pre>';exit;\r\n\t}", "private function processRequest()\n\t{\n\t\t\n\t\t$request = NEnvironment::getService('httpRequest');\n\t\t\n\t\tif ($request->isPost() && $request->isAjax() && $request->getHeader('x-callback-client')) { \n\t\t\t\n\t\t\t$data = json_decode(file_get_contents('php://input'), TRUE);\n\t\t\tif (count($data) > 0) {\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\tif (isset($this->items[$key]) && isset($this->items[$key]['callback']) && $value === TRUE) {\n\t\t\t\t\t\t$this->items[$key]['callback']->invokeArgs($this->items[$key]['args']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tdie(json_encode(array('status' => \"OK\")));\n\t\t}\n\t\t\n\t}", "public function get_request_content();", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "protected function parse_body_params()\n {\n }", "public function getData()\n {\n $data = json_decode(file_get_contents(static::INPUT_STREAM), true);\n\n if ($data) {\n return array_merge($this->data->getAll(), $data);\n }\n\n if ($this->isMethod(self::GET)) {\n return array_merge($this->data->getAll(), $_GET);\n }\n\n if ($this->isMethod(self::POST)) {\n return array_merge($this->data->getAll(), $_POST);\n }\n\n return [];\n }", "protected function setGetData()\n\t{\n\t\t$this->request->addParams($this->query->getParams());\n\t}", "protected function mapRequest() {\n foreach($_REQUEST as $key => $value) {\n $this->data[$key] = $value;\n }\n }", "public function data() {\n $request = $this->requestReader->getContents();\n\t\tif ($request) {\n if ($json_post = CJSON::decode($request)){\n\t\t\t\treturn $json_post;\n\t\t\t}else{\n\t\t\t\tparse_str($request,$variables);\n\t\t\t\treturn $variables;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function collectDataFromInput()\n\t{\n\t\t$id= FormUtil :: getPassedValue('id', null);\n\t\t$objectid= FormUtil :: getPassedValue('objectid', null);\n\n\t\tif (!empty ($objectid))\n\t\t{\n\t\t\t$id= $objectid;\n\t\t}\n\n\t\t$license= FormUtil :: getPassedValue('license', null, 'POST');\n\t\t$license_image= FormUtil :: getPassedValue('license_image', null, 'FILES');\n\n\t\t(!empty ($license['objectid'])) ? $license['id']= $license['objectid'] : '';\n\n\t\t// get all module vars\n\t\t$modvars= pnModGetVar('crpLicense');\n\n\t\t$data= compact('id', 'objectid', 'license', 'license_image', 'modvars');\n\n\t\treturn $data;\n\t}", "private function extractParamsFromJSONBody(Request $request)\n {\n $params = array();\n\n $content = $request->getContent();\n if(!empty($content)) {\n $result = json_decode($content);\n\n if (json_last_error() === JSON_ERROR_NONE) {\n $params = $result;\n }\n }\n\n return $params;\n }", "public function & GetRequest ();", "public function getRequestParams()\n {\n return $_REQUEST;\n }", "public function getRequestParameters()\r\n\t{\r\n\t\tswitch($_SERVER['REQUEST_METHOD'])\r\n\t\t{\r\n\t\t\tcase 'GET':\r\n\t\t\t\t\r\n\t\t\t\t$uri = $_SERVER['REQUEST_URI'];\r\n\t\t\t\t\r\n\t\t\t\tif(preg_match(RestAPI::CUSTOM_BASE64_REGEX, $_SERVER['REQUEST_URI'], $m))\r\n\t\t\t\t\treturn $this->parseCompressedParameters($m[0]);\r\n\t\t\t\t\r\n\t\t\t\treturn $_GET;\r\n\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'POST':\r\n\t\t\t\r\n\t\t\t\treturn $_POST;\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'DELETE':\r\n\t\t\tcase 'PUT':\r\n\t\t\t\r\n\t\t\t\t$request = array();\r\n\t\t\t\t$body = file_get_contents('php://input');\r\n\t\t\t\tparse_str($body, $request);\r\n\t\t\t\t\r\n\t\t\t\treturn $request;\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\r\n\t\t\t\treturn $_REQUEST;\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "public function getRequest();", "private function fetchDataFromRequest()\n {\n $this->data = (object)$_REQUEST;\n if ($this->getParameter('apicheck',self::REGEX_INTEGER)) {\n $this->apiCheck = true;\n }\n\n return true;\n }", "public static function parseRequest(array $requiredData = []): array {\n $headers = self::arrayKeyCase(getallheaders());\n $method = $_SERVER[\"REQUEST_METHOD\"] ?? \"\";\n $requestUri = strtok($_SERVER[\"REQUEST_URI\"] ?? \"\", \"?\");\n $queryString = $_GET;\n $requestBody = [];\n if (!empty($_POST)) {\n $requestBody = $_POST;\n } else {\n $postRaw = (file_get_contents(\"php://input\"));\n if ($postRaw) {\n $post = json_decode($postRaw, TRUE);\n $error = json_last_error();\n if ($error == JSON_ERROR_NONE) {\n $requestBody = $post;\n } else {\n $detail = \"There was an unexpected error processing your request\";\n $errorMessages = [\n JSON_ERROR_DEPTH => \" - Maximum stack depth exceeded\",\n JSON_ERROR_STATE_MISMATCH => \" - Underflow or the modes mismatch\",\n JSON_ERROR_CTRL_CHAR => \" - Unexpected control character found\",\n JSON_ERROR_SYNTAX => \" - Syntax error, malformed JSON\",\n JSON_ERROR_UTF8 => \" - Malformed UTF-8 characters, possibly incorrectly encoded\"\n ];\n $detail .= $errorMessages[$error] ?: \"\";\n $exception = new \\Exception(\"Bad request\", 400);\n $exception->detail = $detail;\n throw $exception;\n }\n }\n }\n array_walk_recursive($requestBody, function (&$val) {\n if (is_string($val)) {\n $val = trim($val);\n }\n });\n $responseData = [\n \"requestMethod\" => $method,\n \"requestUri\" => $requestUri,\n \"uriParams\" => !is_null(Nova::$router) ? Nova::$router->matchRoute()[\"params\"] ?? \"\" : [],\n \"routeName\" => !is_null(Nova::$router) ? Nova::$router->matchRoute()[\"name\"] ?? \"\" : \"\",\n \"headers\" => $headers,\n \"body\" => $requestBody,\n \"queryString\" => $queryString\n ];\n $errors = [];\n foreach ($requiredData as $dataType => $format) {\n if ($dataType == \"headers\") {\n $format = self::arrayKeyCase($format);\n }\n $errors = array_merge($errors, self::dataValidator($responseData[$dataType], $format));\n }\n if ($errors) {\n $exception = new \\Exception(\"Bad request\", 400);\n $exception->detail = ($errors);\n throw $exception;\n }\n return $responseData;\n }", "public function getPostParams()\n {\n return $this->request->all();\n }", "public static function all(): array\n\t{\n\t\treturn $_REQUEST;\n\t}", "public function getRawRequest() {\n\t}", "public function setRequestContent()\n {\n $this->requestContent = array(\n 'method' => $this->request->getMethod(),\n 'headers' => $this->request->headers->all(),\n 'content_type' => $this->request->headers->get('content-type'),\n 'content' => array(),\n );\n\n if (strstr($this->requestContent['content_type'], 'application/x-www-form-urlencoded')) {\n $this->requestContent['content'] += $this->request->request->all();\n } elseif (strstr($this->requestContent['content_type'], 'application/json')) {\n $this->requestContent['content'] += json_decode($this->getRequest()->getContent(), true);\n } else {\n $this->requestContent['content'] += $this->request->query->all();\n }\n }", "abstract public function parseRequestParameters();", "public function processGetRequest(){\n\t\t$query = $this->request->getQueryString();\n\t\t$params = $this->request->getPathParameters();\n\t\tif (!empty($params)){\n\t\t\t\n\t\t\t$uid \t= $this->extractUserId();\n\t\t\t$controller = new ExampleController();\n\t\t\t$result = $controller->getUserById($uid);\n\t\t\tif ($result){\t\n\t\t\t\tnew Response('200', $result);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tnew Response('404');\n\t\t\t} \n\t\t}\n\t\telse{\n\t\t\t// get all\n\t\t\t$controller = new ExampleController();\n\t\t\t$results = $controller->getAllUsers($query);\n\t\t\tnew Response('200', $results);\n\t\t}\n\t}", "public static function getServerParameters() {\n if ($_SERVER['REQUEST_METHOD'] == 'GET' || $_SERVER['REQUEST_METHOD'] == 'HEAD') {\n $data = self::httpParseQuery($_SERVER['QUERY_STRING']);\n }\n elseif ($_SERVER['REQUEST_METHOD'] == 'POST' || $_SERVER['REQUEST_METHOD'] == 'PUT') {\n $data = self::httpParseQuery(file_get_contents('php://input'));\n }\n return $data;\n }", "public function testSimpleExtractionFromRequest()\n {\n $queryData = ['a' => 1, 'b' => 2];\n $requestData = ['a' => 2, 'b' => 4, 'c' => 8];\n $contentData = ['b' => 3, 'c' => 6, 'd' => 9];\n $request = $this->createRequest($queryData, $requestData, $contentData);\n\n $this->assertEquals($requestData, $this->extractParameters($request, null, 'request'));\n }", "function rr() {\n dd(request()->all());\n }" ]
[ "0.70277137", "0.6773456", "0.67220247", "0.6685514", "0.6570688", "0.6566249", "0.65576935", "0.65446967", "0.6541294", "0.65155935", "0.64902806", "0.6467232", "0.64654815", "0.6464678", "0.6456292", "0.6413553", "0.64126134", "0.64126134", "0.6412435", "0.64104426", "0.6408082", "0.6400107", "0.63865453", "0.63830036", "0.6377352", "0.6364234", "0.6362969", "0.6361667", "0.63590956", "0.6289657", "0.62723213", "0.6251545", "0.6238678", "0.6230133", "0.6228488", "0.62205905", "0.62198645", "0.6219273", "0.62191916", "0.6218603", "0.6205152", "0.6182765", "0.61693525", "0.6158221", "0.61504483", "0.6150106", "0.6149109", "0.6144957", "0.61249954", "0.6122704", "0.61147094", "0.611186", "0.61099637", "0.61082655", "0.6087084", "0.60769755", "0.60682034", "0.6057446", "0.6053202", "0.6034205", "0.603019", "0.6022661", "0.6006841", "0.5993477", "0.5987714", "0.5987179", "0.59848535", "0.5982768", "0.5979482", "0.5970764", "0.5970676", "0.5962645", "0.5957175", "0.5953428", "0.59423286", "0.59408426", "0.5936093", "0.5930701", "0.59259397", "0.59216195", "0.5921066", "0.5908534", "0.5904446", "0.5904446", "0.5904446", "0.5904446", "0.5904446", "0.5904446", "0.5904446", "0.5904446", "0.59041005", "0.58969635", "0.5891455", "0.58848023", "0.58783704", "0.58651894", "0.5855748", "0.58443165", "0.58368015", "0.5835533", "0.5834859" ]
0.0
-1
delete image folder and all its content
function delete($record_id){ $rs=parent::get_record($record_id); if (is_dir(USER_IMAGES_FOLDER_ADDRESS.$rs->fields["image_folder"]."/")) { rm_dir_and_all_files(USER_IMAGES_FOLDER_ADDRESS.$rs->fields["image_folder"]."/"); } //--------------delete the user record parent::delete($record_id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public static function deleteImage(){}", "function imageAllDelete();", "function removeImage() {\n\t\t\n $image = $this->getImageByImageId();\n \n $file_image = $this->dir_path.$image['path_image'];\n\n $this->deleteImage(array('image_id' => $image['image_id'] ));\n\n if(file_exists($file_image)) {\n @unlink($file_image);\n }\n\t\t\n\t}", "public function deleteImage(){\n if(file_exists($this->getImage())){\n unlink($this->getImage());\n }\n $this->setImage(null);\n }", "public function deleteImage($path)\n {\n // $file_name = end($file);\n File::delete(public_path($path));\n // File::delete($file_name);\n }", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function delete_file(){\n unlink('/opt/lampp/htdocs/specijalisticki_rad/uploaded_images/'.$this->name);\n\n }", "public function purgeImageCache()\n\t{\n\t\t// Walk through the subfolders\n\t\tforeach (scan(TL_ROOT . '/assets/images') as $dir)\n\t\t{\n\t\t\tif ($dir != 'index.html' && strncmp($dir, '.', 1) !== 0)\n\t\t\t{\n\t\t\t\t// Purge the folder\n\t\t\t\t$objFolder = new \\Folder('assets/images/' . $dir);\n\t\t\t\t$objFolder->purge();\n\n\t\t\t\t// Restore the index.html file\n\t\t\t\t$objFile = new \\File('templates/index.html', true);\n\t\t\t\t$objFile->copyTo('assets/images/' . $dir . '/index.html');\n\t\t\t}\n\t\t}\n\n\t\t// Also empty the page cache so there are no links to deleted images\n\t\t$this->purgePageCache();\n\n\t\t// Add a log entry\n\t\t$this->log('Purged the image cache', __METHOD__, TL_CRON);\n\t}", "public function destroyFolder()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'];\n if (!file_exists($file)) die('File not found '.$file);\n if (!is_dir($file)) die('Not a folder '.$file);\n $h=opendir($file);\n while($f=readdir($h)) {\n if ($f!='.' && $f!='..') die('Folder is not empty');\n }\n closedir($h);\n rmdir($file);\n }", "public function deleteImages() {\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_FULLSIZE . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete image file.\", E_USER_ERROR );\n }\n \n // Delete all thumbnail images for this book\n foreach (glob( ARTICLE_IMAGE_PATH . \"/\" . IMG_TYPE_THUMB . \"/\" . $this->id . \".*\") as $filename) {\n if ( !unlink( $filename ) ) trigger_error( \"Book::deleteImages(): Couldn't delete thumbnail file.\", E_USER_ERROR );\n }\n \n // Remove the image filename extension from the object\n $this->imageExtension = \"\";\n }", "public function remove_image() {\n\t\t$this->join_name = \"images\";\n\t\t$this->use_layout=false;\n\t\t$this->page = new $this->model_class(Request::get('id'));\n\t\t$image = new WildfireFile($this->param(\"image\"));\n\t\t$this->page->images->unlink($image);\n\t}", "function delete($image, $path) {\n\t\tif($path) {\n\t\t\t$path = $path.DS;\n\t\t}\n @unlink(Configure::read('__Site.upload_path').DS.$path.$image);\n\t}", "public function removeImage()\n {\n // Suppression de l'image principale\n $fichier = $this->getAbsolutePath();\n\n if (file_exists($fichier))\n {\n unlink($fichier);\n }\n\n // Suppression des thumbnails\n foreach($this->thumbnails as $key => $thumbnail)\n {\n $thumb = $this->getUploadRootDir() . '/' . $key . '-' . $this->name;\n if (file_exists($thumb))\n {\n unlink($thumb);\n }\n }\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function deleteImages()\n {\n if ($images = $this->getImages()->all()) {\n foreach ($images as $image) {\n /* @var $image AdImages */\n $image->delete();\n }\n }\n }", "public function deleteImage1()\n {\n Storage::delete($this->image1);\n }", "public function clearRespizrImageCache()\n {\n $mediaPath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA);\n $resizedDirPath = $mediaPath . DS\n . Mage::getSingleton('respizr/config')->getRespizrDirName();\n\n if (is_dir($resizedDirPath)) {\n $io = new Varien_Io_File();\n $io->rmdir($resizedDirPath, true);\n }\n }", "private static function purgeImages() {\n self::purgeFiles(self::getInterimImageFolder(), self::$interim_image_expiry);\n }", "public function actionDeleteimage()\n {\n $this->enableCsrfValidation = false;\n $filename = Yii::$app->request->post('filename');\n $path_name = \"../web/web_mat/temp/\" . $filename;\n if (unlink($path_name)) {\n echo \"success\";\n } else {\n echo \"fail\";\n }\n }", "function delete_logoimage() \n {\n \n $fullpath = './assets/uploads/fashion_prod/';\n $thumbpath = './assets/uploads/fashion_prod/thumbs/';\n $picture=$_POST[\"r_logoimage\"];\n \n unlink($fullpath.$picture);\n unlink($thumbpath.$picture);\n $this->db->delete('productimages', array('imagename' => $picture));\n echo true;\n \n }", "public function delete_image_from_storage($image_file_name) {\n\t\t unlink(\"product_images/\".$image_file_name);\n\t }", "function deleteImage($image = \"\")\n {\n if (!$image)\n $image = $this->image;\n unlink ($image);\n }", "private function delete_old_picture(){\n foreach ( glob( UPLOADS.$this->get_name_sanitized().'.*' ) as $picture ){\n if(is_writable($picture)){unlink($picture);}\n }\n }", "public function delete_img(string $table, string $image_folder = '../../../photos'){\n\n $return_info = ['error'=>1, 'message' => 'Greska pri brisanju slike.'];\n $img_name = $this->name();\n\n // iz baze\n $delete_db = $this->delete_object_from_db($table, ['id']);\n if ($delete_db['error']) return $return_info;\n\n\n //iz foldera\n $delete_from_folder = $this->delete_image_from_folers($img_name, $image_folder);\n if ($delete_from_folder) {\n $return_info['error'] = 0;\n $return_info['message'] = 'Slika uspešno izbrisana.';\n return $return_info;\n }\n\n return $return_info;\n\n }", "function delete_image() {\n\tif(isset($_POST['remove'])){\n\t\tglobal $wpdb;\n\t\t$img_path = $_POST['path'];\n\n\t\t// We need to get the images meta ID.\n\t\t$query = \"SELECT ID FROM wp_posts where guid = '\" . esc_url($img_path) . \"' AND post_type = 'attachment'\";\n\t\t$results = $wpdb->get_results($query);\n\n\t\t// And delete it\n\t\tforeach ( $results as $row ) {\n\t\t\twp_delete_attachment( $row->ID ); //delete the image and also delete the attachment from the Media Library.\n\t\t}\n\t\tdelete_option('pochomaps_map_image'); //delete image path from database.\n\t}\n}", "public function deleteImage($image){\n if( !empty( $image ) ){\n \t\t\t\\File::delete( public_path( $image ) );\n \t\t}\n return true;\n }", "public function deleteImage()\n {\n $this->checkImage($this->logo, $this);\n }", "function delete_image($imageId) {\n\t\t\tglobal $wpdb;\n\t\t\t$sql = \"select `filename` from `\".$this->table_img_name.\"` where `id` = '\".$imageId.\"'\";\n\t\t\t$img = $wpdb->get_row($sql, ARRAY_A, 0);\n\n\t\t\t$sql = \"delete from `\".$this->table_img_name.\"` where `id` = '\".$imageId.\"'\";\n\t\t\t$wpdb->query($sql);\n\n\t\t\t$page = $this->plugin_path.$this->images_dir.\"/\".$img['filename'];\n\n\t\t\t@unlink( $page );\n\n\t\t\t$fileExt = split( \"\\.\", $img['filename'] );\n\t\t\tif( $fileExt[1] != \"swf\" ) \n\t\t\t\t{\n\t\t\t\t\t $thumb = $this->plugin_path.$this->images_dir.\"/thumb_\".$img['filename'];\n\t\t\t\t\t @unlink( $thumb );\n\t\t\t\t}\n\t\t}", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function uninstall(bool $deleteimages = false)\n{\n $meta = file_exists(DEFAULT_METAFILE) ? textFileToArray(DEFAULT_METAFILE) : null;\n $files = glob(VAR_FOLDER . DS . '{,.}[!.,!..]*', GLOB_MARK|GLOB_BRACE);\n foreach ($files as $file) {\n unlink($file);\n }\n\n if (true === $deleteimages) {\n $imagesdir = $meta && count($meta) && array_key_exists('imagesfolder', $meta) ? ROOT_FOLDER . DS . $meta['imagesfolder'] : DEFAULT_IMAGEFOLDER;\n\n $files = glob($imagesdir . DS . '{,.}[!.,!..]*', GLOB_MARK|GLOB_BRACE);\n foreach ($files as $file) {\n unlink($file);\n }\n }\n\n if ($meta) {\n unlink(DEFAULT_METAFILE);\n }\n}", "public function destroy($id)\n {\n // $images=LookbookCategoryController::where('lookbook_category_id',$id)->get();\n // foreach ($images as $img) {\n // unlink(public_path('/img/uploads/'.$img->img));\n // }\n // LookbookCategoryController::find($id)->delete();\n }", "public function DeletePhotos()\n\t{\tforeach ($this->imagesizes as $sizename=>$size)\n\t\t{\t@unlink($this->GetImageFile($sizename));\n\t\t}\n\t}", "public function destroyimage($id) {\n $delete = ProductsGallary::find($id);\n if(!empty($delete->media) and file_exists(public_path().'/upload/products/'.$delete->media))\n {\n unlink(public_path().'/upload/products/'.$delete->media);\n }\n $delete->delete();\n session()->flash('success',trans('admin.deleted'));\n return back();\n }", "function deleteImage()\n {\n $this->dbInit();\n\n $this->Database->array_query( $result, \"SELECT ImageID FROM eZLink_Link WHERE ID='$this->ID'\" );\n\n foreach ( $result as $item )\n {\n $image = new eZImage( $item[\"ImageID\"] );\n $image->delete();\n }\n \n $this->Database->query( \"UPDATE eZLink_Link set ImageID='0' WHERE ID='$this->ID'\" );\n }", "public function deleteImage($file)\n { \n // Separate file into name and paths \n $this->parseFileName($file);\n \n $dir = new \\RecursiveIteratorIterator(new \\RecursiveDirectoryIterator($this->file_path));\n foreach($dir as $dir_file){ \n $parts = explode('/', str_replace($this->file_path, '', $dir_file));\n \n if($this->filename == \"/\" . $parts[ count($parts)-1 ]){\n unlink($dir_file);\n }\n }\n \n @unlink($file);\n }", "public function deleteImage($id){\n $delete_image=Details::findOrFail($id);\n $image_large=public_path().'/'.$delete_image->image;\n if($delete_image){\n $delete_image->image='';\n $delete_image->save();\n \n unlink($image_large);\n }\n session()->flash('success','Image bien supprimer');\n return back();\n }", "public function cleanImagesAction()\n {\n parent::cleanImagesAction();\n $this->clearRespizrImageCache();\n }", "function _delete_photo($file){\n\t\t@unlink('web/upload/'.image_small($file));\n\t\t@unlink('web/upload/'.image_large($file));\n\t}", "public function deleteImage(Image $image)\n {\n //need to log unlink error\n @unlink($image->getAbsolutePath());\n $this->em->remove($image);\n }", "public function destroy($id) {\n $item = Item::where('id',$id)->first();\n foreach($item->images as $img) {\n if(\\File::exists(public_path($img->img))){\n \\File::delete(public_path($img->img));\n }\n }\n $path = 'images/items/'.$item->id.'/';\n \\File::deleteDirectory($path); \n $item->delete();\n return redirect('/admin/items')->with('message','تم حذف المنتج بنجاح');\n }", "function delImage($filename)\n\t{\n\t\t// TODO: Retrieve different pictures from root model\t\t\n\t\tif(is_file(WWW_ROOT . \"img/thumbnails/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/thumbnails/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/medium/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/medium/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/large/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/large/\" . $filename);\n\t\t}\n\t\tif(is_file(WWW_ROOT . \"img/original/\" . $filename)) {\n\t\t\tunlink(WWW_ROOT . \"img/original/\" . $filename);\n\t\t}\n\t\treturn true;\n\t}", "public function actionDeleteimage($id){\n\n $image = Images::findOne($id);\n\n $service_id = $image->service_id;\n\n $url = Url::to('@frontend/web/img/clinic/services/') . $image->file;\n $urlThumb = Url::to('@frontend/web/img/clinic/services/thumbs/') . $image->file;\n\n // Delete image from the database and the folder\n if (unlink($url) && unlink($urlThumb) && $image->delete())\n return true;\n else\n return false;\n }", "public function deletePicture($id){\n $picName = null;\n $images = new Images();\n $dataPic = $images->get_image($id);\n foreach ($dataPic as $key => $value) {\n $picName = $value->img_url;\n }\n $checkFile = file_exists(public_path() . '/' . $picName);\n if ($checkFile){\n unlink(public_path() . '/' . $picName);\n }\n }", "public function delete($pathToImage)\n {\n File::delete($pathToImage);\n }", "function remove_image($image_id)\n\t{\n\t\t// global variables from config/db_config.php\n\t\tglobal $idea_db;\n\t\tglobal $images_db_table;\n\t\tglobal $db_hostname;\n\t\tglobal $db_user;\n\t\tglobal $db_password;\n\n\t\t// get the image's name to remove from file system\n\t\t$image = get_image($image_id);\n\n\t\t// construct query\n\t\t$query = \"DELETE FROM images WHERE images . id='$image_id'\";\n\n\t\t//send query\n\t\tif (send_query($query,$db_hostname,$db_user,$db_password,$idea_db))\n\t\t{\n\t\t\t// remove from file system\n\t\t\tunlink($image);\n\t\t} else {\n\t\t\t// TODO: Error occured with removing image. Redirect Appropriately.\n\t\t\t// debug\n\t\t\techo \"<h1> Image Not Deleted </h1>\";\n\t\t}\n\t}", "public function deleteImageDir($postId)\n {\n Storage::deleteDirectory('public/' . Post::getFilePath($postId));\n }", "function deleteArticleTree() {\n\t\tparent::rmtree($this->filesDir);\n\t}", "public function deleteImage($image_path,$file_name)\n {\n if($file_name!=\"\"){\n unlink($image_path.$file_name);\n unlink($image_path.'thumbnails/small/'.$file_name);\n unlink($image_path.'thumbnails/medium/'.$file_name);\n unlink($image_path.'thumbnails/large/'.$file_name);\n }\n }", "function deleteImage() {\n\t$errorFlag = FALSE;\n\n\t$index = intval($_POST[\"imageId\"]);\n\t$xmlImages = simplexml_load_file($_SESSION['cuneidemo']['imagesList']);\n\t$annotationfile = $_SESSION['cuneidemo']['annotationsPath'] . ($xmlImages->image[$index]->annotation);\n\t$imagefile = $_SESSION['cuneidemo']['imagesPath'] . ($xmlImages->image[$index]->file);\n\t$imageThumb = $_SESSION['cuneidemo']['collectionFolder'] . thumbs . DIRECTORY_SEPARATOR . ($xmlImages->image[$index]->file) . '-thumb.jpg';\n\t$imagefile = $imagefile . '.jpg';\n\n\t// LOG START\n\tlogMessage(\"Asked for deletion of file \" . $_POST[\"imageId\"] . \" (\" . (string) ($xmlImages->image[$index]->file) . \".jpg) in group \".$_SESSION['cuneidemo']['group']. \"(\"\n\t\t\t. $_SESSION['cuneidemo']['groupName'] . \"), collection \".$_SESSION['cuneidemo']['collection'].\" (\" . $_SESSION['cuneidemo']['collectionName'] . \")\");\n\n\t// save annotations' names\n\n\tif($xmlImages->image[$index]->annotation != \"empty\") {\n\t\t$annoList = glob(\"$annotationfile-v*.xml\");\n\t\tarray_push($annoList, \"$annotationfile.xml\");\n\t} else {\n\t\t$annoList = array();\n\t}\n\tarray_push($annoList, $imagefile);\n\tarray_push($annoList, $imageThumb);\n\n\t// BAckup everything in a zip-file\n\t$backupDirectory = 'data/trash/';\n\n\t$zip = new ZipArchive();\n\t$filename = $backupDirectory . $_SESSION['cuneidemo']['user'] . time() . \".zip\";\n\n\tif($zip->open($filename, ZipArchive::CREATE) !== TRUE) {\n\t\t$error = \"Error creating Zip file!\";\n\t\tlogMessage(\"Error creating Zip file!\");\n\t\t$errorFlag = TRUE;\n\t} else {\n\t\tforeach($annoList as $anno) {\n\t\t\t$test = (boolean) ($zip->addFile($anno));\n\n\t\t\tif($test != TRUE) {\n\t\t\t\t$error = \"Error adding file to Zip file!\";\n\t\t\t\tlogMessage(\"Error adding file '$anno' to Zip file!\");\n\t\t\t\t$errorFlag = TRUE;\n\t\t\t}\n\t\t}\n\t\t$zip->close();\n\n\t\tif(!$errorFlag) {\n\t\t\tlogMessage(\"Image and Annotations saved to ZIP: $filename\");\n\n\t\t\t// Erase Files\n\t\t\tforeach($annoList as $anno) {\n\t\t\t\t$err = unlink($anno);\n\t\t\t\tif(!$err) {\n\t\t\t\t\t$error = \"Error erasing File\";\n\t\t\t\t\tlogMessage(\"Error erasing File\");\n\t\t\t\t\t$errorFlag = TRUE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlogmessage(\"Image and Annotations erased from disk\");\n\t\t}\n\t}\n\n\tif($errorFlag) {\n\t\techo json_encode(array(\n\t\t\t\t'error' => true,\n\t\t\t\t'Errormsg' => $error\n\t\t));\n\t} else {\n\t\t// Change image total\n\t\t$total = (int) $xmlImages->total;\n\t\t$total--;\n\t\t$xmlImages->total = $total;\n\n\t\t// REMOVE FROM XML\n\t\tunset($xmlImages->image[$index]);\n\n\t\t$counter = 1;\n\n\t\t// Change ID from files\n\t\tforeach($xmlImages->image as $imageInfo) {\n\t\t\t$imageInfo->id = $counter;\n\t\t\t$counter++;\n\t\t}\n\t\t$xmlImages->asXML($_SESSION['cuneidemo']['imagesList']);\n\n\t\tlogMessage(\"Image erased from XML and XML ids updated\");\n\t\techo json_encode(array(\n\t\t\t\t'error' => false\n\t\t));\n\t}\n}", "function delete () {\n $this->clearCache ();\n commentaire::deletePhoto ($this->dir, $this->file);\n return files::deleteFile (luxbum::getFsPath ($this->dir) . $this->file);\n }", "public function deleteImage($image)\n\t{\n\t\t$uploadDir = $this->getUploadDir();\n\n\t\tif ( is_array($this->thumbs) AND !empty($this->thumbs) )\n\t\t{\n\t\t\tforeach (array_keys($this->thumbs) as $thumbDir)\n\t\t\t\t@unlink($uploadDir.'/'.$thumbDir.'/'.$image);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t@unlink($uploadDir.'/'.$image);\n\t\t}\n\n\t\t// Delete all cropped images from this object\n\t\tif ( is_dir($uploadDir . '/_cropped') )\n\t\t{\n\t\t\t$croppedImages = FileHelper::findFiles($uploadDir.'/_cropped', [\n\t\t\t\t'only' => ['*_|_' . $image],\n\t\t\t]);\n\n\t\t\tforeach ($croppedImages as $croppedImage)\n\t\t\t{\n\t\t\t\t@unlink($croppedImage);\n\t\t\t}\n\t\t}\n\t}", "public function remove_dir() {\n\n $path = $this->get_upload_pres_path();\n\n //append_debug_msg($path);\n\n if(!$path || !file_exists($path)){ return; }\n delete_dir($path);\n }", "function deletePhoto($file,$dir){\n\t\n\t@unlink($dir.$file);\n}", "public function destroy($id){\n $post=Post::find($id);\n $image=$post->path;\n $post->delete();\n if($image!=NULL)\n File::delete($image);\n\n\n\n \n \n //\n }", "function deleteFolder();", "public function deleteDirPhoto() {\n if(is_file($this->getLinkplan())){\n unlink($this->getLinkplan());\n }\n return (rmdir($this->dirPhoto));\n }", "public function deleteImage()\n {\n return Storage::delete($this->image);\n }", "function _ddb_cover_upload_cleanup() {\n $data = _ddb_cover_upload_session('ddb_cover_upload_submitted');\n\n // Mark image as upload to prevent more uploads of the same data.\n _ddb_cover_upload_session('ddb_cover_upload_submitted', '');\n\n // Remove local copy of the image.\n file_unmanaged_delete($data['image_uri']);\n}", "public function delete_multipleimage() \n {\n \n $fullpath = './assets/uploads/fashion_prod/';\n $bigpath = './assets/uploads/fashion_prod/mainimage/';\n $thumbpath = './assets/uploads/fashion_prod/thumbs/';\n $picture=$_POST[\"key\"];\n \n unlink($fullpath.$picture);\n unlink($bigpath.$picture);\n unlink($thumbpath.$picture);\n $this->db->delete('productimages', array('imagename' => $picture));\n echo true;\n \n }", "function cleanImages()\r\n {\r\n if (!count($this->imagesContent)) return true;\r\n $this->_echo('<br>Очистка не используемых файлов картинок...');\r\n foreach ($this->imagesContent as $file) {\r\n @unlink($this->rootPath.$file);\r\n }\r\n }", "public function destroy($id)\n {\n \n $destroy = Category_image::find($id);\n if(file_exists('images/sales_page_image/'.$destroy->image_name.''))\n {\n @unlink('images/sales_page_image/'.$destroy->image_name.'');\n }\n $destroy->delete();\n\n return redirect()->back();\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "public function deleteBannerImage($id=null){\n //get banner/slider image name\n $bannerImage =Banner::where(['id'=>$id])->first();\n \n //get banner/slider image paths\n $banner_image_path = 'images/frontend_images/images/banners/';\n\n //delete banner image if exist in folder\n if(file_exists($banner_image_path.$bannerImage->image)){\n unlink($banner_image_path.$bannerImage->image);\n }\n \n // delete image from banner table\n Banner::where(['id'=>$id])->update(['image'=>'']);\n return redirect()->back()->with('flash_success_msg','Slider Image Deleted successfully!');\n }", "public function deleteImage($event)\n {\n $this->unlinkFiles($event->sender->{$this->attribute});\n }", "public function delete_image_file()\n {\n if(Image::remove_image($this->image_url))\n {\n $this->image_url = '';\n return true;\n }\n return true; \n }", "protected function delete($id) {\n\t\t@unlink(self::getPath($id));\n\t\t$this->db->exec(\"DELETE FROM image WHERE id = '\".SQLite3::escapeString($id).\"'\");\n\t}", "public function destroy($id)\n {\n $item = PhotoGallary::find($id);\n $item->delete();\n\n //delete image\n $image_path = \"uploads/photogallary/\".$item->image; // Value is not URL but directory file path\n if(File::exists($image_path)) {\n // dd($image_path);\n File::delete($image_path);\n }\n\n $item = PhotoGallary::get();\n return redirect()->route('photoGallary.index')->with('message','Photo Successfully Deleted');\n }", "public function actionDeletepimage()\n\t{\n\t $sessionimagesarr = array();\n\t if($_POST['type']=='1'){\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'.$_POST['path']);\n\t\t $thumbpath = str_replace(basename($_POST['path']), 'thumb/'.basename($_POST['path']),$_POST['path']);\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'. $thumbpath);\n\t\t }else{\n\t\t $images = Images::model()->findByPK($_POST['path']);\n\t\t @unlink( Yii::getPathOfAlias('webroot').'/'.$images->image_path );\n\t\t $thumbpath = str_replace(basename($images->image_path), 'thumb/'.basename($images->image_path),$images->image_path);\n\t\t @unlink(Yii::getPathOfAlias('webroot').'/'. $thumbpath);\n\t\t $images->delete();\n\t\t }\n\t \n\t\t echo 'Deleted';\n\t\t die;\n\t}", "public function actionAjaxDeleteHomeImage()\n {\n $id=$_REQUEST['id'];\n $detail=HomeImages::model()->findByAttributes(array('id'=>$id));\n unlink(Yii::app()->basePath.'/../HomeImages/'. $detail->image);\n \t //echo \"<pre>\";print_r($detail);die;\n \t $detail->delete();\n \t echo \"success\";\n }", "public function deleting(Image $image)\n {\n Storage::delete($image->filename);\n Storage::delete($image->thumbnail);\n }", "public function delete_file(){\n if($this->file_name != 'sample.jpg'){\n unlink($this->dir_location . $this->file_name);\n }\n }", "public function destroy($id)\n {\n $image = Image::find($id);\n $filename = substr($image->filename, 0, -4);\n $extension = substr($image->filename, -3);\n $image->delete();\n\n if(file_exists(public_path().'/uploads/'.$image->filename)){\n unlink(public_path().'/uploads/'.$image->filename);\n }\n\n if(file_exists(public_path().'/uploads/'.$filename.'_640.'.$extension)){\n unlink(public_path().'/uploads/'.$filename.'_640.'.$extension);\n }\n\n if(file_exists(public_path().'/uploads/'.$filename.'_1280.'.$extension)){\n unlink(public_path().'/uploads/'.$filename.'_1280.'.$extension);\n }\n\n if(file_exists(public_path().'/uploads/'.$filename.'_1920.'.$extension)){\n unlink(public_path().'/uploads/'.$filename.'_1920.'.$extension);\n }\n\n if(file_exists(public_path().'/uploads/'.$filename.'_2560.'.$extension)){\n unlink(public_path().'/uploads/'.$filename.'_2560.'.$extension);\n }\n\n flash()->info('Image deleted successfully.');\n return redirect(route('backend'));\n }", "private function deleteImageFile($name){\n $path = 'assets/images/'.$name;\n return unlink($path);\n\n }", "function deleteUserImageFiles($username) {\n $target_dir = \"uploads/\" . $username . \"/\";\n\n $files = glob(\"$target_dir/*.*\");\n foreach ($files as $file) {\n unlink($file);\n }\n if (is_dir($target_dir)) {\n rmdir($target_dir);\n }\n}", "public function delete_related_images($column_name = 'image',$folder) {\n\t\t$image_name = $this->getOriginal($column_name);\n\t\t// if we don't have previous image then no need to delete it.\n\t\tif ( ! is_null($image_name) && file_exists($this->upload_path .$folder.'/modified/'.$image_name)) {\n\t\t\t$image_path = $this->upload_path .$folder.'/modified/'.$image_name;\n\n\t\t\t$img = Image::make($image_path);\n\t\t\t$mask = $img->filename . '*.*';\n\n\t\t\tarray_map('delete_if_exists', glob(public_path('uploads/'.$folder.'/modified/' . $mask)));\n\t\t}\n\t}", "public function destroy_photo($id)\n {\n //\n if(File::exists(public_path('files/products_img/'.Photo::find($id)->name)))\n {\n File::delete(public_path('files/products_img/'.Photo::find($id)->name));\n Photo::find($id)->delete();\n return redirect()->back();\n }\n }", "private static function toDelete(){\n $filesNotToDelete = [];\n $dir = public_path().'/images/';\n $filesInPublicFolder = scandir($dir);\n\n // izbacivanje assets foldera, .. i .\n $ignoreFiles = ['assets', '.', '..', 'pig.png', 'placeholder.png', 'logo.png', 'index.php'];\n foreach ($ignoreFiles as $toIgnore) {\n if (($key = array_search($toIgnore, $filesInPublicFolder)) !== false) {\n unset($filesInPublicFolder[$key]);\n }\n }\n // dd($filesInPublicFolder);\n $images = [];\n $collectionsOfObjectsWithImages = [Product::all(), ProductGroup::all(), Manufacturer::all(),\n Suggestion::all(), ImageSuggestion::all(), MainAd::all(),SecondAd::all()];\n\n foreach ($collectionsOfObjectsWithImages as $collection) {\n foreach ($collection as $object) {\n if($object->images->count()){\n foreach ($object->images as $image) {\n $images[] = $image->name;\n }\n }\n }\n }\n\n // dd($images);\n // dd(array_diff($filesInPublicFolder, $images));\n // dd($filesNotToDelete, $filesInPublicFolder);\n return $toDelete = array_diff($filesInPublicFolder, $images); //za fju array_dif vazan je redoslijed argumenata\n\n }", "function delete_tmp_folder_content()\n{\n\t$baseDir = '../backups/tmp/';\n\t$files = scandir($baseDir);\n\tforeach ($files as $file) \n\t{\n\t\tif ( ($file != '.') && ($file != '..') && ($file != '.htaccess') ) \n\t\t{\n\t\t\tif ( is_dir($baseDir . $file) ) recursive_deletion($baseDir.$file.'/');\n\t\t\telse unlink('../backups/tmp/' . $file);\n\t\t}\n\t}\n}", "public function deleteldImage() {\n\n if (!empty($this->oldImg) && $this->oldImg != $this->avatar) {\n $file = Yii::app()->basePath . DIRECTORY_SEPARATOR . \"..\" . DIRECTORY_SEPARATOR;\n $file.= \"uploads\" . DIRECTORY_SEPARATOR . \"user_profile\" . DIRECTORY_SEPARATOR . $this->user->primaryKey . DIRECTORY_SEPARATOR . $this->oldImg;\n\n DTUploadedFile::deleteExistingFile($file);\n }\n }", "public function removeTempFolderNDataAction()\n {\n $user_id = Auth_UserAdapter::getIdentity()->getId();\n Helper_common::deleteDir(SERVER_PUBLIC_PATH.'/images/albums/temp_storage_for_socialize_wall_photos_post/user_'.$user_id.'/');\n }", "public function deleteProductImage($id){\n\t\t\t\t$productImage = Product::where(['id'=>$id])->first();\n\t\t\t\t//echo $productImage->image; die;\n\t\t\t\t//Get Product Image path \n\t\t\t\t$large_image_path = 'images/bimages/products/large/';\n\t\t\t\t$medium_image_path = 'images/bimages/products/medium/';\n\t\t\t\t$small_image_path = 'images/bimages/products/small/';\n\n\t\t\t\t// Delete Large Image if not exists in folder\n\t\t\t\tif (file_exists($large_image_path.$productImage->image)) {\n\t\t\t\t\t\tunlink($large_image_path.$productImage->image);\n\t\t\t\t}\n\n\t\t\t\t// Delete Medium Image if not exists in folder\n\t\t\t\tif (file_exists($medium_image_path.$productImage->image)) {\n\t\t\t\t\t\tunlink($medium_image_path.$productImage->image);\n\t\t\t\t}\n\n\t\t\t\t// Delete Small Image if not exists in folder\n\t\t\t\tif (file_exists($small_image_path.$productImage->image)) {\n\t\t\t\t\t\tunlink($small_image_path.$productImage->image);\n\t\t\t\t}\n\n\t\t\t\t//Deleting Image from products table, not from folder\n\t\t\t\t$product = Product::where(['id'=>$id])->update(['image'=>'']); //But it will not Delete from folder\n\t\t\t\treturn redirect()->back()->with('success','The product image has been deleted !!');\n\t\t\n\t\t}", "public function Remove()\n {\n $file = __DIR__ . \\Extensions\\PHPImageWorkshop\\ImageWorkshop::UPLOAD_PATH . \"/banners/\" . $this->getSrc();\n if (file_exists($file)) {\n unlink($file);\n }\n parent::Remove();\n }", "public function deleteAboutImg(){\n\t\t\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($this->db->query(\"update tblschool_about_school set photo='' where location_id=\".$location_id.\"\"))\n\t\t\t{\t\n\t\t\t\t/*$dir=pathinfo(BASEPATH);\n\t\t\t\t//echo $dir; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img); */\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}", "public function actionDeleteguideimage()\n\t{\n\t $sessionimagesarr = array();\n\t if($_POST['type']=='1'){\n\t\t unlink(Yii::getPathOfAlias('webroot').'/'.$_POST['path']);\n\t\t }else{\t\t \n\t\t $images = Images::model()->find('item_type=:item_type AND item_id=:item_id',array(':item_type'=>'guide','item_id'=>$id));\n\t\t\t unlink( Yii::getPathOfAlias('webroot').'/'.$images->image_path );\n\t\t\t $images->delete();\t\t \n\t\t }\n\t \n\t\t echo 'Deleted';\n\t\t die;\n\t}", "public function deleteImage($image){\n /** @var Image $image */\n $this->em->remove($image);\n $image->onPreRemove();\n $this->em->flush();\n }", "public function actionDelete()\n {\n if (Yii::$app->user->can('imagedelete')) {\n if (Yii::$app->request->isAjax) {\n $system = new Filesystem();\n $param = Yii::$app->request->post();\n $model = $this->findModel($param['id']);\n $system->remove($this->original . $model->unique_name);\n $system->remove($this->thumb_145x145 . $model->unique_name);\n $system->remove($this->thumb_original . $model->unique_name);\n $system->remove($this->thumb_191x128 . $model->unique_name);\n $model->delete();\n }\n } else {\n throw new HttpException(403, 'You are not allowed to access this page', 0);\n }\n }", "public function actionDelete()\n\t{\n\t\t// setting the delete tag as false\n\t\t$deleteObject = Image::model()->findByPk($_GET['imageid']);\n\t\t$deleteObject->deleted = true;\n\t\t$deleteObject->save();\n\t\t\n\t\t// link to the physical image file\n\t\t$deleteMe = $deleteObject->getImageFile('full', false, Image::FULLIMAGEPATH);\n\t\t\t\n\t\t// first the existance of the file has to be evaluated in order to avoid an php error\n\t\tif( file_exists( $deleteMe ) )\n\t\t\trename( \n\t\t\t\t// source\n\t\t\t\t$deleteMe,\n\t\t\t\t// target \n\t\t\t\tImage::DELETEDIMAGEPATH . $deleteObject->imageid . '.' . $deleteObject->tiedostotyyppi\t\t\n\t\t);\n\t\t\n\t\t$deleteObject->deleteImage(array('small', 'light', 'medium', 'large'));\n\t\t\n\t\t$this->redirect(Yii::app()->user->returnUrl);\n\t\t\n\t}", "public function cleanUpFolder()\r\n {\r\n $fs = new Filesystem();\r\n\r\n foreach($this->file_list as $file) :\r\n if ( preg_match('#^'.$this->destination_dir.'/#', $file))\r\n $fs->remove($file);\r\n endforeach;\r\n }", "public function destroy($id)\n {\n $one = Gallery::findOrFail($id);\n $filePath = public_path().'/assets/'.$one->gallery;\n File::delete( $filePath);\n $one->delete();\n }", "protected function removeFilesAndDirectories()\n {\n parent::removeFilesAndDirectories();\n $this->laravel['files']->delete(base_path('routes/admin.php'));\n }", "function unsetImage($uid,$table,$data,$path) {\n\t\n\t $this->db->select($data);\n $this->db->from($table);\n\t\t$this->db->where('uid',$uid);\n $query=$this->db->get();\t\t\n\t\tif($query->num_rows()>0)\n\t\t{\n\t\t $query=$query->result();\n\t\t $img=$query[0]->$data;\n @unlink($path.$img);\n\t\t}\t\n return true;\t\t\n\t}", "public function gallery_delete($id) {\n $this->db->select('business_gallery.*');\n $this->db->from('business_gallery');\n $this->db->where('id', $id);\n $query = $this->db->get();\n $query_result = $query->result();\n if (count($query_result) == 0) {\n $details = $query_result;\n } else {\n $details = $query_result[0];\n }\n\n $path = $this->config->item('business_providers_gallery_path');\n\n unlink($path . $details->business_id . \"/\" . $details->images);\n\n $this->db->where('id', $id);\n $this->db->delete('business_gallery');\n return true;\n }", "function ccontent_images_delete($item)\n\t{\n\t\tlusers_require('images/delete');\n\n\t\t$item = luri_split($item);\n\t\tlloader_load_conf($item[0]);\n\n\t\tlimage_delete_many(lconf_get($item[0], 'images'), $item[1]);\n\n\t\tluri_redirect('main/user/admin/content', l('Images successfully deleted.'));\n\t}", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delCate($id, $img) {\n\n \t$delFilePath=\"uploads/categories/\".$img;\n\n \t$k=DB::table('mainCategories')->where('idMainCategory', $id)->delete();\n\n\t if($k!==\"\") {\n\n\t \t$l=DB::table('subCategories')->where('idSubMainCategory', $id)->delete();\n\n \t\t\n \t\t\t//-- To Delete Added Image From Folder\n\t\t //unlink(public_path($delFilePath));\n\n\t\t Session::put('cateDelMsz', 'Category Deleted Successfully.');\n\t\t \treturn Redirect::to('admin/category');\n\t\n \n\t }\n\t else {\n\n\t Session::put('cateDelMsz', 'Category Not Deleted.');\n\t \treturn Redirect::to('admin/category');\n\t }\n\n }", "function deleteimage()\r\n\t{ \t\r\n\t if (isset($_POST['remove']) && $_POST['remove']=='remove selected')\r\n\t {//get the values \r\n \t $id1 = array();\r\n \t $id1 = $_POST['removeid'];\r\n \t $parentid = $_POST['parentid'];\r\n \t if (count($id1) > 0)\r\n \t { //fetch each and every one check box item\r\n \t foreach ($id1 as $id)\r\n \t {\r\n \t \t$this->categeory_model->deleteimage($id);\r\n \t \tunlink('./assets/fun/image'.$id.'.jpg');\r\n \t\t unlink('./assets/fun/thumbnail_'.$id.'.jpg');\r\n \t }\r\n\t }\r\n\t }\r\n\t else{\r\n\t \t\r\n\t\t$id = $this->uri->segment(4);\r\n\t\t$parentid = $this->uri->segment(5);\r\n\t\t$this->categeory_model->deleteimage($id);\r\n\t\tunlink('./assets/fun/image'.$id.'.jpg');\r\n \t unlink('./assets/fun/thumbnail_'.$id.'.jpg');\r\n\t }\r\n\tredirect('admin/categeory/image_view/'.$parentid);\r\n\t}", "public function destroy($id)\n {\n $tree = Tree::find($id);\n foreach($tree->multipleImage as $data){\n if(file_exists(public_path('uploads/tree/'.$data->tree_image))){\n unlink(public_path('uploads/tree/'.$data->tree_image));\n }\n $data->delete();\n }\n $tree->delete();\n return back()->with('bad_status', 'Tree has been Deleted!');\n }", "public static function clearImages()\n {\n $session = self::getSession();\n unset($session->ids);\n }", "public function deleteTextSectionBoxImg(){\n\t\tif(count($_POST)>0){\t\t\t\n\t\t\t\t\t\t\n\t\t\t$location_id = $_POST['location_id'];\n\t\t\t$this->db->where(\"location_id\", $location_id);\n\t\t\t\n\t\t\tif($this->db->query(\"update tbl_school_text_sections set left_photo='' where location_id=\".$location_id.\"\"))\n\t\t\t{\t\n\t\t\t\t/*$dir=pathinfo(BASEPATH);\n\t\t\t\t//echo $dir; die;\n\t\t\t\t$img=$dir['dirname'].'/'.$_POST['image_path'];\t\t\t\t\n\t\t\t\tunlink($img); */\t\t\t\t\t\n\t\t\t\techo 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}else{\n\t\t\t\techo 0;\n\t\t}\n\t\n\t}" ]
[ "0.7753651", "0.76678807", "0.7543783", "0.7405021", "0.7369806", "0.7352433", "0.72714585", "0.7263035", "0.72488004", "0.72072226", "0.7206396", "0.7204684", "0.7200274", "0.7162082", "0.7056499", "0.70295525", "0.6992369", "0.69893205", "0.6962709", "0.6958996", "0.69490385", "0.6934391", "0.6925866", "0.6909154", "0.69016457", "0.68972296", "0.68955964", "0.6891601", "0.6879315", "0.68533885", "0.68258554", "0.68255574", "0.6820139", "0.68161297", "0.681248", "0.6806425", "0.6794152", "0.67869925", "0.6784011", "0.67835236", "0.67778313", "0.6777772", "0.6768966", "0.6765099", "0.67613554", "0.6759782", "0.67597294", "0.6750415", "0.6740377", "0.6715189", "0.6695645", "0.66845083", "0.6677191", "0.66619664", "0.6661378", "0.66574275", "0.66546863", "0.66360766", "0.66337276", "0.66312313", "0.66259044", "0.6621734", "0.66163445", "0.6611921", "0.6611208", "0.6610891", "0.6605814", "0.65963626", "0.6593495", "0.65868187", "0.6586051", "0.6582241", "0.6563912", "0.6547463", "0.6543828", "0.65362024", "0.65361696", "0.6531362", "0.65280974", "0.6524713", "0.6521629", "0.65136975", "0.65124375", "0.6512041", "0.6491583", "0.64785314", "0.6476637", "0.6475191", "0.6465448", "0.6457312", "0.64507586", "0.64463884", "0.6445931", "0.64436674", "0.64378554", "0.6436849", "0.64337724", "0.64336956", "0.64334863", "0.64285815" ]
0.64474154
91
Display a listing of the resource.
public function index() { $faqs = Faq::all(); return view('admin.faqs.index', ['faqs' => $faqs]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "function listing() {\r\n\r\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446838", "0.7361646", "0.7299749", "0.7246801", "0.7163394", "0.7148201", "0.71318537", "0.7104601", "0.7101873", "0.709985", "0.70487136", "0.69936216", "0.6988242", "0.69347453", "0.68989795", "0.68988764", "0.68909055", "0.68874204", "0.68650436", "0.6848891", "0.6829478", "0.6801521", "0.67970383", "0.6794992", "0.678622", "0.67595136", "0.67416173", "0.6730242", "0.67248064", "0.6724347", "0.6724347", "0.6724347", "0.6717754", "0.67069757", "0.67046493", "0.67045283", "0.66652155", "0.6662764", "0.6659929", "0.6659647", "0.665744", "0.6653796", "0.66483474", "0.6620148", "0.6619058", "0.66164845", "0.6606442", "0.66005665", "0.65998816", "0.6593891", "0.6587057", "0.6584887", "0.65822107", "0.65806025", "0.6576035", "0.65731865", "0.6571651", "0.65702003", "0.6569641", "0.6564336", "0.65618914", "0.65526754", "0.6552204", "0.6545456", "0.653638", "0.65332466", "0.65329266", "0.65268785", "0.6525191", "0.652505", "0.65196913", "0.6517856", "0.6517691", "0.65152586", "0.6515112", "0.6507232", "0.65038383", "0.65013176", "0.64949673", "0.6491598", "0.6486873", "0.64857864", "0.6484881", "0.6483896", "0.64777964", "0.6476692", "0.64711976", "0.6469358", "0.64685416", "0.64659655", "0.6462483", "0.6461606", "0.6459046", "0.6457556", "0.6454214", "0.6453915", "0.64524966", "0.64499927", "0.6448528", "0.6447461", "0.6445687" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('admin.faqs.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }" ]
[ "0.75934863", "0.75934863", "0.7587591", "0.75782615", "0.75711566", "0.74992937", "0.74349296", "0.7432467", "0.7387912", "0.7351958", "0.73380226", "0.73111826", "0.72957826", "0.72812104", "0.72734547", "0.7242778", "0.72294843", "0.7225723", "0.718609", "0.71780044", "0.7173978", "0.71492267", "0.71434265", "0.7143343", "0.71356934", "0.7127626", "0.7122704", "0.71151215", "0.71151215", "0.71151215", "0.711137", "0.7093674", "0.708441", "0.70805633", "0.7079313", "0.70560336", "0.70560336", "0.705535", "0.7038748", "0.7038717", "0.70355713", "0.7033314", "0.70298624", "0.70262384", "0.7025372", "0.70192045", "0.7017566", "0.70037806", "0.70029014", "0.69999987", "0.6995955", "0.6994461", "0.69932437", "0.698907", "0.6985915", "0.69654584", "0.69652516", "0.6956021", "0.6951258", "0.6950627", "0.69471824", "0.69432425", "0.6941303", "0.69406337", "0.6937103", "0.6937103", "0.69363457", "0.6934366", "0.6931313", "0.6927307", "0.6926027", "0.6922591", "0.69176334", "0.69158953", "0.6911744", "0.6910005", "0.6909594", "0.6907657", "0.6902698", "0.6900764", "0.69007087", "0.6900391", "0.68942374", "0.68933", "0.68929493", "0.68912417", "0.68912417", "0.68911326", "0.6888626", "0.6887399", "0.68857414", "0.6884495", "0.6881287", "0.6878567", "0.6875623", "0.687334", "0.68722713", "0.6870009", "0.68697596", "0.6869062", "0.6868769" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $messages = [ 'required' => 'Необходимо заполнить поле :attribute', 'min:5' => 'Минимальное количество символов должно быть 5' ]; $validator = Validator::make($request->all(), [ 'answer' => 'required|min:5', 'question' => 'required|min:5', ], $messages); $faq = new Faq(); $faq->fill($request->all()); if ($faq->save()) { return redirect('admin/faq'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $faq = Faq::find($id); return view('admin.faqs.edit', ['faq' => $faq]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78561044", "0.7695814", "0.72755414", "0.72429216", "0.71737534", "0.7064628", "0.7056257", "0.69859976", "0.6949863", "0.6948435", "0.6942811", "0.69298875", "0.69032556", "0.6900465", "0.6900465", "0.6880163", "0.6865618", "0.68620205", "0.6859499", "0.6847944", "0.6837563", "0.6812879", "0.68089813", "0.6808603", "0.68049484", "0.67966837", "0.6795056", "0.6795056", "0.67909557", "0.6787095", "0.67825735", "0.67783386", "0.6771208", "0.67658216", "0.67488056", "0.67488056", "0.67481846", "0.67474896", "0.67430425", "0.6737776", "0.67283165", "0.6715326", "0.66959506", "0.66939133", "0.6690822", "0.6690126", "0.66885006", "0.6687302", "0.6685716", "0.6672116", "0.6671334", "0.6667436", "0.6667436", "0.6664605", "0.6663487", "0.6662144", "0.6659632", "0.6658028", "0.66556853", "0.6645572", "0.66350394", "0.66338056", "0.6630717", "0.6630717", "0.66214246", "0.66212183", "0.661855", "0.6617633", "0.6612846", "0.66112465", "0.66079855", "0.65980226", "0.6597105", "0.6596064", "0.6593222", "0.65920717", "0.6589676", "0.6582856", "0.65828097", "0.6582112", "0.6578338", "0.65776545", "0.65774703", "0.6572131", "0.65708333", "0.65703875", "0.6569249", "0.6564464", "0.6564464", "0.65628386", "0.6560576", "0.6559898", "0.65583706", "0.6558308", "0.6557277", "0.65571105", "0.6557092", "0.6556115", "0.655001", "0.6549598", "0.6547666" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $messages = [ 'required' => 'Необходимо заполнить поле :attribute', 'min:5' => 'Минимальное количество символов должно быть 5', ]; $validator = Validator::make($request->all(), [ 'answer' => 'required|min:5', 'question' => 'required|min:5', ], $messages); if ($validator->fails()) { $messages = $validator->errors(); $errors = $messages->all(); $errorResults = 'Необходимо исправить следующие ошибки' . '<br>'; foreach ($errors as $error) { $errorResults .= '&nbsp;' . $error . '<br>'; } $request->session()->flash('danger', $errorResults); return back(); } $faq = Faq::where(['id' => $id])->first(); $faq->is_active = false; if ($request->is_active) { $faq->is_active = true; } $faq->answer = $request->answer; $faq->question = $request->question; $faq->order = $request->order; if ($faq->save()) { $request->session()->flash('success', 'Вы успешно изменили FAQ'); return redirect('admin/faq'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update($id);", "public function update($id);", "public function put($path, $data = null);", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7423347", "0.70622426", "0.70568657", "0.6896551", "0.65835553", "0.64519453", "0.6348333", "0.6212436", "0.61450946", "0.6122591", "0.6114199", "0.6101911", "0.60876113", "0.60528636", "0.60177964", "0.6006609", "0.59725446", "0.594558", "0.59395295", "0.5938792", "0.5893703", "0.5862337", "0.58523124", "0.58523124", "0.5851579", "0.5815571", "0.58067423", "0.5750728", "0.5750728", "0.5736541", "0.5723664", "0.5715135", "0.56949675", "0.5691129", "0.56882757", "0.5669375", "0.5655524", "0.56517446", "0.5647158", "0.5636521", "0.563466", "0.5632965", "0.56322825", "0.56291395", "0.56202215", "0.56087196", "0.56020856", "0.5591966", "0.5581127", "0.5581055", "0.558085", "0.5575458", "0.55706805", "0.55670804", "0.55629116", "0.5562565", "0.5558853", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.555572", "0.5555007", "0.5553948", "0.5553837", "0.5553147", "0.55429846", "0.5541925", "0.5540208", "0.5539145", "0.5536157", "0.55350804", "0.5534241", "0.5523782", "0.5518406", "0.55147856", "0.5513397", "0.550961", "0.55072165", "0.55067354", "0.5503418", "0.5501671", "0.55010796", "0.54998124", "0.5497327", "0.54942787", "0.54942036", "0.54942036", "0.54935455", "0.549267", "0.5491964", "0.5489983", "0.54833627", "0.54794145", "0.5478835", "0.5478348", "0.5465178", "0.54648995", "0.54607797", "0.54571307" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $faq = Faq::find($id); $faq->delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
die($_POST['email'] . " " . $_POST['password']);
public function confirm() { $email = $_POST['email']; $password = $_POST['password']; $confirmed = $this->login->CheckLogin($email, $password); $general_setting = $this->web->GetAll("g_s_id", "general_setting"); //die('we are here'); if ($confirmed) { $newdata = array( 'email' => $confirmed[0]->email, 'name' => $confirmed[0]->name, 'user_id' => $confirmed[0]->id, 'user_group_id' => $confirmed[0]->user_group_id, 'company_logo' => $general_setting[0]->company_logo, 'company_view_logo' => $general_setting[0]->company_view_logo, 'company_invoice_logo' => $general_setting[0]->company_invoice_logo, 'company_name' => $general_setting[0]->company_name, 'currency_symbol' => $general_setting[0]->currency_symbol, 'company_address' => $general_setting[0]->company_address, 'user_store_id' => $confirmed[0]->user_store_id, 'user_warehouse_id' => $confirmed[0]->user_warehouse_id, 'logged_in' => TRUE, 'failed' => false ); $this->session->set_userdata($newdata); echo "done"; } else { $newdata = array( 'failed' => TRUE ); $this->session->set_userdata($newdata); echo "failed"; } // die($email . " " . $password); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function login_obscure()\n {\n return '<strong>Whoops</strong>: Your username or password are incorrect, please try again.';\n }", "function died($error) {\r\n \r\n echo \"<h1>Whoops!</h1><h2>There appears to be something wrong with your submission.</h2>\";\r\n \r\n echo \"<strong><p>The following items are not specified correctly.</p></strong><br />\";\r\n \r\n echo $error.\"<br /><br />\";\r\n \r\n echo \"<p>Return to the form and try again.</p><br />\";\r\n\t\techo \"<p><a href='index.php'>return to the homepage</a></p>\";\r\n die();\r\n\t\t\r\n \r\n }", "function dame1(){\n\tif(isset($_POST[\"enviando\"])){\n\t\t$usuario = $_POST[\"nombre_usuario\"];\n\t\t$password = $_POST[\"pass_usuario\"];\n\n\t\tif ($usuario==\"jeyson\"&& $password==\"1234\") {\n\t\t\techo \"<p class='validado'> Bienvenido </p>\";\n\n\t\t} else {\n\t\t\techo \"<p class='no_validado'> Usuario y/o password incorrecta </p>\";\n\t\t}\n\t\t\n\n\t}\n}", "function wp_login_obscure()\n{\n\treturn '<strong>Error</strong>: wrong username or password';\n}", "function the_post_password()\n {\n }", "function validate() {\n\t\t\t$email = htmlspecialchars($_POST['email']);\n\t\t\t$ad = Admin::auth($email);\n\t\t\t$pass = $_POST['pass']; \n\t\t\tif ($pass== $ad['contrasenia']) {\n\t\t\t\t$_SESSION['admin'] = $ad;\n\t\t\t\theader(\"Location: ../../contenido/principal/\");\n\t\t\t}else {\n\t\t\t\theader(\"Location: ../../login/\");\n\t\t\t}\n\n\t\t}", "function died($error) {\n\necho \"We are very sorry, but there were error(s) found with the form you submitted. \";\n\necho \"These errors appear below.<br /><br />\";\n\necho $error.\"<br /><br />\";\n\necho \"Please go back and fix these errors.<br /><br />\";\n\ndie();\n\n}", "function validate_form(){\n\tif(empty($_POST['firstname'])) {\n\t\tthrow new Exception(\"Please enter your first name.\");\n\t}\n\tif(empty($_POST['lastname'])) {\n\t\tthrow new Exception(\"Please enter your last name.\");\n\t}\n\tif(empty($_POST['password'])) {\n\t\tthrow new Exception(\"Please enter the password.\");\n\t}\n\tif(empty($_POST['password_confirmation'])) {\n\t\tthrow new Exception(\"Please confirm the password.\");\n\t}\n\tif($_POST['password'] != $_POST['password_confirmation']){\n\t\tthrow new Exception(\"Passwords do not match.\");\n\t}\n\t// Make sure the user entered a valid E-Mail address\n\tif(!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {\n\t\tthrow new Exception(\"Invalid E-Mail Address\");\n\t}\n}", "function forgotUNPWForm(){\n\n\tsession_start();\n\n\techo \"<h1>Please fill in the following information:</h1>\n\t\t<form action=\\\"cms_forgotUsernamePasswordSubmit.php\\\" method=\\\"post\\\">\n\t\tEmail: <input name=\\\"email\\\" type=\\\"text\\\" value=\\\"\\\"><br>\n\t\tSecurity Question: What month, day, and year were you born?<br>\n\t\tMonth: <input name=\\\"month\\\" type=\\\"text\\\" value=\\\"\\\"><br>\n\t\tDay: <input name=\\\"day\\\" type=\\\"text\\\" value=\\\"\\\"><br>\n\t\tYear: Month: <input name=\\\"year\\\" type=\\\"text\\\" value=\\\"\\\"><br>\n\t\t<input name=\\\"create\\\" type=\\\"submit\\\" value=\\\"Submit\\\"></input>\n\t\t</form>\";\n\n}", "function failed_login () {\n\t\n return 'Your username and/or password is incorrect.';\n\n}", "public function test_fail_login() {\n $_POST = array('name' => \"customer2\", 'password' => \"123:\");\n $expected = json_encode(array(\"status\" => 0, \"message\" => \"Username or password is incorrect\"));\n $this->expectOutputString($expected);\n $this->object->main();\n }", "function died($error) {\n echo \"<br />\";\n \n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n die();\n \n }", "function died($error) {\r\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\r\n echo \"These errors appear below.<br /><br />\";\r\n echo $error.\"<br /><br />\";\r\n echo \"Please go back and fix these errors.<br /><br />\";\r\n die();\r\n }", "function died($error) {\r\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\r\n echo \"These errors appear below.<br /><br />\";\r\n echo $error.\"<br /><br />\";\r\n echo \"Please go back and fix these errors.<br /><br />\";\r\n die();\r\n }", "function died($error) {\n \n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n die();\n \n }", "function print_login_form($error) {\n\techo '\n <form method=\"post\" action=\"index.php\">\n <label>\n \tUsername: \n \t<input name=\"username\" type=\"text\">\n </label>\n <label>\n \tPassword: \n \t<input name=\"password\" type=\"password\">\n </label>\n <input type=\"submit\" name=\"action\" value=\"Login\"> \n '.$error.'\n </form>\n ';\n}", "function died($error) {\r\n echo \"Sentimos muito mas o formulário enviado contém erros<br/>\";\r\n echo \"Os erros seguintes apareceram:<br /><br />\";\r\n echo $error.\"<br /><br />\";\r\n echo \"Por favor, volte e corrija-os.<br /><br />\";\r\n die();\r\n }", "function died($error) {\n\t\techo \"We're sorry, but there is an error found with the form you submitted.<br /><br />\";\n\t\techo $error.\"<br /><br />\";\n\t\techo \"Please go back and fix this error.<br /><br />\";\n\t\tdie();\n\t}", "function auth()\n{\n $return = urlencode($_SERVER['REQUEST_URI']);\n\n if (isset($_POST['username']) && isset($_POST['passwd'])) {\n if (!verify_password($_POST['username'], $_POST['passwd'])) {\n header ('Location: https://doc.php.net/login.php?return='.$return);\n exit;\n }\n } else {\n header ('Location: https://doc.php.net/login.php?return='.$return);\n exit;\n }\n}", "function died($error) {\n\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n\n echo \"These errors appear below.<br /><br />\";\n\n echo $error.\"<br /><br />\";\n\n echo \"Please go back and fix these errors.<br /><br />\";\n\n die();\n\n}", "function login_error() {\n echo \"<div class='alert alert-danger'>Invalid username/password\n combination.</div><br><a href='user_login.php'><button type='button'\n class='btn btn-primary'>Return To Login Page</button></a>\";\n echo \"</div>\";\n exit;\n }", "function print_error($reason,$type = 0) {\n global $version, $header_file, $footer_file, $testing, $post_info, $key;\n global $val, $_POST, $recipient;\n// for missing required data\n // if ($type == \"missing\") {\nhtml_header(\"error\");\n?>\n<p>&nbsp;</p>\n<div align=\"center\">\n<table width=\"500\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\" bgcolor=\"#CCCCCC\">\n <tr>\n <td><strong>The form was not submitted because it contained the following reasons:</strong><br>\n\t<ul>\n\t<?=$reason?>\n\t</ul>\n <p>Please use your browser's back button to return to the form and try again.</p>\n\t</td>\n </tr>\n</table></div>\n<?php\n if($testing == 1) {\n $post_info = $_POST;\n print(\"<p><strong>This script is in testing mode:</strong> <br> Here are the post variables:</p><br>\");\n foreach($post_info as $key=>$val) { print(\"$key: $val<br>\");}\n print(\"<br>And the email would have been sent to: $recipient\"); \n }\n html_footer();\n exit; \n}", "public function password(){\n $_error = \"enter the password\";\n\t\treturn $_error;\n\t}", "function error_and_die($msg) {\n echo ('<p><span style=\"color:#ff0000; font-size:1.5em;\">SubmissionBox Error Encountered</span></p>');\n echo ('<p><span style=\"color:#ff0000;\">Message: ' . $msg . '</span></p></body></html>');\n die;\n }", "function wp_validate_application_password($input_user)\n {\n }", "public function testLoginSubmissionWrongEmailAndPassword()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('txt-email', '[email protected]')\n ->type('txt-password', 'wrongpassword123')\n ->press('Sign in')\n ->assertSee('Invalid credentials entered.');\n });\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "private function isNotPost() : void\n {\n if(!($_SERVER['REQUEST_METHOD'] === 'POST'))\n {\n (new Session())->set('user','error', InputError::basicError());\n header('Location:' . self::REDIRECT_SIGNIN);\n die();\n }\n }", "function show_form($email,$pass1,$pass2) {\r\n echo '<form action=\"addadmin.php\" method=\"POST\">' ;\r\n echo '<p>Add Email: <input type=\"text\" name=\"email\" value=\"' . $email . '\"> </p> ' ;\r\n echo '<p>With Password: <input type=\"password\" name=\"pass1\" value=\"' . $pass1 . '\"></p>' ;\r\n echo '<p>Repeat Password: <input type=\"password\" name=\"pass2\" value=\"' . $pass2 . '\"></p>' ; \r\n echo '<p><input type=\"submit\"></p>' ;\r\n echo '</form>' ;\r\n}", "function post_password_required($post = \\null)\n {\n }", "function alt_failed_login()\n {\n return 'The login information you have entered is incorrect.';\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function died($error) {\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n echo \"These errors appear below.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Please go back and fix these errors.<br /><br />\";\n die();\n }", "function password($pass)\n\t{\n\t\tif (strcmp($pass, AUCTION_PASSWORD))\n\t\t\texit(\"Wrong password\");\n\t}", "public function access() {\n \tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\n \t\t$user = Auth::login($_POST['email'], $_POST['pw']);\n \t\tif($user) {\n \t\t\tApp::redirect('dashboard');\n \t\t}\n\t\t\tSession::set('_old_input', $_POST);\n\t\t\tSession::set('_errors', ['login' => \"Email y/o password incorrectos.\"]);\n\t\t\tApp::redirect('login');\n\n \t}\n\n }", "function died($error) {\n\t\techo $template_1;\n\t\techo \"We're sorry, but there's errors found with the form you submitted.<br /><br />\";\n\t\techo $error.\"<br /><br />\";\n\t\techo \"<a href='contact.html'>Please go back</a> and fix these errors.<br /><br />\";\n\t\techo $template_2;\n\t\tdie();\n\t}", "function died($error) {\n\t\techo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n\t\techo \"These errors appear below.<br /><br />\";\n\t\techo $error.\"<br /><br />\";\n\t\techo \"Please go back and fix these errors.<br /><br />\";\n\t\tdie();\n\t}", "function isValidInsert($user)\n{ \n echo $user;\n return isset($user['email']) &&\n isset($user['password']) ;\n}", "function died($error) {\n echo \"<h3>We are very sorry, but there were error(s) found with the form you submitted.</h3>\";\n echo \"<h3>These errors appear below.</h3>\";\n echo \"<h3>\".$error.\"</h3>\";\n echo \"<h3>Please go back and fix these errors.</h3>\";\n die();\n }", "function died($error) {\n header('location: index.html?status=error');\n echo \"We are very sorry, but there were error(s) found with the form you submitted. \";\n \n echo \"These errors appear below.<br /><br />\";\n \n echo $error.\"<br /><br />\";\n \n echo \"Please go back and fix these errors.<br /><br />\";\n \n \n \n die();\n \n }", "function invalid_input($error_msg='') {\n if (empty($error_msg)) {\n die('An unexpected error occurred. Go back and try again.');\n } else {\n die($error_msg);\n }\n}", "public function register () {\r\n if (isset($_POST['submitr'])) {\r\n\r\n $fnm = addslashes(strip_tags($_POST['fname']));\r\n $lnm = addslashes(strip_tags($_POST['lname']));\r\n $email = addslashes(strip_tags($_POST['emailr']));\r\n $pwd = addslashes(strip_tags($_POST['pwdr']));\r\n\r\n if ($fnm !==\"\" && $lnm !==\"\" && $email !==\"\" && $pwd!==\"\") {\r\n\r\n\r\n $s = \"INSERT INTO users (firstName,lastName,email, password) VALUES (?,?,?,?)\";\r\n $sql = $this->_r-> prepare($s);\r\n $sql->execute(array($fnm,$lnm,$email,$pwd));\r\n\r\n echo \"Successfully registered\";\r\n\r\n\r\n\r\n }else {\r\n echo \"Please fill all the information\";\r\n }\r\n\r\n }\r\n\r\n\r\n }", "private static function validatePost() {\n if ( !isset($_POST['email']) ) {\n return false;\n }\n if ( !isset($_POST['password']) ) {\n return false;\n }\n if ( empty($_POST['email']) ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return false;\n }\n if ( empty($_POST['password']) ) {\n self::setError('Unbekannter Benutzername oder Passwort!<br>');\n return false;\n }\n return true;\n }", "function login(){\r\n\techo '<form action=\"demo_form.php\" method=\"post\">';\r\n\techo '<p>Username (email):';\r\n\techo '<input type=\"text\" name=\"email\"><br>';\r\n\techo '<p>Password:';\r\n\techo '<input type=\"password\" name=\"password\"><br>';\r\n\techo '<input type=\"submit\" value=\"Submit\">';\r\n\techo '</form>';\r\n\r\n\t\r\n}", "function user_pass_ok($user_login, $user_pass)\n {\n }", "public function forgot_pwd()\r\n {\r\n //provided the correct combination of user name and email address\r\n\r\n $username = htmlspecialchars($_POST['username']);\r\n $email = htmlspecialchars($_POST['email']);\r\n\r\n require_once 'database/profile.php';\r\n require_once 'database/session.php';\r\n\r\n $usernameId = getUserId($username);\r\n if (!$usernameId) {\r\n return \"Username does not exist.\";\r\n }\r\n\r\n $userInfo = getProfile($usernameId);\r\n if ($userInfo[\"email\"] != $email) {\r\n return \"Email doesn't match the one we have on file.\";\r\n }\r\n\r\n $password = getPassword($userId);\r\n return $this->send_forgotten_pwd($username, $password, $email);\r\n \r\n }", "function validateLogin($destination) {\r\n\t$username = $_POST[\"username\"];\r\n\t$password = $_POST[\"password\"];\r\n\t$attempt = \"$username\".\":\".\"$password\".\"\\n\";\r\n\t$successfulLogin = false;\r\n\t\r\n\t$data = file(\"./passwd.txt\");\r\n\tforeach ($data as $try) {\r\n\t\tif ($attempt == $try) {\r\n\t\t\t$successfulLogin = true;\r\n\t\t}\r\n\t}\r\n\tif ($successfulLogin) {\r\n\t\tshowArticle($destination);\r\n\t}\r\n\telse {\r\n\t\tloginPrompt();\r\n\t\tprint <<<ALERT\r\n\t\t\t<script language=\"javascript\">;\r\n\t\t\talert(\"Invalid username or password. Please create an account if you don't have one.\");\r\n\t\t\t</script>\r\nALERT;\r\n\t}\r\n}", "function RedirectUser(){\r\n\t\t\r\n\t\t\tif (empty($email) || empty($userName) || empty($pwd)){\r\n\t\t\t\techo \"<script type='text/Javascript'> alert('Please fill out all required fields')</script>\";\r\n\t\t\t\techo \"<script type='text/Javascript'> window.location.href='landing.php'</script>\";\r\n\t\t\t}\r\n\t\t\r\n\t}", "public function testLoginSubmissionRightEmailAndWrongPassword()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->type('txt-email', '[email protected]')\n ->type('txt-password', 'wrongpassword123')\n ->press('Sign in')\n ->assertSee('Invalid credentials entered.');\n });\n }", "function isDataValid()\n{\n $errorMessage = null;\n if (!isset($_POST['email']) or trim($_POST['email']) == '') {\n $errorMessage .= 'You must enter your <b>Email</b> <br/>';\n }\n if (!isset($_POST['password']) or trim($_POST['password']) == '') {\n $errorMessage .= 'You must enter your <b>Password</b> <br/>';\n }\n if ($errorMessage !== null) {\n echo <<<EOM\n <div class=\"container\">\n <h1>Sorry, the information is incorrect. Pleace check again.</h1>\n <p> Error: <br/> $errorMessage </p>\n EOM;\n return false;\n } else {\n return true;\n }\n}", "function died($error) {\n echo \"Lo sentimos, pero hay algunos errores con el formulario enviado.\";\n echo \"Estos errores se muestran a continuación.<br /><br />\";\n echo $error.\"<br /><br />\";\n echo \"Por favor corrija estos errores.<br /><br />\";\n die();\n }", "function pretty_die($text)\n{\n\tif (DEBUG)\n\t\tdie(\"<div class=\\\"error\\\">$text</div>\");\n\telse\n\t\tdie(\"<div class=\\\"error\\\">An error occured. Please contact the administrator.</div>\");\n}", "function incorrectLogin(){\r\n echo '<script type=\"text/javascript\">';\r\n echo 'alert(\"Incorrect login\")';\r\n echo '</script>';\r\n }", "private static function sanitize(){\n $_SERVER[\"PHP_AUTH_USER\"] = filter_var(filter_var($_SERVER[\"PHP_AUTH_USER\"], FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL);\n\n\t\tif (!$_SERVER[\"PHP_AUTH_USER\"]){\n\t\t\t// if email validation has failed\n\t\t\tthrow new UsernameNotAValidEmailAddress (\"Submitted UserName is not a valid email address\");\n\t\t}\n\n // sanitise POST data UserName\n Connection::$input['UserName'] = $_SERVER[\"PHP_AUTH_USER\"]; // This should never be sent in the post variables, instead, username should be sent in the header.\n Connection::$input['Password'] = $_SERVER[\"PHP_AUTH_PW\"]; // This also prevents UserName being updated.\n // A new password may be (in the future) sent via POST, but for now, this should not be updatable through this method.\n\n }", "function authenticate(array $credentials)\n {\n die(\"aaaaaaaaaaaa\");\n }", "function dump_die ($data){\n echo \"<pre>\";\n var_dump($data);\n echo \"</pre>\";\n die();\n}", "function doadduser() {\n\n if(isset($_POST['name'])) {\n \n $regstr = new Registration();\n \n $usrinpt = $regstr->badinput();\n \n if(empty($usrinpt)) {\n \n $acct = $regstr->adduseraccount();\n \n if(empty($acct)) {\n \n header('location:successlanding.php');\n \n }\n \n else {\n \n echo \"<script>invalidmsg(\\\"$acct\\\")</script>\"; \n \n } \n \n }\n \n else {\n \n $usrinpt = str_replace(array(\"\\r\", \"\\n\"), '', $usrinpt);\n \n echo \"<script>invalidmsg(\\\"$usrinpt\\\")</script>\"; \n \n }\n \n }\n \n else {\n \n return;\n \n }\n\n}", "function login() {\n\n\techo '<h1 id=\"loginwarning\">Welcome Guest</h1>\n\t\t\t<form action=\"'. $_SERVER['PHP_SELF'] .'\" method=\"post\">\n\t\t\t\t<fieldset>\n\t\t\t\t\tUsername: <input type=\"text\" name=\"login\" />\n\t\t\t\t\t<input type=\"submit\" value=\"Login\" class=\"button\" onclick=\"return validateLoginDetails(this.form.login.value)\" />\n\t\t\t\t</fieldset>\n\t\t\t</form>';\n\n}", "public function login_action() \n\t{\n $rules = array(\n 'mail' => 'valid_email|required',\n 'pass' => 'required'\n );\n \n \n //validate the info\n $validated = FormValidation::is_valid($_POST, $rules);\n \n // Check if validation was successful\n if($validated !== TRUE): \n \n //exit with an error\n exit(Alert::error(false, true, $validated));\n\n endif;\n\n // they've passed the filter login try and log 'em in\n\t\tUserModel::login(); \n }", "function test_authourization_fun( $vars ){\r\n\r\n if (isset($_GET['user']) && $_GET['user']){\r\n $_SERVER[\"PHP_AUTH_USER\"] = $_GET['user'];\r\n }else{\r\n $_SERVER[\"PHP_AUTH_USER\"] = 'NOUSER';\r\n }\r\n if (isset($_GET['pw']) && $_GET['pw']){\r\n $_SERVER[\"PHP_AUTH_PW\"] = $_GET['pw'];\r\n }else{\r\n $_SERVER[\"PHP_AUTH_PW\"] = 'ERRORPASSWORD';\r\n }\r\n}", "public function register($username, $email, $register_error) {\n $register .= \"\n \".$register_error.\"\n <form method='POST' action='index.php?section=public&amp;page=login&amp;action=register_submit'>\n <table style='width:100%'>\n <tr><td width='40%'><label for='form-username'>Username:</label></td><td><input type='text' id='form-username' name='username' value='\".$username.\"' /></td></tr>\n <tr><td colspan='2' class='form-explanation'>Enter the username that you will use to login to your game. Only alpha-numerical characters are allowed.</td></tr>\n\n <tr><td><label for='form-password'>Password:</label></td><td><input type='password' id='form-password' name='password' value='' /></td></tr>\n <tr><td colspan='2' class='form-explanation'>Type in your desired password. Only alpha-numerical characters are allowed.</td></tr>\n\n <tr><td><label for='form-password-confirm'>Verify Password:</label></td><td><input type='password' id='form-password-confirm' name='password_confirm' value='' /></td></tr>\n <tr><td colspan='2' class='form-explanation'>Please re-type your password.</td></tr>\n\n <tr><td><label for='form-email'>Email:</label></td><td><input type='text' id='form-email' name='email' value='\".$email.\"' /></td></tr>\n <tr><td colspan='2' class='form-explanation'>Enter your email address. Only alpha-numerical characters are allowed.</td></tr>\n\n <tr><td><label for='form-email-confirm'>Verify Email:</label></td><td><input type='text' id='form-email-confirm' name='email_confirm' value='' /></td></tr>\n <tr><td colspan='2' class='form-explanation'>Please re-type your email address.</td></tr>\n\n <tr><td colspan='2'><input type='submit' name='register' value='Register!'></td></tr>\n </table>\n </form>\";\n return $register;\n }", "function died($error) {\n \n echo \"Oeps, de volgende dingen zijn er fout gegaan!<br />\";\n echo $error.\"<br /><br />\";\n die(); \n }", "function autho($pass_input, $email, $db)\n{\n\n$pass_input = $_POST['Password'];\n$email = $_POST['Email'];\n\n$req_get = $db->prepare(\"SELECT password FROM users WHERE email = ?\");\n$req_get->execute(array($_POST[\"Email\"]));\n$password = $req_get->fetch();\n\n$verify = password_verify($pass_input, $password['password']);\necho \"<br>\";\necho \"<br>\";\necho \"<br>\";\n\nif ($verify)\n{\n\theader('Location: index.php');\n\t$req_get = $db->prepare(\"SELECT name FROM users WHERE email = ?\");\n\t$req_get->execute(array($_POST[\"Email\"]));\n\t$name = $req_get->fetch();\n\t//var_dump($name);\n\n\t$_SESSION['name'] = $name['name'];\n\tunset($_SESSION['error']);\n}\n\nelse \n{\n\t\t$_SESSION['error'] = \"invalid email or password\";\n\t\theader('Location: login.php');\n\t\n}\n\n\n\n\n\n\n}", "function writeError($method)\r\n{\r\n if (!empty($_POST))\r\n {\r\n if ($_POST['method'] == 'login' && !authenticateUser() && $method == \"login\")\r\n {\r\n echo \"<span class='php_error' id='login_error_php'>The email or password is incorrect</span>\";\r\n }\r\n else if ($_POST['method'] == 'signup' && !registerUser() && $method == \"signup\")\r\n {\r\n echo \"<span class='php_error'>This email is already in use</span>\";\r\n }\r\n }\r\n if ($method == 'request')\r\n {\r\n echo \"<span class='php_error' id='login_error_php'>Please <b>sign in</b> or <b>register</b></br>to request a delivery</span>\";\r\n }\r\n if ($method == 'deliveries')\r\n {\r\n echo \"<span class='php_error' id='login_error_php'>Please <b>sign in</b> or <b>register</b></br>to view your deliveries</span>\";\r\n }\r\n if ($method == 'tracking')\r\n {\r\n echo \"<span class='php_error' id='login_error_php'>Please <b>sign in</b> or <b>register</b></br>to track a delivery</span>\";\r\n }\r\n}", "public function invalidPassword() {\n\t\t$this->messages[] = \"Lösenorden har för få tecken. Minst 6 tecken.\";\n\t}", "function debugPost(){\n foreach ($_POST as $key => $value) {\n echo \"<tr>\";\n echo \"<td>&nbsp\";\n echo $key;\n echo \"</td>\";\n echo \"<td>&nbsp\";\n echo $value;\n echo \"</td>\";\n echo \"</tr><br>\";\n }\n }", "function invalidDetails($email, $msg){\n\t$url = '/index.php?'.'msg='.$msg.'&email='.$email;\n\theader(\"Location: \".$url);\n}", "function authError()\r\n\t{\r\n\t\t$ajax = ajax();\r\n\t\t\r\n\t\t$ajax->warning(\"Could no Authenticate. Please re-login\");\r\n\t}", "function displayPasswordNotSetNotice()\n{\n?>\n <div class=\"warning\">\n <h3>Almost there...</h3>\n <p>Before using this demo, you must set an application password\n to protect your account. You will also need to set your\n Google Apps credentials in order to communicate with the Google\n Apps servers.</p>\n <p>To continue, open this file in a text editor and fill\n out the information in the configuration section.</p>\n </div>\n<?php\n}", "public function validateLogin(){\n // store fieldnames inside the $fieldnames variable\n $fieldnames = ['email', 'password'];\n\n // initialize $error variable and set it as FALSE\n $error = FALSE;\n\n // for each $fieldname, check if its set or empty, if the fieldname is not set or empty then set $error as TRUE\n foreach($fieldnames as $fieldname){\n if(!isset($_POST[$fieldname]) || empty($_POST[$fieldname])){\n $error = TRUE;\n }\n }\n\n // if $error is FALSE\n if(!$error){\n // create variables with $_POST data\n $email = $_POST[\"email\"];\n $wachtwoord = $_POST[\"password\"];\n\n // create new db connection \n $db = new Db('localhost', 'root', '', 'project1', 'utf8');\n\n // login the user\n $db->login($email, $wachtwoord);\n } else{\n // if $error is equal to TRUE then echo Verkeerd wachtwoord of username\n echo '<label>Verkeerd wachtwoord of username</label>';\n }\n }", "public function testWrongFieldsData()\n {\n $response = $this->call('POST','api/auth/login',array(\"email\"=>\"[email protected]\",\"password\"=>\"test\"));\n\n $this->assertEquals(401,$response->status());\n }", "function error_form($diffpwd,$errdate,$presente,$email, $pwd, $pwd2, $nome, $cognome, $giorno_n, $mese_n, $anno_n){\n\techo \"<h1>Registrati</h1> <form action=registrazione.php method=POST>\";\n\tif($presente)\n\t\techo \"Inserisci la tua mail<br/> <input type=email name=email /><br/><font color=red>email gi&agrave presente</font><br/><br/>\";\n\telse\n\t\techo \"Inserisci la tua mail<br/> <input type=email name=email value=\".$email.\" /><br/><br/>\";\n\techo \"Inserisci la password<br/> <input type=password name=pwd />\";\n\techo \"<br/><br/>Ripeti la password<br/> <input type=password name=pwd2 />\";\n\tif($diffpwd)\n\t\techo \"<br/><font color=red>password e password di conferma differenti</font></br>\";\n\techo \"<br/><br/>Inserisci nome<br/> <input type=text name=nome value=\".$nome.\" /><br/>\";\n\techo \"Inserisci cognome<br/> <input type=text name=cognome value=\".$cognome.\" /><br/><br/>\";\n\techo \"Inserisci data di nascita<br/>\"; create_and_set_form_data($giorno_n,$mese_n,$anno_n);\n\tif ($errdate)\n\t\techo \"<br/><font color=red>Data non corretta</font>\";\n\techo \"<br/><br/>\";\n\tdynamic_options();\n\techo \" <input type=submit name=registrazione value=Registrati /></form>\";\n}", "function message_die($msg_text = \"\")\r\n{\r\n\tprint($msg_text);\r\n\texit;\r\n}", "function checkEmail($errorString) {\n if(strlen($_POST[\"email\"]) > 64) { // (1)\n return $errorString.\"Email může být dlouhý maximálně <b>64</b> znaků.<br>\";\n }\n return $errorString;\n}", "public function action_login_post()\n\t{\n\t\t// Must be logged out\n\t\tif (Auth::logged_in())\n\t\t{\n\t\t\tset_error('You must be logged out to login!');\n\t\t\tredirect(site_url());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// No post or invalid post\n\t\tif (! isset($_POST['username']) OR ! isset($_POST['password']))\n\t\t{\n\t\t\tset_error(\"You didn't submit a username/password.\");\n\t\t\tredirect(site_url());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Do the auth method\n\t\t$do_auth = Auth::auth_with_check($_POST['username'], $_POST['password']);\n\t\t\n\t\t// We're in error\n\t\tif (is_simple_error($do_auth))\n\t\t{\n\t\t\tset_error($do_auth);\n\t\t\tredirect(site_url());\n\t\t}\n\t\t\n\t\t//\tAuth passed!\n\t\tset_good('Welcome!');\n\t\t$login_redirect = $this->session->userdata('login_redirect');\n\t\t\n\t\tif (! $login_redirect) :\n redirect(base_url());\n\t\telse :\n\t\t\tredirect($login_redirect);\n endif;\n\t}", "function password_recovery()\n\t{\n\n\n\t}", "function PMA_auth_fails()\n {\n // Deletes password cookie and displays the login form\n setcookie('pma_cookie_password', '', 0, $GLOBALS['cookie_path'], '' , $GLOBALS['is_https']);\n PMA_auth();\n\n return TRUE;\n }", "function _verify()\n {\n $e = \"\";\n if (isset($_POST['login'])) {\n $user = validate($_POST['gebruikersnaam']);\n $pass = validate($_POST['wachtwoord']);\n\n if (strlen($user) < 3 || strlen($user) > 20) {\n $e .= '<p class=\"text-danger mb-n1\">Voer een geldige gebruikersnaam in!</p>';\n }\n if (strlen($pass) < 3 || strlen($pass) > 20) {\n $e .= '<p class=\"text-danger mb-n1\">Voer een geldige wachtwoord in!</p>';\n } else if ($this->mismatch) {\n $e .= '<p class=\"text-danger mb-n1\">Gebruikersnaam en/of wachtwoord komen niet overeen!</p>';\n }\n return $e;\n }\n return $e;\n }", "function adminCheck($adminPW) {\n\t\t\t// if yes redirect admin to the admin page\n\t\t\tif ($_POST['password'] == $adminPW) {\n\t\t\t\theader('Location: admin.php'); \n\t\t\t} else {\n\t\t\t\t$submitErr = \"Invailed login.\";\n\t\t\t}\n\t\t}", "function died($error) {\n echo \"Na vjen keq, kodi ka gabime gjate dergimit. \"; \n echo \"Kto errore do te shfaqen me poshte.<br /><br />\"; \n echo $error.\"<br /><br />\"; \n echo \"Ju lutemi, shkoni prapa dhe provoni prape mbushni formen.<br /><br />\"; \n die(); \n }", "function requirePOST(...$args) {\n foreach ($args as $field) {\n if (!isset($_POST[$field])) die(\"Missing data!\\n\");\n }\n}", "function login_code($quiet)\n{\n\t//return value of 1 means don't do anything else\n\t\t//the login script has closed the fence for some reason\n\tglobal $mysql_db, $config;\n\t#TODO : produce the div tags when quiet=1 and output is actually produced\n\tif ($quiet == 0)\n\t{\n\t\t//this div includes login, logout, and change password widgets\n\t\techo \"<div id=\\\"login_control\\\">\\n\";\n\t}\n\t$retv = 0;\n\tif (!(array_key_exists(\"HTTPS\", $_SERVER)))\n\t{\n\t\t$_SERVER[\"HTTPS\"] = \"off\";\n\t}\n\t\n\tif (($_SERVER[\"HTTPS\"] != \"on\") && ($config['require_https'] == 1))\n\t{\n\t\techo \"HTTPS is required<br >\\n\";\n\t\t$retv = 1;\n\t}\n\n\tif (($_POST[\"action\"] == \"create_user\") && ($config['allow_user_create']=1))\n\t{\n\t\tif (isset($_POST[\"username\"]))\n\t\t{\n\t\t\t$attempt_username = $mysql_db->real_escape_string($_POST[\"username\"]);\n\t\t\t\n\t\t\tif (isset($_POST[\"email\"]))\n\t\t\t{\n\t\t\t\t$attempt_email = $mysql_db->real_escape_string($_POST[\"email\"]);\n\t\t\t\tif (isset($_POST[\"pass2\"]))\n\t\t\t\t{\n\t\t\t\t\t$attempt_pass1 = $mysql_db->real_escape_string($_POST[\"pass2\"]);\n\t\t\t\t\tif (isset($_POST[\"pass3\"]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$attempt_pass2 = $mysql_db->real_escape_string($_POST[\"pass3\"]);\t\t\t\t\t\t\n\t\t\t\t\t\tif ($attempt_pass1 != $attempt_pass2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"Passwords do not match!<br>\\n\";\n\t\t\t\t\t\t\t$_POST[\"action\"] = \"register\";\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\tif (($attempt_pass1 != '') && \n\t\t\t\t\t\t\t\t($attempt_username != '') &&\n\t\t\t\t\t\t\t\t($attempt_email != ''))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (attempt_registration($attempt_username, $attempt_email, $attempt_pass1)==0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo \"Failed to register<br>\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\techo \"Registered successfully<br>\\n\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$_POST[\"action\"] = \"register\";\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\t}\n\t\n\t//If chain to determine what to do\n\tif (($_POST[\"action\"] == \"register\") && ($config['allow_user_create']=1))\n\t{\n\t\tif (isset($_POST[\"username\"]))\n\t\t{\n\t\t\t$previous_username = $mysql_db->real_escape_string($_POST[\"username\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$previous_username = \"\";\n\t\t}\n\t\tif (isset($_POST[\"email\"]))\n\t\t{\n\t\t\t$previous_email = $mysql_db->real_escape_string($_POST[\"email\"]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$previous_email = \"\";\n\t\t}\n\t\techo \t\"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"create_user\\\">\\n\" .\n\t\t\t\t\t\"\tUsername: <input type=\\\"text\\\" name=\\\"username\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tEmail: <input type=\\\"text\\\" name=\\\"email\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tPassword: <input type=\\\"password\\\" name=\\\"pass2\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tPassword again: <input type=\\\"password\\\" name=\\\"pass3\\\" ><br>\\n\" .\n\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Register\\\">\\n\" .\n\t\t\t\t\t\"</form>\\n\";\n\t}\n\telse if ($_POST[\"action\"] == \"login\")\n\t{\t//retrieve submitted username and password, if applicable\n\t\t$username = $mysql_db->real_escape_string($_POST[\"username\"]);\n\t\t$passworder = $mysql_db->real_escape_string($_POST[\"password\"]);\n\t\n\t\t$_SESSION['username'] = $username;\n\t}\n\telse if ($_POST[\"action\"] == \"logout\")\n\t{\n\t\techo \"Logout<br>\\n\";\n\t\tunset($_SESSION['username']);\n\t\tunset($_SESSION['password']);\n\t}\n\telse if ($_POST[\"action\"] == \"change_pass\")\n\t{\n\t\t$retv = 1;\n\t\tif ($quiet == 0)\n\t\t{\n\t\t\t#TODO : create button to change mind on changing password\n\t\t\techo \t\"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"apply_pass\\\">\\n\" .\n\t\t\t\t\t\"\tOld password: <input type=\\\"password\\\" name=\\\"pass1\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tNew password: <input type=\\\"password\\\" name=\\\"pass2\\\" ><br>\\n\" .\n\t\t\t\t\t\"\tNew password again: <input type=\\\"password\\\" name=\\\"pass3\\\" ><br>\\n\" .\n\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Change my password\\\">\\n\" .\n\t\t\t\t\t\"</form>\\n\";\n\t\t}\n\t}\n\telse if ($_POST[\"action\"] == \"apply_pass\")\n\t{\n\t\t$oldpass = $mysql_db->real_escape_string($_POST['pass1']);\n\t\t$newpass = $mysql_db->real_escape_string($_POST['pass2']);\n\t\t$passmatch = $mysql_db->real_escape_string($_POST['pass3']);\n\t\tif ($newpass == $passmatch)\n\t\t{\n\t\t\t$uid = $_SESSION['user']['emp_id'];\n\t\t\tcontacts::store_user_pword($uid, $oldpass, $newpass);\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"<h3>Passwords do not match</h3><br >\\n\";\n\t\t}\n\t}\n\n\t#logic for logging in and normal activity\n\tif (isset($_SESSION['username']))\n\t{\n\t\t$query = \"SELECT * FROM contacts WHERE username='\" . $_SESSION['username'] . \"' LIMIT 1;\";\n\t\t$results = $mysql_db->query($query);\n\t\tif ($results)\n\t\t{\n\t\t\t$row = $results->fetch_array(MYSQLI_BOTH);\n\t\t\t#TODO : more testing of the failed login logic\n\t\t\tif ($row['fail_logins'] >= $config['max_fail_logins'])\n\t\t\t{\t//TODO: set time period for waiting to login\n\t\t\t\techo \"Failed login too many times error<br>\\n\";\n\t\t\t\tunset($_SESSION['username']);\n\t\t\t\tunset($_SESSION['password']);\n\t\t\t}\n\t\t\t\n\t\t\tif ($_POST[\"action\"] == \"login\")\n\t\t\t{\n\t\t\t\t//check to see if the password matches and the stretching does not match\n\t\t\t\t//this piece allows the stretching value to be changed at any given time\n\t\t\t\t//the only drawback is the password is hashed twice when the user logs in\n\t\t\t\t//in order to change the stretching value\n\t\t\t\t$temp = hash_password($passworder, $row['salt'], $row['stretching']);\n\t\t\t\tif ( ($row['password'] == $temp) && ($row['stretching'] != $config['key_stretching_value']) )\n\t\t\t\t{\t//password is good, key stretching needs to be fixed\n\t\t\t\t\tcontacts::mod_user_pword($row['emp_id'], $passworder);\n\t\t\t\t\t$fquery = \"SELECT * From contacts WHERE username='\" . $_SESSION['username'] . \"'LIMIT 1;\";\n\t\t\t\t\t$fresults = $mysql_db->query($fquery);\n\t\t\t\t\tif ($fresults)\n\t\t\t\t\t{\n\t\t\t\t\t\t$row = $fresults->fetch_array(MYSQLI_BOTH);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t//this should never happen\n\t\t\t\t\t\tthrow new Exception(\"Failed to reformat password\");\n\t\t\t\t\t}\n\t\t\t\t\t$temp = hash_password($passworder, $row['salt'], $config['key_stretching_value']);\n\t\t\t\t\t$row['password'] = $temp;\n\t\t\t\t}\n\n\t\t\t\t$_SESSION['password'] = $temp;\n\t\t\t}\n\t\t\tif (($row['password'] == $_SESSION['password']) && isset($_SESSION['password']) && ($_SESSION['password'] <> \"\"))\n\t\t\t{\t#successful login\n\t\t\t\t#TODO : limit the number of valid sessions for users? create a valid session table?\n\t\t\t\t$_SESSION['user'] = $row;\n\t\t\t\tif ($_POST[\"action\"] == \"login\")\n\t\t\t\t{\n\t\t\t\t\t$query = \"UPDATE contacts SET fail_pass_change=0 WHERE emp_id = \" . $_SESSION['user']['emp_id'] . \";\";\n\t\t\t\t\t$mysql_db->query($query);\n\t\t\t\t\t$query = \"UPDATE contacts SET fail_logins=0 WHERE emp_id = \" . $_SESSION['user']['emp_id'] . \";\";\n\t\t\t\t\t$mysql_db->query($query);\n\t\t\t\t}\n\t\t\t\tif ($quiet == 0)\n\t\t\t\t{\n\t\t\t\t\techo \"<h3>Welcome \";\n\t\t\t\t\techo print_contact($_SESSION['user']['emp_id']);\n\t\t\t\t\techo \"</h3>\\n\";\n\t\t\t\t\techo \"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\t \"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"logout\\\">\\n\" .\n\t\t\t\t\t\t \"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Logout\\\">\\n\" .\n\t\t\t\t\t\t \"</form>\\n\";\n\t\t\t\t\tif ($_POST[\"action\"] != \"change_pass\")\n\t\t\t\t\t{\n\t\t\t\t\t\techo\t\"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"change_pass\\\">\\n\" .\n\t\t\t\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Change my password\\\">\\n\" .\n\t\t\t\t\t\t\t\t\"</form>\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\t//password fail match\n\t\t\t\t$query = \"UPDATE contacts SET fail_logins=fail_logins+1 WHERE username = \" . $_SESSION['username'] . \";\";\n\t\t\t\t$mysql_db->query($query);\n\t\t\t\tunset($_SESSION['username']);\n\t\t\t\tunset($_SESSION['password']);\n\t\t\t\tinvalid_username_password();\n\t\t\t\t$retv = 1;\n\t\t\t}\n\t\t\t$results->close();\n\t\t}\n\t\telse\n\t\t{\t//contact not found\n\t\t\tunset($_SESSION['username']);\n\t\t\tunset($_SESSION['password']);\n\t\t\tinvalid_username_password();\n\t\t\t$retv = 1;\t\n\t\t}\n\t}\n\telse\n\t{\n\t\tlogin_button();\n\t\tif ($config['allow_user_create']=1)\n\t\t{\n\t\t\techo \"<form action=\\\"\" . curPageURL() . \"\\\" method=\\\"post\\\">\\n\" .\n\t\t\t\t\t\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"register\\\">\\n\" .\n\t\t\t\t\t\"\t<input class=\\\"buttons\\\" type=\\\"submit\\\" value=\\\"Register\\\">\\n\" .\n\t\t\t\t\t\"</form>\\n\";\n\t\t}\n\t\t$retv = 1;\n\t}\n\n\tif ($quiet == 0)\n\t{\n\t\techo \"</div>\\n\";\n\t}\t\n\n\treturn $retv;\n}", "function register(){\r\n\t\tif(!isset($_POST['username']) || !isset($_POST['email']) ){\r\n\t\t\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Invalid Request\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\r\n\t\t//get inputs\r\n\t\t$username = $_POST['username'];\r\n\t\t$email = $_POST['email'];\r\n\t\t\r\n\t\t$v = new DooValidator;\r\n\t\t//validate\r\n\t\tif(($error = $v->testEmail($_POST['email'])) != null){\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = $error;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//check if username or email already exist in users db\r\n\t\t$u = Doo::db()->find('Users', array(\r\n\t\t\t'where' => \"username = :username OR email = :email\", \r\n\t\t\t'param' => array(':username' => $username, ':email' => $email)\r\n\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\t\r\n\t\tif(!empty($u)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Username or Email already exist\";\r\n\t\t\treturn;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//generate temp password\r\n\t\t$tmpPassword = $this->str_rand(6);\r\n\t\t\r\n\r\n\t\t//send email with temp password\r\n\t\t$to = $email;\r\n\r\n\t\t// Your subject\r\n\t\t$subject = \"Your temp password here\";\r\n\r\n\t\t// From\r\n\t\t$header=\"from: Register-EVAS <[email protected]>\";\r\n\t\t//$header = null;\r\n\t\t\r\n\t\t// Your message\r\n\t\t$message = \"Your Comfirmation password \\r\\n\";\r\n\t\t$message.= \"$tmpPassword\";\r\n\t\t\r\n\t\t//ini_set ( \"SMTP\", \"smtp-server.example.com\" ); \r\n\t\t\r\n\t\t// send email\r\n\t\tif(!mail($to, $subject, $message, $header)){\r\n\t\t\t//build response\r\n\t\t\t$this->res->success = false;\r\n\t\t\t$this->res->message = \"Error sending email to $email\";\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//store new user temp password \r\n\t\tDoo::loadModel('Users');\r\n\t\t$u = new Users;\r\n\t\t$u->username = $username;\r\n\t\t$u->email = $email;\r\n\t\t$u->isEnabled = 1;\r\n\t\t$u->change_password_on_login = 1;\r\n\t\t$u->password = md5($tmpPassword);\r\n\t\t$u->default_basemap = \"Google Streets\";\r\n\t\t$u->cluster_zoom_level = 15;\r\n\t\t$u->is_enabled = 1;\r\n\t\t $u->client = \"T-Mobile\";\r\n\t\t$u->insert();\r\n\t\t\t\r\n\t\t//success!\r\n\t\t$this->res->success = true;\r\n\t}", "function PasswordsNotMach(){\n echo \"<h3 class='text-danger'>Your passwords do not match</h3>\";\n }", "function auth_fail() {\n header('HTTP/1.1 401 Unauthorized');\n header('WWW-Authenticate: Digest realm=\"'.$realm.\n\t '\",qop=\"auth\",nonce=\"'.uniqid().'\",opaque=\"'.md5($realm).'\"');\n}", "function signup($email, $password){\r\n\t\t$notice = null;\r\n\t\t$conn = new mysqli($GLOBALS[\"serverHost\"], $GLOBALS[\"serverUsername\"], $GLOBALS[\"serverPassword\"], $GLOBALS[\"database\"]);\r\n\t\t//Show where to enter new data\r\n\t\t$stmt = $conn->prepare(\"INSERT INTO accounts (user, password) VALUES(?,?)\");\r\n\t\techo $conn->error;\r\n\t\t//Encrypt password\r\n\t\t$options = [\r\n\t\t\t\t\t\t'cost' => 12,\r\n\t\t\t\t\t];\r\n\t\t//Hash it\r\n\t\t$pwdhash = password_hash($password, PASSWORD_BCRYPT, $options);\r\n\t\t\r\n\t\t//Send to database\r\n\t\t$stmt->bind_param(\"ss\", $email, $pwdhash);\r\n\t\tif($stmt->execute()){\r\n\t\t\t$notice = \"ok\";\r\n\t\t} else {\r\n\t\t\t$notice = $stmt->error;\r\n\t\t}\r\n\t\t//Close connection\r\n\t\t$stmt->close();\r\n\t $conn->close();\r\n\t\treturn $notice;\r\n\t}", "function registerUser() {\n $org = htmlspecialchars(trim($_POST['org']), ENT_QUOTES);\n $email = htmlspecialchars(trim($_POST['email']), ENT_QUOTES);\n $password = htmlspecialchars(trim($_POST['password1']), ENT_QUOTES);\n $date = date('Y-m-d');\n \n connectDatabase();\n \n $result = queryDatabase(\"SELECT pk\n FROM user\n WHERE email = '$email'\");\n \n if (mysql_num_rows($result) == 1) {\n header('Location: ' . HOME . 'login.php?feedback=3');\n } else {\n queryDatabase(\"INSERT INTO user (email, password, registered) VALUES ('$email', '$password', '$date')\");\n \n $emailCrypt = HOME . 'login.php?account=' . crypt($email, SALT);\n\n $message = \"Hello $email,\\n\\nTo activate your \" . COMPANY . \" account, please click the link below:\\n\\n$emailCrypt\\n\\nThank you,\\n\" . COMPANY . \" support staff - \" . date('m/d/Y');\n\n mail($email, 'Activate ' . COMPANY . ' account', $message, 'From: ' . EMAIL);\n \n header('Location: ' . HOME . 'login.php?feedback=4');\n }\n}", "function reiskoffer_frontend_login_fail( $username ) {\n\tif(isset($_SERVER['HTTP_REFERER'])) {\n \t $referrer = $_SERVER['HTTP_REFERER']; // where did the post submission come from?\n }\n // if there's a valid referrer, and it's not the default log-in screen\n if ( !empty($referrer) && !strstr($referrer, 'wp-login') && !strstr($referrer, 'wp-admin') ) {\n wp_redirect( $referrer . '?login=failed' ); // let's append some information (login=failed) to the URL for the theme to use\n exit;\n } else {\n\t wp_redirect(home_url());\n\t exit();\n }\n}", "function insert_to_db($email, $password, $conn) {\r\n\t\t$enc_psw = password_hash($password, PASSWORD_DEFAULT);\r\n\t\t$sql = \"INSERT INTO User (email, password) VALUES ('$email', '$enc_psw')\";\r\n\r\n\t\tif ($conn->query($sql) === TRUE) {\r\n \t\t$_SESSION[\"error\"] = -1;\r\n \t\theader(\"Location: signup.php\");\r\n\t\t} else {\r\n\t\t\t$_SESSION[\"error\"] = 3;\r\n\t\t\theader(\"Location: registration.php\");\r\n\r\n\t\t}\r\n\t}", "function forgotUNPWSubmit(){\n\n\tglobal $mysqli;\n\tglobal $cms_login;\n\n\trequire_once(\"cms_uNpW.php\");\n\t\n\tsession_start();\n\n\t$inputEmail=$_POST[\"email\"];\n\t$email=password_hash($inputEmail, PASSWORD_DEFAULT);\n\t$inputMonth=$_POST[\"month\"];\n\t$inputDay=$_POST[\"day\"];\n\t$inputYear=$_POST[\"year\"];\n\t$submit=$_POST[\"submit\"];\n\n\t$hashCommand=\"SELECT month, day, year FROM users WHERE email=\".$email.\";\";\n\t$hash=mysqli_query($mysqli, $hashCommand);\n\n\tif(isset($submit)){\n\n\t\tif(password_verify($inputMonth, $hash[\"month\"]) \n\t\t&& password_verify($inputDay, $hash[\"day\"]) \n\t\t&& password_verify($inputYear, $hash[\"year\"])){\n\n\t\t\tpage_redirect(\"cms_changePassword.php?email=\".$email.\"\");\n\n\t\t}else{\n\t\t\n\t\t\tpage_redirect($cms_login);\n\n\t\t}\n\n\t}\n\n}", "public function please_login()\n {\n echo json_encode(array(\"status\"=>\"success\", \"msg\"=>\"Naaaa\"));\n die();\n }", "function validate_user_login() {\n\n\t$errors = [];\n\n\t\n\n\tif(isset($_POST['submit'])) {\n\n\t\t\t$password \t = md5($_POST['password']);\n\t\t\t$idd \t \t\t = $_POST['iddler'];\n\n\t\t\tif(!empty($errors)) {\n\n\t\t\t\tforeach ($errors as $error) {\n\t\t\t\n\t echo validation_errors($error); \n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tif(log_user($password)) {\n\t\t\t\t\tsession_start();\n\t\t\t\t\t$_SESSION['secured'] = $password;\n\t\t\t\t\theader(\"location: ./seen?id=$idd\");\n\n\t\t\t\t} else {\n\n\t\t\t\t\techo validation_errors(\"Wrong Password\");\n\t\t\t\t}\n\t\t\t} \n\n\t\t}\n\n}", "private function validateUserInput() {\n\t\ttry {\n\t\t\t$this->clientUserName = $this->loginObserver->getClientUserName();\n\t\t\t$this->clientPassword = $this->loginObserver->getClientPassword();\n\t\t\t$this->loginModel->validateForm($this->clientUserName, $this->clientPassword);\n\t\t} catch (\\Exception $e) {\n\t\t\t$this->message = $e->getMessage();\n\t\t}\n\t}", "function get_the_password_form($post = 0)\n {\n }", "public function actionIndex()\n\t{\n\t\t$this->email = $_POST['email'];\n\t\t$this->pwd = $_POST['pwd'];\n\t\t$this->authenticate();\n\t}" ]
[ "0.62466395", "0.6127143", "0.6029233", "0.60018635", "0.59776235", "0.59664917", "0.5846178", "0.57937956", "0.57752216", "0.5767569", "0.5766951", "0.576211", "0.5742378", "0.5742378", "0.57405674", "0.5737008", "0.5734198", "0.57230145", "0.57119", "0.57058793", "0.57041776", "0.5696277", "0.5693879", "0.56937367", "0.5679355", "0.56722647", "0.56669056", "0.56669056", "0.56540346", "0.56530887", "0.56328386", "0.5628718", "0.5623729", "0.5623729", "0.5623729", "0.5623729", "0.5623729", "0.5623729", "0.5623729", "0.56154245", "0.5600083", "0.5574743", "0.557322", "0.5539756", "0.55391014", "0.55379796", "0.5524154", "0.5520574", "0.5515377", "0.5512049", "0.5508247", "0.55052114", "0.5484477", "0.5457756", "0.54560304", "0.54476494", "0.5445693", "0.544437", "0.5444191", "0.5427161", "0.54122066", "0.53926", "0.53890324", "0.53783727", "0.5365726", "0.5359474", "0.53552985", "0.53414434", "0.5339159", "0.5322723", "0.53175163", "0.5304303", "0.53031176", "0.5302759", "0.5298951", "0.5290072", "0.5289593", "0.5283818", "0.52833587", "0.5282024", "0.52779984", "0.5277286", "0.52768326", "0.52640516", "0.52463037", "0.5241988", "0.5240994", "0.5225746", "0.5223847", "0.5220013", "0.52169776", "0.521451", "0.52114516", "0.5210008", "0.5205373", "0.520415", "0.52034515", "0.5199594", "0.5197446", "0.51933855", "0.5192478" ]
0.0
-1
Encoding string according to RFC3986
protected function encode($value) { return str_replace(static::$characters_set_encoded, static::$characters_set, rawurlencode($value)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function encode_rfc3986($string)\n\t{\n\t\treturn str_replace('+', ' ', str_replace('%7E', '~', rawurlencode(($string))));\n\t}", "function p_enc($string) {\r\n $char_encoded = mb_convert_encoding($string, 'UTF-8', 'SJIS');\r\n return urlencode($char_encoded);\r\n}", "abstract function encode($s);", "abstract public function encode();", "public function getEncoded();", "private function rfc3986_encode($raw_input) {\r\n if (is_array($raw_input)) {\r\n return array_map('self::rfc3986_encode', $raw_input);\r\n } else if (is_scalar($raw_input)) {\r\n return str_replace('%7E', '~', rawurlencode($raw_input));\r\n } else {\r\n return '';\r\n }\r\n }", "function encode($str)\n{\n\treturn mb_convert_encoding($str,'UTF-8');\n}", "protected function _encode($str = '') {\n\t\treturn iconv(\"UTF-8\",\"WINDOWS-1257\", html_entity_decode($str, ENT_COMPAT, 'utf-8'));\n//\t\treturn $str;\n\t}", "private static function urlencodeRFC3986( $string )\n\t {\n\t\treturn str_replace( '%7E', '~', rawurlencode( $string ) );\n\t }", "public static function encode($string) {\n\t\treturn '=?utf-8?B?' . base64_encode($string) . '?=';\n\t}", "function MimeHeaderEncode($string) {\n if (preg_match('/[^\\x20-\\x7E]/', $string)) {\n $chunk_size = 47; // floor((75 - strlen(\"=?UTF-8?B??=\")) * 0.75);\n $len = strlen($string);\n $output = '';\n while ($len > 0) {\n $chunk = $this->TruncateBytes($string, $chunk_size);\n $output .= ' =?UTF-8?B?' . base64_encode($chunk) . \"?=\\n\";\n $c = strlen($chunk);\n $string = substr($string, $c);\n $len -= $c;\n }\n return trim($output);\n }\n return $string;\n }", "function encode($name){\n\t\treturn $name->toUTF8();\n\t}", "public function urlencode_rfc3986($input) {\n \t\tif (is_array($input)) {\n\t\t\treturn array_map(array($this, 'urlencode_rfc3986'), $input);\n \t\t} else if (is_scalar($input)) {\n\t\t\treturn str_replace(\n\t \t\t\t'+',\n\t \t\t\t' ',\n\t \t\t\tstr_replace('%7E', '~', rawurlencode($input))\n\t\t\t);\n \t\t} else {\n\t\t\treturn '';\n \t\t}\n\t}", "public function encode_url_rfc3986( $url ) {\n\t\tif ( filter_var( $url, FILTER_VALIDATE_URL ) ) {\n\t\t\treturn $url;\n\t\t}\n\n\t\t$url = $this->encode_url_path( $url );\n\t\t$url = $this->encode_url_query( $url );\n\n\t\treturn $url;\n\t}", "function encode($var)\n {\n switch (gettype($var)) {\n case 'boolean':\n return $var ? 'true' : 'false';\n\n case 'NULL':\n return 'null';\n\n case 'integer':\n return (int) $var;\n\n case 'double':\n case 'float':\n return (float) $var;\n\n case 'string':\n // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT\n $ascii = '';\n $strlen_var = strlen($var);\n\n /*\n * Iterate over every character in the string,\n * escaping with a slash or encoding to UTF-8 where necessary\n */\n for ($c = 0; $c < $strlen_var; ++$c) {\n\n $ord_var_c = ord($var{$c});\n\n switch (true) {\n case $ord_var_c == 0x08:\n $ascii .= '\\b';\n break;\n case $ord_var_c == 0x09:\n $ascii .= '\\t';\n break;\n case $ord_var_c == 0x0A:\n $ascii .= '\\n';\n break;\n case $ord_var_c == 0x0C:\n $ascii .= '\\f';\n break;\n case $ord_var_c == 0x0D:\n $ascii .= '\\r';\n break;\n\n case $ord_var_c == 0x22:\n case $ord_var_c == 0x2F:\n case $ord_var_c == 0x5C:\n // double quote, slash, slosh\n $ascii .= '\\\\'.$var{$c};\n break;\n\n case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):\n // characters U-00000000 - U-0000007F (same as ASCII)\n $ascii .= $var{$c};\n break;\n\n case (($ord_var_c & 0xE0) == 0xC0):\n // characters U-00000080 - U-000007FF, mask 110XXXXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $char = pack('C*', $ord_var_c, ord($var{$c + 1}));\n $c += 1;\n $utf16 = $this->utf82utf16($char);\n $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n break;\n\n case (($ord_var_c & 0xF0) == 0xE0):\n // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $char = pack('C*', $ord_var_c,\n ord($var{$c + 1}),\n ord($var{$c + 2}));\n $c += 2;\n $utf16 = $this->utf82utf16($char);\n $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n break;\n\n case (($ord_var_c & 0xF8) == 0xF0):\n // characters U-00010000 - U-001FFFFF, mask 11110XXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $char = pack('C*', $ord_var_c,\n ord($var{$c + 1}),\n ord($var{$c + 2}),\n ord($var{$c + 3}));\n $c += 3;\n $utf16 = $this->utf82utf16($char);\n $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n break;\n\n case (($ord_var_c & 0xFC) == 0xF8):\n // characters U-00200000 - U-03FFFFFF, mask 111110XX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $char = pack('C*', $ord_var_c,\n ord($var{$c + 1}),\n ord($var{$c + 2}),\n ord($var{$c + 3}),\n ord($var{$c + 4}));\n $c += 4;\n $utf16 = $this->utf82utf16($char);\n $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n break;\n\n case (($ord_var_c & 0xFE) == 0xFC):\n // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $char = pack('C*', $ord_var_c,\n ord($var{$c + 1}),\n ord($var{$c + 2}),\n ord($var{$c + 3}),\n ord($var{$c + 4}),\n ord($var{$c + 5}));\n $c += 5;\n $utf16 = $this->utf82utf16($char);\n $ascii .= sprintf('\\u%04s', bin2hex($utf16));\n break;\n }\n }\n\n return '\"'.$ascii.'\"';\n\n case 'array':\n /*\n * As per JSON spec if any array key is not an integer\n * we must treat the the whole array as an object. We\n * also try to catch a sparsely populated associative\n * array with numeric keys here because some JS engines\n * will create an array with empty indexes up to\n * max_index which can cause memory issues and because\n * the keys, which may be relevant, will be remapped\n * otherwise.\n *\n * As per the ECMA and JSON specification an object may\n * have any string as a property. Unfortunately due to\n * a hole in the ECMA specification if the key is a\n * ECMA reserved word or starts with a digit the\n * parameter is only accessible using ECMAScript's\n * bracket notation.\n */\n\n // treat as a JSON object\n if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {\n $properties = array_map(array($this, 'name_value'),\n array_keys($var),\n array_values($var));\n\n foreach($properties as $property) {\n if(Services_JSON::isError($property)) {\n return $property;\n }\n }\n\n return '{' . join(',', $properties) . '}';\n }\n\n // treat it like a regular array\n $elements = array_map(array($this, 'encode'), $var);\n\n foreach($elements as $element) {\n if(Services_JSON::isError($element)) {\n return $element;\n }\n }\n\n return '[' . join(',', $elements) . ']';\n\n case 'object':\n $vars = get_object_vars($var);\n\n $properties = array_map(array($this, 'name_value'),\n array_keys($vars),\n array_values($vars));\n\n foreach($properties as $property) {\n if(Services_JSON::isError($property)) {\n return $property;\n }\n }\n\n return '{' . join(',', $properties) . '}';\n\n default:\n return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)\n ? 'null'\n : new Services_JSON_Error(gettype($var).\" can not be encoded as JSON string\");\n }\n }", "function encode_code39_ext($code) {\n\n $encode = array(\n chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C', \n chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G', \n chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '£K', \n chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O', \n chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S', \n chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W', \n chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A', \n chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E', \n chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C', \n chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G', \n chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K', \n chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O', \n chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', \n chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', \n chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F', \n chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J', \n chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', \n chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', \n chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', \n chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', \n chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', \n chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', \n chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K', \n chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O', \n chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C', \n chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G', \n chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K', \n chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O', \n chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S', \n chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W', \n chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P', \n chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T');\n\n $code_ext = '';\n for ($i = 0 ; $i<strlen($code); $i++) {\n if (ord($code[$i]) > 127)\n $this->Error('Invalid character: '.$code[$i]);\n $code_ext .= $encode[$code[$i]];\n }\n return $code_ext;\n}", "function encode_subject($in_str, $charset) { \n $out_str = $in_str; \n if ($out_str && $charset) { \n\n // define start delimimter, end delimiter and spacer \n $end = \"?=\"; \n $start = \"=?\" . $charset . \"?B?\"; \n $spacer = $end . \"\\r\\n \" . $start; \n\n // determine length of encoded text within chunks \n // and ensure length is even \n $length = 75 - strlen($start) - strlen($end); \n\n /* \n [EDIT BY danbrown AT php DOT net: The following \n is a bugfix provided by (gardan AT gmx DOT de) \n on 31-MAR-2005 with the following note: \n \"This means: $length should not be even, \n but divisible by 4. The reason is that in \n base64-encoding 3 8-bit-chars are represented \n by 4 6-bit-chars. These 4 chars must not be \n split between two encoded words, according \n to RFC-2047. \n */ \n $length = $length - ($length % 4); \n\n // encode the string and split it into chunks \n // with spacers after each chunk \n $out_str = base64_encode($out_str); \n $out_str = chunk_split($out_str, $length, $spacer); \n\n // remove trailing spacer and \n // add start and end delimiters \n $spacer = preg_quote($spacer); \n $out_str = preg_replace(\"/\" . $spacer . \"$/\", \"\", $out_str); \n $out_str = $start . $out_str . $end; \n } \n return $out_str; \n}", "function _encode($text)\r\n\t{\r\n\t\t$source_encoding = mb_detect_encoding($text);\r\n\t\t$target_encoding = _get_codeset();\r\n\t\tif ($source_encoding != $target_encoding) {\r\n\t\t\treturn mb_convert_encoding($text, $target_encoding, $source_encoding);\r\n\t\t} else {\r\n\t\t\treturn $text;\r\n\t\t}\r\n\t}", "function encode_string($str)\r\n {\r\n return strlen($str) . ':' . $str;\r\n }", "function _encode($string) {\n\t\tif (preg_match('/(\\/|&)/', $string)) {\n\t\t\t$string = urlencode($string);\n\t\t}\n\n\t\treturn urlencode($string);\n\t}", "function encode_code39_ext($code) {\n\n\t $encode = array(\n\t chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C',\n\t chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G',\n\t chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => 'ŁK',\n\t chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O',\n\t chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S',\n\t chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W',\n\t chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A',\n\t chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E',\n\t chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C',\n\t chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G',\n\t chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K',\n\t chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O',\n\t chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3',\n\t chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7',\n\t chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F',\n\t chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J',\n\t chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C',\n\t chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G',\n\t chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K',\n\t chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O',\n\t chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S',\n\t chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W',\n\t chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K',\n\t chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O',\n\t chr(96) => '%W', chr(97) => 'A', chr(98) => 'B', chr(99) => 'C',\n\t chr(100) => 'D', chr(101) => 'E', chr(102) => 'F', chr(103) => 'G',\n\t chr(104) => 'H', chr(105) => 'I', chr(106) => 'J', chr(107) => 'K',\n\t chr(108) => 'L', chr(109) => 'M', chr(110) => 'N', chr(111) => 'O',\n\t chr(112) => 'P', chr(113) => 'Q', chr(114) => 'R', chr(115) => 'S',\n\t chr(116) => 'T', chr(117) => 'U', chr(118) => 'V', chr(119) => 'W',\n\t chr(120) => 'X', chr(121) => 'Y', chr(122) => 'Z', chr(123) => '%P',\n\t chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T');\n\n\t $code_ext = '';\n\t for ($i = 0 ; $i<strlen($code); $i++) {\n\t if (ord($code{$i}) > 127)\n\t $this->Error('Invalid character: '.$code{$i});\n\t $code_ext .= $encode[$code{$i}];\n\t }\n\t return $code_ext;\n\t}", "protected function encode ($str = '') {\n\t\treturn $this->encodingConversion\n\t\t\t? iconv($this->systemEncoding, $this->responseEncoding, $str)\n\t\t\t: $str;\n\t}", "function linkencode1($str)\n{\n\t// for php < 4.1.0\n\t$str=ereg_replace(\" \",\"%20\",$str);\n\t$str=ereg_replace(\"&\",\"%26\",$str);\n\t$str=ereg_replace(\"\\+\",\"%2b\",$str);\n\t$str=ereg_replace(\"ü\",\"%fc\",$str);\n\t$str=ereg_replace(\"Ü\",\"%dc\",$str);\n\n\treturn $str;\n}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "public function encode($data) {}", "abstract function encode($data);", "function utf8_encode($data)\n{\n}", "function uniencode($s)\n{\n $r = \"\";\n for ($i=0;$i<strlen($s);$i++) $r.= \"&#\".ord(substr($s,$i,1)).\";\";\n return $r;\n}", "function get_encoded_string ($str) {\n setlocale(LC_ALL, 'fr_FR.UTF-8');\n return iconv('UTF-8', 'ASCII//TRANSLIT', $str);\n}", "function encodeFrom($from) {\n $items = explode(\"<\", $from);\n $name = trim($items[0]);\n return \"=?UTF-8?B?\" . base64_encode($name) . \"?= <\" . $items[1];\n}", "public function EncodeHeader($str, $position = 'text') {\n\t $x = 0;\n\t\n\t switch (strtolower($position)) {\n\t case 'phrase':\n\t if (!preg_match('/[\\200-\\377]/', $str)) {\n\t // Can't use addslashes as we don't know what value has magic_quotes_sybase\n\t $encoded = addcslashes($str, \"\\0..\\37\\177\\\\\\\"\");\n\t if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\\'*+\\/=?^_`{|}~ -]/', $str)) {\n\t return ($encoded);\n\t } else {\n\t return (\"\\\"$encoded\\\"\");\n\t }\n\t }\n\t $x = preg_match_all('/[^\\040\\041\\043-\\133\\135-\\176]/', $str, $matches);\n\t break;\n\t case 'comment':\n\t $x = preg_match_all('/[()\"]/', $str, $matches);\n\t // Fall-through\n\t case 'text':\n\t default:\n\t $x += preg_match_all('/[\\000-\\010\\013\\014\\016-\\037\\177-\\377]/', $str, $matches);\n\t break;\n\t }\n\t\n\t if ($x == 0) {\n\t return ($str);\n\t }\n\t\n\t $maxlen = 75 - 7 - strlen($this->CharSet);\n\t // Try to select the encoding which should produce the shortest output\n\t if (strlen($str)/3 < $x) {\n\t $encoding = 'B';\n\t if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) {\n\t // Use a custom function which correctly encodes and wraps long\n\t // multibyte strings without breaking lines within a character\n\t $encoded = $this->Base64EncodeWrapMB($str);\n\t } else {\n\t $encoded = base64_encode($str);\n\t $maxlen -= $maxlen % 4;\n\t $encoded = trim(chunk_split($encoded, $maxlen, \"\\n\"));\n\t }\n\t } else {\n\t $encoding = 'Q';\n\t $encoded = $this->EncodeQ($str, $position);\n\t $encoded = $this->WrapText($encoded, $maxlen, true);\n\t $encoded = str_replace('='.$this->LE, \"\\n\", trim($encoded));\n\t }\n\t\n\t $encoded = preg_replace('/^(.*)$/m', \" =?\".$this->CharSet.\"?$encoding?\\\\1?=\", $encoded);\n\t $encoded = trim(str_replace(\"\\n\", $this->LE, $encoded));\n\t\n\t return $encoded;\n\t}", "public static function url_encode_rfc3986($input)\n {\n if (is_array($input)) {\n return array_map(array('phpVimeo', 'url_encode_rfc3986'), $input);\n }\n else if (is_scalar($input)) {\n return str_replace(array('+', '%7E'), array(' ', '~'), rawurlencode($input));\n }\n else {\n return '';\n }\n }", "public function encode($format);", "public function encoded() {\n static $alphabet= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';\n\n $length= strlen($this->bytes);\n if (0 === $length) {\n return '';\n } else if ($length >= (1 << 28)) {\n throw new IllegalStateException('Cannot encode value, too long ('.$length.')');\n }\n\n $buffer= ord($this->bytes[0]);\n $next= 1;\n $left= 8;\n $result= '';\n while (($left > 0 || $next < $length)) {\n if ($left < 5) {\n if ($next < $length) {\n $buffer= $buffer << 8 | ord($this->bytes[$next++]) & 0xff;\n $left+= 8;\n } else {\n $pad= 5 - $left;\n $buffer <<= $pad;\n $left+= $pad;\n }\n }\n\n $result.= $alphabet[0x1f & ($buffer >> ($left-= 5))];\n }\n\n return $result;\n }", "public function encode($data);", "public function encode($data);", "public function encode($data);", "abstract public function encode($data);", "public function encodeString($str, $encoding = self::ENCODING_BASE64)\n {\n }", "private static function encode($string)\n {\n return base64_encode($string);\n }", "abstract public static function encode($data): string;", "protected function getItoa64() {}", "protected function getItoa64() {}", "function encodeFromName($text)\r\n {\r\n // Activate the following line if needed\r\n // $text = \"=?{$this->charSet}?B?\".base64_encode($text).\"?=\";\r\n return $text;\r\n }", "public function encode()\n {\n }", "public function getEncoding(): string;", "function encode($s,$key) {\r\n\r\n\t$o = \"\";\r\n\r\n\tfor ($i=0;$i<strlen($s);$i++) {\r\n\r\n\t\t$char = substr($s, $i, 1);\r\n\t\t$pos = alphabet_position($char);\r\n\r\n\t\tif ($pos !== false) {\r\n\t\t\t$key_char = substr($key, $i, 1);\r\n\t\t\t$char_pos = (alphabet_position($key_char) + $pos) % 52;\r\n\t\t\t$char = char_at_position($char_pos);\r\n\t\t}\r\n\r\n\t\t$o .= $char;\r\n\t}\r\n\treturn $o;\r\n}", "public function encoding($encoding);", "function acoc_encode( $value ) {\n\n $func = 'base64' . '_encode';\n return $func( $value );\n \n}", "public static function encode_mimeheader($str) {\n $length = 45;\n $pos = 0;\n $max = strlen($str);\n\n while ($pos < $max) {\n if ($pos + $length < $max) {\n $adjust = 0;\n\n while (intval(ord($str[$pos + $length + $adjust]) & 0xC0) == 0x80)\n $adjust--;\n\n $buffer .= ($buffer == '' ? '' : \"?=\\n =?UTF-8?B?\") . base64_encode(substr($str, $pos, $length + $adjust));\n $pos = $pos + $length + $adjust;\n } else {\n $buffer .= ($buffer == '' ? '' : \"?=\\n =?UTF-8?B?\") . base64_encode(substr($str, $pos));\n $pos = $max;\n }\n }\n\n return '=?UTF-8?B?' . $buffer . '?=';\n }", "public function getEncoding();", "public function encode(string $string): string\n {\n return base64_encode($string);\n }", "public static function encode_javascript($string) {\n $string = str_replace('\\\\', '\\\\\\\\', $string);\n $string = str_replace('\"', '\\\\\"', $string);\n $string = str_replace(\"'\", \"\\\\'\", $string);\n $string = str_replace(\"\\n\", \"\\\\n\", $string);\n $string = str_replace(\"\\r\", \"\\\\r\", $string);\n $string = str_replace(\"\\t\", \"\\\\t\", $string);\n\n $len = strlen($string);\n $pos = 0;\n $out = '';\n\n while ($pos < $len) {\n $ascii = ord(substr($string, $pos, 1));\n\n if ($ascii >= 0xF0) {\n $byte[1] = ord(substr($string, $pos, 1)) - 0xF0;\n $byte[2] = ord(substr($string, $pos + 1, 1)) - 0x80;\n $byte[3] = ord(substr($string, $pos + 2, 1)) - 0x80;\n $byte[4] = ord(substr($string, $pos + 3, 1)) - 0x80;\n\n $char_code = ($byte[1] << 18) + ($byte[2] << 12) + ($byte[3] << 6) + $byte[4];\n $pos += 4;\n } elseif (($ascii >= 0xE0) && ($ascii < 0xF0)) {\n $byte[1] = ord(substr($string, $pos, 1)) - 0xE0;\n $byte[2] = ord(substr($string, $pos + 1, 1)) - 0x80;\n $byte[3] = ord(substr($string, $pos + 2, 1)) - 0x80;\n\n $char_code = ($byte[1] << 12) + ($byte[2] << 6) + $byte[3];\n $pos += 3;\n } elseif (($ascii >= 0xC0) && ($ascii < 0xE0)) {\n $byte[1] = ord(substr($string, $pos, 1)) - 0xC0;\n $byte[2] = ord(substr($string, $pos + 1, 1)) - 0x80;\n\n $char_code = ($byte[1] << 6) + $byte[2];\n $pos += 2;\n } else {\n $char_code = ord(substr($string, $pos, 1));\n $pos += 1;\n }\n\n if ($char_code < 0x80)\n $out .= chr($char_code);\n else\n $out .= '\\\\u' . str_pad(dechex($char_code), 4, '0', STR_PAD_LEFT);\n }\n\n return $out;\n }", "abstract protected function getItoa64() ;", "protected function encodeForHeader(string $text): string\n {\n if ($this->appCharset === null) {\n return $text;\n }\n\n $restore = mb_internal_encoding();\n mb_internal_encoding($this->appCharset);\n $return = mb_encode_mimeheader($text, $this->getHeaderCharset(), 'B');\n mb_internal_encoding($restore);\n\n return $return;\n }", "function encode_email_address( $email ) {\n\n $output = '';\n\n for ($i = 0; $i < strlen($email); $i++) \n { \n $output .= '&#'.ord($email[$i]).';'; \n }\n\n return $output;\n}", "protected static function urlencode_rfc3986($value)\n {\n\tif (is_array($value)) {\n\t return array_map(array(__CLASS__, 'urlencode_rfc3986'), $value);\n\t} else {\n\t $search = array('+', ' ', '%7E', '%');\n\t $replace = array('%20', '%20', '~', '%25');\n\n\t return str_replace($search, $replace, urlencode($value));\n\t}\n }", "function unicode_encode( $name )\r\n{\r\n\t\t\t\t$name = iconv( \"UTF-8\", \"UCS-2\", $name );\r\n\t\t\t\t$len = strlen( $name );\r\n\t\t\t\t$str = \"\";\r\n\t\t\t\t$i = 0;\r\n\t\t\t\tfor ( ;\t$i < $len - 1;\t$i += 2\t)\r\n\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$c = $name[$i];\r\n\t\t\t\t\t\t\t\t$c2 = $name[$i + 1];\r\n\t\t\t\t\t\t\t\tif ( 0 < ord( $c ) )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$c2 = base_convert( ord( $c2 ), 10, 16 );\r\n\t\t\t\t\t\t\t\t\t\t\t\tif ( strlen( $c2 ) == 1 )\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$c2 = \"0\".$c2;\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t$str .= \"\\\\u\".base_convert( ord( $c ), 10, 16 ).$c2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t$str .= $c2;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn $str;\r\n}", "public function defaultencode($string) {\n $this->ci->load->library('encrypt');\n $data = $this->ci->encrypt->encode($string);\n $data = str_replace(array('+', '/', '='), array('-', '_', '~'), $data);\n return $data;\n }", "function encode($str) {\n\t\treturn str_replace(array('&', '<', '>'), array('&amp;', '&lt;', '&gt;'), $str);\n\t}", "public static function xmlEncode($_str,$_latin=FALSE) {\n\t\treturn strtr($_str,self::xmlTable($_latin));\n\t}", "protected function _encodeHeader($value)\n {\n if (\\Zend_Mime::isPrintable($value)) {\n return $value;\n } else {\n /**\n * Next strings fixes the problems\n * According to RFC 1522 (http://www.faqs.org/rfcs/rfc1522.html)\n */\n $quotedValue = '';\n $count = 1;\n for ($i=0; strlen($value)>$i;$i++) {\n if ($value[$i] == '?' or $value[$i] == '_' or $value[$i] == ' ') {\n $quotedValue .= str_replace(array('?', ' ', '_'), array('=3F', '=20', '=5F'), $value[$i]);\n } else {\n $quotedValue .= $this->encodeQuotedPrintable($value[$i]);\n }\n if (strlen($quotedValue)>$count*\\Zend_Mime::LINELENGTH) {\n $count++;\n $quotedValue .= \"?=\\n =?\". $this->_charset . '?Q?';\n }\n }\n return '=?' . $this->_charset . '?Q?' . $quotedValue . '?=';\n }\n }", "function _encode_body ($str) {\n\t\t\treturn str_replace ( array (\"\\x5c\\x6e\"), //linefeed command characters \"\\n\"\n\t\t\tarray (\"\\x0d\\x0a\"), // convert \"\\n\" real linefeed LF\n\t\t\t$str);\n }", "public function testCanBeEncoded()\n {\n $value = \"[#77675] New Issue:xxxxxxxxx xxxxxxx xxxxxxxx xxxxxxxxxxxxx xxxxxxxxxx xxxxxxxx, tähtaeg xx.xx, xxxx\";\n $res = Header::canBeEncoded($value);\n $this->assertTrue($res);\n\n $value = '';\n for ($i = 0; $i < 255; ++$i)\n $value .= chr($i);\n\n $res = Header::canBeEncoded($value);\n if ($res)\n var_Dump(Header::wrap($value));\n $this->assertFalse($res);\n }", "function encode_email_header($text, $charset = 'utf-8', $force_encode = false, $quoted_string = true)\n\t{\n\t\t$text = trim($text);\n\n\t\tif (!$charset)\n\t\t{\n\t\t\t// don't know how to encode, so we can't\n\t\t\treturn $text;\n\t\t}\n\n\t\tif ($force_encode == true)\n\t\t{\n\t\t\t$qp_encode = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$qp_encode = false;\n\n\t\t\tfor ($i = 0; $i < strlen($text); $i++)\n\t\t\t{\n\t\t\t\tif (ord($text{$i}) > 127)\n\t\t\t\t{\n\t\t\t\t\t// we have a non ascii character\n\t\t\t\t\t$qp_encode = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($qp_encode == true)\n\t\t{\n\t\t\t// see rfc 2047; not including _ as allowed here, as I'm encoding spaces with it\n\t\t\t$outtext = preg_replace('#([^a-zA-Z0-9!*+\\-/= ])#e', \"'=' . strtoupper(dechex(ord(str_replace('\\\\\\\"', '\\\"', '\\\\1'))))\", $text);\n\t\t\t$outtext = str_replace(' ', '_', $outtext);\n\t\t\t$outtext = \"=?$charset?q?$outtext?=\";\n\t\t\treturn $outtext;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($quoted_string)\n\t\t\t{\n\t\t\t\t$text = str_replace(array('\"', '(', ')'), array('\\\"', '\\(', '\\)'), $text);\n\t\t\t\treturn \"\\\"$text\\\"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn preg_replace('#(\\r\\n|\\n|\\r)+#', ' ', $text);\n\t\t\t}\n\t\t}\n\t}", "function yt_encode( $value ) {\n\n\t$func = 'base64' . '_encode';\n\treturn $func( $value );\n \n}", "function TxtEncoding4Soap($txt){\r\n $to = $GLOBALS[\"POSTA_SECURITY\"]->Security->configuration['charset'];\r\n return iconv('UTF-8',$to, $txt);\r\n}", "function encode_email_address( $email ) {\n\n $output = '';\n\n for ($i = 0; $i < strlen($email); $i++) \n { \n $output .= '&#'.ord($email[$i]).';'; \n }\n\n return $output;\n}", "function encodeXSString($string) {\n // Remove dead space.\n $string = trim($string);\n\n // Prevent potential Unicode codec problems.\n $string = utf8_decode($string);\n\n // HTMLize HTML-specific characters.\n $string = htmlentities($string, ENT_QUOTES);\n $string = str_replace(\"#\", \"&#35;\", $string);\n $string = str_replace(\"%\", \"&#37;\", $string);\n\n return $string;\n }", "public static function encodeHeader($string, $default_charset = 'utf-8')\n {\n // Use B encoding for multibyte charsets\n $mb_charsets = array(\n 'utf-8',\n 'big5',\n 'gb2312',\n 'euc-kr',\n 'gbk'\n );\n if (in_array($default_charset, $mb_charsets)) {\n return self::encodeHeaderBase64($string, $default_charset);\n }\n // Encode only if the string contains 8-bit characters or =?\n $j = strlen($string);\n $max_l = 75 - strlen($default_charset) - 7;\n $aRet = array();\n $ret = '';\n $iEncStart = $enc_init = false;\n $cur_l = $iOffset = 0;\n for ($i = 0; $i < $j; ++ $i) {\n switch ($string{$i}) {\n case '\"':\n case '=':\n case '<':\n case '>':\n case ',':\n case '?':\n case '_':\n if ($iEncStart === false) {\n $iEncStart = $i;\n }\n $cur_l += 3;\n if ($cur_l > ($max_l - 2)) {\n /* if there is an stringpart that doesn't need encoding, add it */\n $aRet[] = substr($string, $iOffset, $iEncStart - $iOffset);\n $aRet[] = \"=?$default_charset?Q?$ret?=\";\n $iOffset = $i;\n $cur_l = 0;\n $ret = '';\n $iEncStart = false;\n } else {\n $ret .= sprintf(\"=%02X\", ord($string{$i}));\n }\n break;\n case '(':\n case ')':\n if ($iEncStart !== false) {\n $aRet[] = substr($string, $iOffset, $iEncStart - $iOffset);\n $aRet[] = \"=?$default_charset?Q?$ret?=\";\n $iOffset = $i;\n $cur_l = 0;\n $ret = '';\n $iEncStart = false;\n }\n break;\n case ' ':\n if ($iEncStart !== false) {\n $cur_l ++;\n if ($cur_l > $max_l) {\n $aRet[] = substr($string, $iOffset, $iEncStart - $iOffset);\n $aRet[] = \"=?$default_charset?Q?$ret?=\";\n $iOffset = $i;\n $cur_l = 0;\n $ret = '';\n $iEncStart = false;\n } else {\n $ret .= '_';\n }\n }\n break;\n default:\n $k = ord($string{$i});\n if ($k > 126) {\n if ($iEncStart === false) {\n // do not start encoding in the middle of a string, also take the rest of the word.\n $sLeadString = substr($string, 0, $i);\n $aLeadString = explode(' ', $sLeadString);\n $sToBeEncoded = array_pop($aLeadString);\n $iEncStart = $i - strlen($sToBeEncoded);\n $ret .= $sToBeEncoded;\n $cur_l += strlen($sToBeEncoded);\n }\n $cur_l += 3;\n /* first we add the encoded string that reached it's max size */\n if ($cur_l > ($max_l - 2)) {\n $aRet[] = substr($string, $iOffset, $iEncStart - $iOffset);\n $aRet[] = \"=?$default_charset?Q?$ret?= \"; /* the next part is also encoded => separate by space */\n $cur_l = 3;\n $ret = '';\n $iOffset = $i;\n $iEncStart = $i;\n }\n $enc_init = true;\n $ret .= sprintf(\"=%02X\", $k);\n } else {\n if ($iEncStart !== false) {\n $cur_l ++;\n if ($cur_l > $max_l) {\n $aRet[] = substr($string, $iOffset, $iEncStart - $iOffset);\n $aRet[] = \"=?$default_charset?Q?$ret?=\";\n $iEncStart = false;\n $iOffset = $i;\n $cur_l = 0;\n $ret = '';\n } else {\n $ret .= $string{$i};\n }\n }\n }\n break;\n }\n }\n if ($enc_init) {\n if ($iEncStart !== false) {\n $aRet[] = substr($string, $iOffset, $iEncStart - $iOffset);\n $aRet[] = \"=?$default_charset?Q?$ret?=\";\n } else {\n $aRet[] = substr($string, $iOffset);\n }\n $string = implode('', $aRet);\n }\n return $string;\n }", "function utf8encode($string){\n\tif(function_exists('mb_convert_encoding')){\n\t\t return mb_convert_encoding($string, \"UTF-8\", mb_detect_encoding($string));\n\t}else{\n\t\treturn utf8_encode($string);\n\t}\n}", "protected function _encode($str = '') {\n\t\treturn iconv(\"UTF-8\",\"UTF-8//IGNORE\", html_entity_decode($str, ENT_COMPAT, 'utf-8'));\n\t}", "function encode($text) {\n $b1 = 0x80 | (0x1 & 0x0f);\n $length = strlen($text);\n\n if ($length <= 125)\n $header = pack('CC', $b1, $length);\n elseif($length > 125 && $length < 65536)$header = pack('CCS', $b1, 126, $length);\n elseif($length >= 65536)\n $header = pack('CCN', $b1, 127, $length);\n\n return $header.$text;\n}", "protected function _urlencodeRfc3986($input)\n\t{\n\t\tif(is_array($input)) {\n\t\t\treturn array_map(array($this, '_urlencodeRfc3986'), $input);\n\t\t} elseif (is_scalar($input)) {\n\t\t\treturn str_replace('+',' ',str_replace('%7E', '~', rawurlencode($input)));\n\t\t} else{\n\t\t\treturn '';\n\t\t}\n\t}", "public function testEqualsAndQuestionAndUnderscoreAreEncoded()\n {\n $encoder = new QpMimeHeaderEncoder();\n $this->assertEquals('=3D=3F=5F', $encoder->encodeString('=?_'), 'Chars =, ? and _ (underscore) may not appear as per RFC 2047.');\n }", "function acadp_base64_encode( $string ) {\n\t return str_replace( array( '+', '/', '=' ), array( '-', '_', '.' ), base64_encode( $string ) );\n}", "function url_encode($string){\n return urlencode(utf8_encode($string));\n }", "public function encodeHeader($str, $position = 'text')\n {\n $matchcount = 0;\n switch (strtolower($position)) {\n case 'phrase':\n if (!preg_match('/[\\200-\\377]/', $str)) {\n // Can't use addslashes as we don't know the value of magic_quotes_sybase\n $encoded = addcslashes($str, \"\\0..\\37\\177\\\\\\\"\");\n if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\\'*+\\/=?^_`{|}~ -]/', $str)) {\n return ($encoded);\n } else {\n return (\"\\\"$encoded\\\"\");\n }\n }\n $matchcount = preg_match_all('/[^\\040\\041\\043-\\133\\135-\\176]/', $str, $matches);\n break;\n /** @noinspection PhpMissingBreakStatementInspection */\n case 'comment':\n $matchcount = preg_match_all('/[()\"]/', $str, $matches);\n // Intentional fall-through\n case 'text':\n default:\n $matchcount += preg_match_all('/[\\000-\\010\\013\\014\\016-\\037\\177-\\377]/', $str, $matches);\n break;\n }\n\n //There are no chars that need encoding\n if ($matchcount == 0) {\n return ($str);\n }\n\n $maxlen = 75 - 7 - strlen($this->CharSet);\n // Try to select the encoding which should produce the shortest output\n if ($matchcount > strlen($str) / 3) {\n // More than a third of the content will need encoding, so B encoding will be most efficient\n $encoding = 'B';\n if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) {\n // Use a custom function which correctly encodes and wraps long\n // multibyte strings without breaking lines within a character\n $encoded = $this->base64EncodeWrapMB($str, \"\\n\");\n } else {\n $encoded = base64_encode($str);\n $maxlen -= $maxlen % 4;\n $encoded = trim(chunk_split($encoded, $maxlen, \"\\n\"));\n }\n } else {\n $encoding = 'Q';\n $encoded = $this->encodeQ($str, $position);\n $encoded = $this->wrapText($encoded, $maxlen, true);\n $encoded = str_replace('=' . self::CRLF, \"\\n\", trim($encoded));\n }\n\n $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . \"?$encoding?\\\\1?=\", $encoded);\n $encoded = trim(str_replace(\"\\n\", $this->LE, $encoded));\n\n return $encoded;\n }", "function utf8_uri_encode($utf8_string, $length = 0, $encode_ascii_characters = \\false)\n {\n }", "public function EncodeString ($str, $encoding = 'base64') {\n\t $encoded = '';\n\t switch(strtolower($encoding)) {\n\t case 'base64':\n\t $encoded = chunk_split(base64_encode($str), 76, $this->LE);\n\t break;\n\t case '7bit':\n\t case '8bit':\n\t $encoded = $this->FixEOL($str);\n\t //Make sure it ends with a line break\n\t if (substr($encoded, -(strlen($this->LE))) != $this->LE)\n\t $encoded .= $this->LE;\n\t break;\n\t case 'binary':\n\t $encoded = $str;\n\t break;\n\t case 'quoted-printable':\n\t $encoded = $this->EncodeQP($str);\n\t break;\n\t default:\n\t $this->SetError($this->Lang('encoding') . $encoding);\n\t break;\n\t }\n\t \n\t return $encoded;\n\t}", "function cs_encode($input, $charsetFrom = 'ISO-8859-15', $charsetTo = null)\r\n{\r\n\tglobal $cs_main;\r\n\t\r\n\tif (is_null($charsetTo))\r\n\t{\r\n\t\t$charsetTo = strtoupper($cs_main['charset']);\r\n\t}\r\n\t\r\n\t// no need to convert if the charsets are the same\r\n\tif (strtoupper($charsetTo) == strtoupper($charsetFrom))\r\n\t{\r\n\t\treturn $input;\r\n\t}\r\n\t\r\n\tif (function_exists('iconv'))\r\n\t{\r\n\t\t/* use transliteral */\r\n\t\t$return = @iconv(strtoupper($charsetFrom), strtoupper($charsetTo).'//TRANSLIT', $input);\r\n\t\tif ($return !== false)\r\n\t\t\treturn $return;\r\n\t}\r\n\telse\r\n\t{\r\n\t\t/* Uses utf8_encode/utf8_decode and mb_detect_encoding/mb_convert_encoding.\r\n\t\t * To be extended in the future...\r\n\t\t */\r\n\t\tif (strtoupper($charsetTo) == 'UTF-8')\r\n\t\t{\r\n\t\t\tswitch (strtoupper($charsetFrom))\r\n\t\t\t{\r\n\t\t\tcase 'ISO-8859-1':\r\n//\t\t\tcase 'ISO-8859-15':\r\n\t\t\t\treturn utf8_encode($input);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tif (function_exists('mb_detect_encoding'))\r\n\t\t\t\t{\r\n\t\t\t\t\t$encoding = mb_detect_encoding($input);\r\n\t\t\t\t\tif (is_string($encoding))\r\n\t\t\t\t\t\treturn mb_convert_encoding($input, 'UTF-8', $encoding);\r\n\t\t\t\t\t// else, do nothing\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (strtoupper($charsetFrom) == 'UTF-8')\r\n\t\t{\r\n\t\t\tswitch (strtoupper($charsetTo))\r\n\t\t\t{\r\n\t\t\tcase 'ISO-8859-1':\r\n//\t\t\tcase 'ISO-8859-15':\r\n\t\t\t\treturn utf8_decode($input);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t// if we don't know what to do, just return it\r\n\treturn $input;\r\n}", "function utf8_uri_encode( $utf8_string, $length = 0 ) {\r\n\t $unicode = '';\r\n\t $values = array();\r\n\t $num_octets = 1;\r\n\t $unicode_length = 0;\r\n\r\n\t mbstring_binary_safe_encoding();\r\n\t $string_length = strlen( $utf8_string );\r\n\t reset_mbstring_encoding();\r\n\r\n\t for ($i = 0; $i < $string_length; $i++ ) {\r\n\r\n\t\t$value = ord( $utf8_string[ $i ] );\r\n\r\n\t\tif ( $value < 128 ) {\r\n\t\t if ( $length && ( $unicode_length >= $length ) )\r\n\t\t\tbreak;\r\n\t\t $unicode .= chr($value);\r\n\t\t $unicode_length++;\r\n\t\t} else {\r\n\t\t if ( count( $values ) == 0 ) $num_octets = ( $value < 224 ) ? 2 : 3;\r\n\r\n\t\t $values[] = $value;\r\n\r\n\t\t if ( $length && ( $unicode_length + ($num_octets * 3) ) > $length )\r\n\t\t\tbreak;\r\n\t\t if ( count( $values ) == $num_octets ) {\r\n\t\t\tif ($num_octets == 3) {\r\n\t\t\t $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]) . '%' . dechex($values[2]);\r\n\t\t\t $unicode_length += 9;\r\n\t\t\t} else {\r\n\t\t\t $unicode .= '%' . dechex($values[0]) . '%' . dechex($values[1]);\r\n\t\t\t $unicode_length += 6;\r\n\t\t\t}\r\n\r\n\t\t\t$values = array();\r\n\t\t\t$num_octets = 1;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\r\n\t return $unicode;\r\n\t}", "function lang_encode_from_utf($strValue)\r\n{\r\n\tif(function_exists(\"iconv\"))\r\n\t\treturn iconv('UTF-8','Windows-1252',$strValue);\r\n\treturn $strValue;\r\n}", "public function testParensAndQuotesAreEncoded()\n {\n\n $encoder = new QpMimeHeaderEncoder();\n $this->assertEquals('=28=22=29', $encoder->encodeString('(\")'), 'Chars (, \" (DQUOTE) and ) may not appear as per RFC 2047.');\n }", "function urlsafe_b64encode($string) {\n $data = base64_encode($string);\n $data = str_replace(array('+','/','='),array('-','_','.'),$data);\n return $data;\n}", "public function encodePassword(string $raw): string;", "function encode($input)\n{\n\tif(STRIPSLASHES)\n\t\t$input = stripslashes($input);\n\n\treturn urlencode(htmlspecialchars($input));\n}", "function encodeSubject($text)\r\n {\r\n // Activate the following line if needed\r\n // $text = \"=?{$this->charSet}?B?\".base64_encode($text).\"?=\";\r\n return $text;\r\n }", "private function detect_encoding( $str ) {\r\n }", "function urlsafeB64Encode(string $input)\n\t{\n\t\treturn str_replace('=', '', strtr(base64_encode($input), '+/', '-_'));\n\t}", "function fixEncoding($in_str) \r\n{ \r\n $cur_encoding = mb_detect_encoding($in_str) ; \r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\")) \r\n return $in_str; \r\n else \r\n return utf8_encode($in_str); \r\n}", "public function encodeString($str, $encoding = 'base64')\n {\n $encoded = '';\n switch (strtolower($encoding)) {\n case 'base64':\n $encoded = chunk_split(base64_encode($str), 76, $this->LE);\n break;\n case '7bit':\n case '8bit':\n $encoded = $this->fixEOL($str);\n // Make sure it ends with a line break\n if (substr($encoded, -(strlen($this->LE))) != $this->LE) {\n $encoded .= $this->LE;\n }\n break;\n case 'binary':\n $encoded = $str;\n break;\n case 'quoted-printable':\n $encoded = $this->encodeQP($str);\n break;\n default:\n $this->setError($this->lang('encoding') . $encoding);\n break;\n }\n return $encoded;\n }", "function encodeToken($token) {\n if (!$token) return;\n $key = sha1('ab$6*1hVmkLd^0.');\n $code1 = substr($key,0,strlen($key)-constant('token_length')); \n $code2 = substr($key,strlen($key)-constant('token_length'),constant('token_length'));\n $key = $code1.$token.$code2.'|'.base64_encode(strlen($code2.$token));\n\n return base64_encode($key);\n }", "public function encode_convert($string) {\r\n\t\treturn mb_convert_encoding(trim($string), \"UTF-8\", \"EUC-JP, UTF-8, ASCII, JIS, eucjp-win, sjis-win\");\r\n\t}", "function fixEncoding($in_str)\r\n\r\n{\r\n\r\n $cur_encoding = mb_detect_encoding($in_str) ;\r\n\r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\"))\r\n\r\n return $in_str;\r\n\r\n else\r\n\r\n return utf8_encode($in_str);\r\n\r\n}", "public function enc($val)\n {\n\n return rawurlencode($val);\n }", "function Base64Encode( $str )\n{ \n return substr(chunk_split(base64_encode( $str ),64,\"\\n\"),0,-1).\"\\n\";\n}" ]
[ "0.72643566", "0.70784384", "0.7049284", "0.692924", "0.6846208", "0.6761426", "0.6655924", "0.6645543", "0.6614273", "0.66053146", "0.6595956", "0.65885293", "0.6510286", "0.650735", "0.6496986", "0.64969796", "0.6487117", "0.6451612", "0.64362377", "0.6435398", "0.6388115", "0.6377038", "0.6357255", "0.6353087", "0.635047", "0.635047", "0.635047", "0.635047", "0.63369554", "0.6309043", "0.6289161", "0.62810814", "0.6256589", "0.6256497", "0.62509197", "0.6235797", "0.6227678", "0.6214021", "0.6214021", "0.6214021", "0.6200211", "0.61986053", "0.6192886", "0.61907", "0.6184947", "0.6184947", "0.617814", "0.6175052", "0.61706156", "0.6147908", "0.61405855", "0.6135438", "0.6117533", "0.6114053", "0.61109525", "0.60909975", "0.60855824", "0.6083967", "0.60821927", "0.60761064", "0.6067363", "0.60661733", "0.60557175", "0.60429853", "0.6037194", "0.603561", "0.6023673", "0.60227734", "0.6021757", "0.602057", "0.6018549", "0.6017332", "0.60050774", "0.59995013", "0.5998154", "0.59953284", "0.598887", "0.59842026", "0.5974683", "0.59646523", "0.59585214", "0.59544164", "0.59528357", "0.5950325", "0.5937838", "0.5935985", "0.59269166", "0.59176224", "0.59131587", "0.5907471", "0.5907007", "0.59056556", "0.5901778", "0.5894603", "0.588903", "0.5884066", "0.58779114", "0.5865347", "0.58630526", "0.5850954" ]
0.59374064
85
This is effectively a constructorcall, since Magento doesn't call _construct for items loaded from the db.
protected function _afterLoad() { parent::_afterLoad(); if ($plexId = $this->getData('plex_id')) { $this->customer = Mage::getModel('customer/customer')->load($plexId); } else { $this->customer = Mage::getModel('customer/customer'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __construct() {\r\n $this->items = $this->initItems();\r\n }", "public function _construct()\n {\n $this->_initProductCollection();\n parent::_construct();\n }", "public function __construct()\n {\n parent::__construct();\n $session = Mage::getSingleton('customer/session');\n $purchased = Mage::getResourceModel('mytunes/link_collection')\n ->addFieldToFilter('customer_id', $session->getCustomerId())\n ->addOrder('order_id', 'desc')\n ->addOrder('order_item_id', 'asc')\n ->addOrder('track_number', 'asc');\n $this->setItems($purchased);\n }", "protected function _construct()\n {\n $this->_init('cminds_multiwishlist/item', 'wishlist_item_id');\n }", "public function __construct()\n {\n $this->items = new Collection;\n }", "public function __construct()\n {\n $this->items = new Collection;\n }", "public function __construct()\n {\n infolog('[BulkInventory] __construct at '. now());\n }", "function __construct()\r\n\t{\r\n // Call the Controller constructor\r\n\t\tparent::__construct();\r\n\t\t$this->config->load_db_items();\r\n\t}", "public function __construct($item) {\n\t\t$this->item = $item;\n\t}", "public function _construct()\r\r\n {\r\r\n $this->_init('megamenu/menuitems', 'id');\r\r\n }", "public function __construct($items = [])\n {\n //Execute parent construct\n parent::__construct($items);\n }", "public function __construct()\n {\n parent::_construct();\n $this->setModel('adminhtml/report_item');\n $this->_resource = Mage::getResourceModel('sales/report')->init($this->_aggregationTable);\n $this->setConnection($this->getResource()->getReadConnection());\n }", "public function __construct($id, $item);", "public function ITEM($itemid) { $this->__construct($itemid); }", "public function __construct()\n {\n parent::__construct();\n \n $this->load->helper('item');\n }", "public function _construct()\n {\n parent::_construct();\n $this->_init('wholesale/product');\n }", "function __construct()\n {\n parent::__construct();\n\n $this->methods['addtocart_post']['limit'] = 500; \n $this->methods['removeitem_post']['limit'] = 500; \n\n\t\t$this->load->model(\"Item_model\", \"item\");\n\t\t$this->load->model(\"Transactions_model\", \"transactions\");\n }", "public function initialize()\n {\n // attributes\n $this->setName('item');\n $this->setPhpName('Item');\n $this->setIdentifierQuoting(false);\n $this->setClassName('\\\\Slims\\\\Models\\\\Bibliography\\\\Item\\\\Item');\n $this->setPackage('Slims.Models.Bibliography.Item');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('item_id', 'ItemId', 'INTEGER', true, null, null);\n $this->addColumn('item_code', 'Item_code', 'VARCHAR', true, 20, null);\n $this->addForeignKey('biblio_id', 'BiblioId', 'INTEGER', 'biblio', 'biblio_id', true, null, null);\n $this->addColumn('call_number', 'Call_number', 'VARCHAR', false, 50, null);\n $this->addForeignKey('coll_type_id', 'Coll_type_id', 'INTEGER', 'mst_coll_type', 'coll_type_id', false, 3, null);\n $this->addColumn('inventory_code', 'Inventory_code', 'VARCHAR', false, 200, null);\n $this->addColumn('received_date', 'Received_date', 'DATE', false, null, null);\n $this->addColumn('supplier_id', 'SupplierId', 'INTEGER', false, null, null);\n $this->addColumn('order_no', 'Order_no', 'VARCHAR', false, 20, null);\n $this->addColumn('location_id', 'LocationId', 'VARCHAR', false, 3, null);\n $this->addColumn('order_date', 'Order_date', 'DATE', false, null, null);\n $this->addColumn('item_status_id', 'ItemStatusId', 'CHAR', false, 3, null);\n $this->addColumn('site', 'Site', 'VARCHAR', false, 50, null);\n $this->addColumn('source', 'Source', 'INTEGER', false, 1, null);\n $this->addColumn('invoice', 'Invoice', 'VARCHAR', false, 20, null);\n $this->addColumn('price', 'Price', 'INTEGER', false, null, null);\n $this->addColumn('price_currency', 'Price_currency', 'VARCHAR', false, 10, null);\n $this->addColumn('invoice_date', 'Invoice_date', 'DATE', false, null, null);\n $this->addColumn('input_date', 'Input_date', 'TIMESTAMP', false, null, null);\n $this->addColumn('last_update', 'Last_update', 'TIMESTAMP', false, null, null);\n $this->addForeignKey('uid', 'Uid', 'INTEGER', 'user', 'user_id', false, null, null);\n }", "protected function __construct() {\n\t\t//Generated by ManagerGenerator::generateConstruct()\n\t}", "public function __construct()\n {\n $this->mapper = \\Lib\\DataMapper::instance();\n $this->product = new Product();\n }", "public function __construct() {\n $this->items = new ArrayCollection;\n $this->orderProducts = new ArrayCollection;\n $this->promotions = new ArrayCollection();\n\n }", "public function __construct(){\n parent::__construct();\n\n # load history\n # have to get it from database manually to get past the cache\n $config = Mage::getModel(\"core/config_data\")->getCollection()\n ->addFieldToFilter(\"scope_id\",\"0\")\n ->addFieldToFilter(\"path\",self::XML_PATH_DATASTORE)\n ->getFirstItem();\n\n if($config->getId()){\n $this->_dataStore = json_decode($config->getValue(),true);\n } else {\n $this->_dataStore = json_decode(Mage::getStoreConfig(self::XML_PATH_DATASTORE,0),true);\n }\n }", "public function __construct($item)\n\t{\n\t\tif (Valid::digit($item))\n\t\t{\n\t\t\t$id = $item;\n\t\t\t$item = ORM::factory('Item', $id);\n\n\t\t\tif ($item->loaded())\n\t\t\t{\n\t\t\t\t$this->_item = $item;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Item_Exception('Item \":id\" could not be loaded', array(':id' => $id));\n\t\t\t}\n\t\t}\n\t\telseif ($item->loaded())\n\t\t{\n\t\t\tif (is_a($item, 'Model_Item'))\n\t\t\t{\n\t\t\t\t$this->_item = $item;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Item_Exception('The supplied item\\'s resource does not come from a model.');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Item_Exception('Item \":name\" could not be loaded', array(':name' => $item->name));\n\t\t}\n\t}", "private function __construct()\n\t{\n\t\tglobal $ilDB;\n\n\t\t$this->db =& $ilDB;\n\n\t\t$this->__read();\n\t}", "public function __construct($item)\n {\n $this->item = $item;\n }", "public function __construct()\n {\n $this->productList = new ProductList();\n }", "protected function _construct()\n {\n $this->_init(\\MagentoCoders\\CustomCatalog\\Model\\Product::class, Product::class);\n }", "public function __construct()\n {\n $this->connection = Shopware()->Models()->getConnection();\n $this->db = Shopware()->Db();\n $this->writer = new TranslationComponent();\n $this->shops = $this->getShops();\n }", "function __construct()\n {\n $this->items = [];\n }", "public function __construct($items) {\n $this->items = $items;\n }", "public function __construct(){\n parent::__construct(new ImportItemInfo());\n }", "function __construct()\n\t{\n\t\t$this->db = new dbHelper();\n\t\t$this->cb = new CombosData();\n\t\treturn;\n\t}", "protected function _construct()\n {\n $this->_init(self::TABLE_NAME, self::TABLE_ID);\n }", "public function __construct()\n {\n $this->uuid = Uuid::uuid4()->toString();\n $this->createdDate = new \\DateTime();\n $this->items = new ArrayCollection();\n }", "function __construct() {\n \t$this->tablename \t\t\t= \"block_ilp_plu_dd\";\n \t$this->data_entry_tablename = \"block_ilp_plu_dd_ent\";\n\t\t$this->items_tablename \t\t= \"block_ilp_plu_dd_items\";\n\tparent::__construct();\n }", "function __construct() \n\t{\n\t\tparent::__construct( 'rt_products', 'id', 'prd' );\n\t}", "public function __construct() {\n $this->_db = Zend_Registry::get('db');\n $this->_auth = Zend_Auth::getInstance()->getIdentity();\n if (isset($this->getSessionNs()->items)) {\n $this->_items = $this->getSessionNs()->items;\n }\n if (isset($this->getSessionNs()->shipping)) {\n $this->_shipping = $this->getSessionNs()->shipping;\n }\n if (isset($this->getSessionNs()->shippingCost)) {\n $this->_shippingCost = $this->getSessionNs()->shippingCost;\n }\n if (isset($this->getSessionNs()->salesTax)) {\n $this->_salesTax = $this->getSessionNs()->salesTax;\n }\n $this->_order = new Application_Model_Order;\n }", "public function __construct() {\n\t\t$this->model = new Model();\n\t\t$this->view = new View();\n\t\t$this->cart = array();\n\t\t$this->productArray = array();\n\t\t$this->productVar = array();\n\t\t\n\t}", "function __construct($item_id, $item_name, $quantity, $price) {\n $this->item_id = $item_id;\n $this->item_name = $item_name;\n $this->quantity = $quantity;\n $this->price = $price;\n }", "public function __construct() {\n\t\t// creating a collection for storing menus\n\t\t$this->collection = new Collection ();\n\t}", "protected function _construct()\n {\n $this->_init(\\Mage2\\Inquiry\\Model\\ResourceModel\\Inquiry::class);\n }", "public function __construct( )\n\t\t{\n\t\t\t$this->state = self::STATE_NULL;\n\t\t\t$this->iCallbacks = new \\stdClass;\n\t\t\tabstractDatasourceBase::__construct();\n\t\t}", "function __construct(){\n\t\t// nowt much...\n\t}", "public function __construct($product_item)\n {\n $this->product_item = $product_item;\n }", "private static function init() \n {\n $object = Item::getObjectById($this->id);\n\n $this->name = $object['name'];\n $this->status = $object['status'];\n }", "private function __construct()\r\n\t\t{\r\n\r\n\t\t\t/* Do Nothing */\r\n\r\n\t\t}", "public function init()\n\t{\n\t\tparent::init();\n\t\t//$this->itemFile = Yii::getAlias($this->itemFile);\n\t\t$this->load();\n\t}", "protected function _construct()\r\n {\r\n $this->_init('ss_price', 'price_id');\r\n }", "protected function __init__() { }", "function _construct() {\n\t\tparent::_construct();\n\t}", "public function __construct()\n {\n // All of my models are like this\n parent::__construct(get_class($this));\n // Calling methods to get the relevant data\n $this->generateNewsData();\n $this->generateAnalyticsData();\n $this->generatePostsData();\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t// Other code to run when object is instantiated\n\t}", "protected function _construct()\r\n {\r\n $this->setCacheKey(\r\n 'rss_catalog_category_'\r\n . Mage::app()->getStore()->getId() . '_'\r\n . $this->getRequest()->getParam('cid') . '_'\r\n . $this->getRequest()->getParam('sid')\r\n );\r\n $this->setCacheLifetime(600);\r\n }", "public function _construct()\n {\n $this->_init('configbox_magento_xref_mprod_cbprod', 'id');\n }", "public function _construct()\n {\n $this->_init('warehouse/warehouse', 'id');\n\t\t//$this->_isPkAutoIncrement = false;\n }", "function __construct()\n {\n parent::__construct();\n\t\t// Other stuff\n\t\t$this->_prefix = $this->config->item('DX_table_prefix');\n\t\t$this->_table = $this->_prefix.$this->config->item('DX_app_module');\n }", "public function __construct()\n\t\t{\n\t\t\t# code...\n\t\t}", "public function __construct()\n\t{\n\t\t// creating a collection for storing menus\n\t\t$this->collection = new Collection();\n\t}", "protected function _construct()\n {\n $this->_init('tiny_compressimages/totals', 'entity_id');\n }", "public function __construct()\n {\n $this->_idField = $this->getIdField();\n $this->_tableName = $this->getTableName();\n\n if (!static::$_db) {\n static::$_db = Database::getInstance();\n }\n\n if (!static::$_schema) {\n static::$_schema = new Cache();\n }\n }", "public function __construct()\n {\n parent::__construct();\n // Only index live items.\n // The old FTS module also indexed Draft items. This is unnecessary\n // If versioned is needed, a separate Versioned Search module is required\n Versioned::set_reading_mode(Versioned::DEFAULT_MODE);\n $this->setService(Injector::inst()->get(SolrCoreService::class));\n $this->setLogger(Injector::inst()->get(LoggerInterface::class));\n $this->setDebug(Director::isDev() || Director::is_cli());\n $this->setBatchLength(DocumentFactory::config()->get('batchLength'));\n $cores = SolrCoreService::config()->get('cpucores') ?: 1;\n $this->setCores($cores);\n $currentStates = SiteState::currentStates();\n SiteState::setDefaultStates($currentStates);\n }", "public function __construct()\n {\n $this->itemPrices = new ArrayCollection();\n }", "public function __construct() {\n //récupérer les items dans le panier s'il y en avait de renseignés dans la session\n $this->items = [];\n $this->load();\n }", "protected function _construct()\n {\n $this->_init(ProductResourceModel::class);\n }", "public function __construct() {\n\t\t\t// retrieve and store into session any overflowed errors to prevent excessive logging\n\t\t\terrorHandler::retrieveErrorOverflow();\n\t\t\tparent::__construct();\n\t\t\t// instantiate shopping cart\n\t\t\t$this->package = new package_old;\n\t\t\t// set up package via offer request\n\t\t\tif ($landingPackage = tracker::get('landingPackage')) {\n\t\t\t\t$this->package->setOfferID(tracker::get('offerID'));\n\t\t\t\t$this->package->setPackageID($landingPackage);\n\t\t\t\t$this->package->getPackageArray();\n\t\t\t\tif (!$this->package->validPackage()) {\n\t\t\t\t\t$this->package->resetPackage();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// set up package via direct url request\n\t\t\t\t$this->package->retrievePackage();\n\t\t\t}\n\t\t\t// initialize address objects\n\t\t\t$this->shippingAddress = new address_old;\n\t\t\t$this->billingAddress = new address_old;\n\t\t\t// payment method object\n\t\t\t$this->paymentMethod = new paymentMethod;\n\t\t\t// order object\n\t\t\t$this->order = new orderProcessor;\n\t\t\t$this->order->associateOrder($this->memberID, $this->shippingAddress, $this->billingAddress, $this->paymentMethod, $this->package);\n\t\t}", "public function __construct() {\n $this->items = [];\n }", "public function __construct()\n { \n parent::__construct();\n\n $this->init($this->_sCoreTable);\n }", "private function __construct()\n\t{\n\t\t$this->_loadCacheObj();\n\t\treturn;\n\t}", "public function __construct() \n\t{\n\t\t$strSqlModel = \n\t\t'SELECT cat.*, prd.* \n\t\tFROM \n\t\t(\n\t\t\t(\n\t\t\t\t(\n\t\t\t\t\t(\n\t\t\t\t\t\tproducts prd INNER JOIN categories cat ON (prd.prd_cat_id = cat.cat_id)\n\t\t\t\t\t) INNER JOIN prices pri ON (prd.prd_id = pri.pri_prd_id)\n\t\t\t\t) INNER JOIN countries cnt ON (pri.pri_cnt_id = cnt.cnt_id)\n\t\t\t) INNER JOIN currencies cur ON (cnt.cnt_cur_id = cur.cur_id)\n\t\t)\n\t\tINNER JOIN stocks stk ON (prd.prd_id = stk.stk_prd_id) \n\t\t'.CONF_TAG_LIST_SQL_CRITERIA.' \n\t\tGROUP BY prd.prd_id \n\t\tORDER BY cat.cat_id ASC, prd.prd_id ASC \n\t\t'.CONF_TAG_LIST_SQL_LIMIT.'';\n\t\t\n\t\t$intPageNbRow = CONF_LIST_PAGE_COUNT_ROW_PROD;\n\t\t\n\t\t$tabCritOperation = array();\n\t\t$tabCritOperation['cur_id'] = \"(cur.cur_id = \".CONF_TAG_LIST_SQL_OPE_VALUE.\")\";\n\t\t\n\t\tparent::__construct($strSqlModel, $tabCritOperation, $intPageNbRow);\n\t}", "function __construct()\n\t\t{\n\t\t\t// Call the Model constructor\n\t\t\tparent::__construct();\n\t\t $this->load->database();\t\n\t\t}", "public function __construct()\n {\n parent::__construct();\n $this->articleList = ArticleManager::findAll();\n }", "public function __construct()\n {\n $this->cart = Cart::content();\n $this->checkStock();\n }", "protected function _construct()\n {\n $this->_init('magento_reminder_rule', 'rule_id');\n $this->_websiteTable = $this->getTable('magento_reminder_rule_website');\n }", "public function _construct()\n {\n $this->_init('saveorder/saveorder', 'saveorder_id');\n }", "public function __construct()\n {\n $this->item = [];\n }", "public function __construct() {\n $this->items = func_get_args();\n }", "public function __construct(&$db)\n\t{\n\t\tparent::__construct('#__rl_disp_restaurant_list', 'id', $db);\n\t}", "public function __construct() {\n\t\t$this->answers = new Tx_Extbase_Persistence_ObjectStorage();\n\t\t\n\t\t$this->columns = new Tx_Extbase_Persistence_ObjectStorage();\n\t\t\n\t\t$this->subquestions = new Tx_Extbase_Persistence_ObjectStorage();\n\t\t\n\t\t$this->sublines = new Tx_Extbase_Persistence_ObjectStorage();\n\t}", "public function __construct()\n {\n parent::__construct();\n // check if user has products capability\n if(User::userCan('products') === false)\n {\n abort(403, 'Unauthorized action.');\n }\n $this->product \t\t= new Products;\n $this->category \t= new Categories;\n $this->att \t = new ProductAttributes;\n }", "private function __construct()\t{}", "public function __construct()\n\t{\n\t\t// DO NOT! call parent::__construct(); as otherwise we will end up having references in this class.\n\t}", "public function __construct() {\n $this->articleModel = $this->loadModel('Article');\n $this->categories = $this->articleModel->findAllCategories();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->load->model('collection_model');\n $this->load->model('collection_product_relaction_model');\n }", "public function __construct() {\n\t\t// Nothing to do.\n\t}", "public function __construct() {\n $this->load = new Load();\n $this->model = new Model();\n }", "public function __construct( $item ) {\n\t\t$this->set_item( $item );\n\n\t\t$this->setup_actions();\n\t}", "public function _construct(){\n $infoOrder = Mage::getSingleton('adminhtml/session')->getInfoOrder();\n if($infoOrder == null){\n $orderId = Mage::getSingleton('adminhtml/session')->getOrderViewDetail();\n } else {\n $orderId = $infoOrder['entity_id'];\n }\n if($orderId == null){\n $orderId = $this->getRequest('')->getParam('order_id');\n }\n $this->order = Mage::getModel('sales/order')->load($orderId);\n $this->_orderId = $orderId;\n }", "function __construct(){\r\n\t\t$this->mIDCache\t\t\t= MY_DB_IN . \"-\" . SAFE_VERSION . \"-\" . SAFE_REVISION;\r\n \t\t$this->init();\r\n }", "protected function __construct()\r\n\t\t{\r\n\t\t}", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->load->model('data');\n\t}", "function init(){\n parent::init();\n \n //HAS ONE BLOCK\n \n\n\t\t//FIELDS\n $this->addField(\"Name\")->type(\"string\");\n $this->addField(\"Description\")->type(\"text\");\n \n\n //HAS MANY BLOCK\n\t\t$this->hasMany(\"Items_Core\",\"category_id\",null,\"Items\");\n \t\t\n }", "public function __construct()\n {\n // Setup internal data arrays\n self::internals();\n }", "public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.windowsQualityUpdateCatalogItem');\n }", "public function __construct() {\n\t\t$this->_db = Database::getInstance();\n\t}", "public function __construct(Item $items)\n {\n $this->model = $items;\n }", "public function _construct()\n {\n $this->_init('liveoptim/capping', 'id');\n }", "public function __construct()\n {\n $this->model = New Checklist();\n $this->modelEvents = New Event();\n $this->fractal = new Manager();\n }", "public function __construct($itemData) {\n if(self::$itemSchema == null) {\n self::updateSchema();\n }\n\n $this->defindex = $itemData->defindex;\n\n $this->backpackPosition = $itemData->inventory & 0xffff;\n $this->class = self::$itemSchema[$this->defindex]->item_class;\n $this->count = $itemData->quantity;\n $this->id = $itemData->id;\n $this->level = $itemData->level;\n $this->name = self::$itemSchema[$this->defindex]->item_name;\n $this->quality = self::$qualities[$itemData->quality];\n $this->slot = self::$itemSchema[$this->defindex]->item_slot;\n $this->type = self::$itemSchema[$this->defindex]->item_type_name;\n\n $this->equipped = array();\n foreach(self::$CLASSES as $classId => $className) {\n $this->equipped[$className] = ($itemData->inventory & (1 << 16 + $classId) != 0);\n }\n\n if(self::$itemSchema[$this->defindex]->attributes != null) {\n $this->attributes = self::$itemSchema[$this->defindex]->attributes->attribute;\n }\n }", "public function __construct()\n {\n $this->initStorageObjects();\n }", "protected function __construct()\n\t{\n\t\t// Nothing here\n\t}", "final private function __construct() {\n\t\t\t}" ]
[ "0.76702815", "0.732443", "0.719515", "0.7031342", "0.6862528", "0.6862528", "0.683766", "0.6837236", "0.6825874", "0.681014", "0.6803631", "0.6788996", "0.67732745", "0.6768777", "0.67572993", "0.6743083", "0.6710229", "0.6689357", "0.6683816", "0.66826534", "0.66787773", "0.6678175", "0.66665", "0.66603786", "0.66502225", "0.66392803", "0.6623509", "0.66143054", "0.6593866", "0.6584031", "0.65808296", "0.6577142", "0.65699077", "0.65595865", "0.65389514", "0.65211916", "0.65203756", "0.651389", "0.65049976", "0.6499854", "0.64981806", "0.6497297", "0.6497018", "0.6491592", "0.6485618", "0.6473672", "0.6471715", "0.6459203", "0.64568526", "0.6451291", "0.644766", "0.6439809", "0.6437416", "0.6434526", "0.64280343", "0.6425739", "0.64245254", "0.6420883", "0.64189774", "0.6417113", "0.6413071", "0.6409393", "0.64062387", "0.64055276", "0.63936615", "0.63889897", "0.6388629", "0.6387584", "0.6385736", "0.6377437", "0.63746387", "0.63691765", "0.6363743", "0.63620675", "0.6356735", "0.6356284", "0.6354975", "0.63520926", "0.63509214", "0.635059", "0.6350299", "0.63465357", "0.634009", "0.6337437", "0.63332206", "0.6331652", "0.6327522", "0.63201463", "0.6313082", "0.63118726", "0.6308634", "0.63045543", "0.6303953", "0.6303053", "0.6297794", "0.6296456", "0.6295137", "0.6290982", "0.628937", "0.62862885", "0.6275026" ]
0.0
-1
Get the customer represented by this Plex User
public function getCustomer() { return $this->customer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCustomer()\n {\n return $this->hasOne(User::class, ['id' => 'customer_id']);\n }", "public function getCustomer()\n {\n return $this->hasOne(User::className(), ['id' => 'customer_id']);\n }", "public function customer()\n {\n return Customer::retrieve($this->customer);\n }", "public function getCustomer()\n {\n return $this->data->customer;\n }", "public function getCustomer() {\n return $this->customer;\n }", "public function getCustomer() {\r\n return $this->session->getCustomer();\r\n }", "public function customer(){\n\t\treturn Customers::find($this->customers_id);\n\t}", "public function getCustomer()\n {\n if (null === $customer && isset($this['CUSTOMER_ID']))\n {\n $this->customer = \\Fastbill\\Customer\\Finder::findOneById($this['CUSTOMER_ID']);\n }\n return $this->customer;\n }", "public function customer()\n {\n return $this->hasOne('App\\Customer', 'customer_id', 'user_id');\n }", "public function getCustomer()\n {\n $customer = $this->ticketData->getCustomer();\n return $customer;\n }", "public function getCustomer();", "public function getCustomer()\n {\n return $this->hasOne(Customer::className(), ['customerId' => 'customerId']);\n }", "public function getCustomer()\n {\n return \\tabs\\api\\core\\Customer::create($this->getCusref());\n }", "public function getCustomer()\n {\n return $this->hasOne(Customer::class, ['id' => 'customer_id'])->inverseOf('orders');\n }", "public function getCustomer()\n {\n $customer = new Customer($this->getEmail(),\n $this->getFirstname(),\n $this->getLastname());\n $customer->setId($this->getCustomerId())\n ->setStreet($this->getStreet())\n ->setPostCode($this->getPostcode())\n ->setCity($this->getCity())\n ->setCountry($this->getCountry())\n ->setPhone($this->getPhone())\n ->setLanguage($this->getLanguage());\n\n\n return $customer;\n }", "public function customer()\n {\n return $this->hasOne(Customer::class);\n }", "public function customer()\n {\n return $this->hasOne(Customer::class);\n }", "public static function getCustomerInfo() {\n\t\t\tif (isset(self::$customer['user'])) {\n\t\t\t\treturn self::$customer['user'];\n\t\t\t}\n\t\t\treturn NULL;\n\t\t}", "public function getCustomer()\n {\n return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;\n }", "public function getCustomer()\n {\n return $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer;\n }", "protected function getCustomer()\n {\n if($this->isAdmin()) {\n return Mage::getModel('customer/customer')->load(Mage::getSingleton('adminhtml/session_quote')->getCustomerId()); // Get customer from admin panel quote\n } else {\n return Mage::getModel('customer/session')->getCustomer(); // Get customer from frontend quote\n }\n }", "public function findCustomer()\n {\n try {\n return $this->gateway->findCustomer($this->user->paymentProfile)->send()->getData();\n } catch (NotFound $exception) {\n return $this->gateway->findCustomer($this->user->refreshPaymentProfile($this->name))->send()->getData();\n }\n }", "public function getCustomerIdentity()\n {\n return $this->customerIdentity;\n }", "public function getCustomerId() {\n return $this->customerID;\n }", "public function customer()\n {\n return $this->belongsTo(User::class);\n }", "public function getCustomer()\n {\n try {\n return $this->currentCustomer->getCustomer();\n } catch (NoSuchEntityException $e) {\n return null;\n }\n }", "public function getCustomer()\n {\n if (Mage::app()->getStore()->isAdmin()) {\n $adminQuote = Mage::getSingleton('adminhtml/session_quote');\n if ($customer = $adminQuote->getCustomer()) {\n return $customer;\n }\n } else if (Mage::getSingleton('customer/session')->isLoggedIn()) {\n return Mage::getSingleton('customer/session')->getCustomer();\n }\n\n return false;\n }", "public function customer()\n {\n return $this->morphTo(__FUNCTION__, 'customer_type', 'customer_uuid')->withoutGlobalScopes();\n }", "protected function _getCustomer()\n {\n return Mage::registry('current_customer');\n }", "public function user()\n {\n return $this->belongsTo(User::class, 'customer_id');\n }", "public function getCustomerId()\n {\n return $this->customer_id;\n }", "public function getCustomerId()\n {\n return $this->customer_id;\n }", "public function getCustomer() {\r\n\t\tif( isset( $this->_customer ) ) {\r\n\t\t\t$customer = $this->_customer;\r\n\t\t}\r\n\t\telseif( $this->_admin ) {\r\n\t\t\t$customer = Mage::getModel('customer/customer')->load( Mage::getSingleton('adminhtml/session_quote')->getCustomerId() );\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$customer = Mage::getSingleton('customer/session')->getCustomer();\r\n\t\t}\r\n\t\t\r\n\t\t$this->setCustomer( $customer );\r\n\t\t\r\n\t\treturn $customer;\r\n\t}", "public function getCustomer()\n {\n $customerInfo = array(\n 'email' => null,\n 'firstName' => null,\n 'lastName' => null\n );\n\n try {\n if ($this->customerSession->isLoggedIn()) {\n $customer = $this->customerSession->getCustomer();\n $customerMiddleName = $customer->getMiddlename();\n $customerInfo = array(\n 'email' => $customer->getEmail(),\n 'firstName' => $customer->getFirstname() . (!empty($customerMiddleName) ? ' ' . $customerMiddleName : ''),\n 'lastName' => $customer->getLastname()\n );\n }\n } catch (Exception $exception) {\n $this->exceptionHandler->logException($exception);\n }\n\n return $customerInfo;\n }", "public function user()\n {\n return $this->belongsTo(Customer::class);\n }", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomerIdentifier()\n {\n return $this->customer_identifier;\n }", "public function getCustomerName(){\n return $this->customer_name;\n }", "protected function getCustomerFromAccountOrUser(): ?CustomerContract\n {\n $customer = $this->account->getProfessional()->getCustomer();\n\n // If not found => from user\n if (!$customer && $this->user):\n return $this->user->toCustomer();\n endif;\n\n return $customer;\n }", "public function getCustomer($_ID)\n {\n return $this->getUnique(\"customers\", $_ID);\n }", "public function getCustomer_Id() {\n return $this->customer_Id; \n }", "public function customer()\n\t{\n\t\treturn $this->belongsTo('App\\Http\\Models\\AppCustomer','customer_code','customer_code');\n\t}", "public function getCustomer($customer_id);", "public function getCustomerName()\n {\n return $this->customerName;\n }", "public function getCustomerName();", "public function customer()\n {\n return $this->belongsTo(\\App\\Models\\Customer::class, \"customer_id\", \"id\");\n }", "public function getOrCreateCustomer();", "private function GetUser()\r\n\t\t{\r\n\t\t\tif (!empty($_POST['customer_id']))\r\n\t\t\t\treturn $_POST['customer_id'];\r\n\t\t\t\r\n\t\t\tif (!empty($_GET['customer_id']))\r\n\t\t\t\treturn $_GET['customer_id'];\r\n\t\t}", "public function getLoggedUser() {\n\t\t$session = $this->getUserSession();\n\t\treturn ($this->isAdmin()) ? $session->getUser() : $session->getCustomer();\n\t}", "public function customer()\n {\n return $this->belongsTo('App\\Models\\Customer\\Customer', 'customer_id', 'id');\n }", "public function getCustomerName(){\n return $this->_getData(self::CUSTOMER_NAME);\n }", "function getSpecificCustomers() {\n\t\treturn $this->_specificCustomers;\n\t}", "public function getCustomers()\n {\n if (array_key_exists(\"customers\", $this->_propDict)) {\n return $this->_propDict[\"customers\"];\n } else {\n return null;\n }\n }", "public function customer()\n {\n return $this->belongsTo(Customer::class, 'customer_id', 'id');\n }", "public function customer()\n {\n // Note: Laravel throws a LogicException if a customer method exists but\n // doesn't return a valid relationship.\n try {\n if ($customer = $this->customermodel) {\n return $customer;\n }\n } catch (LogicException $e) {}\n \n if (method_exists($this, 'customermodel')) {\n return $this->customermodel();\n }\n \n // Check for customer/subscription on the same model.\n if (method_exists($this, 'gatewayCustomer')) {\n return $this;\n }\n \n return null;\n }", "public function customer()\n {\n return $this->belongsTo('App\\Models\\Customer', 'customer_id');\n }", "public function getCustomer($id) {\n return $this->customerRepository->getById($id);\n }", "public function user()\n {\n return $this->belongsTo('App\\Models\\User','customer_id');\n }", "public function customer() {\n return $this->belongsTo('Customer', 'customer_id');\n }", "public function billingCustomer()\n {\n $customer = new Customer();\n $this->setBilling($customer);\n\n return $customer;\n }", "public function getCustpo()\n {\n return $this->custpo;\n }", "public static function getCompanyByCustomerId()\n\t{\n\t\t$userId = Auth::getUser()->ID;\n\t\t$companyName = self::select('company')->where('ID', $userId)->first()->company;\n\t\treturn $companyName;\n\t}", "public function getCustomerId()\n {\n if (array_key_exists(\"customerId\", $this->_propDict)) {\n return $this->_propDict[\"customerId\"];\n } else {\n return null;\n }\n }", "public function getCustomerId()\n {\n return $this->getParameter('customerId');\n }", "public function getCustomerId()\n {\n return $this->_customerSession->getCustomerId();\n }", "public static function getCustomerById($customerId) {\n return Customer::loadById($customerId);\n }", "protected function _getAuthenticatedCustomer()\n {\n // retrieve authenticated customer ID\n $customerId = $this->_getAuthenticatedCustomerId();\n if ( $customerId )\n {\n // load customer\n /** @var Mage_Customer_Model_Customer $customer */\n $customer = Mage::getModel('customer/customer')\n ->load($customerId);\n if ( $customer->getId() ) {\n // if customer exists, return customer object\n return $customer;\n }\n }\n\n // customer not authenticated or does not exist, so throw exception\n Mage::throwException(Mage::helper('mymodule')->__('Unknown Customer'));\n }", "public function get( Customer $customer )\n {\n return $this->customerService->get();\n }", "public function getCustomer(): ?CustomerInterface\n {\n if (null === $token = $this->tokenStorage->getToken()) {\n return null;\n }\n\n if ($this->authorizationChecker->isGranted('IS_AUTHENTICATED_REMEMBERED') && $token->getUser() instanceof User) {\n return $token->getUser()->getCustomer();\n }\n\n return null;\n }", "public function getStripeCustomer()\n {\n return new StripeCustomer($this, BaseCustomer::retrieve($this->user->gateway_customer_id));\n }", "public function getCustid()\n {\n return $this->custid;\n }", "public function customer()\r\n {\r\n return $this->belongsTo(Customer::class, 'customer_id', 'id');\r\n }", "public function getCustomerModel()\n {\n if (is_null($this->_customerModel)) {\n $object = Mage::getModel('customer/customer');\n $this->_customerModel = Mage::objects()->save($object);\n }\n return Mage::objects()->load($this->_customerModel);\n }", "public function getGravityCustomerId()\n {\n return $this->getGravityHelper()->getApiUser();\n }", "public function getCustomers()\n {\n return $this->hasMany(User::className(), ['id' => 'customer_id'])->viaTable('favorite_contractor', ['contractor_id' => 'id']);\n }", "public function customer_by_id($id)\n {\n return $this->customers->customer_by_id($id);\n }", "function getCustomerNo() {\n return $this->customerNo;\n }", "public function getCustomerName(){\n return $this->customer ? $this->customer->name : '- no name provided -';\n }", "public function customer()\n {\n return $this->belongsTo(Customer::class);\n }", "public function customer()\n {\n return $this->belongsTo(Customer::class);\n }", "public function customer()\n {\n return $this->belongsTo(Customer::class);\n }", "public function customer()\n {\n return $this->belongsTo(Customer::class);\n }", "public function show(Customer $customer)\n {\n return $customer;\n }", "public function getCustomerName()\n {\n if (array_key_exists(\"customerName\", $this->_propDict)) {\n return $this->_propDict[\"customerName\"];\n } else {\n return null;\n }\n }", "function getCustomeruuid()\n {\n return $this->customer_uuid;\n }", "public static function get_customer( $id=0 ) {\r\n\t\tglobal $wpdb;\r\n\r\n\t\treturn $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}customers WHERE id = %d\", $id ) );\r\n\t}", "public function getCustomerOrNot ()\n {\n if ($this->getId() <= 0)\n return null;\n\n if (is_object($this->getCustomer()))\n return true;\n else\n return false;\n }", "public function asPaystackCustomer()\n {\n $this->assertCustomerExists();\n\n Paystack::setApiKey(config('paystacksubscription.secret', env('PAYSTACK_SECRET')));\n\n return PaystackCustomer::fetch($this->paystack_id);\n }", "public function customer()\n {\n return $this->belongsTo('App\\Models\\Customer');\n }", "public function getCustomerEmail(){\n return $this->customer_email;\n }", "public function customer() {\n return $this->belongsTo(\"App\\Models\\Customer\");\n }", "function jpid_get_customer_by( $field, $value ) {\n\t$field = sanitize_key( $field );\n\n\tif ( ! in_array( $field, array( 'customer_id', 'customer_email', 'user_id' ) ) ) {\n\t\treturn null;\n\t}\n\n\tif ( is_numeric( $value ) && $value < 1 ) {\n\t\treturn null;\n\t}\n\n\t$by_user_id = ( $field === 'user_id' ) ? true : false;\n\t$customer = new JPID_Customer( $value, $by_user_id );\n\n\tif ( $customer->get_id() > 0 ) {\n\t\treturn $customer;\n\t} else {\n\t\treturn null;\n\t}\n}", "public function customer()\n {\n return $this->hasMany(CustomerProxy::modelClass());\n }", "public function getCustomerId()\n {\n return $this->getValue('nb_customer_id');\n }", "public function getCustomer(int $id)\n {\n return Customer::where('id', $id)->first();\n }", "public function getCustomerId()\n {\n return $this->getSavedCustomer()->id;\n }" ]
[ "0.8600679", "0.8536459", "0.8350856", "0.8240036", "0.81745994", "0.8060675", "0.8058182", "0.8014956", "0.7872859", "0.7827071", "0.7789557", "0.7761184", "0.7719266", "0.7592633", "0.7531493", "0.7506492", "0.7506492", "0.7448405", "0.7430536", "0.7430536", "0.74242604", "0.7411216", "0.7364712", "0.7336401", "0.7326041", "0.7323937", "0.7286917", "0.72793764", "0.72462535", "0.7211564", "0.7194844", "0.7194844", "0.71257025", "0.7116336", "0.71079266", "0.70865434", "0.70865434", "0.70865434", "0.70843554", "0.7025972", "0.6951655", "0.69416964", "0.69397753", "0.6924523", "0.69239414", "0.6922347", "0.69167924", "0.6901616", "0.68958676", "0.689225", "0.68724185", "0.6856315", "0.6823524", "0.68123263", "0.67877346", "0.6784713", "0.6768171", "0.6765642", "0.6734546", "0.6727553", "0.67223823", "0.67179036", "0.6715852", "0.6710046", "0.6707539", "0.6704507", "0.669926", "0.66961473", "0.6694957", "0.6690999", "0.66805476", "0.6662265", "0.6649442", "0.66443574", "0.6642924", "0.66416436", "0.6640801", "0.6634673", "0.66240793", "0.6616591", "0.6608226", "0.6608226", "0.6608226", "0.6608226", "0.6589833", "0.65857273", "0.6584774", "0.65750164", "0.65499324", "0.65396017", "0.6534868", "0.6532736", "0.6529877", "0.65124875", "0.6494613", "0.6476369", "0.6469377", "0.64600474" ]
0.81891966
5
Hace la consulta para seleccionar los tutores
public function allTutorModel($tabla){ $stmt = Conexion::conector()->prepare("SELECT * FROM $tabla"); $stmt->execute(); return $stmt->fetchAll(); $stmt->close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function seleccionarTodos();", "public function select(){\n\t$sql=\"SELECT * FROM tipousuario\";\n\treturn ejecutarConsulta($sql);\n}", "public function Select(){\n\t\t\t//Query para selecionar a tabela contatos\n\t\t\t$sql=\"SELECT p.*, e.* FROM tbl_paciente AS p INNER JOIN tbl_endereco AS e ON p.id_endereco = e.id_endereco WHERE ativo = 1 AND status = 1;\";\n\n\t\t\t//Instancio o banco e crio uma variavel\n\t\t\t$conex = new Mysql_db();\n\n\t\t\t/*Chama o método para conectar no banco de dados e guarda o retorno da conexao\n\t\t\tna variavel que $PDO_conex*/\n\t\t\t$PDO_conex = $conex->Conectar();\n\n\t\t\t//Executa o select no banco de dados e guarda o retorno na variavel select\n\t\t\t$select = $PDO_conex->query($sql);\n\n\t\t\t//Contador\n\t\t\t$cont = 0;\n\n\t\t\t//Estrutura de repetição para pegar dados\n\n \n\n\t\t\twhile ($rs = $select->fetch(PDO::FETCH_ASSOC)) {\n\t\t\t\t#Cria um array de objetos na classe contatos\n\n //var_dump($rs);exit();\n\n\t\t\t\t//$lista_paciente[] = $rs;\n\n $lista_pacientes[] = new Paciente();\n \n\t\t\t\t// Guarda os dados no banco de dados em cada indice do objeto criado\n\t\t\t\t$lista_pacientes[$cont]->id_paciente = $rs['id_paciente'];\n $lista_pacientes[$cont]->id_endereco = $rs['id_endereco'];\n $lista_pacientes[$cont]->id_convenio = $rs['id_convenio'];\n $lista_pacientes[$cont]->nome = $rs['nome'];\n $lista_pacientes[$cont]->sobrenome = $rs['sobrenome'];\n $lista_pacientes[$cont]->dt_nasc = $rs['dt_nasc'];\n $lista_pacientes[$cont]->rg = $rs['rg'];\n $lista_pacientes[$cont]->cpf = $rs['cpf'];\n $lista_pacientes[$cont]->carteirinha_convenio = $rs['carterinha_convenio'];\n $lista_pacientes[$cont]->foto = $rs['foto'];\n $lista_pacientes[$cont]->status = $rs['status'];\n\t\t\t\t$lista_pacientes[$cont]->id_endereco = $rs['id_endereco'];\n $lista_pacientes[$cont]->cep = $rs['cep'];\n $lista_pacientes[$cont]->logradouro = $rs['logradouro'];\n $lista_pacientes[$cont]->numero = $rs['numero'];\n $lista_pacientes[$cont]->id_estado = $rs['id_estado'];\n $lista_pacientes[$cont]->cidade = $rs['cidade'];\n $lista_pacientes[$cont]->bairro = $rs['bairro'];\n\n\t\t\t\t// Soma mais um no contador\n\t\t\t\t$cont+=1;\n\t\t\t}\n\n\t\t\t$conex::Desconectar();\n\n\t\t\t//Apenas retorna o $list_contatos se existir dados no banco de daos\n\t\t\tif (isset($lista_pacientes)) {\n\t\t\t\t# code...\n\t\t\t\treturn $lista_pacientes;\n\t\t\t}\n\n\t\t}", "public function select($tienda);", "public function select(){\n\t\t$sql = \"SELECT * FROM equipo_tipo\n\t\t\t\twhere equi_tip_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function select($usuario_has_hojaruta);", "public function select($cotizacion);", "public function select()\n {\n $sql = \"SELECT * FROM tipousuario\";\n return ejecutarConsulta($sql);\n }", "public function select($titulos){\n $id=$titulos->getId();\n\n try {\n $sql= \"SELECT `id`, `descripcion`, `universidad_id`, `docente_id`\"\n .\"FROM `titulos`\"\n .\"WHERE `id`='$id'\";\n $data = $this->ejecutarConsulta($sql);\n for ($i=0; $i < count($data) ; $i++) {\n $titulos->setId($data[$i]['id']);\n $titulos->setDescripcion($data[$i]['descripcion']);\n $titulos->setUniversidad_id($data[$i]['universidad_id']);\n $docente = new Docente();\n $docente->setId($data[$i]['docente_id']);\n $titulos->setDocente_id($docente);\n\n }\n return $titulos; } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n return null;\n }\n }", "public function selectTalents(){\n\t\t\t$query = new Query();\n\n\t\t\t$query->tables = array(\"talenti_completa\");\n\t\t\t$query->fields = array(\"id\", \"Nome\", \"Tipo\", \"Descrizione\", \"prerequisito\");\n\t\t\t\n\t\t\tif ($query->Open()){\n\t\t\t\twhile ($row = $query->GetNextRecord(true)){\n\t\t\t\t\t$talents[] = $row;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn $talents;\n\t\t}", "public function seleccionarTodos() {\n\n $planConsulta = \"SELECT c.IdContacto,c.ConNombres,c.ConApellidos,c.ConCorreo,r.Idrolcontacto,r.Nomrol\";\n $planConsulta .= \" FROM contacto c\";\n $planConsulta .= \" JOIN rolcontacto r ON c.rolcontacto_Idrolcontacto=r.Idrolcontacto \";\n $planConsulta .= \" ORDER BY c.IdContacto ASC \";\n\n $registrosContactos = $this->conexion->prepare($planConsulta);\n $registrosContactos->execute(); //Ejecución de la consulta \n\n $listadoRegistrosContacto = array();\n\n while ($registro = $registrosContactos->fetch(PDO::FETCH_OBJ)) {\n $listadoRegistrosContacto[] = $registro;\n }\n\n $this->cierreBd();\n\n return $listadoRegistrosContacto;\n }", "public function seleccionar(){\n //sql de la consulta\n $sql = \"SELECT * FROM especialidad E WHERE E.Estado = 1;\";\n //preparando la consulta\n $query = $this->conexion->prepare($sql);\n //ejecutandola\n $query->execute();\n //obteniendo el resultado en un arreglo asociativo\n $result = $query->fetchAll(PDO::FETCH_ASSOC);\n $this->conexion = null;\n return $result;\n }", "public function select($otros_votos);", "public function select(){\n\t\t$sql = \"SELECT * FROM cargo\n\t\t\t\twhere car_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "function listarTramitesAjustables(){\n\t\t$this->procedimiento='pre.ft_partida_ejecucion_sel';\n\t\t$this->transaccion='PRE_LISTRAPE_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('fecha_ajuste','fecha_ajuste','date');\n\t\t$this->captura('id_gestion','int4');\n $this->captura('nro_tramite','varchar');\n $this->captura('codigo','varchar');\n\t\t$this->captura('id_moneda','int4');\n\t\t$this->captura('desc_moneda','varchar');\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function seleccionarTodosEuno() {\n\n $planConsulta = \"SELECT c.IdContacto,c.ConNombres,c.ConApellidos,c.ConCorreo,r.Idrolcontacto,r.Nomrol\";\n $planConsulta .= \" FROM contacto c\";\n $planConsulta .= \" JOIN rolcontacto r ON c.rolcontacto_Idrolcontacto=r.Idrolcontacto \";\n $planConsulta .= \" WHERE c.Estado = 1 \";\n $planConsulta .= \" ORDER BY c.IdContacto ASC \";\n\n $registrosContactos = $this->conexion->prepare($planConsulta);\n $registrosContactos->execute(); //Ejecución de la consulta \n\n $listadoRegistrosContacto = array();\n\n while ($registro = $registrosContactos->fetch(PDO::FETCH_OBJ)) {\n $listadoRegistrosContacto[] = $registro;\n }\n\n $this->cierreBd();\n\n return $listadoRegistrosContacto;\n }", "public function requeteSelect($table) {\n $injectionSQL = \"SELECT * FROM `$table`\";\n // INSERT INTO `livre` (`id_livre`, `Auteur`, `Titre`) VALUES (NULL, 'Test', 'Un test');\n\n $request = $this->monPDO->prepare($injectionSQL);\n\n if ($request->execute()) { \n \n $res = $request->fetchAll();\n return $res;\n }\n }", "function listado() {\r\n return self::consulta('SELECT * FROM \".self::$nTabla.\"');\r\n }", "public function select($actividades_fuera);", "function select() {\r\n $ing_item = $this->ing_item;\r\n $ing_estado_ingreso = $this->ing_estado_ingreso;\r\n $ing_item = $this->ing_item;\r\n $prov_id = $this->prov_id;\r\n $ing_numerodoc = $this->ing_numerodoc;\r\n $ing_tipodoc = $this->ing_tipodoc;\r\n $bod_codigo = $this->bod_codigo;\r\n\r\n $sql = \"SELECT * FROM ing_ingreso_det h INNER JOIN ingreso_compra p ON p.ing_numerodoc = h.ing_numerodoc WHERE p.ing_estado_doc > '0' \";\r\n if ($ing_estado_ingreso != null) {\r\n $sql = $sql . \"AND h.ing_estado_ingreso = '\" . $ing_estado_ingreso . \"' \";\r\n } else {\r\n $sql = $sql . \"AND h.ing_estado_ingreso > '0' \";\r\n }\r\n if ($ing_item != null) {\r\n $sql = $sql . \"AND h.ing_item = '\" . $ing_item . \"' \";\r\n }\r\n if ($prov_id != null) {\r\n $sql = $sql . \"AND h.prov_id = '\" . $prov_id . \"' \";\r\n }\r\n if ($ing_numerodoc != null) {\r\n $sql = $sql . \"AND h.ing_numerodoc = '\" . $ing_numerodoc . \"' \";\r\n }\r\n if ($ing_tipodoc != null) {\r\n $sql = $sql . \"AND h.ing_tipodoc = '\" . $ing_tipodoc . \"' \";\r\n }\r\n if ($bod_codigo != null) {\r\n $sql = $sql . \"AND h.bod_codigo = '\" . $bod_codigo . \"' \";\r\n }\r\n\r\n\r\n $result = $this->database->query($sql);\r\n\r\n $i = 0;\r\n while ($datos = $this->database->fetch_array($result)) {\r\n $this->arringdet[$i]['ing_item'] = $datos['ing_item'];\r\n $this->arringdet[$i]['prov_id'] = $datos['prov_id'];\r\n $this->arringdet[$i]['ing_numerodoc'] = $datos['ing_numerodoc'];\r\n $this->arringdet[$i]['ing_tipodoc'] = $datos['ing_tipodoc'];\r\n $this->arringdet[$i]['prod_equiv_id'] = $datos['prod_equiv_id'];\r\n $this->arringdet[$i]['bod_codigo'] = $datos['bod_codigo'];\r\n $this->arringdet[$i]['prod_codigo'] = $datos['prod_codigo'];\r\n $this->arringdet[$i]['ing_bodega'] = $datos['ing_bodega'];\r\n $this->arringdet[$i]['ing_zeta'] = $datos['ing_zeta'];\r\n $this->arringdet[$i]['ing_cantidad1'] = $datos['ing_cantidad1'];\r\n $this->arringdet[$i]['ing_cantidad_bulto'] = $datos['ing_cantidad_bulto'];\r\n $this->arringdet[$i]['ing_unid_bulto'] = $datos['ing_unid_bulto'];\r\n $this->arringdet[$i]['ing_valor1'] = $datos['ing_valor1'];\r\n $this->arringdet[$i]['ing_valor2'] = $datos['ing_valor2'];\r\n $this->arringdet[$i]['ing_estado_ingreso'] = $datos['ing_estado_ingreso'];\r\n $this->arringdet[$i]['ing_peso'] = $datos['ing_peso'];\r\n $this->arringdet[$i]['ing_umed_peso'] = $datos['ing_umed_peso'];\r\n $this->arringdet[$i]['ing_valor_total'] = $datos['ing_valor_total'];\r\n\r\n $this->arringdet[$i]['ing_correlativo'] = $datos['ing_correlativo'];\r\n $this->arringdet[$i]['ing_fechadoc'] = $datos['ing_fechadoc'];\r\n $this->arringdet[$i]['ing_fechavisacion'] = $datos['ing_fechavisacion'];\r\n $this->arringdet[$i]['ing_numerovisacion'] = $datos['ing_numerovisacion'];\r\n $this->arringdet[$i]['ing_moneda'] = $datos['ing_moneda'];\r\n $this->arringdet[$i]['ing_tipodecambio'] = $datos['ing_tipodecambio'];\r\n $this->arringdet[$i]['ing_iva'] = $datos['ing_iva'];\r\n $this->arringdet[$i]['ing_ciftotal'] = $datos['ing_ciftotal'];\r\n $this->arringdet[$i]['ing_costototal'] = $datos['ing_costototal'];\r\n $this->arringdet[$i]['ing_viutotal'] = $datos['ing_viutotal'];\r\n $this->arringdet[$i]['ing_estado_pago'] = $datos['ing_estado_pago'];\r\n $this->arringdet[$i]['ing_estado_doc'] = $datos['ing_estado_doc'];\r\n $this->arringdet[$i]['ing_neto'] = $datos['ing_neto'];\r\n $this->arringdet[$i]['ing_total'] = $datos['ing_total'];\r\n $this->arringdet[$i]['ing_tipodocsve'] = $datos['ing_tipodocsve'];\r\n $this->arringdet[$i]['ing_bodega_rec'] = $datos['ing_bodega_rec'];\r\n }\r\n }", "function select() {\r\n\r\n $oc_id = $this->oc_id;\r\n $prov_id = $this->prov_id;\r\n $oc_tipo = $this->oc_tipo;\r\n $oc_estado = $this->oc_estado;\r\n $oc_fecha_entrega = $this->oc_fecha_entrega;\r\n $oc_fecha_entrega_fin = $this->oc_fecha_entrega_fin;\r\n\r\n $sql = \"SELECT * FROM ing_oc p LEFT JOIN efectua_compra h ON p.oc_id=h.oc_id WHERE \";\r\n\r\n if ($oc_estado != null) {\r\n $sql = $sql . \"p.oc_estado = '\" . $oc_estado . \"' \";\r\n } else {\r\n $sql = $sql . \"p.oc_estado > '0' \";\r\n }\r\n if ($oc_id != null) {\r\n $sql = $sql . \"AND p.oc_id = '\" . $oc_id . \"' \";\r\n }\r\n if ($prov_id != null) {\r\n $sql = $sql . \"AND p.prov_id = '\" . $prov_id . \"' \";\r\n }\r\n if ($oc_tipo != null) {\r\n $sql = $sql . \"AND p.oc_tipo = '\" . $oc_tipo . \"' \";\r\n }\r\n if ($oc_fecha_entrega != null) {\r\n if ($oc_fecha_entrega_fin != null) {\r\n $sql = $sql . \"AND P.oc_fecha_entrega BETWEEN '\" . $oc_fecha_entrega . \"' AND '\" . $oc_fecha_entrega_fin . \"' \";\r\n }\r\n $sql = $sql . \"AND P.oc_fecha_entrega = '\" . $oc_fecha_entrega . \"' \";\r\n }\r\n\r\n $result = $this->database->query($sql);\r\n// $result = $this->database->result;\r\n// $row = mysql_fetch_object($result);\r\n\r\n $i = 0;\r\n while ($datos = $this->database->fetch_array($result)) {\r\n $this->arringoc[$i]['prov_id'] = $datos['prov_id'];\r\n $this->arringoc[$i]['oc_id'] = $datos['oc_id'];\r\n $this->arringoc[$i]['oc_codigo'] = $datos['oc_codigo'];\r\n $this->arringoc[$i]['oc_tipo'] = $datos['oc_tipo'];\r\n $this->arringoc[$i]['oc_empresa'] = $datos['oc_empresa'];\r\n $this->arringoc[$i]['oc_log'] = $datos['oc_log'];\r\n $this->arringoc[$i]['oc_estado'] = $datos['oc_estado'];\r\n $this->arringoc[$i]['oc_fecha_entrega'] = $datos['oc_fecha_entrega'];\r\n $this->arringoc[$i]['oc_solicitante'] = $datos['oc_solicitante'];\r\n $this->arringoc[$i]['oc_observacion'] = $datos['oc_observacion'];\r\n $this->arringoc[$i]['oc_neto'] = $datos['oc_neto'];\r\n $this->arringoc[$i]['oc_iva'] = $datos['oc_iva'];\r\n $this->arringoc[$i]['oc_total'] = $datos['oc_total'];\r\n $this->arringoc[$i]['oc_forma_pago'] = $datos['oc_forma_pago'];\r\n $this->arringoc[$i]['oc_condiciones'] = $datos['oc_condiciones'];\r\n $this->arringoc[$i]['oc_tipo_descuento'] = $datos['oc_tipo_descuento'];\r\n $this->arringoc[$i]['oc_impuesto'] = $datos['oc_impuesto'];\r\n $this->arringoc[$i]['oc_gasto_envio'] = $datos['oc_gasto_envio'];\r\n $this->arringoc[$i]['solc_id'] = $datos['solc_id'];\r\n $i++;\r\n }\r\n\r\n// $this->prov_id = $row->prov_id;\r\n//\r\n// $this->oc_id = $row->oc_id;\r\n//\r\n// $this->oc_codigo = $row->oc_codigo;\r\n//\r\n// $this->oc_tipo = $row->oc_tipo;\r\n//\r\n// $this->oc_empresa = $row->oc_empresa;\r\n//\r\n// $this->oc_log = $row->oc_log;\r\n//\r\n// $this->oc_estado = $row->oc_estado;\r\n//\r\n// $this->oc_fecha_entrega = $row->oc_fecha_entrega;\r\n//\r\n// $this->oc_solicitante = $row->oc_solicitante;\r\n//\r\n// $this->oc_observacion = $row->oc_observacion;\r\n//\r\n// $this->oc_neto = $row->oc_neto;\r\n//\r\n// $this->oc_iva = $row->oc_iva;\r\n//\r\n// $this->oc_total = $row->oc_total;\r\n//\r\n// $this->oc_forma_pago = $row->oc_forma_pago;\r\n//\r\n// $this->oc_condiciones = $row->oc_condiciones;\r\n//\r\n// $this->oc_rut_emision = $row->oc_rut_emision;\r\n//\r\n// $this->oc_rut_aprobacion = $row->oc_rut_aprobacion;\r\n//\r\n// $this->oc_cheque_adjunto = $row->oc_cheque_adjunto;\r\n//\r\n// $this->oc_descuento = $row->oc_descuento;\r\n//\r\n// $this->oc_tipo_descuento = $row->oc_tipo_descuento;\r\n//\r\n// $this->oc_impuesto = $row->oc_impuesto;\r\n//\r\n// $this->oc_gasto_envio = $row->oc_gasto_envio;\r\n//\r\n// $this->oc_estado_pago = $row->oc_estado_pago;\r\n }", "private function consultar_usuario_todos() {\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u;\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }", "public function selectMedecin(){\n $bdd=Connexion::getInstance();\n $req=\" select * from utilisateur u ,specialite s,service ser \n WHERE u.idSpecialite=s.idSpecialite and s.idService=ser.idService\n AND idStatus=\".self::NIVEAU_1;\n $rep=$bdd->query($req);\n return $rep->fetchall();\n \n }", "public function select($producto);", "public function consulta_asistencia()\n {\n $fecha_reporte = cambiaf_a_mysql($this->txt_fecha_desde->Text);\n $dir = $this->drop_direcciones->SelectedValue;\n $cod_organizacion = usuario_actual('cod_organizacion');\n\n // se obtienen las justificaciones del día seleccionado\n $sql=\"SELECT (p.cedula) as cedula_just, p.nombres, p.apellidos, j.codigo, jd.fecha_desde, jd.hora_desde,\n jd.fecha_hasta, jd.hora_hasta, jd.observaciones, jd.lun, jd.mar, jd.mie, jd.jue, jd.vie,\n tf.descripcion as descripcion_falta, tj.descripcion as descripcion_tipo_justificacion\n\t\t\t\t\t FROM asistencias.justificaciones as j, asistencias.justificaciones_dias as jd,\n\t\t\t\t\t\t asistencias.justificaciones_personas as jp, organizacion.personas as p, organizacion.personas_nivel_dir as n, asistencias.tipo_faltas tf, asistencias.tipo_justificaciones tj\n\t\t\t\t\t\tWHERE ((p.cedula = jp.cedula) and\n\t\t\t\t\t\t (p.cedula = n.cedula) and (jd.codigo_tipo_falta = tf.codigo) and (tj.id = jd.codigo_tipo_justificacion) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t (jd.fecha_desde <= '$fecha_reporte') and\n\t\t\t\t\t\t\t (jd.fecha_hasta >= '$fecha_reporte') and\n\t\t\t\t\t\t\t (j.estatus='1') and (j.codigo=jd.codigo_just) and (j.codigo=jp.codigo_just))\n\t\t\t\t\t\tORDER BY p.nombres, p.apellidos, jp.cedula \";\n $this->justificaciones=cargar_data($sql,$this); \n\n // se obtiene el horario vigente para la fecha seleccionada\n $this->horario_vigente = obtener_horario_vigente($cod_organizacion,$fecha_reporte,$this);\n \n // se realizan las consultas para mostrar los listados\n // Se consultan los asistentes\n $sql=\"SELECT (p.cedula) as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre,\n e.cedula, e.fecha, MIN(e.hora) as entrada, MAX(e.hora) as salida\n FROM asistencias.entrada_salida as e, organizacion.personas as p, organizacion.personas_nivel_dir as n\n WHERE ((p.cedula = e.cedula) and\n (p.cedula = n.cedula) and\n (n.cod_direccion LIKE '$dir%') and\n (p.fecha_ingreso <= '$fecha_reporte') and\n (e.fecha <= '$fecha_reporte') and\n (e.fecha >= '$fecha_reporte'))\n GROUP BY e.cedula\n ORDER BY entrada, p.nombres, p.apellidos \";\n $this->asistentes=cargar_data($sql,$this);\n $this->ind_asistentes = count($this->asistentes);\n\n // se consultan los inasistentes\n $sql2=\"SELECT p.cedula as cedula_integrantes, CONCAT(p.nombres,' ',p.apellidos) as nombre\n\t\t\t\t\t\t\t\t\t FROM organizacion.personas as p, asistencias.personas_status_asistencias as s,\n\t\t\t\t\t\t\t\t\t organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t WHERE ((s.status_asistencia = '1') and\n\t\t\t\t\t\t\t\t\t \t\t (s.cedula = p.cedula) and\n\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%') and\n\t\t\t\t\t\t\t\t\t (p.fecha_ingreso <= '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t (p.cedula not in\n\t\t\t\t\t\t\t\t\t (SELECT e.cedula\n\t\t\t\t\t\t\t\t\t\t FROM asistencias.entrada_salida as e, organizacion.personas_nivel_dir as n\n\t\t\t\t\t\t\t\t\t\t \t WHERE ((e.fecha = '$fecha_reporte') and\n\t\t\t\t\t\t\t\t\t\t\t\t (p.cedula = n.cedula) and\n\t\t\t\t\t\t\t (n.cod_direccion LIKE '$dir%'))\n\t\t\t\t\t\t\t\t\t\t\t GROUP BY e.cedula)))\n\t\t\t\t\t\t\t\t\t ORDER BY p.nombres, p.apellidos\";\n $this->inasistentes=cargar_data($sql2,$this);\n\n\n // Se consultan los asistentes para comparar inconsistencia de horas en el marcado\n // Si le falta hora\n $inconsistentes = array();\n foreach($this->asistentes as $arreglo){\n \n $sql2=\"SELECT COUNT(*) as n_horas FROM asistencias.entrada_salida as e\n\t\t\t WHERE e.fecha = '$fecha_reporte' AND e.cedula = '$arreglo[cedula_integrantes]' \";\n $resultado2=cargar_data($sql2,$this);\n if(!empty($resultado2)){\n if ($resultado2[0][n_horas]%2!=0) {//impar\n array_unshift($inconsistentes, array('cedula'=>$arreglo[cedula_integrantes], 'nombre'=>$arreglo[nombre],'salida'=>$arreglo[salida]));\n }//fin si\n }//fin si\n }//fin each\n\n\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n //$this->DataGrid_fj->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n if(!empty($inconsistentes)){\n $this->DataGrid_fh->DataSource=$inconsistentes;\n $this->DataGrid_fh->dataBind();\n }\n\n // Se enlaza el nuevo arreglo con el listado de Direcciones\n $this->DataGrid->Caption=\"Reporte de Asistencias del \".$this->txt_fecha_desde->Text;\n $this->DataGrid->DataSource=$this->asistentes;\n $this->DataGrid->dataBind();\n\n\n $this->DataGrid_ina->Caption=\"Inasistentes el d&iacute;a \".$this->txt_fecha_desde->Text;\n $this->DataGrid_ina->DataSource=$this->inasistentes;\n $this->DataGrid_ina->dataBind();\n\n /* Por un error que no supe identificar, el cual suma un numero adicional a la variable\n * de inasistentes no justificados, he tenido que sacarla del procedimiento donde normalmente\n * se contaba y tuve que realizarla por resta en esta sección.\n */\n $this->ind_inasistentes_no_just = count($this->inasistentes) - $this->ind_inasistentes_si_just;\n\n $this->Repeater->DataSource = $this->justificaciones;\n $this->Repeater->dataBind();\n\n $xale=rand(100,99999);\n // Se realiza la construcción del gráfico para indicadores\n\n $chart = new PieChart();\n $dataSet = new XYDataSet();\n if ($this->ind_asistentes>=1) {$dataSet->addPoint(new Point(\"Funcionarios Asistentes: (\".$this->ind_asistentes.\")\", $this->ind_asistentes));};\n if ($this->ind_inasistentes_no_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes NO JUSTIFICADOS: (\".$this->ind_inasistentes_no_just.\")\", $this->ind_inasistentes_no_just));};\n if ($this->ind_inasistentes_si_just>=1) {$dataSet->addPoint(new Point(\"Inasistentes JUSTIFICADOS: (\".$this->ind_inasistentes_si_just.\")\", $this->ind_inasistentes_si_just));};\n $chart->setDataSet($dataSet);\n $chart->setTitle(\"Porcentajes de Asistencias / Inasistencias del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_01.png\");\n $chart->render(\"imagenes/temporales/\".$xale.\"_01.png\");\n $this->grafico1->ImageUrl = \"imagenes/temporales/\".$xale.\"_01.png\";\n\n\n $chart2 = new PieChart();\n $dataSet2 = new XYDataSet();\n $this->ind_asistentes_no_retrasados=$this->ind_asistentes-$this->ind_asistentes_tarde_no_just-$this->ind_asistentes_tarde_si_just;\n if ($this->ind_asistentes_no_retrasados>=1) {$dataSet2->addPoint(new Point(\"Puntuales: (\".$this->ind_asistentes_no_retrasados.\")\", $this->ind_asistentes_no_retrasados));};\n if ($this->ind_asistentes_tarde_no_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales NO JUSTIFICADOS: (\".$this->ind_asistentes_tarde_no_just.\")\", $this->ind_asistentes_tarde_no_just));};\n if ($this->ind_asistentes_tarde_si_just>=1) {$dataSet2->addPoint(new Point(\"Impuntuales JUSTIFICADOS: (\".$this->ind_asistentes_tarde_si_just.\")\", $this->ind_asistentes_tarde_si_just));};\n $chart2->setDataSet($dataSet2);\n $chart2->setTitle(\"Porcentajes de Retrasos del: \".$this->txt_fecha_desde->Text);\n elimina_grafico($xale.\"_02.png\");\n $chart2->render(\"imagenes/temporales/\".$xale.\"_02.png\");\n $this->grafico2->ImageUrl = \"imagenes/temporales/\".$xale.\"_02.png\";\n\n // si la consulta de asistentes tiene resultados se habilita la impresion, sino, se deshabilita\n if (!empty($this->asistentes)) {$this->btn_imprimir->Enabled = true;} else {$this->btn_imprimir->Enabled = false;}\n\n }", "function listarCliente(){\n\t\t$this->procedimiento='rec.ft_cliente_sel';\n\t\t$this->transaccion='REC_CLI_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cliente','int4');\n\t\t$this->captura('genero','varchar');\n\t\t$this->captura('ci','varchar');\n\t\t$this->captura('email','varchar');\n\t\t$this->captura('email2','varchar');\n\t\t$this->captura('direccion','varchar');\n\t\t$this->captura('celular','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('lugar_expedicion','varchar');\n\t\t$this->captura('apellido_paterno','varchar');\n\t\t$this->captura('telefono','varchar');\n\t\t$this->captura('ciudad_residencia','varchar');\n\t\t$this->captura('id_pais_residencia','int4');\n\t\t$this->captura('nacionalidad','varchar');\n\t\t$this->captura('barrio_zona','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('apellido_materno','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\n $this->captura('nombre_completo1','text');\n $this->captura('nombre_completo2','text');\n\t\t$this->captura('pais_residencia','varchar');\n\t\t//$this->captura('nombre','varchar');\n\n\n\n\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public static function seleccionar($campos)\n\t{\n\t\t// A la variable global se le asigna que campos va a traer para la consulta\n\t\tstatic::$consultaSelect = \"SELECT $campos FROM \". static::$tablaConsulta . \"\";\n\n\t\t// Se devuelve el objeto\n\t\treturn new static;\n\t}", "function selectByIdac_consumos($consumo_id){\n\t\t\t$this->connection = Connection::getinstance()->getConn();\n\t\t\t$PreparedStatement = \"SELECT consumo_id, socio_id, nro_medidor, fecha_lectura, fecha_emision, periodo_mes, periodo_anio, consumo_total_lectura, consumo_por_pagar, costo_consumo_por_pagar, estado, fecha_hora_pago, usuario_pago, monto_pagado, pagado_por, ci_pagado_por,\n (SELECT CONCAT(nombres,' ',apellidos) FROM asapasc.ac_socios WHERE socio_id = asapasc.ac_consumos.socio_id) AS socio \n FROM asapasc.ac_consumos WHERE consumo_id = \".Connection::inject($consumo_id).\" ;\";\n\t\t\t$ResultSet = mysql_query($PreparedStatement,$this->connection);\n\t\t\tlogs::set_log(__FILE__,__CLASS__,__METHOD__, $PreparedStatement);\n\n\t\t\t$elem = new ac_consumosTO();\n\t\t\twhile($row = mysql_fetch_array($ResultSet)){\n\t\t\t\t$elem = new ac_consumosTO();\n\t\t\t\t$elem->setConsumo_id($row['consumo_id']);\n\t\t\t\t$elem->setSocio_id($row['socio_id']);\n\t\t\t\t$elem->setNro_medidor($row['nro_medidor']);\n\t\t\t\t$elem->setFecha_lectura($row['fecha_lectura']);\n\t\t\t\t$elem->setFecha_emision($row['fecha_emision']);\n\t\t\t\t$elem->setPeriodo_mes($row['periodo_mes']);\n\t\t\t\t$elem->setPeriodo_anio($row['periodo_anio']);\n\t\t\t\t$elem->setConsumo_total_lectura($row['consumo_total_lectura']);\n\t\t\t\t$elem->setConsumo_por_pagar($row['consumo_por_pagar']);\n\t\t\t\t$elem->setCosto_consumo_por_pagar($row['costo_consumo_por_pagar']);\n\t\t\t\t$elem->setEstado($row['estado']);\n\t\t\t\t$elem->setFecha_hora_pago($row['fecha_hora_pago']);\n\t\t\t\t$elem->setUsuario_pago($row['usuario_pago']);\n\t\t\t\t$elem->setMonto_pagado($row['monto_pagado']);\n\t\t\t\t$elem->setPagado_por($row['pagado_por']);\n\t\t\t\t$elem->setCi_pagado_por($row['ci_pagado_por']);\n $elem->setSocio($row['socio']);\n\n\t\t\t}\n\t\t\tmysql_free_result($ResultSet);\n\t\t\treturn $elem;\n\t\t}", "function datos_seleccion($id_seleccion,$id_usuario) {\n\t\t$query = \"SELECT seleccion.*\n\t\tFROM seleccion\n\t\tWHERE seleccion.id_seleccion = '$id_seleccion'\n\t\tAND seleccion.id_usuario='$id_usuario'\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\t$row=mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $row;\n\t\t}\n\t}", "public function seleccionar($tablas, $columnas, $condicion = \"\", $agrupamiento = \"\", $ordenamiento = \"\", $filaInicial = NULL, $numeroFilas = NULL) {\n $listaColumnas = array();\n $listaTablas = array();\n $limite = \"\";\n\n if (!is_array($tablas)){\n $tablas = array($tablas);\n\n }\n \n if (!is_array($columnas)){\n $columnas = array($columnas);\n\n }\n\n foreach ($columnas as $alias => $columna) {\n\n if (preg_match(\"/(^[a-zA-z]+[a-zA-Z0-9]*)/\", $alias)) {\n $alias = \" AS $alias\";\n } else {\n $alias = '';\n }\n\n $listaColumnas[] = $columna . $alias;\n }\n\n $columnas = implode(', ', $listaColumnas);\n\n foreach ($tablas as $alias => $tabla) {\n\n if (preg_match(\"/(^[a-zA-z]+[a-zA-Z0-9]*)/\", $alias)) {\n $alias = ' AS ' . $alias;\n } else {\n $alias = '';\n }\n\n $tabla = $this->prefijo . $tabla;\n $listaTablas[] = $tabla . $alias;\n }\n\n if (!empty($condicion)) {\n $condicion = ' WHERE ' . $condicion;\n }\n\n if (!empty($agrupamiento)) {\n $agrupamiento = ' GROUP BY ' . $agrupamiento;\n }\n\n if (!empty($ordenamiento)) {\n $ordenamiento = ' ORDER BY ' . $ordenamiento;\n }\n\n if (is_int($numeroFilas) && $numeroFilas > 0) {\n $limite = ' LIMIT ';\n\n if (is_int($filaInicial) && $filaInicial >= 0) {\n $limite .= \"$filaInicial, \";\n }\n\n $limite .= $numeroFilas;\n }\n\n $tablas = implode(', ', $listaTablas);\n $sentencia = 'SELECT ' . $columnas . ' FROM ' . $tablas . $condicion . $agrupamiento . $ordenamiento . $limite;\n\n $this->sentenciaSql = $sentencia;\n\n return $this->ejecutar($sentencia);\n }", "private function selectTable(){\n\t\tView::show(\"user/seleccionaTablas\");\n\t}", "public function selectAll() {\n $conn = $this->conex->connectDatabase();\n $sql = \"select * from tbl_texto_principal\";\n $stm = $conn->prepare($sql);\n $success = $stm->execute();\n if ($success) {\n //Criando uma lista com os dados\n $listTextoPrincipal = [];\n foreach ($stm->fetchAll(PDO::FETCH_ASSOC) as $result) {\n $TextoPrincipal = new TextoPrincipal();\n $TextoPrincipal->setId($result['id_texto_principal']);\n $TextoPrincipal->setTitulo($result['titulo']);\n $TextoPrincipal->setTexto($result['texto']);\n $TextoPrincipal->setTipoTexto($result['tipo_texto']);\n array_push($listTextoPrincipal, $TextoPrincipal);\n };\n\n $this->conex -> closeDataBase();\n //retornando a lista\n return $listTextoPrincipal;\n } else {\n return \"Erro\";\n }\n }", "public function sel_tornejos(){\n $query = $this->db->query('SELECT * FROM torneig t JOIN joc j ON(j.Id = t.codiJoc) WHERE activo = 1');\n\n return $query->result();\n }", "public function get_ventas_consulta($id_paciente){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n \n\t$sql=\"select*from ventas where id_paciente=?;\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$id_paciente);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "function listadoSelect();", "public function select(){\n\t\t$sql = \"SELECT * FROM producto\n\t\t\t\twhere prod_estado = 1\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function selectReservations() {\n $tab=[];\n $pdo=$this->connect_db('boutique');\n $reqlogin = $pdo->prepare(\"SELECT r.id, r.id_utilisateur, r.titrereservation, r.typeevenement, r.datedebut, r.heuredebut FROM reservation AS r INNER JOIN utilisateurs AS u ON r.id_utilisateur = u.id\");\n $reqlogin->execute($tab);\n $result=$reqlogin->fetchAll();\n return $result;\n }", "function listarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_sel';\n\t\t$this->transaccion='WF_tabla_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('vista_id_tabla_maestro','int4');\n\t\t$this->captura('bd_scripts_extras','text');\n\t\t$this->captura('vista_campo_maestro','varchar');\n\t\t$this->captura('vista_scripts_extras','text');\n\t\t$this->captura('bd_descripcion','text');\n\t\t$this->captura('vista_tipo','varchar');\n\t\t$this->captura('menu_icono','varchar');\n\t\t$this->captura('menu_nombre','varchar');\n\t\t$this->captura('vista_campo_ordenacion','varchar');\n\t\t$this->captura('vista_posicion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('menu_codigo','varchar');\n\t\t$this->captura('bd_nombre_tabla','varchar');\n\t\t$this->captura('bd_codigo_tabla','varchar');\n\t\t$this->captura('vista_dir_ordenacion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('nombre_tabla_maestro','varchar');\n\t\t$this->captura('vista_estados_new','text');\n\t\t$this->captura('vista_estados_delete','text');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function consultaTodos()\n\t{\n\t\t$sql = \"SELECT * FROM \" . $this->tabela;\n\n\t\t// $this->resultado = mysqli_query($this->conn, $sql);\n\t\t$this->resultado = $this->conn->prepare($sql);\n\t\treturn $this->resultado->execute();\n\t}", "public function Listar(){\n\n $motorista = new Motorista();\n\n return $motorista::Select();\n\n }", "function selectConciertosEspera(){\n $c = conectar();\n $select = \"select CONCIERTO.FECHA as FECHA, CONCIERTO.HORA as HORA, LOCALES.UBICACION as UBICACION, GENERO.NOMBRE as GENERO, USUARIOS.NOMBRE as NOMBRE, CIUDAD.NOMBRE as CIUDAD, CONCIERTO.ID_CONCIERTO as ID from CONCIERTO \n inner join LOCALES on CONCIERTO.ID_LOCAL = LOCALES.ID_LOCAL\n inner join USUARIOS on LOCALES.ID_USUARIO = USUARIOS.ID_USUARIO\n inner join CIUDAD on USUARIOS.ID_CIUDAD = CIUDAD.ID_CIUDAD\n inner join GENERO on CONCIERTO.ID_GENERO = GENERO.ID_GENERO where CONCIERTO.ESTADO=0 order by CONCIERTO.FECHA,CONCIERTO.HORA\";\n $resultado = mysqli_query($c, $select);\n desconectar($c);\n return $resultado;\n\n}", "function listarTipoVenta(){\n\t\t$this->procedimiento='vef.ft_tipo_venta_sel';\n\t\t$this->transaccion='VF_TIPVEN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_tipo_venta','int4');\n\t\t$this->captura('codigo_relacion_contable','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('tipo_base','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('codigo','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('id_plantilla','int4');\n\t\t$this->captura('desc_plantilla','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function get_datos_empresa($empresa){\n\t$conectar= parent::conexion();\n\tparent::set_names();\n\t$sql=\"select *from empresas where nombre=?\";\n\t$sql=$conectar->prepare($sql);\n\t$sql->bindValue(1,$empresa);\n\t$sql->execute();\n\treturn $resultado= $sql->fetchAll(PDO::FETCH_ASSOC);\n}", "function listar_valores($tipo, $id){\n $contratista = \"\";\n $contratante = \"\";\n \n // Si viene algun dato y es contratista\n if ($tipo == \"contratista\" && $id != \"\") {\n $contratista = \"AND c.Fk_Id_Terceros = {$id}\";\n }\n \n // Si viene algun dato y es contratista\n if ($tipo == \"contratante\" && $id != \"\") {\n $contratista = \"AND c.Fk_Id_Terceros_Contratante = {$id}\";\n }\n\n $sql =\n \"SELECT\n c.Pk_Id_Contrato,\n c.Numero,\n c.Objeto,\n tc.Nombre AS Contratante,\n tbl_terceros.Nombre AS Contratista,\n c.Fecha_Inicial,\n c.Fecha_Vencimiento,\n c.Plazo AS Plazo_Inicial,\n c.Valor_Inicial,\n (\n SELECT\n ifnull(SUM(contratos_pagos.Valor_Pago), 0)\n FROM\n contratos\n LEFT JOIN contratos_pagos ON contratos_pagos.Fk_Id_Contratos = contratos.Pk_Id_Contrato\n WHERE\n contratos.Pk_Id_Contrato = c.Pk_Id_Contrato\n GROUP BY\n contratos.Pk_Id_Contrato\n ) AS Pagado,\n (\n SELECT\n IFNULL(SUM(adiciones.Plazo), 0)\n FROM\n contratos_adiciones AS adiciones\n WHERE\n adiciones.Fk_Id_Contrato = c.Pk_Id_Contrato\n ) AS Plazo_Adiciones,\n (\n SELECT\n IFNULL(\n SUM(contratos_adiciones.Valor),\n 0\n )\n FROM\n contratos_adiciones\n WHERE\n contratos_adiciones.Fk_Id_Contrato = c.Pk_Id_Contrato\n ) AS Valor_Adiciones,\n tbl_estados.Estado,\n tcc.Nombre AS CentroCosto\n FROM\n contratos AS c\n LEFT JOIN tbl_terceros ON c.Fk_Id_Terceros = tbl_terceros.Pk_Id_Terceros\n LEFT JOIN tbl_estados ON c.Fk_Id_Estado = tbl_estados.Pk_Id_Estado\n LEFT JOIN tbl_terceros AS tc ON c.Fk_Id_Terceros_Contratante = tc.Pk_Id_Terceros\n INNER JOIN tbl_terceros AS tcc ON tcc.Pk_Id_Terceros = c.Fk_Id_Terceros_CentrodeCostos\n WHERE c.Fk_Id_Proyecto = {$this->session->userdata('Fk_Id_Proyecto')}\n {$contratista}\n ORDER BY\n c.Fk_Id_Estado ASC,\n c.Fecha_Inicial DESC\";\n\n //Se retorna la consulta\n return $this->db->query($sql)->result();\n }", "public function cargar_retenciones()\r\n {\r\n $cod_org = usuario_actual('cod_organizacion');\r\n $ano=$this->drop_ano->SelectedValue;\r\n $sql2 = \"select * from presupuesto.retencion where cod_organizacion='$cod_org' and ano='$ano' \";\r\n $datos2 = cargar_data($sql2,$this);\r\n // array_unshift($datos2, \"Seleccione\");\r\n $this->drop_retenciones->Datasource = $datos2;\r\n $this->drop_retenciones->dataBind();\r\n }", "public function selectAllRegiuniData(){\n $sql = \"SELECT * FROM regiune ORDER BY id DESC\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "public function select($datos_){\n $id=$datos_->getId();\n\n try {\n $sql= \"SELECT `id`, `nombre_proyecto`, `nombre_actividad`, `modalidad_participacion`, `responsable`, `fecha_realizacion`, `producto`, `semillero_id`\"\n .\"FROM `datos_`\"\n .\"WHERE `id`='$id'\";\n $data = $this->ejecutarConsulta($sql);\n for ($i=0; $i < count($data) ; $i++) {\n $datos_->setId($data[$i]['id']);\n $datos_->setNombre_proyecto($data[$i]['nombre_proyecto']);\n $datos_->setNombre_actividad($data[$i]['nombre_actividad']);\n $datos_->setModalidad_participacion($data[$i]['modalidad_participacion']);\n $datos_->setResponsable($data[$i]['responsable']);\n $datos_->setFecha_realizacion($data[$i]['fecha_realizacion']);\n $datos_->setProducto($data[$i]['producto']);\n $semillero = new Semillero();\n $semillero->setId($data[$i]['semillero_id']);\n $datos_->setSemillero_id($semillero);\n\n }\n return $datos_; } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n return null;\n }\n }", "public function listaEmpresa($autorizado,$empresa)\n {\n $conexao=Conexao::getConnection();\n $result=array();\n $sql =\"SELECT '' CodEmpresa,'=>Selecionar Empresa<=' Empresa \";\n $sql.=\"UNION ALL \";\n \n $sql.=\"SELECT DISTINCT \";\n $sql.=\" empresa.cod_empresa CodEmpresa ,des_empresa Empresa \";\n $sql.=\" FROM tb_setores_autorizados setorautorizado \";\n \n $sql.=\" inner join tb_empresas empresa on\";\n $sql.=\" setorautorizado.cod_empresa=empresa.cod_empresa \";\n \n \n if ($autorizado!=\"\")\n {\n $sql.= \" WHERE cod_autorizado=?\";\n $smtm=$conexao -> prepare($sql);\n \n $smtm->bindValue(1,$autorizado);\n \n }\n elseif ($codEmpresa != \"\" )\n {\n $sql.= \" WHERE cod_autorizado=? AND \";\n $sql.= \" cod_empresa =?\";\n \n $smtm=$conexao -> prepare($sql);\n \n $smtm->bindValue(1,$autorizado);\n $smtm->bindValue(2,$empresa);\n \n }\n \n $smtm->execute();\n $result=$smtm->fetchAll(PDO::FETCH_ASSOC);\n $conexao=null;\n\n $html=\"\";\n foreach ($result as $key=>$coluna){\n\n if ( $key=='' )\n {\n $html.='<option disabled selected value=\"'. $coluna[\"CodEmpresa\"] .'\">' .$coluna[\"Empresa\"] .\"</option>\"; \n }\n else\n {\n $html.='<option value=\"'. $coluna[\"CodEmpresa\"] .'\">' .$coluna[\"Empresa\"] .\"</option>\"; \n }\n }\n return $html;\n\n }", "public function recuperarTodos() {\n $query = \"select * from tb_atividade where id_evento = :id\";\n\n $stmt = $this->conexao->prepare($query);\n $stmt->bindValue(':id', $_GET['id']);\n // $stmt->bindValue(':id', 8);\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_OBJ);\n }", "public function selectAllClasse(){\n\n\t\tif($this->unPdo!=null)\n\t\t{\n\t\t\t$requete=\"select * from classe ;\";\n\t\t\t//preparation de la requete avant execution\n\t\t\t$select= $this->unPdo->prepare($requete);\n\t\t\t//execution de la requete\n\t\t\t$select->execute();\n\t\t\t//extraction des données\n\t\t\t$resultats = $select->fetchAll();\n\t\t\treturn $resultats;\n\t\t}\n\t}", "public function selector_tip_doc(){\n $sql = \"SELECT * FROM tbltipo_documento WHERE tblestado_general_est_gen_id=1\";\n $result = mysqli_query($this->conection,$sql);\n return $result;\n }", "function listaRuta()\r\n\t{\t\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::listaRegistros( $query );\r\n\t}", "private function ExibirTamanhos(){\r\n $oDadosCamiseta;\r\n $sSql = \"SELECT * FROM tamanho_camiseta\";\r\n $oDadosCamiseta = $this->Fbd->PesquisarSQL($sSql);\r\n \r\n foreach($oDadosCamiseta as $oRegistro){\r\n echo \"<option value='\".$oRegistro->sigla.\"' class='sctOptTamanho'>\".$oRegistro->nome.\"</option>\";\r\n }\r\n }", "public function pegaTodos(){\n\t\treturn $this->resultado->fetchAll();\n\t}", "function consultar_select($id, $columna_descripcion, $tabla){\n\t\t//Primero conectarse a la bd\n\t\t$conexion_bd = conectar_bd();\n\n\t\t$resultado = '<select name =\"'.$tabla.'\"><option value=\"\" disabled selected>Selecciona una opción</option>';\n\n \t$consulta = \"SELECT $id, $columna_descripcion FROM $tabla\";\n \t$resultados = $conexion_bd->query($consulta);\n \twhile ($row = mysqli_fetch_array($resultados, MYSQLI_BOTH)) {\n\t\t\t$resultado .= '<option value=\"'.$row[\"$id\"].'\">'.$row[\"$columna_descripcion\"].'</option>';\n\t\t}\n \n \t// desconectarse al termino de la consulta\n\t\tdesconectar_bd($conexion_bd);\n\n\t\t$resultado .= '</select><label>Marca</label></div>';\n\n\t\treturn $resultado;\n\n\t}", "public function listar(){\n\t\t$sql = \"SELECT * FROM equipo_tipo\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function SelectById($paciente){\n\t\t\t$sql = \"SELECT p.*, e.* FROM tbl_paciente AS p INNER JOIN tbl_endereco AS e ON p.id_endereco = e.id_endereco WHERE id_paciente = \". $paciente->id_paciente;\n\n\t\t\t//Instancio o banco e crio uma variavel\n\t\t\t$conex = new Mysql_db();\n\n\t\t\t/*Chama o método para conectar no banco de dados e guarda o retorno da conexao\n\t\t\tna variavel que $PDO_conex*/\n\t\t\t$PDO_conex = $conex->Conectar();\n\n\t\t\t$select = $PDO_conex->query($sql);\n\n\t\t\t//Executa o script no banco de dados\n\t\t\tif($rs = $select->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t//Se der true redireciona a tela\n\n\t\t\t\t$paciente = array();\n\n $paciente = $rs;\n\n\t\t\t\t// Guarda os dados no banco de dados em cada indice do objeto criado\n\t\t\t\t/*$paciente->id_paciente = $rs['id_paciente'];\n $paciente->id_endereco = $rs['id_endereco'];\n $paciente->id_convenio = $rs['id_convenio'];\n $paciente->nome = $rs['nome'];\n $paciente->sobrenome = $rs['sobrenome'];\n $paciente->dt_nasc = $rs['dt_nasc'];\n $paciente->rg = $rs['rg'];\n $paciente->cpf = $rs['cpf'];\n $paciente->carteirinha_convenio = $rs['carteirinha_convenio'];\n $paciente->foto = $rs['foto'];\n $paciente->status = $rs['status'];\n\t\t\t\t $paciente->id_endereco = $rs['id_endereco'];\n $paciente->cep = $rs['cep'];\n $paciente->logradouro = $rs['logradouro'];\n $paciente->numero = $rs['numero'];\n $paciente->id_estado = $rs['id_estado'];\n $paciente->cidade = $rs['cidade'];\n $paciente->bairro = $rs['bairro']; */\n\n return $paciente;\n\n\t\t\t}else {\n\t\t\t\t//Mensagem de erro\n\t\t\t\techo \"Error ao selecionar no Banco de Dados\";\n\t\t\t}\n\n\t\t\t//Fecha a conexão com o banco de dados\n\t\t\t$conex->Desconectar();\n\t\t}", "public function listarPorId(){\n $query = \"select * from usuario where idusuario=?\";\n\n //preparando a consulta para a execução\n $stmt=$this->conn->prepare($query);\n\n //vamos fazer um blind(ligação) do id pesquisado\n //com o paramêtro da consulta, neste caso é o \n //ponto de interrogação\n $stmt ->bindParam(1,$this->idusuario);\n\n //executar efetivamente a consulta \n $stmt ->execute();\n\n //Organizar os dados retornados da consulta para \n // a exibição em formato de json\n // Vamos usar uma variavel e um array para associar \n // os campos da tabela\n $linha = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //organizar no objeto usuario(aqrquivo usuario.php)\n //os dados retornados\n //da tabela usuario que está no banco de dados\n \n $this->email = $linha['email'];\n $this->senha = $linha['senha'];\n $this->nome = $linha['nome'];\n $this->cpf = $linha['cpf'];\n $this->telefone = $linha['telefone'];\n $this->foto = $linha['foto'];\n\n }", "public function consultar()\r\n {\r\n $id = $_GET['id'];\r\n\r\n //criando conexão com o banco\r\n $q = new QueryBuilder();\r\n\r\n //selecionando dados\r\n $dados = $q->selectinner2($id);\r\n\r\n \r\n\r\n //devolvendo a pagina \r\n require './app/views/consultar.php';\r\n\r\n \r\n\r\n \r\n }", "function ColsultarTodosLosID(){///funciona\n try {\n $FKAREA=$this->objRequerimiento->getFKAREA();\n $objControlConexion = new ControlConexion();\n $objControlConexion->abrirBd();\n //$comandoSql = \"select * from Requerimiento where FKAREA = '\".$FKAREA.\"' \";\n $comandoSql = \"SELECT IDREQ ,TITULO,FKEMPLE,FKAREA,FKESTADO,OBSERVACION,FKEMPLEASIGNADO FROM Requerimiento INNER JOIN detallereq ON Requerimiento.IDREQ=detallereq.FKREQ where FKAREA = '\".$FKAREA.\"'\";\n $rs = $objControlConexion->ejecutarSelect($comandoSql);\n return $rs;\n $objControlConexion->cerrarBd();\n } catch(Exception $e) {\n echo \"Error: \" . $e->getMessage();\n }\n}", "function listarChequera(){\n\t\t$this->procedimiento='tes.f_chequera_sel';\n\t\t$this->transaccion='TES_CHQ_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->captura('id_chequera','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('nro_chequera','int4');\n\t\t$this->captura('codigo','varchar');\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public static function recupereTudo() {\n include_once 'conexao.php';\n $sql = \"SELECT * FROM INSTITUICAO\";\n $query = mysql_query($sql);\n while ($sql = mysql_fetch_array($query)) {\n $id = $sql[\"id\"];\n $nome = $sql[\"nome\"];\n echo \"<a href=nome.php?id=$id>$nome</a>\";\n }\n }", "public function consult(){\n\t\t\t$para = array(\"1\"=>1);\n\t\t\tif($this->tipodocum_id_tipodocum != null){\n\t\t\t\t$para[\"tipodocum_id_tipodocum\"] = $this->tipodocum_id_tipodocum;\n\t\t\t}\n\t\t\tif($this->documento != null){\n\t\t\t\t$para[\"documento\"] = $this->documento;\n\t\t\t}\n\t\t\t\n\t\t\t$query = $this->db->get_where(\"paciente\",$para);\n\t\t\treturn $query->result();\n\t\t}", "public function rechercherTous() {\n // select all query\n $sRequete = \"SELECT * FROM \" . $this->sNomTable .\"\n LEFT JOIN panier ON idPanier = iNoPanier\n LEFT JOIN produit ON idProduit = iNoProduit\n \";\n\n // prepare query statement\n $stmt = $this->oConnexion->prepare($sRequete);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "function SelectValuesSeguros_Empresas($db_conx, $table) {\r\n $sql = \"\";\r\n if ($table == \"seguros\") {\r\n $sql = \"SELECT * FROM tseguros ORDER BY seg_descrip ASC\";\r\n } else {\r\n $sql = \"SELECT * FROM tempresas ORDER BY emp_descrip ASC\";\r\n }\r\n $query = mysqli_query($db_conx, $sql);\r\n\r\n $n_filas = $query->num_rows;\r\n $data = '<select size=\"12\" class=\"cmb' . $table . '\" id=\"cmb' . $table . '\">\r\n <option value=\"\">Ninguno</option>';\r\n $c = 0;\r\n while ($c < $n_filas) {\r\n $row = mysqli_fetch_array($query);\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[1] . \"_\" . $row[2] . '</option>';\r\n $c++;\r\n }\r\n $data .= '</select>';\r\n echo $data;\r\n}", "public function selectEmpresas() {\r\n return $this->getDb()->query(\"SELECT E.ID_EMPRESA,E.NOMBRE,E.TELEFONO,E.DIRECCION,concat(U.NOMBRE,concat(' ',U.APELLIDO)) \\\"USUARIO ENCARGADO\\\" ,E.ESTADO FROM EMPRESA E LEFT JOIN USUARIO U ON(E.ID_PERSONA_ENCARGADA=U.IDENTIFICADOR)\");\r\n }", "function listarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_sel';\n\t\t$this->transaccion='WF_TABLAINS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('historico','historico','varchar');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_' . $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'],'int4');\n\t\t\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] == 'maestro') {\n\t\t\t\t\n\t\t\t$this->captura('estado','varchar');\n\t\t\t$this->captura('id_estado_wf','int4');\n\t\t\t$this->captura('id_proceso_wf','int4');\n\t\t\t$this->captura('obs','text');\n\t\t\t$this->captura('nro_tramite','varchar');\n\t\t}\n\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t\n\t\t\t$this->captura($value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\n\t\t\t//campos adicionales\n\t\t\tif ($value['bd_campos_adicionales'] != '' && $value['bd_campos_adicionales'] != null) {\n\t\t\t\t$campos_adicionales = explode(',', $value['bd_campos_adicionales']);\n\t\t\t\t\n\t\t\t\tforeach ($campos_adicionales as $campo_adicional) {\n\t\t\t\t\t\n\t\t\t\t\t$valores = explode(' ', $campo_adicional);\n\t\t\t\t\t$this->captura($valores[1],$valores[2]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$this->captura('estado_reg','varchar');\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function sviRezultati() {\n\t\t$mysqli = new mysqli(\"localhost\", \"root\", \"\", \"kviz\");\n\t\t$q = 'SELECT * FROM tabela t join korisnik k on t.korisnikID = k.korisnikID order by t.brojPoena desc';\n\t\t$this ->result = $mysqli->query($q);\n\t\t$mysqli->close();\n\t}", "public function consultarTodos()\n\t{\n\t\t$sql = \t' SELECT colores.* '.\n\t\t\t\t' FROM colores '.\n\t\t\t\t' ORDER BY nombre ';\n\t\n\t\t$stmt = $this->getEntityManager()->getConnection()->prepare($sql);\n\t\t$stmt->execute();\n\t\t$result = $stmt->fetchAll(); //Se utiliza el fecth por que es un registro\n\t\t\n\t\t//Elimina los espacios\n\t\tforeach($result as &$reg)\n\t\t{\n\t\t\t$reg['nombre'] = trim($reg['nombre']);\n\t\t}//end foreach\n\t\n\t\treturn $result;\n\t}", "public function listarSocios() {\r\n $sql = \"select j.nombre,j.apellido,j.cedula,j.fechanac, j.porcentaje, m.nombre from juntadirectiva as j, municipio as m \"\r\n\t\t .\" where j.ciudadnac = m.id\";\t\t\r\n $respuesta = $this->object->ejecutar($sql);\r\n $this->construirListadoSocio($respuesta);\r\n }", "function listarEmpresa(){\n\t\t$this->procedimiento='dir.f_empresa_sel';\n\t\t$this->transaccion='DIR_EMP_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_empresa','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('tipo_sociedad','varchar');\n\t\t$this->captura('actividad','text');\n\t\t$this->captura('actividad_esp','varchar');\n\t\t$this->captura('nit','varchar');\n\t\t$this->captura('actividad_gral','varchar');\n\t\t$this->captura('domicilio','text');\n\t\t$this->captura('matricula','int8');\n\t\t$this->captura('renovado','int4');\n\t\t$this->captura('actividad_prim','varchar');\n\t\t$this->captura('nombre','varchar');\n\t\t$this->captura('departamento','varchar');\n\t\t$this->captura('telefono','varchar');\n\t\t$this->captura('municipio','varchar');\n\t\t$this->captura('estado_matricula','varchar');\n\t\t$this->captura('mail','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "function consultarUserEmpleado(){\n\t\t\n\t\t$usu=$this->objEmpleado->getUsuario();\n\t\t//SELECT ESTADO FROM `cliente` WHERE `usuario`=\"lili\"\n\t\t$objConexion = new ControlConexion();\n\t\t$objConexion->abrirBd($GLOBALS['serv'],$GLOBALS['usua'],$GLOBALS['pass'],$GLOBALS['bdat']);\n\t\t//$comandoSql=\"SELECT cedula, nombre_tmp, tipoCliente, fechaRegistro, imagen_tmp, email_tmp, telefono_tmp, cupoCredito, contrasena FROM CLIENTE WHERE USUARIO='\".$usu.\"' \";\n\t\t$comandoSql=\"SELECT * FROM EMPLEADO WHERE USUARIO='\".$usu.\"' \";\n\t\t\n\t\t$recordSet=$objConexion->ejecutarSelect($comandoSql);\n\n\t\t \n\t\t\n\t\twhile($registro = $recordSet->fetch_array(MYSQLI_ASSOC)){\n\t\t\n\t\t\t$this->objEmpleado->setNombre($registro[\"nombre\"]);\n\t\t\t$this->objEmpleado->setCedula($registro[\"cedula\"]);\n\t\t\t$this->objEmpleado->setFechaIngreso($registro[\"fechaIngreso\"]);\n\t\t\t$this->objEmpleado->setFechaRetiro($registro[\"fechaRetiro\"]);\n\t\t\t$this->objEmpleado->setSalarioBasico($registro[\"salarioBasico\"]);\n\t\t\t$this->objEmpleado->setDeducciones($registro[\"deducciones\"]);\n\t\t\t$this->objEmpleado->setFoto($registro[\"foto\"]);\n\t\t\t$this->objEmpleado->setHojaVida($registro[\"hojaVida\"]);\n\t\t\t$this->objEmpleado->setEmail($registro[\"email\"]);\n\t\t\t$this->objEmpleado->setTelefono($registro[\"telefono\"]);\n\t\t\t$this->objEmpleado->setCelular($registro[\"celular\"]);\n\t\t\t$this->objEmpleado->setEstado($registro[\"estado\"]);\n\t\t\t$this->objEmpleado->setContrasena($registro[\"contrasena\"]);\n\t\t\t$this->objEmpleado->setNombreTmp($registro[\"nombre_tmp\"]);\n\t\t\t$this->objEmpleado->setFotoTmp($registro[\"foto_tmp\"]);\n\t\t\t$this->objEmpleado->setHojaVidaTmp($registro[\"hojaVida_tmp\"]);\n\t\t\t$this->objEmpleado->setEmailTmp($registro[\"email_tmp\"]);\n\t\t\t$this->objEmpleado->setTelefonoTmp($registro[\"telefono_tmp\"]);\n\t\t\t$this->objEmpleado->setCelularTmp($registro[\"celular_tmp\"]);\n\n\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t$objConexion->cerrarBd(); \n\t\t\treturn $this->objEmpleado; \t\t\n\t}", "function recorre_tabla($nombret,$campot){\r\n$sql_query= \"Select $campot From $nombret where estado=true\";\r\n$consulta = pg_query($sql_query);\r\nwhile($fila=pg_fetch_row($consulta)) \r\n { echo \"<option value='\".$fila[1].\"'>\".$fila[0].\"</option>\"; } \r\n}", "public function mostrarDados(){\n\t\t$sql = \"SELECT cliente.cod_cliente, cliente.nome_cliente, categoria.cod_categoria, categoria.desc_categoria, servico.cod_servico, servico.desc_servico, servico.foto\t\n\t\t\t\tFROM cliente INNER JOIN (categoria INNER JOIN servico ON categoria.cod_categoria = servico.cod_categoria) ON cliente.cod_cliente = servico.cod_cliente\n\t\t\t\twhere cod_servico = '$this->cod_servico'\";\n\t\t$qry= self:: executarSQL($sql);\n\t\t$linha = self::listar($qry);\n\t\t\n\t\t$this-> cod_servico = $linha['cod_servico'];\n\t\t$this-> cod_categoria = $linha['cod_categoria'];\n\t\t$this-> desc_categoria = $linha['desc_categoria'];\n\t\t$this-> cod_cliente = $linha['cod_cliente'];\n\t\t$this-> nome_cliente = $linha['nome_cliente'];\n\t\t$this-> desc_servico = $linha['desc_servico'];\n\t\t$this-> foto = $linha['foto'];\n\t}", "public function filtro($bus,$tip) {\n $this->buscar=$bus;\n $this->tipo=$tip;\n \n switch ($this->tipo){\n case 'apellido': $this->consulta=$this->con->query(\"SELECT * FROM usuarios WHERE apellido LIKE '%$this->buscar%' ORDER BY apellido ASC, nombre ASC\");\n break;\n case 'dni': $this->consulta=$this->con->query(\"SELECT * FROM usuarios WHERE dni = '$this->buscar'\");\n break;\n case 'telefono': $this->consulta=$this->con->query(\"SELECT * FROM usuarios WHERE telefono = '$this->buscar' ORDER BY apellido ASC, nombre ASC\");\n }\n $this->i=1;\n while($this->datos= $this->consulta->fetch_array()) {\n ?>\n <tr>\n <td>\n <b><?php echo $this->i;?></b>\n <img src=\"fotos/<?php echo $this->datos['idUsuario'];?>\" width=\"50px\"> \n </td>\n <td><?php echo $this->datos['apellido'].\", \".$this->datos['nombre'];?></td>\n <td><?php echo $this->datos['usuario'];?></td>\n <td><?php echo $this->datos['dni'];?></td>\n <td><?php echo $this->datos['edad'];?></td>\n <td><?php echo $this->datos['domicilio'];?></td>\n <td><?php echo $this->datos['telefono'];?></td>\n <td><?php echo $this->datos['email'];?></td>\n <td><?php echo $this->datos['sexo'];?></td>\n <td><?php echo $this->datos['privilegio'];?></td>\n <td>\n <div class=\"row\">\n <a class=\"btn btn-success btn-sm\" href=\"formmodificar.php?idUsuario=<?php echo $this->datos['idUsuario'];?>\"><i class=\"material-icons\">create</i></a>\n <a class=\"btn btn-danger btn-sm\" onclick=\"return confirm('¿Desea eliminar este registro?')\" href=\"formeliminar.php?idUsuario=<?php echo $this->datos['idUsuario'];?>\"><i class=\"material-icons\">delete</i></a>\n </div>\n </td>\n </tr> \n <?php \n $this->i++;\n }\n $this->con->close();\n }", "public function listar()\n {\n $sql = \"SELECT CO.idconsulta, US.nombre, US.area, US.email, CO.problema, CO.tipo_problema,CO.estado, CO.tipo_estado,date(CO.fecha_hora) as fecha \n FROM usuarios US JOIN consulta CO\n ON US.idusuarios = CO.idusuario\n WHERE CO.tipo_estado IN ('Pendiente','En Proceso') AND CO.condicion=''\";\n return ejecutarConsulta($sql);\n\n }", "function listar_selecciones_por_palabra($letra,$id_usuario) {\n\t\t\t\n\t\tif ($letra=='') { $sql_letra=''; } else { $sql_letra=$letra; }\n\t\t\n\t\t$query = \"SELECT seleccion.*\n\t\tFROM seleccion\n\t\tWHERE (seleccion.seleccion LIKE '%%$sql_letra%%' OR seleccion.tags LIKE '%%$sql_letra%%')\n\t\tAND seleccion.id_usuario='$id_usuario'\n\t\tGROUP BY seleccion.id_seleccion\n\t\tORDER BY seleccion.seleccion asc\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\t\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function consultarEmpleado(){\n\t$ced=$this->objEmpleado->getCedula();\n\t$objConexion = new ControlConexion();\n\t$objConexion->abrirBd($GLOBALS['serv'],$GLOBALS['usua'],$GLOBALS['pass'],$GLOBALS['bdat']);\n\t//$comandoSql=\"SELECT cedula, nombre_tmp, tipoCliente, fechaRegistro, imagen_tmp, email_tmp, telefono_tmp, cupoCredito, contrasena FROM CLIENTE WHERE USUARIO='\".$usu.\"' \";\n\t$comandoSql=\"SELECT * FROM EMPLEADO WHERE CEDULA='\".$ced.\"' \";\n\n\t$recordSet=$objConexion->ejecutarSelect($comandoSql);\n\n\t\t \n\t\n\twhile($registro = $recordSet->fetch_array(MYSQLI_ASSOC)){\n\t\n\t\t$this->objEmpleado->setNombre($registro[\"nombre\"]);\n\t\t$this->objEmpleado->setFechaIngreso($registro[\"fechaIngreso\"]);\n\t\t$this->objEmpleado->setFechaRetiro($registro[\"fechaRetiro\"]);\n\t\t$this->objEmpleado->setSalarioBasico($registro[\"salarioBasico\"]);\n\t\t$this->objEmpleado->setDeducciones($registro[\"deducciones\"]);\n\t\t$this->objEmpleado->setFoto($registro[\"foto\"]);\n\t\t$this->objEmpleado->setHojaVida($registro[\"hojaVida\"]);\n\t\t$this->objEmpleado->setEmail($registro[\"email\"]);\n\t\t$this->objEmpleado->setTelefono($registro[\"telefono\"]);\n\t\t$this->objEmpleado->setCelular($registro[\"celular\"]);\n\t\t$this->objEmpleado->setEstado($registro[\"estado\"]);\n\t\t$this->objEmpleado->setContrasena($registro[\"contrasena\"]);\n\t\t$this->objEmpleado->setNombreTmp($registro[\"nombre_tmp\"]);\n\t\t$this->objEmpleado->setFotoTmp($registro[\"foto_tmp\"]);\n\t\t$this->objEmpleado->setHojaVidaTmp($registro[\"hojaVida_tmp\"]);\n\t\t$this->objEmpleado->setEmailTmp($registro[\"email_tmp\"]);\n\t\t$this->objEmpleado->setTelefonoTmp($registro[\"telefono_tmp\"]);\n\t\t$this->objEmpleado->setCelularTmp($registro[\"celular_tmp\"]);\n\t\t}\t\n\t\t$objConexion->cerrarBd(); \n\t\treturn $this->objEmpleado; \t\t\n}", "function Readto()\n {\n $conexion=floopets_BD::Connect();\n $conexion->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);\n\n $consulta=\"SELECT denuncia.*,tipo_denuncia.* FROM tipo_denuncia INNER JOIN denuncia on tipo_denuncia.td_cod_tipo_denuncia=denuncia.td_cod_tipo_denuncia \";\n // $consulta=\"SELECT * FROM citas WHERE Cod_usu=?\";\n $query=$conexion->prepare($consulta);\n $query->execute(array());\n\n\t$resultado=$query->fetchAll(PDO::FETCH_BOTH);\n\n\tfloopets_BD::Disconnect();\n\n\treturn $resultado;\n }", "public function listaPrateleira($codEmpresa,$codArquivo,$codCorredor,$codEstante,$codPrateleira)\n {\n \n $conexao=Conexao::getConnection();\n $result=array();\n $sql =\"SELECT '' CodPrateleira,'=>Selecionar Prateleira<=' Prateleira \";\n $sql.=\"UNION ALL \";\n \n $sql.=\"SELECT cod_prateleira CodPrateleira,des_prateleira Prateleira \";\n $sql.=\" FROM tb_prateleiras \";\n \n \n if ($codPrateleira != \"\" )\n {\n $sql.= \" WHERE cod_empresa =? AND \";\n $sql.= \" cod_arquivo =? AND \";\n $sql.= \" cod_corredor =? AND \";\n $sql.= \" cod_estante =? AND \";\n $sql.= \" cod_prateleira=? \";\n \n \n $smtm=$conexao->prepare($sql); \n $smtm->bindValue(1,$codEmpresa);\n $smtm->bindValue(2,$codArquivo);\n $smtm->bindValue(3,$codCorredor);\n $smtm->bindValue(4,$codEstante);\n $smtm->bindValue(5,$codPrateleira);\n\n }\n elseif ($codEstante != \"\" )\n {\n \n $sql.= \" WHERE cod_empresa =? AND \";\n $sql.= \" cod_arquivo =? AND \";\n $sql.= \" cod_corredor =? AND \";\n $sql.= \" cod_estante =? \";\n \n \n $smtm=$conexao->prepare($sql);\n \n $smtm->bindValue(1,$codEmpresa);\n $smtm->bindValue(2,$codArquivo);\n $smtm->bindValue(3,$codCorredor);\n $smtm->bindValue(4,$codEstante);\n }\n $smtm->execute();\n $result=$smtm->fetchAll(PDO::FETCH_ASSOC);\n $conexao=null;\n\n $html=\"\";\n foreach ($result as $key=>$coluna){\n\n if ( $key=='' )\n {\n $html.='<option disabled selected value=\"'. $coluna[\"CodPrateleira\"] .'\">' .$coluna[\"Prateleira\"] .\"</option>\"; \n }\n else\n {\n $html.='<option value=\"'. $coluna[\"CodPrateleira\"] .'\">' .$coluna[\"Prateleira\"] .\"</option>\"; \n }\n }\n return $html;\n\n }", "public function tratarDados(){\r\n\t\r\n\t\r\n }", "public function resultados($bus){\n $this->busqueda=$bus;\n $this->consulta= $this->con->query(\"SELECT * FROM usuarios WHERE apellido like '%$this->busqueda%'\");\n if($this->busqueda==''){\n \n }else{\n \n \n ?>\n <table class=\"table table-bordered table-striped table-hover\">\n <thead>\n <tr class=\"bg-blue\">\n <th>APELLIDO Y NOMBRE</th>\n <th>DNI</th>\n <th>EDAD</th>\n <th>DIRECCIÓN</th>\n <th>CONTACTO</th>\n </tr>\n </thead>\n <tbody>\n <?php\n while($this->datos= $this->consulta->fetch_array()){\n ?>\n <tr>\n <td><?php echo $this->datos['apellido'].', '.$this->datos['nombre'] ?></td>\n <td><?php echo $this->datos['dni']?></td>\n <td><?php echo $this->datos['edad'] ?></td>\n <td><?php echo $this->datos['domicilio'] ?></td>\n <td><?php echo $this->datos['email']?></td>\n </tr>\n <?php\n }\n ?>\n </tbody>\n </table> \n <?php \n } \n }", "public function Carrera()\n {\n include('conexion.php');\n $Consulta_Carrera = \"SELECT * FROM p_carrera ORDER BY car_nombre\";\n $Resultado_Consulta_Carrera = $conexion->prepare($Consulta_Carrera);\n $Resultado_Consulta_Carrera->execute();\n while ($a = $Resultado_Consulta_Carrera->fetch())\n {\n echo '<option value=\"'.$a[car_codigo].'\">'.$a[car_nombre].'</option>';\n }\n\n }", "public function selecionarAction() { \r\n // Recupera os parametros da requisição\r\n $params = $this->_request->getParams();\r\n \r\n // Instancia a classes de dados\r\n $menus = new WebMenuSistemaModel();\r\n \r\n // Retorna para a view os menus cadastrados\r\n $this->view->menus = $menus->getMenus();\r\n \r\n // Define os filtros para a cosulta\r\n $where = $menus->addWhere(array(\"CD_MENU = ?\" => $params['cd_menu']))->getWhere();\r\n \r\n // Recupera o sistema selecionado\r\n $menu = $menus->fetchRow($where);\r\n \r\n // Reenvia os valores para o formulário\r\n $this->_helper->RePopulaFormulario->repopular($menu->toArray(), \"lower\");\r\n }", "public function select($cargo){\n $id=$cargo->getId();\n\n try {\n $sql= \"SELECT `id`, `fecha_ingreso`, `empresa_idempresa`, `area_empresa_idarea_emp`, `cargo_empreso_idcargo`, `puesto_idpuesto`\"\n .\"FROM `cargo`\"\n .\"WHERE `id`='$id'\";\n $data = $this->ejecutarConsulta($sql);\n for ($i=0; $i < count($data) ; $i++) {\n $cargo->setId($data[$i]['id']);\n $cargo->setFecha_ingreso($data[$i]['fecha_ingreso']);\n $empresa = new Empresa();\n $empresa->setIdempresa($data[$i]['empresa_idempresa']);\n $cargo->setEmpresa_idempresa($empresa);\n $area_empresa = new Area_empresa();\n $area_empresa->setIdarea_emp($data[$i]['area_empresa_idarea_emp']);\n $cargo->setArea_empresa_idarea_emp($area_empresa);\n $cargo_empreso = new Cargo_empreso();\n $cargo_empreso->setIdcargo($data[$i]['cargo_empreso_idcargo']);\n $cargo->setCargo_empreso_idcargo($cargo_empreso);\n $puesto = new Puesto();\n $puesto->setIdpuesto($data[$i]['puesto_idpuesto']);\n $cargo->setPuesto_idpuesto($puesto);\n\n }\n return $cargo; } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n return null;\n }\n }", "function listarPais(){\n $this->procedimiento='rec.ft_cliente_sel';\n $this->transaccion='CLI_LUG_SEL';\n $this->tipo_procedimiento='SEL';//tipo de transaccion\n $this->setCount(false);\n //Definicion de la lista del resultado del query\n $this->captura('id_lugar','int4');\n $this->captura('codigo','varchar');\n $this->captura('estado_reg','varchar');\n $this->captura('id_lugar_fk','int4');\n $this->captura('nombre','varchar');\n $this->captura('sw_impuesto','varchar');\n $this->captura('sw_municipio','varchar');\n $this->captura('tipo','varchar');\n $this->captura('fecha_reg','timestamp');\n $this->captura('id_usuario_reg','int4');\n $this->captura('fecha_mod','timestamp');\n $this->captura('id_usuario_mod','int4');\n $this->captura('usr_reg','varchar');\n $this->captura('usr_mod','varchar');\n $this->captura('es_regional','varchar');\n\n //$this->captura('nombre_lugar','varchar');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n //var_dump($this->consulta); exit;\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "public function listar(){\n\t\t$sql = \"SELECT * FROM cargo\";\n\n\t\treturn ejecutarConsulta($sql);\n\t}", "public function mostrar(){\n\t\t\t$Oconn = new conexaoClass();\n\t\t\t$Oconn -> abrir_conexao();\n\t\t\t$sql = \"SELECT * FROM noticias\";\n\t\t\t$conn = $Oconn -> getconn();\n\t\t\t$this -> resultado = $conn -> query($sql);\n\t\t}", "public function actionSelect(){\n $select = $this->select('Pilih donk akhh..', ['kopi'=>'kopi', 'susu'=>'susu']);\n echo \"Pilihan nya adalah : $select\";\n }", "function listado_temas() {\n\n\t\t$query = \"SELECT * FROM temas ORDER BY tema\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\t\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn 0;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "function abrirSeleccionAlumno(){\n\t\t\t$seleccionTiempo\t\t= new SeleccionTiempo();\n\t\t\t//$condicionadoss\t\t\t= new ReconsideracionBaja();\n\n\t\t\t$this->redirect(\"profesor/informacion\");\n\t\t\treturn;\n\t\t\t\n\t\t\t$day = date (\"d\");\n\t\t\t$month = date (\"m\");\n\t\t\t$year = date (\"Y\");\n\t\t\t$date1 = date (\"Y-m-d\", mktime(0, 0, 0, $month, $day, $year));\n\n\t\t\t$nomina = Session::get_data('registro');\n\t\t\t$division = Session::get_data('coordinacion');\n\n\t\t\tunset( $this -> noCondicionados );\n\t\t\tunset( $this -> condicionados );\n\t\t\t$Periodos = new Periodos();\n\t\t\t$periodo = $Periodos -> get_periodo_actual();\n\n\t\t\t$i = 0;\n\t\t\tforeach( $seleccionTiempo -> find_all_by_sql\n\t\t\t\t\t ( \"select al.miReg registroo, al.vcNomAlu, al.enPlan\n\t\t\t\t\t\tFrom alumnos al\n\t\t\t\t\t\twhere (pago = 1\n\t\t\t\t\t\tor condonado = 1)\n\t\t\t\t\t\tand al.miReg not in\n\t\t\t\t\t\t( select registro\n\t\t\t\t\t\t from reconsideracion_baja\n\t\t\t\t\t\t where periodo = '\".$periodo.\"')\n\t\t\t\t\t\t order by al.miReg\" ) as $selTiempo ){\n\n\t\t\t\t$this -> noCondicionados[$i] = $selTiempo;\n\t\t\t\t$i ++;\n\t\t\t}\n\t\t\t/*\n\t\t\t$i = 0;\n\t\t\tforeach( $condicionadoss -> find_all_by_sql\n\t\t\t\t\t( \"Select rb.registro as registroo, al.vcNomAlu, al.enPlan\n\t\t\t\t\t\tfrom reconsideracion_baja rb, alumnos al\n\t\t\t\t\t\twhere rb.procede = 1\n\t\t\t\t\t\tand rb.periodo = \".$periodo.\"\n\t\t\t\t\t\tand rb.registro = al.miReg\n\t\t\t\t\t\torder by registro\" ) as $condicionado ){\n\n\t\t\t\t$this -> condicionados[$i]\t\t= $condicionado;\n\t\t\t\t$i ++;\n\t\t\t}\n\t\t\t*/\n }", "function SelectUnidad($db_conx, $query = null) {\r\n\r\n if ($query == NULL) {\r\n $sql = \"SELECT * FROM vlocalizacionxunidad LIMIT 20\";\r\n $query = mysqli_query($db_conx, $sql);\r\n }\r\n\r\n $n_columnas = $query->field_count;\r\n $data = '<tr class=\"row_header\">\r\n <td>COD</td>\r\n <td>Localizacion</td>\r\n <td>Descripcion</td>\r\n <td>Observacion</td>\r\n <td>Activo</td>\r\n <td id=\"custom-action\"></td>\r\n </tr>';\r\n while ($row = mysqli_fetch_array($query)) {\r\n $data .= '<tr class=\"row_data\">';\r\n for ($i = 0; $i < $n_columnas - 1; $i++) {\r\n if ($i == 1) {\r\n $data .= '<td><input type=\"hidden\" id=\"cod_loc_' . $row[0] . '\" value=\"' . $row[$n_columnas - 1] . '\" /><span style=\"display:none;\" id=\"td_' . $row[0] . '_' . $i . '\">' . $row[$i] . '</span>\r\n <span>' . $row[$i] . '</span></td>';\r\n } else {\r\n $data .= '<td><span id=\"td_' . $row[0] . '_' . $i . '\">' . $row[$i] . '</span></td>';\r\n }\r\n }\r\n $data .= '<td id=\"custom-action\"><button id=\"editar\" onclick=\"editUnidad(' . $row[0] . ')\">Editar</button></td></tr>';\r\n }\r\n echo $data;\r\n}", "function consultaGrupos($idTutor)\n{\n $sql=\"SELECT DISTINCT gp.id_grupo as id ,\n gp.nombre_grupo as nombre ,\n gp.clave as clave,\n gp.id_escuela as \\\"idEscuela\\\",\n gp.id_empresa as \\\"idEmpresa\\\",\n gp.tipo_grupo as \\\"tipoGrupo\\\" \n FROM rel_curso_tutor r_c_t\n JOIN rel_curso_grupo r_c_g\n ON r_c_t.id_rel_curso_grupo = r_c_g.id_rel_curso_grupo\n JOIN grupo gp\n ON gp.id_grupo = r_c_g.id_grupo \n WHERE \tgp.status = 1\n AND r_c_t.id_tutor = \".$idTutor;\n \n $consultaGrupo= new Query(\"SG\");\n $consultaGrupo->sql=$sql;\n $resultado = $consultaGrupo->select(\"obj\");\n \n return $resultado;\n}", "function ObtenerCursos($cursos)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM courses WHERE status = 1 ORDER BY id_user ASC\");\n\t\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\n\t?> \n <?php\n\tif ($totalRows_ConsultaFuncion > 0) {\n\t\tdo {\n\t\t\t?> \n\t\t<option value=\"<?php echo $row_ConsultaFuncion['id_courses']?>\"><?php echo $row_ConsultaFuncion['name']?></option>\n\t<?php\n\t\t} while ($row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion));\n\t}\n\t\t \n\tmysqli_free_result($ConsultaFuncion);\n}", "function seleziona_corsi($classe, $tipo,$id,$t){\n \n$c= $classe[0];\nswitch($c)\n{case \"1\" :\n $a=\"%prime%\";\n $b=\"%biennio%\";\n break;\n case \"2\": \n $a=\"%seconde%\";\n $b=\"%biennio%\";\n break;\n case \"3\" :\n $a=\"%terze%\";\n $b=\"%triennio%\";\n break;\n case \"4\" :\n $a=\"%quarte%\";\n $b=\"%triennio%\";\n break;\n case \"5\" :\n $a=\"%quinte%\";\n $b=\"%triennio%\";\n break;\n}\n$d=\"%tutte%\";\n$cl=\"%\".$c.\"%\";\n//inizio la connessione\n$pdo=connetti();\n// Prepare a select statement\n$sql = \"SELECT * FROM \".CORSI.\" WHERE Tipo LIKE :tipo AND (Classe LIKE :cl OR Classe LIKE :a OR Classe LIKE :b OR Classe LIKE :d)\";\n\n\nif($stmt = $pdo->prepare($sql)){\n // Bind variables to the prepared statement as parameters\n $stmt->bindParam(\":tipo\", $tipo, PDO::PARAM_STR);\n $stmt->bindParam(\":cl\", $cl, PDO::PARAM_STR);\n $stmt->bindParam(\":a\", $a, PDO::PARAM_STR);\n $stmt->bindParam(\":b\", $b, PDO::PARAM_STR);\n $stmt->bindParam(\":d\", $d, PDO::PARAM_STR); \n // Attempt to execute the prepared statement\n if($stmt->execute()){\n echo '<div class=\"table-responsive\">\n <table class=\"table table-sm\" id=\"'.$t.'\">\n <thead>\n <tr>\n \n <th scope=\"col\">Nome</th>\n <th scope=\"col\" class=\"d-none d-sm-table-cell\">Classi</th>\n <th scope=\"col\">Docente</th>\n <th scope=\"col\">Orario</th>\n <th scope=\"col\" class=\"d-none d-sm-table-cell\">Prenota</th>\n </tr>\n </thead>\n <tbody>';\n // Check results\n while($row = $stmt->fetch()){\n stampa ($row, $id,$pdo);\n\n \n }\n echo ' </tbody>\n </table>\n </div>';\n \n } else{\n echo \"Oops! Something went wrong. Please try again later.\";\n }\n}\ndisconnetti($stmt,$pdo);\n \n}", "public function readTaskc(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore \n INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine WHERE stato = 2\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "public function read_alltiendas(){\r\n $sql=\"select p.id_proveedor, p.nombre_establecimiento, p.direccion_fisica, p.direccion_web,\r\n p.descripcion_tienda, p.id_usuario\r\n from proveedor p\r\n INNER JOIN usuario u on p.id_usuario = u.id_usuario\";\r\n $resul=mysqli_query($this->con(),$sql);\r\n while($row=mysqli_fetch_assoc($resul)){\r\n $this->proveedores[]=$row;\r\n }\r\n return $this->proveedores;\r\n\r\n }", "function setColeccion() {\n $this->query = \"SELECT * FROM PROFESOR\";\n $this->datos = BDConexionSistema::getInstancia()->query($this->query);\n\n for ($x = 0; $x < $this->datos->num_rows; $x++) {\n $this->addElemento($this->datos->fetch_object(\"Profesor\"));\n }\n }", "function listarSolicitudModalidades()\r\n {\r\n $this->procedimiento = 'adq.f_solicitud_modalidades_sel';\r\n $this->transaccion = 'ADQ_SOLMODAL_SEL';\r\n $this->tipo_procedimiento = 'SEL';//tipo de transaccion\r\n\r\n\r\n $this->setParametro('id_funcionario_usu', 'id_funcionario_usu', 'int4');\r\n $this->setParametro('tipo_interfaz', 'tipo_interfaz', 'varchar');\r\n $this->setParametro('historico', 'historico', 'varchar');\r\n\r\n\r\n //Definicion de la lista del resultado del query\r\n $this->captura('id_solicitud', 'int4');\r\n $this->captura('estado_reg', 'varchar');\r\n $this->captura('id_solicitud_ext', 'int4');\r\n $this->captura('presu_revertido', 'varchar');\r\n $this->captura('fecha_apro', 'date');\r\n $this->captura('estado', 'varchar');\r\n $this->captura('id_funcionario_aprobador', 'int4');\r\n $this->captura('id_moneda', 'int4');\r\n $this->captura('id_gestion', 'int4');\r\n $this->captura('tipo', 'varchar');\r\n $this->captura('num_tramite', 'varchar');\r\n $this->captura('justificacion', 'text');\r\n $this->captura('id_depto', 'int4');\r\n $this->captura('lugar_entrega', 'varchar');\r\n $this->captura('extendida', 'varchar');\r\n\r\n $this->captura('posibles_proveedores', 'text');\r\n $this->captura('id_proceso_wf', 'int4');\r\n $this->captura('comite_calificacion', 'text');\r\n $this->captura('id_categoria_compra', 'int4');\r\n $this->captura('id_funcionario', 'int4');\r\n $this->captura('id_estado_wf', 'int4');\r\n $this->captura('fecha_soli', 'date');\r\n $this->captura('fecha_reg', 'timestamp');\r\n $this->captura('id_usuario_reg', 'int4');\r\n $this->captura('fecha_mod', 'timestamp');\r\n $this->captura('id_usuario_mod', 'int4');\r\n $this->captura('usr_reg', 'varchar');\r\n $this->captura('usr_mod', 'varchar');\r\n\r\n $this->captura('id_uo', 'integer');\r\n\r\n $this->captura('desc_funcionario', 'text');\r\n $this->captura('desc_funcionario_apro', 'text');\r\n $this->captura('desc_uo', 'text');\r\n $this->captura('desc_gestion', 'integer');\r\n $this->captura('desc_moneda', 'varchar');\r\n $this->captura('desc_depto', 'varchar');\r\n $this->captura('desc_proceso_macro', 'varchar');\r\n $this->captura('desc_categoria_compra', 'varchar');\r\n $this->captura('id_proceso_macro', 'integer');\r\n $this->captura('numero', 'varchar');\r\n $this->captura('desc_funcionario_rpc', 'text');\r\n $this->captura('obs', 'text');\r\n $this->captura('instruc_rpc', 'varchar');\r\n $this->captura('desc_proveedor', 'varchar');\r\n $this->captura('id_proveedor', 'integer');\r\n $this->captura('id_funcionario_supervisor', 'integer');\r\n $this->captura('desc_funcionario_supervisor', 'text');\r\n $this->captura('ai_habilitado', 'varchar');\r\n $this->captura('id_cargo_rpc', 'integer');\r\n $this->captura('id_cargo_rpc_ai', 'integer');\r\n $this->captura('tipo_concepto', 'varchar');\r\n $this->captura('revisado_asistente', 'varchar');\r\n $this->captura('fecha_inicio', 'date');\r\n $this->captura('dias_plazo_entrega', 'integer');\r\n $this->captura('obs_presupuestos', 'varchar');\r\n $this->captura('precontrato', 'varchar');\r\n $this->captura('update_enable', 'varchar');\r\n $this->captura('codigo_poa', 'varchar');\r\n $this->captura('obs_poa', 'varchar');\r\n $this->captura('contador_estados', 'bigint');\r\n\r\n $this->captura('nro_po', 'varchar');\r\n $this->captura('fecha_po', 'date');\r\n\r\n $this->captura('importe_total', 'numeric');\r\n $this->captura('prioridad', 'varchar');\r\n $this->captura('id_prioridad', 'integer');\r\n $this->captura('list_proceso', 'integer[]');\r\n\r\n $this->captura('cuce', 'varchar');\r\n $this->captura('fecha_conclusion', 'date');\r\n $this->captura('presupuesto_aprobado', 'varchar');\r\n\r\n $this->captura('tipo_modalidad', 'varchar');\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n //echo($this->consulta);exit;\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }", "function select ($requete){\r\n\t\t$message=\"\";\r\n\t\ttry{\r\n\t\t\t$resultats=$this->connexion->query($requete);\r\n\t\t\t$tab=$resultats->fetchALL(PDO::FETCH_ASSOC); // on dit qu'on veut que le résultat soit récupérable sous forme de tableau)\r\n\t\t}\r\n\t\tcatch(PDOException $e){\r\n\t\t\t$message=\"probleme pour executer cette requete $requete : \";\r\n\t\t\t$message=$message.$e->getMessage();\r\n\t\t\treturn $message;\r\n\t\t}\r\n\t\t\r\n\t\treturn $tab;\r\n\t}", "public function getRegistros()\n {\n if($this->input->post('id_cliente'))\n {\n $id_cliente = $this->input->post('id_cliente'); \n $contratos = $this->m_contratos->getRegistros($id_cliente, 'id_cliente');\n \n echo '<option value=\"\" disabled selected style=\"display:none;\">Seleccione una opcion...</option>';\n foreach ($contratos as $row) \n {\n echo '<option value=\"'.$row->id_vehiculo.'\">'.$row->vehiculo.'</option>';\n }\n }\n }" ]
[ "0.7032664", "0.70091945", "0.696269", "0.6933703", "0.6917176", "0.688792", "0.6878168", "0.6856485", "0.68518424", "0.6827299", "0.6801308", "0.6758395", "0.67441356", "0.6735374", "0.67289174", "0.6660712", "0.66454923", "0.6635402", "0.6618029", "0.6614077", "0.6607778", "0.6568369", "0.6538589", "0.653735", "0.65013677", "0.6472508", "0.64617795", "0.6454372", "0.64376193", "0.64334023", "0.64300966", "0.6423812", "0.6418145", "0.6405927", "0.6402094", "0.6399346", "0.6379359", "0.637123", "0.6348737", "0.63404906", "0.633096", "0.63126504", "0.6309897", "0.6303782", "0.6292923", "0.6292753", "0.6291035", "0.62890506", "0.6287389", "0.6283969", "0.6278795", "0.62784296", "0.62775767", "0.6275838", "0.6274492", "0.6269093", "0.6266103", "0.62601686", "0.6248747", "0.62437606", "0.6242625", "0.6241526", "0.6228452", "0.6225154", "0.6224185", "0.62237847", "0.62230235", "0.6217477", "0.6214827", "0.6212788", "0.62060314", "0.61992997", "0.61961496", "0.6190781", "0.61885875", "0.6178037", "0.6175812", "0.6172531", "0.61720145", "0.6162474", "0.61600834", "0.61531216", "0.6150469", "0.614246", "0.6141187", "0.6140263", "0.6139204", "0.6134298", "0.612535", "0.612419", "0.61237574", "0.6121869", "0.612156", "0.61184645", "0.61111486", "0.6107491", "0.61061376", "0.6105548", "0.6105307", "0.61045504", "0.61036366" ]
0.0
-1
The annual rate that is charged for borrowing (or made by investing), expressed as a single percentage number that represents the actual yearly cost of funds over the term of a loan. This includes any fees or additional costs associated with the transaction.
public function annualPercentageRate($value) { $this->setProperty('annualPercentageRate', $value); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAnnualPrice(): float\n {\n $ratio = $this->getMonths() / 12;\n return $this->getPrice() / $ratio;\n }", "function it_returns_one_percent_for_one_payment_one_year_after_the_advance()\n {\n $this->addPayment(101, 365);\n\n $this->calculate()->shouldReturn(1.0);\n }", "public function getAmountAsPercentage();", "function getInterestFactor($interest)\n{\n $rate = $interest / 365.25;\n return $rate;\n}", "function get_annual_period_balance($cur='IDR',$acc=null,$eyear=null)\n {\n// transactions.debit, transactions.credit, transactions.vamount, gls.approved');\n \n $this->db->select_sum('transactions.vamount');\n $this->db->select_sum('transactions.debit');\n $this->db->select_sum('transactions.credit');\n \n $this->db->from('gls, transactions, accounts');\n $this->db->where('gls.id = transactions.gl_id');\n $this->db->where('transactions.account_id = accounts.id');\n $this->db->where('YEAR(dates)', $eyear);\n $this->db->where('gls.currency', $cur);\n $this->cek_null($acc,\"transactions.account_id\");\n $this->db->where('gls.approved', 1);\n $this->db->where('accounts.deleted', NULL);\n return $this->db->get(); \n }", "function get_payment_rate($subtotal) {}", "public function getLoanAmount(): float;", "public function getAmountRate()\n {\n return $this->amountRate;\n }", "public function toMoney()\n {\n return $this->rate;\n }", "function getOutletDiscountRate()\n {\n $dayOfMonth = date('j');\n return 20 + $dayOfMonth;\n }", "public function getMonthlyFee(): float { return 2.0; }", "public function getTaxRate();", "public function getCurrentBalanceInDollars()\n {\n return $this->getCurrentBalance()->getAmount() / 100;\n }", "public function getExternalTaxRate();", "public function getInterestRate()\n {\n return (1 + ((float) $this->_webserviceHelper->getConfigData('interest_rate') / 100));\n }", "function formatAsYears($paymentPeriods, $paymentTerm)\n{\n $days = $paymentPeriods * $paymentTerm;\n $years = round($days / 365, 1);\n return $years;\n}", "public function calculate(LoanApplication $application): float;", "function interestRate($item_id){\n\t\treturn 0.1;\n\t}", "private static function getAmortizationCoefficient(float $rate): float\n {\n // Life of assets (1/rate) Depreciation coefficient\n // Less than 3 years 1\n // Between 3 and 4 years 1.5\n // Between 5 and 6 years 2\n // More than 6 years 2.5\n $fUsePer = 1.0 / $rate;\n\n if ($fUsePer < 3.0) {\n return 1.0;\n } elseif ($fUsePer < 4.0) {\n return 1.5;\n } elseif ($fUsePer <= 6.0) {\n return 2.0;\n }\n\n return 2.5;\n }", "public function getTotalDiscount(): float;", "public function getBaseTotalRefunded();", "public function averageRatingAsPercentage() : float\n {\n $range = config('rateable.minimum') > 0 ? config('rateable.maximum') - config('rateable.minimum') : config('rateable.maximum');\n return ($this->ratings()->count() * $range) != 0 ? $this->sumRating() / ($this->ratings()->count() * $range) * 100 : 0;\n }", "public function getAvgRate()\n {\n $avg = 0;\n $nb = 0;\n if (!empty($this->getRates())) {\n foreach($this->getRates() as $rate) {\n $avg += $rate->getNbStar();\n $nb++;\n }\n $avg /= $nb;\n }\n return $avg;\n }", "public function getPerfection(): float\n {\n return round($this->getTotal() / 45, 3) * 100;\n }", "public function getBaseTotalPaid();", "public static function AMORLINC(\n $cost,\n $purchased,\n $firstPeriod,\n $salvage,\n $period,\n $rate,\n $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD\n ) {\n $cost = Functions::flattenSingleValue($cost);\n $purchased = Functions::flattenSingleValue($purchased);\n $firstPeriod = Functions::flattenSingleValue($firstPeriod);\n $salvage = Functions::flattenSingleValue($salvage);\n $period = Functions::flattenSingleValue($period);\n $rate = Functions::flattenSingleValue($rate);\n $basis = ($basis === null)\n ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD\n : Functions::flattenSingleValue($basis);\n\n try {\n $cost = FinancialValidations::validateFloat($cost);\n $purchased = FinancialValidations::validateDate($purchased);\n $firstPeriod = FinancialValidations::validateDate($firstPeriod);\n $salvage = FinancialValidations::validateFloat($salvage);\n $period = FinancialValidations::validateFloat($period);\n $rate = FinancialValidations::validateFloat($rate);\n $basis = FinancialValidations::validateBasis($basis);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n $fOneRate = $cost * $rate;\n $fCostDelta = $cost - $salvage;\n // Note, quirky variation for leap years on the YEARFRAC for this function\n $purchasedYear = DateTimeExcel\\DateParts::year($purchased);\n $yearFracx = DateTimeExcel\\YearFrac::fraction($purchased, $firstPeriod, $basis);\n if (is_string($yearFracx)) {\n return $yearFracx;\n }\n /** @var float */\n $yearFrac = $yearFracx;\n\n if (\n $basis == FinancialConstants::BASIS_DAYS_PER_YEAR_ACTUAL\n && $yearFrac < 1\n && DateTimeExcel\\Helpers::isLeapYear(Functions::scalar($purchasedYear))\n ) {\n $yearFrac *= 365 / 366;\n }\n\n $f0Rate = $yearFrac * $rate * $cost;\n $nNumOfFullPeriods = (int) (($cost - $salvage - $f0Rate) / $fOneRate);\n\n if ($period == 0) {\n return $f0Rate;\n } elseif ($period <= $nNumOfFullPeriods) {\n return $fOneRate;\n } elseif ($period == ($nNumOfFullPeriods + 1)) {\n return $fCostDelta - $fOneRate * $nNumOfFullPeriods - $f0Rate;\n }\n\n return 0.0;\n }", "public function getRate(Currency $currency);", "public function charge(DepositAccount $depositAccount): float;", "public function getDiscountTaxCompensationAmount();", "public function getBaseToGlobalRate();", "public function calculateTotalPercentage()\n {\n return round((($this->totalcovered + $this->totalmaybe) / $this->totallines) * 100, 2);\n }", "public function getGrossTotal(): float;", "private function getGrossEarnings()\n {\n $markup = $this->worked_in_delaware ? 1.032 : 1;\n return $this->payroll->getEarnings() * $this->payroll->pay_periods * $markup;\n }", "abstract public function getTaxPercent();", "function convertToDollar($localAmount, $rate){\n return round ($localAmount/$rate, 3);\n //return number_format(round ($localAmount/$rate, 3), 3, \".\", \",\");\n\n}", "protected function getDeductableIncome()\n {\n return $this->salary->getGross('year');\n }", "public function getBaseToOrderRate();", "function get_tax_rate()\n\t{\n\t\tif(empty($this->address))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$rate\t= 0;\n\t\t\n\t\t$rate += $this->get_country_tax_rate();\n\t\t$rate += $this->get_zone_tax_rate();\n\t\t$rate += $this->get_area_tax_rate();\n\t\t\n\t\t//returns the total rate not affected by price of merchandise.\n\t\treturn $rate;\n\t}", "public function impurity() : float\n {\n return $this->impurity;\n }", "public function get_percentage_complete() {\n\t\t$args = $this->get_donation_argument( array( 'number' => - 1, 'output' => '' ) );\n\t\tif ( isset( $args['page'] ) ) {\n\t\t\tunset( $args['page'] );\n\t\t}\n\t\t$query = give_get_payments( $args );\n\t\t$total = count( $query );\n\t\t$percentage = 100;\n\t\tif ( $total > 0 ) {\n\t\t\t$percentage = ( ( 30 * $this->step ) / $total ) * 100;\n\t\t}\n\t\tif ( $percentage > 100 ) {\n\t\t\t$percentage = 100;\n\t\t}\n\n\t\treturn $percentage;\n\t}", "public function testActiveAccountPayoutFullDonationPercentage()\n {\n $inflationEffect = factory(InflationEffect::class, 1)->create([\n 'amount' => '10000'\n ]);\n\n $activeAccounts = factory(ActiveAccount::class, 3)->create([\n 'balance' => '1000' * StellarAmount::STROOP_SCALE\n ]);\n\n $activeAccount = factory(ActiveAccount::class)->create([\n 'balance' => '1000' * StellarAmount::STROOP_SCALE,\n 'user_id' => function() {\n return factory(\\lumenous\\User::class)->create([\n 'donation_percentage' => 100\n ]);\n }\n ]);\n\n $this->payoutService->init();\n\n $this->payoutService->setInflationEffect($inflationEffect->first());\n\n $payoutAmount = $this->payoutService->calculateActiveAccountPayoutAmount($activeAccount);\n\n $this->assertEquals(0, $payoutAmount);\n }", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "function calcAmountOfRewards()\n {\n $payoutPercentage = getPayoutPercentage();\n $totalBetCount = getAmountOfBets();\n\n return floor($payoutPercentage * $totalBetCount);\n }", "public function getAverageRatingAsPercentageAttribute() : float\n {\n return $this->averageRatingAsPercentage();\n }", "public static function AMORDEGRC(\n $cost,\n $purchased,\n $firstPeriod,\n $salvage,\n $period,\n $rate,\n $basis = FinancialConstants::BASIS_DAYS_PER_YEAR_NASD\n ) {\n $cost = Functions::flattenSingleValue($cost);\n $purchased = Functions::flattenSingleValue($purchased);\n $firstPeriod = Functions::flattenSingleValue($firstPeriod);\n $salvage = Functions::flattenSingleValue($salvage);\n $period = Functions::flattenSingleValue($period);\n $rate = Functions::flattenSingleValue($rate);\n $basis = ($basis === null)\n ? FinancialConstants::BASIS_DAYS_PER_YEAR_NASD\n : Functions::flattenSingleValue($basis);\n\n try {\n $cost = FinancialValidations::validateFloat($cost);\n $purchased = FinancialValidations::validateDate($purchased);\n $firstPeriod = FinancialValidations::validateDate($firstPeriod);\n $salvage = FinancialValidations::validateFloat($salvage);\n $period = FinancialValidations::validateInt($period);\n $rate = FinancialValidations::validateFloat($rate);\n $basis = FinancialValidations::validateBasis($basis);\n } catch (Exception $e) {\n return $e->getMessage();\n }\n\n $yearFracx = DateTimeExcel\\YearFrac::fraction($purchased, $firstPeriod, $basis);\n if (is_string($yearFracx)) {\n return $yearFracx;\n }\n /** @var float */\n $yearFrac = $yearFracx;\n\n $amortiseCoeff = self::getAmortizationCoefficient($rate);\n\n $rate *= $amortiseCoeff;\n $fNRate = round($yearFrac * $rate * $cost, 0);\n $cost -= $fNRate;\n $fRest = $cost - $salvage;\n\n for ($n = 0; $n < $period; ++$n) {\n $fNRate = round($rate * $cost, 0);\n $fRest -= $fNRate;\n\n if ($fRest < 0.0) {\n switch ($period - $n) {\n case 0:\n case 1:\n return round($cost * 0.5, 0);\n default:\n return 0.0;\n }\n }\n $cost -= $fNRate;\n }\n\n return $fNRate;\n }", "public function getOpeningBalance(): float\n {\n return $this->openingBalance;\n }", "public function averageRate()\n {\n $this->quotes = (isset($this->quotes) && (is_array($this->quotes))) ? array_slice($this->quotes, 0, $this->totalCarriers) : [];\n $rateList = $this->enArrayColumn($this->quotes, 'cost');\n $count = count($this->quotes);\n $count = $count > 0 ? $count : 1;\n $rateSum = array_sum($rateList) / $count;\n $quotesReset = reset($this->quotes);\n\n $rate[] = [\n 'id' => $this->randString(),\n 'carrier_scac' => (isset($quotesReset['carrier_scac'])) ? $quotesReset['carrier_scac'] : \"\",\n 'label' => (isset($quotesReset['label'])) ? $quotesReset['label'] : \"\",\n 'cost' => $rateSum,\n 'markup' => (isset($quotesReset['markup'])) ? $quotesReset['markup'] : \"\",\n 'appendLabel' => (isset($quotesReset['appendLabel'])) ? $quotesReset['appendLabel'] : \"\",\n ];\n return $rate;\n }", "public function getBalance()\n {\n return (float)$this->client->requestExecute(\"credit\");\n }", "public function getRatio(): Amount\n {\n return $this->ratio;\n }", "function getProfitPercentage()\n\t{\n\t\t$firstTrade = $this->data->getFirstCompletedTrade();\n\n\t\tif ($firstTrade)\n\t\t\t$start = $this->data->getT(Time::fromDateTime($firstTrade->getProcessedAt()), \"amount\");\n\n\t\t$start = $firstTrade ? $firstTrade->getSellAmount() : 0;\n\n\t\tif (!$start)\n\t\t\treturn 0;\n\n\t\t$current = $this->getTotalHoldings();\n\n\t\t$percentage = round((($current / $start) - 1) * 10000)/100;\n\n\t\treturn $percentage;\n\t}", "public function GetCurrenPercentageY(){\n return $this->CalculatePercentageY($this->GetY());\n }", "public function getCurrentCurrencyRate() {\r\n\t\treturn $this->_storeManager->getStore()->getCurrentCurrencyRate();\r\n\t}", "public function getBaseDiscountTaxCompensationAmount();", "function calculateChangePercent($close,$prevClose){\n $percentageChange=round(($close-$prevClose)*100/$close,2);\n return $percentageChange;\n}", "public function getCitizenIncomePercentage($amount) {\n $ci_percentage = $this->getCiPercentage();\n $percent_amount = ($amount * $ci_percentage) / 100;\n return $percent_amount;\n }", "public function evaluateWealth() : float;", "public function getBaseDiscountAmount();", "public function getFee(): float;", "protected function calculate(int $amount)\n {\n return $amount * 100;\n }", "function obtain_year_profitable($acc_number)\n\t{\n\t return $this->db->select('AVG(pamm_tp_profitable) AS ptp,year(pamm_tp_timestamp) AS year')\n\t\t ->from('pamm_tp_results') \n\t\t ->where(\"pamm_tp_account\",$acc_number)\n\t\t ->group_by('year(pamm_tp_timestamp)')\n\t\t ->get()->result();\n\t}", "public function getPercentual() {\n return $this->nPercentual;\n }", "public function getBaseTotalInvoicedCost();", "public function getTax(){\n $brutto = $this->getBrutto();\n return $brutto - ($brutto / (107) * 100);\n }", "public function getMinimalYearlyIncome($mortgageAmount, $interestRate);", "function getExchangeRate($currency);", "protected function giveCost()\n {\n $novoValor = 4;\n $this->valueNow = 210.54 / $novoValor;\n return $this->valueNow;\n }", "public function getBaseTotalOnlineRefunded();", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "private function discountOrChargePercetageBoleta()\n {\n if($this->discount_or_charge_percentage > 0)\n return $this->discount_or_charge_percentage;\n else if ($this->discount_or_charge_value > 0)\n return round(\n $this->discount_or_charge_value * 100 /\n ($this->price * $this->quantity)\n , 2); // 2 => decimal precition\n else //pos sale without discount\n return 0;\n }", "public function getPercentual()\n {\n return $this->percentual;\n }", "public function getBounceRate(Period $period);", "public function avarageTaxRate($country_id){\n \t$country = Country::find($country_id);\n\n \t$sum = 0;\n \t$count = 0;\n\n \tforeach($country->states as $state){\n \t\tforeach($state->counties as $county){\n \t\t\t$sum += $county->tax_rate;\n \t\t\t$count++;\n \t\t}\n \t}\n\n \treturn round(($sum / $count),2);\n }", "Function BankOfBaroda_Homeloan($netAmount,$DOB,$obligations,$property_value)\n{\n\t\n\t$maxterm = 60 - $DOB;\n\tif($maxterm>30)\n\t{\n\t\t$print_term=30;\n\t\t$term = $print_term * 12;\n\t}\n\telse\n\t{\n\t\tif($maxterm>0)\n\t\t{\n\t\t\t$print_term=$maxterm;\n\t\t\t$term = $print_term * 12;\n\t\t}\n\t}\n\n\n\t//income creteria\n\t//multiplier\n\tif($netAmount>=100000)\n\t\t{ \n\t\t\t$loan_amt=$netAmount*60;\n\t\t}\n\t\telseif($netAmount>=50000 && $netAmount<100000)\n\t\t{ \n\t\t\t$loan_amt=$netAmount*54;\n\t\t}\n\t\telseif($netAmount<50000)\n\t\t{ \n\t\t\t$loan_amt=$netAmount*48;\n\t\t}\n\t\telse\n\t\t{ \n\t\t\t$loan_amt=$netAmount*48;\n\t\t}\t\t\n\n\t//LTV ratio\n\tif($property_value>1)\n\t{\n\t\tif($property_value>7500000)\n\t\t{\n\t\t\t$loan_amt2= round($property_value * 75 / 100);\n\t\t}\n\t\telseif($property_value>2000000 && $property_value<=7500000)\n\t\t{\n\t\t\t$loan_amt2= round($property_value * 80 / 100);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$loan_amt2= round($property_value * 90 / 100);\n\t\t}\n\t}\n\t\n\t$printinter=\"8.35%\";\n\t$interestrate1=8.35/1200;\n\t//$interestrate2=9.55/1200;\n\n\tif($loan_amt>1 && $loan_amt2>1)\n\t{\n\t\tif($loan_amt>$loan_amt2)\n\t\t{\n\t\t\t$loan_amount = $loan_amt2;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$loan_amount = $loan_amt;\t\n\t\t}\n\t}\n\telse\n\t{\n\t\t$loan_amount = $loan_amt;\n\t}\n\t$actualemi1 = round($loan_amount * $interestrate1 / (1 - (pow(1/(1 + $interestrate1),$term))),2);\n\t$actualemi2 = round($loan_amount * $interestrate2 / (1 - (pow(1/(1 + $interestrate2),$term))),2);\n\t//$emi = \"Rs.\".$actualemi1.\"- Rs.\".$actualemi2;\n\t$emi = \"Rs.\".$actualemi1;\n\t\n\t$processing_fee=\"NA\";\n\t$details[]= $processing_fee;\n\t$details[]= $emi;\n\t$details[] = $printinter;\n\t$details[] = $print_term;\n\t$details[] = $loan_amount;\n\n\treturn($details);\n}", "public function totalCost(): float;", "public function getLoanAmountMetrics()\n\t\t{\n\t\t\t$business_rules = new ECash_BusinessRulesCache($this->db);\n\n\t\t\t$metrics = $this->data->getLoanAmountMetrics($this->application_id);\n\t\t\t$metrics->business_rules = $business_rules->Get_Rule_Set_Tree($metrics->rule_set_id);\n\n\t\t\t// :(\n\t\t\t$company_list = ECash::getFactory()->getReferenceList('Company');\n\t\t\t$metrics->display_short = $company_list->toName($this->getCompanyId());\n\t\t}", "public function getBalanceDueAttribute()\n {\n return $this->grossValue - $this->paid;\n }", "function percentage_rate($value, $append_plus = false)\n {\n $percentage = (float)$value;\n\n if($percentage > 0) {\n return ($append_plus ? \"+\" : \"\").$percentage.\"%\";\n } else {\n return $percentage.\"%\";\n }\n }", "public function getRate() {\n return $this->rate;\n }", "public function getTotalDiscountAmount();", "public function calculateReducingBalancePayment($loanAmount, $totalPeriods, $interest) {\n\n $interest = (float)$interest / 100; // convert to a percentage\n\n $value1 = (float)$interest * pow((1 + $interest), $totalPeriods);\n $value2 = (float)pow((1 + $interest), $totalPeriods) - 1;\n\n $payment = +($loanAmount * ($value1 / $value2));\n\n $payment = (float) $this->formatAmount($payment);\n return $payment;\n }", "public function calculateStraightLinePayment($loanAmount, $totalPeriods, $rate) {\n\n $interestAmount = (float)( $rate / 100 ) * $loanAmount;\n\n $principalPerPeriod = (float) $loanAmount / $totalPeriods;\n\n $payment = $principalPerPeriod + $interestAmount;\n\n return (float) $this->formatAmount($payment);\n }", "public function rate()\n {\n return $this->rate;\n }", "public function rate()\n {\n return $this->rate;\n }", "function calculateTotalPrice()\n {\n $this->sellingPrice = $this->bid;\n $this->buyersPremium = $this->sellingPrice * 0.1;\n $this->totalPrice = $this->sellingPrice + $this->buyersPremium;\n\n return $this->totalPrice;\n }", "public function tax(): float;", "public function testActiveAccountCharityPayoutFullDonationPercentage()\n {\n $inflationEffect = factory(InflationEffect::class, 1)->create([\n 'amount' => '10000'\n ]);\n\n $activeAccounts = factory(ActiveAccount::class, 3)->create([\n 'balance' => '1000' * StellarAmount::STROOP_SCALE\n ]);\n\n $activeAccount = factory(ActiveAccount::class)->create([\n 'balance' => '1000' * StellarAmount::STROOP_SCALE,\n 'user_id' => function() {\n return factory(\\lumenous\\User::class)->create([\n 'donation_percentage' => 100\n ]);\n }\n ]);\n\n $this->payoutService->init();\n\n $this->payoutService->setInflationEffect($inflationEffect->first());\n\n $payoutAmount = $this->payoutService->calculateActiveAccountCharityPayoutAmount($activeAccount);\n\n $this->assertEquals(25000000000, $payoutAmount);\n }", "function spectra_money_top100 ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\t$balance_calc[\"total\"] = \"Re-Balancing\";\n\t\t\t$balance_calc[\"percent\"] = \"0.00\";\n\t\t\n\t\t\treturn $balance_calc;\n\t\t}\n\t\t\n\t\t$accounts = mysqli_getset ($GLOBALS[\"tables\"][\"ledger\"], \"1 ORDER BY `balance` DESC LIMIT 90 OFFSET 10\");\n\n\t\tif ($accounts[\"success\"] < 1 || $accounts[\"data\"] == \"\")\n\t\t{\n\t\t\t$balance_calc[\"total\"] = \"Unavailable\";\n\t\t\t$balance_calc[\"percent\"] = \"0.00\";\n\t\t\n\t\t\treturn $balance_calc;\n\t\t}\n\t\t\n\t//\tInitialize Calculation Result\n\t\t$sum_balances = 0;\n\t\t\n\t\tforeach ($accounts[\"data\"] as $account)\n\t\t{\n\t\t\t$sum_balances = bcadd ($sum_balances, $account[\"balance\"], 8);\n\t\t}\n\t\t\n\t\t$calc_perc = bcdiv ($sum_balances, spectra_money_supply (), 8);\n\t\n\t\t$balance_calc[\"total\"] = $sum_balances;\n\t\t$balance_calc[\"percent\"] = ($calc_perc * 100);\n\t\t\n\t\treturn $balance_calc;\n\t}", "private function getTotalCharge() {\n $result = 0;\n\n foreach ($this->rentals as $rental) {\n $result += $rental->getCharge();\n }\n return $result;\n\n }", "public function calculate() : float\n {\n $aprGuess = (float)($this->interestRate / 100) / $this->numberOfInstallments;\n $partial = 0;\n $full = 1;\n\n $tempGuess = $aprGuess;\n\n do {\n $aprGuess = $tempGuess;\n //Step 1\n $rate1 = $tempGuess / (100 * $this->numberOfInstallments);\n $amount1 = $this->generalEquation(\n $this->numberOfYears * $this->numberOfInstallments,\n $this->periodicPayment,\n $full,\n $partial,\n $rate1\n );\n //Step 2\n $rate2 = ($tempGuess + 0.1) / (100 * $this->numberOfInstallments);\n $amount2 = $this->generalEquation(\n $this->numberOfYears * $this->numberOfInstallments,\n $this->periodicPayment,\n $full,\n $partial,\n $rate2\n );\n //Step 3\n $tempGuess = $tempGuess + 0.1 * ($this->principalAmount - $amount1) / ($amount2 - $amount1);\n\n } while (abs($aprGuess * 10000 - $tempGuess * 10000) > 1);\n\n $interestRate = (float) round($aprGuess, 3);\n\n // call Tae class to find TAE\n $tae = Tae::init($interestRate, $this->numberOfInstallments);\n\n return $tae->calculate();\n }", "public function getAverageConfidence(): float\n {\n return RoadDamageReport::where('roaddamage_id', $this->id)\n ->avg('confidence');\n }", "public function getDiscountRate(){\n return $this->getParameter('discount_rate');\n }", "public function getRate()\n {\n $ratesData = $this->getDataFromSource();\n\n if (!$ratesData) {\n return null;\n }\n\n $rateElements = $ratesData->xpath('/source/organizations/organization/currencies/c[@id=\"USD\"]');\n\n $rateSourcesCount = count($rateElements);\n\n if (!$rateSourcesCount) {\n return null;\n }\n\n $sumRate = 0;\n\n foreach ($rateElements as $rateSource) {\n $sumRate += (float)$rateSource->attributes()->ar;\n }\n\n return $sumRate / $rateSourcesCount;\n }", "public function getDonationPercent()\n {\n return $this->donationPercent;\n }", "public function getAccountingCost()\n {\n return $this->accountingCost;\n }", "protected function calculateTaxAmount()\n {\n\n //TAX ratio\n $tax_ratio = config('paths.tax') / 100;\n //Total amount as per current currency\n $total = Session::get('total') + Session::get('shipping_cost');\n //base currency total amount\n $bc_total = Session::get('bc_currency_total') + Session::get('bc_shipping_cost');\n //Tax amount for current currency\n $total_tax = round(($tax_ratio * $total), 2);\n //Tax amount for base currency\n $bc_total_tax = round(($tax_ratio * $bc_total), 2);\n Session::put('tax_amount', $total_tax);\n Session::put('bc_tax_amount', $bc_total_tax);\n return $total_tax;\n }", "function compute_saving_fee($amount)\n{\n $fee = 0;\n if (!is_null($amount) && $amount > 0)\n {\n $fee = $amount * 0.5;\n if ($fee > 10000)\n {\n $fee = 10000;\n }\n else \n {\n $fee = ceil($fee);\n }\n $fee = $fee * 0.01;\n }\n return $fee;\n}" ]
[ "0.7048916", "0.6441658", "0.62440926", "0.6178631", "0.616266", "0.61594385", "0.60861105", "0.60031074", "0.5999476", "0.59917885", "0.59478843", "0.5942794", "0.59083617", "0.5865003", "0.5848721", "0.58162296", "0.5784676", "0.5766853", "0.5723153", "0.5710646", "0.564306", "0.5635883", "0.5626945", "0.56106997", "0.5610244", "0.560411", "0.56033474", "0.55650765", "0.55641836", "0.554028", "0.5540182", "0.55261755", "0.551738", "0.5516592", "0.5516573", "0.5513709", "0.55064553", "0.5477554", "0.54764843", "0.5459498", "0.54559946", "0.545554", "0.5452947", "0.54466087", "0.5422265", "0.54192334", "0.54173976", "0.5415725", "0.5407304", "0.5394962", "0.53931546", "0.5390075", "0.5386664", "0.5383436", "0.5380554", "0.53763354", "0.53731126", "0.5370319", "0.53645784", "0.5362451", "0.53619707", "0.53587294", "0.5357102", "0.53562075", "0.5353107", "0.53479224", "0.5342538", "0.5341986", "0.5341986", "0.5341986", "0.5341986", "0.5341986", "0.5340115", "0.5337056", "0.53325206", "0.53273755", "0.5323185", "0.53132087", "0.5312928", "0.52993166", "0.5299053", "0.52942544", "0.52933735", "0.5289094", "0.5288065", "0.5271936", "0.5271936", "0.52674466", "0.5264879", "0.5259464", "0.52575916", "0.52545744", "0.5252455", "0.52424544", "0.5238574", "0.5233729", "0.5228619", "0.5225755", "0.52160066", "0.52093774" ]
0.67632556
1
The interest rate, charged or paid, applicable to the financial product. Note: This is different from the calculated annualPercentageRate.
public function interestRate($value) { $this->setProperty('interestRate', $value); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getInterestRate()\n {\n return (1 + ((float) $this->_webserviceHelper->getConfigData('interest_rate') / 100));\n }", "public function getAmountRate()\n {\n return $this->amountRate;\n }", "function interestRate($item_id){\n\t\treturn 0.1;\n\t}", "public function getCurrentCurrencyRate() {\r\n\t\treturn $this->_storeManager->getStore()->getCurrentCurrencyRate();\r\n\t}", "public function getRate() {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "function getInterestFactor($interest)\n{\n $rate = $interest / 365.25;\n return $rate;\n}", "public function getTaxRate();", "public function toMoney()\n {\n return $this->rate;\n }", "public function getDiscountRate(){\n return $this->getParameter('discount_rate');\n }", "public function getCurrentBalanceInDollars()\n {\n return $this->getCurrentBalance()->getAmount() / 100;\n }", "public function rate()\n {\n return $this->rate;\n }", "public function rate()\n {\n return $this->rate;\n }", "public function getRatePeriod()\n {\n return $this->ratePeriod;\n }", "public function getAnnualPrice(): float\n {\n $ratio = $this->getMonths() / 12;\n return $this->getPrice() / $ratio;\n }", "public function getRate(Currency $currency);", "public function getAvgRate()\n {\n $avg = 0;\n $nb = 0;\n if (!empty($this->getRates())) {\n foreach($this->getRates() as $rate) {\n $avg += $rate->getNbStar();\n $nb++;\n }\n $avg /= $nb;\n }\n return $avg;\n }", "public function getExternalTaxRate();", "public function impurity() : float\n {\n return $this->impurity;\n }", "public function getBaseToOrderRate();", "public function getExchangeRate()\n {\n return $this->exchangeRate;\n }", "public function getExchangeRate()\n {\n return $this->exchangeRate;\n }", "public function getExchangeRate()\n {\n return $this->exchangeRate;\n }", "public function getExchangeRate()\n {\n return $this->exchange_rate;\n }", "public function getTaxRate()\n {\n if (is_null($this->taxRate)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_TAX_RATE);\n if (is_null($data)) {\n return null;\n }\n\n $this->taxRate = TaxRateModel::of($data);\n }\n\n return $this->taxRate;\n }", "public function getTaxRate()\r\n {\r\n return $this->item->getParentObject()->getOrder()->getProxy()->getTaxRate();\r\n }", "public function getRate() : ?float \n {\n if ( ! $this->hasRate()) {\n $this->setRate($this->getDefaultRate());\n }\n return $this->rate;\n }", "protected function LiveCurrentRate()\n {\n $this->currentTaxObjects();\n\n return self::$current_tax_objects_rate;\n }", "public function getExchangeRate();", "public function getIteneraryTotalFareCurrency()\n {\n return $this->IteneraryTotalFareCurrency;\n }", "function intRate($type=null){\n\t\tglobal $driver;\n if($type==2){\n return 11.1;\n }else{\n $sql =\t\"SELECT interestrate FROM settings\"; //Retrieve the interest rate\n if($results\t= $driver->perform_request($sql)):\n $row\t= $driver->load_data($results,MYSQL_ASSOC);\n $interest = ($row['interestrate']>0)?($row['interestrate']):20;\n else:\n die('<p class=\"error\">Interest rate Error: '.mysql_error().'</p>');\n endif;\n return $interest; //The interest rate\n }\n}", "public function getExchangeRate()\n\t{\n\t\treturn $this->exchangeRate; \n\n\t}", "function get_payment_rate($subtotal) {}", "public function getProfit() {\n return round($this->getTotalPrice()*0.2, 2);\n }", "public function getRate()\n {\n $ratesData = $this->getDataFromSource();\n\n if (!$ratesData) {\n return null;\n }\n\n $rateElements = $ratesData->xpath('/source/organizations/organization/currencies/c[@id=\"USD\"]');\n\n $rateSourcesCount = count($rateElements);\n\n if (!$rateSourcesCount) {\n return null;\n }\n\n $sumRate = 0;\n\n foreach ($rateElements as $rateSource) {\n $sumRate += (float)$rateSource->attributes()->ar;\n }\n\n return $sumRate / $rateSourcesCount;\n }", "public function getBaseToGlobalRate();", "public function getISOCurrency()\n {\n return $this->iSOCurrency;\n }", "public function getRate($currencyCode = null){\n if($currencyCode && $currencyCode !== $this->getCurrencyCode()){\n $currency_converter = Shop_CurrencyConverter::create();\n return $currency_converter->convert( $this->rate, $this->getCurrencyCode(), $currencyCode );\n }\n return $this->rate;\n }", "public function getBaseCurrency()\n {\n return $this->baseCurrency;\n }", "function getExchangeRate($currency);", "public function getConversionRateAsString()\n {\n return $this->getConversionRate().'%';\n }", "function getOutletDiscountRate()\n {\n $dayOfMonth = date('j');\n return 20 + $dayOfMonth;\n }", "public function getResponseRateValue()\n {\n return isset($this->ResponseRateValue) ? $this->ResponseRateValue : null;\n }", "public function getBaseCurrency()\n {\n return $this->base_currency;\n }", "public function getRate(): ?float\n {\n return $this->rate;\n }", "public function getDiscountTaxCompensationInvoiced();", "public function getIteneraryEquivFareCurrency()\n {\n return $this->IteneraryEquivFareCurrency;\n }", "public function annualPercentageRate($value)\n {\n $this->setProperty('annualPercentageRate', $value);\n return $this;\n }", "public function getBaseDiscountTaxCompensationInvoiced();", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "protected function LiveDefaultRate()\n {\n $this->defaultTaxObjects();\n\n return self::$default_tax_objects_rate;\n }", "function get_tax_base_rate() {\n\t\t\n\t\tif ( $this->is_taxable() && get_option('woocommerce_calc_taxes')=='yes') :\n\t\t\t\n\t\t\t$_tax = &new woocommerce_tax();\n\t\t\t$rate = $_tax->get_shop_base_rate( $this->data['tax_class'] );\n\t\t\t\n\t\t\treturn $rate;\n\t\t\t\n\t\tendif;\n\t\t\n\t}", "public function getPerPersonTotalFareCurrency()\n {\n return $this->PerPersonTotalFareCurrency;\n }", "public function getRatio(): Amount\n {\n return $this->ratio;\n }", "function discount_rate($discount_rate=null)\n {\n if (isset($discount_rate)) $this->discount_rate = $discount_rate;\n return $this->discount_rate;\n }", "public function getExchangeRate()\n {\n if (null !== $this->cache) {\n if ($exchangeRate = $this->cache->fetch($this->getCacheKey())) {\n\n return $exchangeRate;\n }\n }\n\n $exchangeRate = parent::getExchangeRate();\n\n if (null !== $this->cache) {\n $this->cache->save($this->getCacheKey(), $exchangeRate, 24 * 60 * 60);\n }\n\n return $exchangeRate;\n }", "public function getOverallBitRate()\n {\n return $this->overallBitRate;\n }", "function calculateInterestPayment($n){\n global $P, $N, $c, $r, $REM, $PRINC;\n $INTER = $c - calculatePrincipalPayment($n);\n return round($INTER, 2);\n}", "public function getShippingRate();", "public function getCurrentBalance(): float\n {\n return $this->currentBalance;\n }", "public function getPerPersonEquivFareCurrency()\n {\n return $this->PerPersonEquivFareCurrency;\n }", "public function getIteneraryTotalTaxesCurrency()\n {\n return $this->IteneraryTotalTaxesCurrency;\n }", "public function getPerfection(): float\n {\n return round($this->getTotal() / 45, 3) * 100;\n }", "protected function getDeductableIncome()\n {\n return $this->salary->getGross('year');\n }", "public function getAccountingCost()\n {\n return $this->accountingCost;\n }", "public function currencyPrice()\n {\n \t$this->currencyPrice = CurrencyPrice::getCurrencyPrices($this->sellPrices->CurrencyNo)->BuyPrice;\n \treturn $this->currencyPrice > 0 ? $this->currencyPrice : 1 ;\n }", "public function getProcessRate() : int {\n return $this->iProcessRate;\n }", "public function getInterest()\n\t\t{\n\t\t return $this->interest;\n\t\t}", "public function getPerPersonTotalTaxCurrency()\n {\n return $this->PerPersonTotalTaxCurrency;\n }", "public function calculateSellingPriceCoefficient(): float\n {\n $currentDate = Carbon::today();\n $dueDate = Carbon::createFromFormat('Y-m-d', $this->due_on->format('Y-m-d'));\n $remainingDays = $currentDate->diffInDays($dueDate, false);\n return $remainingDays <= self::DAYS_TO_DUE ? self::MIN_COEFFICIENT : self::MAX_COEFFICIENT;\n }", "public function preferredCurrency()\n {\n return config('cashier.currency');\n }", "public function getDiscountTaxCompensationAmount();", "function get_tax_rate()\n\t{\n\t\tif(empty($this->address))\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$rate\t= 0;\n\t\t\n\t\t$rate += $this->get_country_tax_rate();\n\t\t$rate += $this->get_zone_tax_rate();\n\t\t$rate += $this->get_area_tax_rate();\n\t\t\n\t\t//returns the total rate not affected by price of merchandise.\n\t\treturn $rate;\n\t}", "public function getCurrency();", "public function getCurrency();", "public function getRatePerSecond()\n {\n return $this->rate_per_second;\n }", "public function calculate()\n {\n $nationalInsurance = 0.0;\n $nationalInsurance += $this->calculateBand('basic');\n $nationalInsurance += $this->calculateBand('higher');\n return $nationalInsurance;\n }", "public function getBaseDiscountTaxCompensationAmount();", "public function getBaseDiscountInvoiced();", "function getDiscountedPrice()\n {\n if (!$this->hasDiscount()) return null;\n $price = $this->price;\n if ($this->discount_active) {\n $price = $this->discountprice;\n }\n// NOTE: Add more conditions and rules as desired, i.e.\n// if ($this->testFlag('Outlet')) {\n// $discountRate = $this->getOutletDiscountRate();\n// $price = number_format(\n// $price * (100 - $discountRate) / 100,\n// 2, '.', '');\n// }\n return $price;\n }", "function getProfitPercentage()\n\t{\n\t\t$firstTrade = $this->data->getFirstCompletedTrade();\n\n\t\tif ($firstTrade)\n\t\t\t$start = $this->data->getT(Time::fromDateTime($firstTrade->getProcessedAt()), \"amount\");\n\n\t\t$start = $firstTrade ? $firstTrade->getSellAmount() : 0;\n\n\t\tif (!$start)\n\t\t\treturn 0;\n\n\t\t$current = $this->getTotalHoldings();\n\n\t\t$percentage = round((($current / $start) - 1) * 10000)/100;\n\n\t\treturn $percentage;\n\t}", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getCurrency()\n {\n return $this->currency;\n }", "public function getRate()\n {\n return $this->hasOne(PaymentRate::class, ['id' => 'rate_id']);\n }", "public function getOpeningBalance(): float\n {\n return $this->openingBalance;\n }", "public function getGwBasePriceInvoiced() {\n return $this->item->getGwBasePriceInvoiced();\n }", "public function getAverageRatingAsPercentageAttribute() : float\n {\n return $this->averageRatingAsPercentage();\n }", "public function getBalanceDueAttribute()\n {\n return $this->grossValue - $this->paid;\n }", "public function getEffectivePrice()\n {\n return $this->effective_price;\n }", "public function getPenaltySurchargePercent()\n {\n return $this->penaltySurchargePercent;\n }" ]
[ "0.7655486", "0.69028586", "0.6797481", "0.67399514", "0.643854", "0.64270866", "0.64270866", "0.64270866", "0.64270866", "0.64270866", "0.63610226", "0.63199997", "0.625513", "0.62267447", "0.62033004", "0.6155344", "0.6155344", "0.61388594", "0.60754204", "0.60649645", "0.6012468", "0.5997269", "0.5988673", "0.5961582", "0.5958687", "0.5958687", "0.5958687", "0.59483296", "0.5935893", "0.593047", "0.5929721", "0.59180176", "0.5903644", "0.5875602", "0.5861613", "0.5842163", "0.5831277", "0.58150285", "0.57935435", "0.5762488", "0.576174", "0.57593983", "0.57474536", "0.5742927", "0.5730732", "0.5705894", "0.5699184", "0.568463", "0.5675256", "0.56635165", "0.5656709", "0.5650369", "0.5647863", "0.5630295", "0.56131065", "0.56000715", "0.55964226", "0.5586481", "0.5584628", "0.55560577", "0.5554781", "0.55527216", "0.55523795", "0.5545375", "0.5523352", "0.55194426", "0.55123556", "0.5506771", "0.5505521", "0.54987425", "0.5492822", "0.5492566", "0.5473733", "0.54705065", "0.5469944", "0.5465404", "0.54636943", "0.5460319", "0.5460319", "0.54580116", "0.54572433", "0.544826", "0.54325867", "0.54268146", "0.5421967", "0.54143596", "0.54143596", "0.54143596", "0.54143596", "0.54143596", "0.54143596", "0.54143596", "0.54143596", "0.5391759", "0.53743905", "0.5370921", "0.5368759", "0.53627646", "0.53486246", "0.53471285" ]
0.58847135
33
Description of fees, commissions, and other terms applied either to a class of financial product, or by a financial service organization.
public function feesAndCommissionsSpecification($value) { $this->setProperty('feesAndCommissionsSpecification', $value); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDiscountDescription();", "public function late_fee_text() {\n switch ($this->late_fee_type) {\n case 'percent':\n return sprintf('%s%%', number_format($this->late_fee));\n case 'amount':\n return money::display($this->late_fee);\n default:\n return '';\n }\n }", "public function getPaymentDescription();", "protected function myDescription()\n {\n return _t('OrderStep.SENTINVOICE_DESCRIPTION', 'Invoice gets sent to the customer via e-mail. In many cases, it is better to only send a receipt and sent the invoice to the shop admin only so that they know an order is coming, while the customer only sees a receipt which shows payment as well as the order itself.');\n }", "function TataCapitalPL($net_salary, $company, $category, $DOB, $Company_Type, $Primary_Acc, $reqtenure, $reqloanamount) {\n\t\t $exactnet_salary = $net_salary;\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"4\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n\n if ($category == \"TATA Group\" || $category == \"TATA GROUP\") {\n if ($net_salary >= 60000) {\n $interestrate = \"12.50\";\n $intr = 12.50;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"12.75\";\n $intr = 12.75;\n } else if ($net_salary >= 20000 && $net_salary < 30000) {\n $interestrate = \"12.75\";\n $intr = 12.75;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n $proc_Fee = \"1.25%\";\n } else if ($category == \"Super Cat A\" || $category == \"Super CAT A\" || $category == \"SUPER CAT A\") {\n\t\t\t if ($net_salary >= 100000) {\n $interestrate = 12.50;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else if ($net_salary >= 60000 && $net_salary < 100000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_Fee = \"1.25%\";\n } else if ($net_salary <= 30000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $proc_Fee = \"1.25%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else if ($category == \"CAT A\") {\n if ($net_salary >= 100000) {\n $interestrate = 13.90;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else if ($net_salary >= 60000 && $net_salary < 100000) {\n $interestrate = 14.35;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = 16.50;\n $intr = $interestrate;\n $proc_Fee = \"1.50%\";\n } else if ($net_salary <= 30000) {\n $interestrate = 17;\n $intr = $interestrate;\n $proc_Fee = \"1.50%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else if ($category == \"CAT B\") {\n if ($net_salary >= 100000) {\n $interestrate = 14.50;\n $intr = $interestrate;\n $proc_Fee = \"1%\";\n } else if ($net_salary >= 60000 && $net_salary < 100000) {\n $interestrate = 15;\n $intr = $interestrate / 1200;\n $proc_Fee = \"1%\";\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = 17;\n $intr = $interestrate;\n $proc_Fee = \"1.75%\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n } else if ($category == \"CAT C\") {\n if ($net_salary >= 60000) {\n $interestrate = \"17\";\n $intr = 17;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"17\";\n $intr = 17;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n $proc_Fee = \"2%\";\n } else if ($category == \"GOVT\") {\n if ($net_salary >= 60000) {\n $interestrate = \"16.50\";\n $intr = 16.5;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"17\";\n $intr = 17;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n $proc_Fee = \"2%\";\n } else {\n if ($net_salary >= 60000) {\n $interestrate = \"19\";\n $intr = 19;\n } else if ($net_salary >= 30000 && $net_salary < 60000) {\n $interestrate = \"19.50\";\n $intr = 19.50;\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n }\n\t\t //special Clause \n /*if (($category == \"TATA Group\" || $category == \"TATA GROUP\" || $category == \"Super Cat A\" || $category == \"Super CAT A\" || $category == \"CAT A\" || $category == \"CAT B\") && $net_salary >= 100000) {\n $interestrate = \"14.99\";\n $intr = 14.99;\n $proc_Fee = \"1.25%\";\n } else {\n $interestrate = \"15.99\";\n $intr = 15.99;\n $proc_Fee = \"1.50%\";\n }*/\n\n //Calculate Tenure\n if ($category == \"TATA Group\" || $category == \"Super Cat A\" || $category == \"Super CAT A\") {\n if ($term > 72) {\n $calcterm = 66;\n $getterm = 5.5;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n } else if ($category == \"CAT A\" || $category == \"CAT B\" || $category == \"GOVT\") {\n if ($term > 48) {\n $calcterm = 48;\n $getterm = 4;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n } else {\n if ($term > 36) {\n $calcterm = 36;\n $getterm = 3;\n } else {\n $calcterm = $term;\n $getterm = $print_term;\n }\n }\n\t\t\n // Multiplier\n if ($category == \"TATA Group\" || $category == \"Super Cat A\" || $category == \"Super CAT A\") {\n if ($calcterm >= 49 && $calcterm <= 66) {\n $loan_amt = $net_salary * 18;\n } else if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 15;\n } else if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 12;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 10;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"CAT A\") {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = \"\";\n } else if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 14;\n } else if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 9;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"CAT B\" || $category == \"GOVT\") {\n if ($calcterm >= 49 && $calcterm <= 60) {\n $loan_amt = \"\";\n } else if ($calcterm >= 37 && $calcterm <= 48) {\n $loan_amt = $net_salary * 13;\n } else if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 8;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else if ($category == \"CAT C\") {\n if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 8;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n }\n } else {\n if ($calcterm >= 25 && $calcterm <= 36) {\n $loan_amt = $net_salary * 11;\n } else if ($calcterm >= 24 && $calcterm <= 13) {\n $loan_amt = $net_salary * 8;\n } else if ($calcterm <= 12) {\n $loan_amt = $net_salary * 5;\n } else {\n $loan_amt = 0;\n }\n }\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$loan_amt)\n\t\t\t\t{\n\t\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$loan_amt=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$loan_amt=$loan_amt;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n\t\tif($loan_amt >= 600000)\n\t\t{\n if (($category == \"TATA Group\" || $category == \"TATA GROUP\" || $category == \"Super Cat A\" || $category == \"Super CAT A\") && $loan_amt >= 600000) {\n $interestrate = 12.50;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } elseif (($category == \"CAT A\" || $category == \"CAT B\") && $loan_amt >= 600000) {\n $interestrate = 13.90;\n $intr = $interestrate;\n $proc_Fee = \"Rs. 999\";\n } else {\n $interestrate = 17;\n $intr = 17;\n $proc_Fee = \"2%\";\n }\n\t\t}\n //MAx Loan Amount\n if ($intr > 0) {\n if ($category == \"TATA Group\" || $category == \"TATA GROUP\" || $category == \"Super Cat A\" || $category == \"Super CAT A\" || $category == \"CAT A\") {\n if ($loan_amt >= 1500000) {\n $loan_amount = 1500000;\n } else {\n $loan_amount = $loan_amt;\n }\n } else {\n if ($loan_amt >= 1500000) {\n $loan_amount = 1500000;\n } else {\n $loan_amount = $loan_amt;\n }\n }\n $getemicalc = round($loan_amount * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $calcterm))));//getController()->Common()->getEMI($loan_amount, $intr, $calcterm);\n $fterm = $calcterm / 12;\n }\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $calcterm))));\n $details['bank_code'] = \"Tata Capital\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($loan_amount);\n $details['processing_fee'] = $proc_Fee;\n $details['category'] = $category;\n return($details);\n }", "protected function initFinancialServices()\n {\n $this->financialServices = [\n FinancialService::getOne(\"CROUS\", FinancialService::TYPE_FINANCIAL_HELP, [\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"birthday\"))\n ->addConstraint(new AgeSuperiorTo(18))\n ->addConstraint(new AgeInferiorTo(25)),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"nationality\"))\n ->addConstraint(new EqualTo(\"française\")),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"status\"))\n ->addConstraint(new In([\"Etudiant\", \"Apprenti\", \"Contrat pro\"])),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"location.birth\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"location.current\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resident.since\"))\n ->addCondition(new OnlyIf(\"nationality\", new Not(new EqualTo(\"française\"))))\n ->addConstraint(new SuperiorTo(12)),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.parent.marital.situation\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.siblings.count\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.children.own\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.children.support\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"wish.licence.car\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.diploma.bac\"))\n ->addConstraint(new IsTrue()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.diploma.bac.mention\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.diploma.current\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.diploma.bac.after\"))\n ->addConstraint(new Not(new EqualTo(\"Je n'ai pas encore commencé d'études supérieures\"))),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"location.education.current\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.school.name\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.distance.school.parents\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.internship.abroad\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.internship.abroad.country.isplanned\"))\n ->addCondition(new OnlyIf(\"education.internship.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.internship.abroad.country\"))\n ->addCondition(new OnlyIf(\"education.internship.abroad.country.isplanned\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.internship.abroad.duration\"))\n ->addCondition(new OnlyIf(\"education.internship.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.internship.abroad.convention\"))\n ->addCondition(new OnlyIf(\"education.internship.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.study.abroad\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.study.abroad.country.isplanned\"))\n ->addCondition(new OnlyIf(\"education.study.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.study.abroad.country\"))\n ->addCondition(new OnlyIf(\"education.study.abroad.country.isplanned\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.study.abroad.duration\"))\n ->addCondition(new OnlyIf(\"education.study.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.study.abroad.convention\"))\n ->addCondition(new OnlyIf(\"education.study.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"housing.me.type\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"housing.me.family.link\"))\n ->addCondition(new OnlyIf(\"housing.me.type\", new EqualTo(\"Locataire (mon nom figure sur le bail)\")))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"housing.me.status\"))\n ->addCondition(new OnlyIf(\"housing.me.type\", new EqualTo(\"Locataire (mon nom figure sur le bail)\")))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"housing.flat.type\"))\n ->addCondition(new OnlyIf(\"housing.me.type\", new EqualTo(\"Locataire (mon nom figure sur le bail)\")))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"housing.flat.furniture\"))\n ->addCondition(new OnlyIf(\"housing.me.type\", new EqualTo(\"Locataire (mon nom figure sur le bail)\")))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"housing.rent.base.alone\"))\n ->addCondition(new OnlyIf(\"housing.me.type\", new EqualTo(\"Locataire (mon nom figure sur le bail)\")))\n ->addCondition(new OnlyIf(\"housing.me.status\", new EqualTo(\"Seul\")))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"housing.rent.base.group\"))\n ->addCondition(new OnlyIf(\"housing.me.type\", new EqualTo(\"Locataire (mon nom figure sur le bail)\")))\n ->addCondition(new OnlyIf(\"housing.me.status\", new Not(new EqualTo(\"Seul\"))))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"housing.rent.base.own\"))\n ->addCondition(new OnlyIf(\"housing.me.type\", new EqualTo(\"Locataire (mon nom figure sur le bail)\")))\n ->addCondition(new OnlyIf(\"housing.me.status\", new EqualTo(\"En couple\")))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"housing.rent.extra\"))\n ->addCondition(new OnlyIf(\"housing.me.type\", new EqualTo(\"Locataire (mon nom figure sur le bail)\")))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resources.income\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resources.income.monthly\"))\n ->addCondition(new OnlyIf(\"resources.income\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resources.tax.own.has\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resources.tax.parents.has\"))\n ->addCondition(new Unless(\"resources.tax.own.has\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resources.tax.own.brut\"))\n ->addCondition(new OnlyIf(\"resources.tax.own.has\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resources.tax.parents.brut\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resources.tax.parents.reference\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resources.tax.siblings\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resources.tax.siblings.superior.school\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"wish.student.loan.personal\"))\n ->addConstraint(new Any()),\n ]),\n FinancialService::getOne(\"Erasmus+ Stage\", FinancialService::TYPE_FINANCIAL_HELP, [\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"birthday\"))\n ->addConstraint(new AgeSuperiorTo(18))\n ->addConstraint(new AgeInferiorTo(25)),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"nationality\"))\n ->addConstraint(new EqualTo(\"française\")),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"status\"))\n ->addConstraint(new In([\"Etudiant\", \"Apprenti\", \"Contrat pro\"])),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"location.birth\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"location.current\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resident.since\"))\n ->addCondition(new OnlyIf(\"nationality\", new Not(new EqualTo(\"française\"))))\n ->addConstraint(new SuperiorTo(12)),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.parent.marital.situation\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.siblings.count\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.children.own\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.children.support\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"wish.licence.car\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.diploma.bac\"))\n ->addConstraint(new IsTrue()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.internship.abroad\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.internship.abroad.country.isplanned\"))\n ->addCondition(new OnlyIf(\"education.internship.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.internship.abroad.country\"))\n ->addCondition(new OnlyIf(\"education.internship.abroad.country.isplanned\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.internship.abroad.duration\"))\n ->addCondition(new OnlyIf(\"education.internship.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.internship.abroad.convention\"))\n ->addCondition(new OnlyIf(\"education.internship.abroad\", new IsTrue()))\n ->addConstraint(new Any())\n ]),\n FinancialService::getOne(\"Erasmus+ Etudes\", FinancialService::TYPE_FINANCIAL_HELP, [\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"birthday\"))\n ->addConstraint(new AgeSuperiorTo(18))\n ->addConstraint(new AgeInferiorTo(25)),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"nationality\"))\n ->addConstraint(new EqualTo(\"française\")),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"status\"))\n ->addConstraint(new In([\"Etudiant\", \"Apprenti\", \"Contrat pro\"])),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"location.birth\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"location.current\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"resident.since\"))\n ->addCondition(new OnlyIf(\"nationality\", new Not(new EqualTo(\"française\"))))\n ->addConstraint(new SuperiorTo(12)),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.parent.marital.situation\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.siblings.count\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.children.own\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"family.children.support\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"wish.licence.car\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.diploma.bac\"))\n ->addConstraint(new IsTrue()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.study.abroad\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.study.abroad.country.isplanned\"))\n ->addCondition(new OnlyIf(\"education.study.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.study.abroad.country\"))\n ->addCondition(new OnlyIf(\"education.study.abroad.country.isplanned\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.study.abroad.duration\"))\n ->addCondition(new OnlyIf(\"education.study.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.study.abroad.convention\"))\n ->addCondition(new OnlyIf(\"education.study.abroad\", new IsTrue()))\n ->addConstraint(new Any()),\n ]),\n FinancialService::getOne(\"Emploi d'avenir professeur\", FinancialService::TYPE_FINANCIAL_HELP, [\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"birthday\"))\n ->addConstraint(new AgeSuperiorTo(18))\n ->addConstraint(new AgeInferiorTo(25)),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"nationality\"))\n ->addConstraint(new EqualTo(\"française\")),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"status\"))\n ->addConstraint(new In([\"Etudiant\"])),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"location.current\"))\n ->addConstraint(new Any()),\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"education.diploma.teaching\"))\n ->addConstraint(new IsTrue()),\n ]),\n FinancialService::getOne(\"Yestudent\", FinancialService::TYPE_GOOD_PLAN, [\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"status\"))\n ->addConstraint(new In([\"Lycéen\", \"Etudiant\", \"Apprenti\", \"Contrat pro\"])),\n ]),\n FinancialService::getOne(\"Ornikar\", FinancialService::TYPE_GOOD_PLAN, [\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"birthday\"))\n ->addConstraint(new AgeSuperiorTo(16))\n ]),\n FinancialService::getOne(\"Carte 12-27\", FinancialService::TYPE_GOOD_PLAN, [\n RequiredInfo::getOne()\n ->setInfo($this->getInfo(\"birthday\"))\n ->addConstraint(new AgeSuperiorTo(12))\n ->addConstraint(new AgeInferiorTo(27))\n ])\n ];\n }", "public function getFeeInfo()\n {\n return $this->trading([\n 'command' => 'returnFeeInfo',\n ]);\n }", "public function formattedTax(): string;", "public function toString()\n {\n return \"Currency rate has been applied correctly on Catalog page.\";\n }", "public function form()\n {\n $this->number('month', '贷款月数')\n ->min(1)\n ->max(360)\n ->required();\n $this->number('total', '贷款总额')\n ->required();\n $this->rate('rate', '贷款利率')\n ->required();\n $this->radio('type', '还款方式')\n ->options(Loan::$typeMap)\n ->required();\n\n $this->html('等额本金法与等额本息法并没有很大的优劣之分,大部分是根据每个人的现状和需求而定的。');\n $this->html('<a target=\"_blank\" href=\"https://zhuanlan.zhihu.com/p/61140535\">等额本息和等额本金的区别!</a>');\n }", "function getDescription() {\n\t\tswitch ($this->type) {\n\t\t\tcase PAYMENT_TYPE_PURCHASE_FILE:\n\t\t\t\treturn __('payment.directSales.monograph.description');\n\t\t\tdefault:\n\t\t\t\t// Invalid payment ID\n\t\t\t\tassert(false);\n\t\t}\n\t}", "public function toString()\n {\n return \"CategoryRepository - TaxClass - Discount Product - You are able to apply discount under 100% only\";\n }", "function _erpal_contract_helper_get_billable_text() {\n\n $default_text = t('Payment for !service_category_token contract \"!contract_title_token\"', array('!service_category_token' => '[erpal_contract_billable_subject:service_category]', '!contract_title_token' => '[erpal_contract_billable_subject:contract_title]'));\n return variable_get('erpal_billable_text_erpal_contract', $default_text);\n}", "public function getDiscountTaxCompensationRefunded();", "public function printTermFee()\n {\n ini_set('max_execution_time', 0);\n $TF = new TermFee();\n $PTFI = $TF->printTFInv();\n return view('Activities.Reports.printTermFeeRpt', array('termFees' => $PTFI));\n }", "public function getExpedition()\n {\n if ($this->amount > 50) {\n return 'Spedizione Gratuita';\n }\n return 'Costo di spedizione 5€';\n }", "public function description();", "public function description();", "public function getDescription()\n {\n return 'Developer at Afrihost. Design Patterns acolyte. Dangerous sysadmin using \\'DevOps\\' as an excuse. I like '.\n 'long walks on the beach and craft beer.';\n }", "public function getDescription()\n {\n return $this->beverage->getDescription().', '.$this->description;\n }", "function BajajFinservPL($strnet_salary, $company, $category, $DOB, $clubbed_emi, $reqtenure, $reqloanamount) {\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n $bflloansmt = round($strnet_salary * 10);\n\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$bflloansmt)\n\t\t\t\t{\n\t\t\t\t\t$bflloansmt=$bflloansmt;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$bflloansmt=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$bflloansmt=$bflloansmt;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n $intr1 = 14.50;\n $intr2 = 15.50;\n $bflintr1 = $intr1;\n $bflintr2 = $intr2;\n $bflintrte = \"$intr1% - $intr2%\";\n $getemi1 = round($bflloansmt * ($bflintr1/1200) / (1 - (pow(1/(1 + ($bflintr1/1200)), $term))));//getController()->Common()->getEMI($bflloansmt, $bflintr1, $term);\n $getemi2 = round($bflloansmt * ($bflintr2/1200) / (1 - (pow(1/(1 + ($bflintr2/1200)), $term))));//getController()->Common()->getEMI($bflloansmt, $bflintr2, $term);\n $getemi = \"Rs. \" . $getemi1 . \" - Rs. \" . $getemi2;\n $getterm = $print_term;\n $proc_fee = \"Upto 2%\";\n\t\t$emiperlac = round(100000 * ($bflintrte/1200) / (1 - (pow(1/(1 + ($bflintrte/1200)), $term))));\n\n $details['bank_code'] = \"Bajaj Finserv\";\n $details['interest_rate'] = interestRateFormat($bflintrte);\n $details['emi'] = $getemi;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($bflloansmt);\n $details['processing_fee'] = $proc_fee;\n $details['category'] = $category;\n return($details);\n }", "public function payment_fields() {\n\t\t\tif (true === $this->description) {\n\t\t\t\techo esc_html($this->description);\n\t\t\t}\n\n\t\t}", "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}", "function payment_fields()\n {\n if ($this->description) {\n echo wpautop(wptexturize($this->description));\n }\n }", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getDescription();", "public function getAmountDescription()\n {\n return $this->_fields['AmountDescription']['FieldValue'];\n }", "public function getDealTerms()\n {\n return $this->dealTerms;\n }", "public function add_terms_of_use_field() {\n\t?>\n\t\t<p style=\"width:100%; margin-bottom:1em;\">\n\t\t<input name=\"rcp_terms_agreement\" id=\"rcp_terms_agreement\" class=\"required\" type=\"checkbox\"/>\n\t\t<label style=\"width:90%\" for=\"rcp_terms_agreement\">Read and Agree to <a href=\"/terms-of-service\" target=\"_blank\">Our Terms, Conditions and Privacy Policy</a> <em>(required)</em></label>\n\t\t</p>\n\t<?php\n\t}", "function payment_fields() {\r\n if ($this->description) {\r\n echo wpautop(wptexturize($this->description));\r\n }\r\n }", "static function parseLastDescription($is_fee) {\n // If found, add to type_pdf and match format for CSV\n\n $pdf_transaction_type_search = array();\n // Varer => VARER\n $pdf_transaction_type_search['Varer '] = 'VARER';\n // Lønn => LØNN\n $pdf_transaction_type_search['Lønn '] = 'LØNN';\n // Minibank => MINIBANK\n $pdf_transaction_type_search['Minibank '] = 'MINIBANK';\n // Avtalegiro => AVTALEGIRO\n $pdf_transaction_type_search['Avtalegiro '] = 'AVTALEGIRO';\n // Overføring => Overførsel\n $pdf_transaction_type_search['Overføring '] = 'OVERFØRSEL';\n // Overførsel => OVERFØRSEL\n $pdf_transaction_type_search['Overførsel '] = 'OVERFØRSEL';\n // Valuta => VALUTA\n $pdf_transaction_type_search['Valuta '] = 'VALUTA';\n // Nettbank til: => NETTBANK TIL\n $pdf_transaction_type_search['Nettbank til:'] = 'NETTBANK TIL';\n // Nettbank til: => NETTBANK FRA\n $pdf_transaction_type_search['Nettbank fra:'] = 'NETTBANK FRA';\n // Giro Fra: => GIRO FRA\n $pdf_transaction_type_search['Giro Fra:'] = 'GIRO FRA';\n // Nettgiro til: => NETTGIRO TIL\n $pdf_transaction_type_search['Nettgiro til:'] = 'NETTGIRO TIL';\n // Nettgiro Til: => NETTGIRO TIL\n $pdf_transaction_type_search['Nettgiro Til:'] = 'NETTGIRO TIL';\n // Nettgiro fra: => NETTGIRO FRA\n $pdf_transaction_type_search['Nettgiro fra:'] = 'NETTGIRO FRA';\n // Nettgiro Fra: => NETTGIRO FRA\n $pdf_transaction_type_search['Nettgiro Fra:'] = 'NETTGIRO FRA';\n // Telegiro fra: => TELEGIRO FRA\n $pdf_transaction_type_search['Telegiro fra:'] = 'TELEGIRO FRA';\n // Telegiro Til: => TELEGIRO TIL\n $pdf_transaction_type_search['Telegiro Til:'] = 'TELEGIRO TIL';\n // Mobilbank fra: => MOBILBANK FRA\n $pdf_transaction_type_search['Mobilbank fra: '] = 'MOBILBANK FRA';\n // Innskudd Fra: => INNSKUDD FRA\n $pdf_transaction_type_search['Innskudd Fra:'] = 'INNSKUDD';\n // Innskudd => INNSKUDD\n $pdf_transaction_type_search['Innskudd automat'] = 'INNSKUDD';\n // Bedrterm overf. Fra: => BEDRTERM OVERFØRSEL\n $pdf_transaction_type_search['Bedrterm overf. Fra:'] = 'BEDRTERM OVERFØRSEL';\n foreach ($pdf_transaction_type_search as $search => $transaction_type) {\n self::$lasttransactions_description = self::remove_firstpart_if_found_and_set_type_pdf(\n self::$lasttransactions_description,\n $search,\n $transaction_type);\n }\n if (substr(self::$lasttransactions_description, 0, 1) == '*' && is_numeric(substr(self::$lasttransactions_description, 1, 4))) // *1234 = VISA VARE\n {\n }\n if ($is_fee) {\n // 1 Kontohold => Kontohold\n self::$lasttransactions_description = str_replace('1 Kontohold', 'Kontohold', self::$lasttransactions_description);\n self::$lasttransactions_type = 'GEBYR';\n }\n\n if (self::$lasttransactions_type == 'VARER') {\n self::$lasttransactions_description = trim(substr(self::$lasttransactions_description, 5));\n }\n\n if (\n self::$lasttransactions_type == 'NETTBANK TIL' ||\n self::$lasttransactions_type == 'NETTBANK FRA' ||\n self::$lasttransactions_type == 'NETTGIRO TIL' ||\n self::$lasttransactions_type == 'NETTGIRO FRA' ||\n self::$lasttransactions_type == 'TELEGIRO FRA'\n ) {\n // Nettbank til: Some Name Betalt: DD.MM.YY\n // Nettbank fra: Some Name Betalt: 31.12.99\n // Nettgiro til: 1234.56.78901 Betalt: 01.01.11\n // Nettgiro fra: Some Name Betalt: 01.01.11\n // Telegiro fra: Some Name Betalt: 01.01.11\n //\n // Format:\n // TYPE: TEXT Betalt: 15.10.09\n //\n // Nettbank til/Nettbank fra/Nettgiro til are already chopped of\n\n // :? Search for \"Betalt: \" in the text\n $betalt_pos = strpos(self::$lasttransactions_description, 'Betalt: ');\n if ($betalt_pos !== false) {\n // -> Found \"Betalt: \"\n $date_tmp = substr(\n self::$lasttransactions_description,\n $betalt_pos + strlen('Betalt: ')\n );\n if (substr($date_tmp, 6) >= 90) // year 1990-1999\n {\n $date_tmp = substr($date_tmp, 0, 6) . '19' . substr($date_tmp, 6);\n }\n else // year 2000-2099\n {\n $date_tmp = substr($date_tmp, 0, 6) . '20' . substr($date_tmp, 6);\n }\n self::$lasttransactions_payment_date = sb1helper::convert_stringDate_to_intUnixtime($date_tmp);\n self::$lasttransactions_description = trim(substr(self::$lasttransactions_description, 0, $betalt_pos));\n }\n }\n }", "public function getDescription()\n\t{\n\t\treturn $this->getContext()->getI18n()->dt( 'controller/jobs', 'Deletes unfinished orders an makes their products and coupon codes available again' );\n\t}", "function AccountsBody()\n\t{\t$this->DiscountBody();\n\t}", "public function extendFee()\n {\n return Fee::NAMESPACE_AND_MOSAIC;\n }", "public function description(): string\n\t{\n\t\treturn match ($this) {\n\t\t\tself::Created => 'Displayed in admin only',\n\t\t\tself::Tentative => 'Displayed on the site as month, tentative signup',\n\t\t\tself::Confirmed => 'Displayed on the site with full date, regular signup',\n\t\t\tself::Canceled => 'Displayed only in admin',\n\t\t};\n\t}", "public function getServiceDescription();", "function payment_fields(){\r\n if($this -> description) echo wpautop(wptexturize($this -> description));\r\n }", "abstract public function getFormDesc();", "public function payment_fields(){\r\n if($this->description) echo wpautop(wptexturize($this->description));\r\n }", "public function getDiscountTaxCompensationInvoiced();", "function emc_the_term_description() {\r\n\r\n\t$term = get_queried_object();\r\n\tif ( ! isset( $term->taxonomy ) || ! class_exists( 'Acf', false ) ) return false;\r\n\r\n\t$term_id = $term->taxonomy . '_' . $term->term_id;\r\n\t$description = get_field( 'project_description', $term_id, true );\r\n\r\n\techo $description;\r\n\r\n}", "public function getFee(){\r\n\t\treturn $this->fee;\r\n\t}", "public function getRationale()\n {\n return $this->rationale;\n }", "function IIFLbankPL($net_salary,$clubbed_emi,$company,$category,$DOB,$Company_Type, $reqtenure, $reqloanamount)\n\t{\n\t\t $net_salary= $net_salary - $clubbed_emi;\n\t\tlist($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"60\");\n\n\tif($category==\"SUPER CAT A\")\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 0;\n\t\t\t\t\t$intr=0;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1%\";\n\n\t\t\t}\n\t\telseif($category==\"CAT A\" || $category==\"CAT B\")\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 0;\n\t\t\t\t\t$intr=0;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1%\";\n\t\t\t\t//tenure\n\t\t\t\tif($category==\"CAT A\")\n\t\t\t\t{\n\t\t\t\t\tif($calterm>48)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=48;\n\t\t\t\t\t\t$calprint_term=4;\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$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($category==\"CAT B\")\n\t\t\t\t{\n\t\t\t\t\tif($calterm>36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=36;\n\t\t\t\t\t\t$calprint_term=3;\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$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}//CAT B\n\t\telse\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1.50%\";\n\t\t\t\tif($calterm>36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=36;\n\t\t\t\t\t\t$calprint_term=3;\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$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t}\n\t\t//non cat company\n\t\t$term=$calterm;\n\t\t$print_term=$calprint_term;\n\t\t\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//foir\n\t\t$princ=100000;\n\t\t$perlacemi=round($princ * $intr / (1 - (pow(1/(1 + $intr), $term))));\n\n\t\tif($category==\"SUPER CAT A\" || $category==\"CAT A\")\n\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (60/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}elseif($category==\"CAT B\")\n\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (55/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$firstnet_salary=($net_salary* (50/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}//foir end\n\t\t\n\t\tif($category==\"SUPER CAT A\")\n\t\t{\n\t\t\tif($finalloanamount_dbr>2500000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 2500000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\t\telseif($category==\"CAT A\")\n\t\t{\n\t\t\tif($finalloanamount_dbr>2000000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 2000000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($finalloanamount_dbr>1500000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 1500000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\n\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\n\t\t$getterm=$print_term;\n\t\t$getemicalc=round($getloanamout * $intr / (1 - (pow(1/(1 + $intr), $term))));\n\t\t\t\n\t\t\t$details['bank_code'] = \"IIFL\";\n\t\t\t$details['interest_rate'] = interestRateFormat($interestrate);\n\t\t\t$details['emi'] = $getemicalc;\n\t\t\t$details['emiperlac'] = $emiperlac;\n\t\t\t$details['tenure'] = $getterm;\n\t\t\t$details['loan_amount'] = round($getloanamout);\n\t\t\t$details['processing_fee'] = $proc_Fee;\n\t\t\t$details['category'] = $category;\n\t\t\treturn($details);\n\t}", "public function getDiscountTaxCompensationAmount();", "private function print_tab_budgetSummary(){\n\n $GLOBALS['b_fmt::money'] = ' SEK';\n print x('h2','Budget summary');\n $this->dbg();\n\n // Use the same header for the summary as for the visitors\n $header = $this->header();\n \n // Get the price of social events \n $word_socialEvents = '';\n $detailed_socialEvents = False;\n $total_socialEvents = 0;\n if (is_object(VM::$e)){\n VM::$e->socialEvents()->get_budget();\n if (($s = VM::$e->socialEvents()->summary)){\n\tob_start();\n\t$t = new b_table_zebra(array('what'=>' ','skoko'=>' '));\n\t$t->showLineCounter = False;\n\tforeach($s as $what=>$v){\n\t if (empty($v)) continue;\n\t $total_socialEvents += $v;\n\t $t->prt(array('what' =>$what,\n\t\t\t'skoko'=>b_fmt::money($v)));\n\t}\n\t$t->close();\n\t$socialEvents = ob_get_contents();\n\tob_end_clean();\n }\n if ($total_socialEvents > 0){\n\t$detailed_socialEvents = True;\n\t$header['name'] = 'Social events';\n\t// $this->scholar_summary['name'] = $socialEvents;\n\t$word_socialEvents = 'Social events';\n\t$header['name'] = '';\n }\n \n $this->total['name'] = $total_socialEvents;\n @$this->total['total_e'] += $total_socialEvents;\n @$this->total['total_r'] += $total_socialEvents;\n }\n\n foreach($this->total as $k=>$v){\n $this->money_bold[] = $k;\n $budget[$k] = $v;\n $budgetP[$k] = b_fmt::money($v);\n $this->set_colorCodes($k,$budgetP[$k]);\n }\n\n // \n // Add details about socialEvents\n //\n if ($detailed_socialEvents){\n $this->money_bold[] = 'name';\n $budgetP['name'] .= x(\"span font-style:italic'\",'<br><hr>&nbsp;'.$socialEvents);\n $word_socialEvents = 'Social events';\n $header['name'] = '';\n // $this->set_colorCodes($k,$budgetP[$k]);\n }\n $GLOBALS['b_fmt::money'] = '';\n\n // \n // Add details about accommodation \n //\n foreach($this->ac2h as $hut_code=>$header_element){\n if (!empty($header[$header_element])){\n\tob_start();\n\tif (is_object(VM::$e)){\n\t VM_accommodationOptions(VM::$e)->show_usage($hut_code);\n\t}else{\n\t $av_id = @$_GET['host_avid_once'];\n\t if (empty($av_id) && is_object($this->av)) $av_id = $this->av->ID;\n\t if (!empty($av_id)) VM_accommodationOptions(myOrg_ID)->show_usage($hut_code,0,0,$av_id);\n\t}\n\t$result = ob_get_contents();\n\tob_end_clean();\n\tif (!empty($result)) $budgetP[$header_element] .= '<br><hr>N. tenants'.$result;\n } \n }\n\n //\n // Add details about scholarships\n //\n foreach(array_keys($this->total) as $k){\n if (!empty($this->scholar_summary[$k])){\n\tob_start();\n\t$t = new b_table_zebra(array('n'=>' ','zone'=>' '));\n\t$t->showLineCounter = False;\n\tforeach($this->scholar_summary[$k] as $zone=>$n) $t->prt(array('n' =>$n,\n\t\t\t\t\t\t\t\t 'zone'=>$zone));\n\t\n\t$t->close();\n\t$budgetP[$k] .= '<br><hr>N.trips'.ob_get_contents();\n\tob_end_clean();\n }\n }\n\n if ($this->bs) print x('h4',(!b_posix::is_empty($b=b_fmt::money(VM::$e->budgetSource()->total))\n\t\t\t\t ? \"Available budget $b\".CONST_currency.\n\t\t\t\t ($this->something_was_paid\n\t\t\t\t ? ''\n\t\t\t\t : \", estimated cost \".b_fmt::money(@$budget['total_e']).CONST_currency) \n\t\t\t\t : 'No known budget source'));\n \n ob_start();\n $t = new b_table_zebra($header);\n foreach (array_keys($header) as $k) $t->css[$k]['align'] = 'align_right'; \n\n $this->set_colorCodesTH($header,$t->th_attr);\n\n $t->preHeaders = $this->build_budget_preHeaders($header,$word_socialEvents);\n $t->noSort = True;\n $t->showLineCounter = False;\n \n foreach($header as $k=>$v){\n $t->class[$k] = array(stripos($k,'space')===0 ? 'highlightShadow' : 'highlightWhite'); \n // if (stripos($k,'space')===False) $separator[$k] = '<hr>';\n }\n $t->prt($budgetP);\n \n if (is_object(VM::$e) && !is_object($this->av)){\n if (VM::$e->isArchived()) $t->extraTD[] = bIcons()->get('b-archive');\n elseif (VM::$e->isEventEndorsed()) $t->extraTD[] = bIcons()->get('b-approved');\n }\n $t->close();\n $table = ob_get_contents();\n ob_end_clean();\n print x(\"div class='messages status-no-image'\",$table);\n }", "public function getScheduleDescription() {\n\t\t\n\t\t$description = '';\n\t\t\n\t\tif ($this->isEveryDaySchedule()) {\n\t\t\t$description .= 'Envio Diario';\n\t\t}\n\t\t\n\t\tif ($this->isOnceAWeekSchedule()) {\n\t\t\t\n\t\t\t$description .= 'Envio Semanal ';\n\t\t\t$weekdays = NewsletterSchedulePeer::getWeekdays();\n\t\t\t$description .= '(Se realiza los dias ' . $weekdays[$this->getDeliveryDay()] . ')';\n\t\t}\n\n\t\tif ($this->isOnceAMonthSchedule()) {\n\t\t\t\n\t\t\t$description .= 'Envio Mensual ';\n\t\t\t$description .= '(Se realiza el dia ' . $this->getDeliveryDayNumber() . ' del mes)';\n\t\t}\n\t\t\n\t\tif ($this->isOnceSchedule()) {\n\t\t\t\n\t\t\t$description .= 'Envio Unico ';\n\t\t\t$description .= '(Se realiza el dia ' . date(\"d-m-Y\",strtotime($this->getDeliveryDate())) . ')';\n\t\t}\t\t\n\t\t\n\t\treturn $description;\n\t\t\n\t}", "function construct_final_value_donation_fee($pid = 0, $amount = 0, $mode = 'charge')\n\t{\n\t\tglobal $ilance, $ilconfig, $phrase;\n\t\t$fvf = $fvfnotax = 0;\n\t\t// fetch awarded bid amount\n\t\t$project = $ilance->db->query(\"\n\t\t\tSELECT user_id, donation, charityid, donationpercentage\n\t\t\tFROM \" . DB_PREFIX . \"projects\n\t\t\tWHERE project_id = '\" . intval($pid) . \"' \n\t\t\tLIMIT 1\n\t\t\", 0, null, __FILE__, __LINE__);\n\t\tif ($ilance->db->num_rows($project) > 0)\n\t\t{\n\t\t\t$resproject = $ilance->db->fetch_array($project, DB_ASSOC);\n\t\t\tif ($resproject['donation'] AND $resproject['charityid'] > 0 AND $resproject['donationpercentage'] > 0)\n\t\t\t{\n\t\t\t\t$fvf = ($amount * $resproject['donationpercentage'] / 100);\n\t\t\t\t$fvfnotax = $fvf;\n\t\t\t}\n\t\t\tif ($fvf > 0)\n\t\t\t{\n\t\t\t\t// #### taxes on final value fees ##############\n\t\t\t\t$extrainvoicesql = \"totalamount = '\" . sprintf(\"%01.2f\", $fvf) . \"',\";\n\t\t\t\t$fvfnotax = $fvf;\n\t\t\t\tif ($ilance->tax->is_taxable($resproject['user_id'], 'finalvaluefee'))\n\t\t\t\t{\n\t\t\t\t\t// fetch tax amount to charge for this invoice type\n\t\t\t\t\t$taxamount = $ilance->tax->fetch_amount($resproject['user_id'], $fvf, 'finalvaluefee', 0);\n\t\t\t\t\t// fetch total amount to hold within the \"totalamount\" field\n\t\t\t\t\t$totalamount = ($fvf + $taxamount);\n\t\t\t\t\t// fetch tax bit to display when we display tax infos\n\t\t\t\t\t$taxinfo = $ilance->tax->fetch_amount($resproject['user_id'], $fvf, 'finalvaluefee', 1);\n\t\t\t\t\t// #### extra bit to assign tax logic to the transaction \n\t\t\t\t\t$extrainvoicesql = \"\n\t\t\t\t\t\tistaxable = '1',\n\t\t\t\t\t\ttotalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n\t\t\t\t\t\ttaxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n\t\t\t\t\t\ttaxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n\t\t\t\t\t\";\n\t\t\t\t\t// ensure our new tax is applied to the current fvf..\n\t\t\t\t\t$fvf = $totalamount;\n\t\t\t\t}\n\t\t\t\t// #### CHARGE FVF LOGIC #######################################\n\t\t\t\tif ($mode == 'charge')\n\t\t\t\t{\n\t\t\t\t\t// do we have funds in online account?\n\t\t\t\t\t$account = $ilance->db->query(\"\n\t\t\t\t\t\tSELECT available_balance, total_balance, autopayment\n\t\t\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\t\t\tWHERE user_id = '\" . $resproject['user_id'] . \"'\n\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\tif ($ilance->db->num_rows($account) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res = $ilance->db->fetch_array($account, DB_ASSOC);\n\t\t\t\t\t\t$avail = $res['available_balance'];\n\t\t\t\t\t\t$total = $res['total_balance'];\n\t\t\t\t\t\t// #### suffificent funds to cover transaction\n\t\t\t\t\t\tif ($avail >= $fvf AND $res['autopayment'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// #### create a paid final value donation fee\n\t\t\t\t\t\t\t$invoiceid = $this->insert_transaction(\n\t\t\t\t\t\t\t\t0, intval($pid), 0, $resproject['user_id'], 0, 0, 0, '{_final_value_donation_fee} (' . $resproject['donationpercentage'] . '%) - ' . fetch_auction('project_title', intval($pid)) . ' #' . intval($pid), sprintf(\"%01.2f\", $fvfnotax), sprintf(\"%01.2f\", $fvf), 'paid', 'debit', 'account', DATETIME24H, DATETIME24H, DATETIME24H, '{_auto_debit_from_online_account_balance}', 0, 0, 1\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// #### update invoice mark as final value fee invoice type\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\t$extrainvoicesql\n\t\t\t\t\t\t\t\tisdonationfee = '1',\n\t\t\t\t\t\t\t\tcharityid = '\" . $resproject['charityid'] . \"',\n\t\t\t\t\t\t\t\tisautopayment = '1'\n\t\t\t\t\t\t\t\tWHERE invoiceid = '\" . intval($invoiceid) . \"'\n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t// #### update donation details in listing table\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"projects\n\t\t\t\t\t\t\t\tSET donermarkedaspaid = '1',\n\t\t\t\t\t\t\t\tdonermarkedaspaiddate = '\" . DATETIME24H . \"',\n\t\t\t\t\t\t\t\tdonationinvoiceid = '\" . intval($invoiceid) . \"'\n\t\t\t\t\t\t\t\tWHERE project_id = '\" . intval($pid) . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t// #### update account balance\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\tSET available_balance = available_balance - \" . sprintf(\"%01.2f\", $fvf) . \",\n\t\t\t\t\t\t\t\ttotal_balance = total_balance - \" . sprintf(\"%01.2f\", $fvf) . \"\n\t\t\t\t\t\t\t\tWHERE user_id = '\" . $resproject['user_id'] . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"charities\n\t\t\t\t\t\t\t\tSET donations = donations + 1,\n\t\t\t\t\t\t\t\tearnings = earnings + $fvfnotax\n\t\t\t\t\t\t\t\tWHERE charityid = '\" . $resproject['charityid'] . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t// #### track income history\n\t\t\t\t\t\t\t$ilance->accounting_payment->insert_income_spent($resproject['user_id'], sprintf(\"%01.2f\", $fvf), 'credit');\n\t\t\t\t\t\t\t// #### referral tracker\n\t\t\t\t\t\t\t$ilance->referral->update_referral_action('fvf', $resproject['user_id']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// #### insufficient funds to cover transaction\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$invoiceid = $this->insert_transaction(\n\t\t\t\t\t\t\t\t0, intval($pid), 0, $resproject['user_id'], 0, 0, 0, '{_final_value_donation_fee} (' . $resproject['donationpercentage'] . '%) - ' . fetch_auction('project_title', intval($pid)) . ' #' . intval($pid), sprintf(\"%01.2f\", $fvfnotax), '', 'unpaid', 'debit', 'account', DATETIME24H, DATEINVOICEDUE, '', '{_please_pay_this_invoice_soon_as_possible}', 0, 0, 1\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// update invoice mark as final value donation fee invoice type\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\tSET isdonationfee = '1',\n\t\t\t\t\t\t\t\tcharityid = '\" . $resproject['charityid'] . \"'\n\t\t\t\t\t\t\t\tWHERE invoiceid = '\" . intval($invoiceid) . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"projects\n\t\t\t\t\t\t\t\tSET donermarkedaspaid = '0',\n\t\t\t\t\t\t\t\tdonationinvoiceid = '\" . intval($invoiceid) . \"'\n\t\t\t\t\t\t\t\tWHERE project_id = '\" . intval($pid) . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if ($mode == 'refund')\n\t\t\t\t{\n\t\t\t\t\t// do we have funds in online account?\n\t\t\t\t\t$sql = $ilance->db->query(\"\n\t\t\t\t\t\tSELECT donationinvoiceid, donermarkedaspaid\n\t\t\t\t\t\tFROM \" . DB_PREFIX . \"projects\n\t\t\t\t\t\tWHERE project_id = '\" . intval($pid) . \"'\n\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\tif ($ilance->db->num_rows($sql) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res = $ilance->db->fetch_array($sql, DB_ASSOC);\n\t\t\t\t\t\t// #### reset listing table\n\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"projects\n\t\t\t\t\t\t\tSET donermarkedaspaid = '0',\n\t\t\t\t\t\t\tdonermarkedaspaiddate = '0000-00-00 00:00:00',\n\t\t\t\t\t\t\tdonationinvoiceid = '0'\n\t\t\t\t\t\t\tWHERE project_id = '\" . intval($pid) . \"'\n\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t// #### remove old invoice\n\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\tDELETE FROM \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\tWHERE invoiceid = '\" . $res['donationinvoiceid'] . \"'\n\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t// #### refund donation associated invoice\n\t\t\t\t\t\tif ($res['donermarkedaspaid'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// #### create a paid final value donation fee refund credit\n\t\t\t\t\t\t\t$invoiceid = $this->insert_transaction(\n\t\t\t\t\t\t\t\t0, intval($pid), 0, $resproject['user_id'], 0, 0, 0, '{_final_value_donation_fee_refund_credit} (' . $resproject['donationpercentage'] . '%) - ' . fetch_auction('project_title', intval($pid)) . ' #' . intval($pid), sprintf(\"%01.2f\", $fvf), sprintf(\"%01.2f\", $fvf), 'paid', 'credit', 'account', DATETIME24H, DATETIME24H, DATETIME24H, '{_auto_credited_to_online_account_balance}', 0, 0, 1\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t// #### update account balance\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\tSET available_balance = available_balance + \" . sprintf(\"%01.2f\", $fvf) . \",\n\t\t\t\t\t\t\t\ttotal_balance = total_balance + \" . sprintf(\"%01.2f\", $fvf) . \"\n\t\t\t\t\t\t\t\tWHERE user_id = '\" . $resproject['user_id'] . \"'\n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t// #### track income history\n\t\t\t\t\t\t\t$ilance->accounting_payment->insert_income_spent($resproject['user_id'], sprintf(\"%01.2f\", $fvf), 'debit');\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"charities\n\t\t\t\t\t\t\t\tSET donations = donations - 1,\n\t\t\t\t\t\t\t\tearnings = earnings - $fvfnotax\n\t\t\t\t\t\t\t\tWHERE charityid = '\" . $resproject['charityid'] . \"' \n\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "function commissionComputation($type,$totalContract,$requestCommission,$vat){\n $finalCommission = 0;\n $formula = '0';\n $note = 0;\n $legend = '';\n if($type == 'MARKUP'){\n if($vat == true){\n $formula = $requestCommission.' - ( ('.$requestCommission.'/ 1.12 x .12 ) + ( '.$requestCommission.' / 1.12 x .05 ) )';\n $lessVat = $requestCommission / 1.12;\n $lessVat = $lessVat * .12;\n $lessVat = round($lessVat,6);\n $incomeTax = $requestCommission / 1.12;\n $incomeTax = $incomeTax * .05;\n $incomeTax = round($incomeTax,6);\n $totalDeduction = $lessVat + $incomeTax;\n $legend = 'Request Commission Amount : '.$requestCommission.'| VAT :12% | Income Tax : 5%';\n $finalCommission = $requestCommission - $totalDeduction;\n }\n else{\n //false\n $formula = $requestCommission.' - ( '.$requestCommission.' x .05 )';\n $incomeTax = $requestCommission * .05;\n $totalDeduction = $incomeTax;\n $legend = 'Request Commission Amount : '.$requestCommission.' | Income Tax : 5%';\n $finalCommission = $requestCommission - $totalDeduction;\n }\n }elseif($type == 'REGULAR'){\n if($vat == true){\n $formula = $requestCommission.\"-((\".$requestCommission.\"/ 1.12) X 0.12)\";\n $lessVat = $requestCommission / 1.12;\n $lessVat = $lessVat * .12;\n $lessVat = round($lessVat,6);\n $totalDeduction = $lessVat;\n $legend = 'Request Commission Amount : '.$requestCommission.'| VAT :12% | Income Tax : 5%';\n $finalCommission = $requestCommission - $totalDeduction;\n }else{\n $formula = $requestCommission.' [No Formula]';\n $finalCommission = $requestCommission;\n }\n }\n elseif($type == 'CTD'){\n if($vat == true){\n $formula = $requestCommission.' - ( ('.$requestCommission.'/ 1.12 x .12 ) + ( '.$requestCommission.' / 1.12 x .05 ) )';\n $lessVat = $requestCommission / 1.12;\n $lessVat = $lessVat * .12;\n $lessVat = round($lessVat,6);\n $incomeTax = $requestCommission / 1.12;\n $incomeTax = $incomeTax * .05;\n $incomeTax = round($incomeTax,6);\n $totalDeduction = $lessVat + $incomeTax;\n $finalCommission = $requestCommission - $totalDeduction;\n $legend = 'Request Commission Amount : '.$requestCommission.'<br> VAT :12% | Income Tax : 5%';\n }\n else{\n //false\n $formula = $requestCommission.' - ( '.$requestCommission.' x .05 )';\n $incomeTax = $requestCommission * .05;\n $totalDeduction = $incomeTax;\n $legend = 'Request Commission Amount : '.$requestCommission.' | Income Tax : 5%';\n $finalCommission = $requestCommission - $totalDeduction;\n }\n }\n else{\n $formulationDetails = array(\n 'success' => false,\n 'type' => $type,\n 'formula' => $formula,\n 'note' => $legend,\n 'final_commission' => $finalCommission,\n 'vat'=>$vat\n );\n }\n $formulationDetails = array(\n 'success' => false,\n 'type' => $type,\n 'formula' => $formula,\n 'note' => $legend,\n 'final_commission' => $finalCommission,\n 'vat'=>$vat\n );\n return $formulationDetails;\n}", "public function getAcquisitionInformation() {\n $fields = array('acquisitionInformation' => array(\n 'acquisitionTerms',\n ));\n $result = tingOpenformatMethods::parseFields($this->_getDetails(), $fields);\n return $result;\n }", "function qualificationServ(): string\n{\n $FtPqr = getFtPqr();\n $FtPqrCalificacion = $FtPqr->getLastCalificacion();\n\n return $FtPqrCalificacion ? $FtPqrCalificacion->getFieldValue('experiencia_servicio') : '-';\n}", "function getDescription() {\n\t\treturn __('plugins.generic.autoApprovePublicationFormats.description');\n\t}", "public function getMonthlyFee();", "public function getDescription() {\n\t\treturn null;\n\t}", "public function dispFees ($stud_id)\n\t{\n\t\t\t$year_id = $this->getYear();\n\n\t\t $fees_query = \"SELECT C.term_name,B.due_date_from,B.due_date_to,A.status FROM `edu_term_fees_status` A, `edu_fees_master` B,`edu_terms` C WHERE A.year_id='$year_id' AND A.student_id='$stud_id' AND A.fees_id=B.id AND B.term_id = C.term_id\";\n\t\t\t$fees_res = $this->db->query($fees_query);\n\t\t\t$fees_result= $fees_res->result();\n\n\t\t\t if($fees_res->num_rows()==0){\n\t\t\t\t $response = array(\"status\" => \"error\", \"msg\" => \"Fees Not Found\");\n\t\t\t}else{\n\t\t\t\t$response = array(\"status\" => \"success\", \"msg\" => \"View Fees\", \"feesDetails\"=>$fees_result);\n\t\t\t}\n\n\t\t\treturn $response;\n\t}", "public function getFee(): float;", "public function terms()\n {\n return view('main::terms')\n ->with('about_us_english', Fixed::where('name', 'LIKE', 'Terms and Conditions')->first()->body)\n ->with('about_us_arabic', Helper::localization('fixed_pages', 'body', 2, 2));\n }", "public function getFee()\n {\n return $this->fee;\n }", "public function getFee()\n {\n return $this->fee;\n }", "public function getSectoreconomicofecha()\n\t{\n\t\treturn $this->sectoreconomicofecha;\n\t}", "function getDescription() {\n\t\tif( !($ret = $this->getField( 'summary' )) ) {\n\t\t\t$ret = $this->getField( 'data' );\n\t\t}\n\t\treturn $ret;\n\t}", "public function show_fees($grnumber,$class,$division)\n\t{\n\t\tif(isset($this->session->isactive)){\n\n\t\t\t$this->load->model('fees_model');\n\t\t\t$this->load->model('student_model');\n\t\t\t$term_one = $this->fees_model->get_fees_term_one($grnumber,$class,$division);\n\t\t\t$term_two = $this->fees_model->get_fees_term_two($grnumber,$class,$division);\n\t\t\t$name = $this->student_model->get_student($grnumber);\n\n\t\t\t// Storing fees details termwise and student name to be displayed\n\t\t\t$data['term_one'] = $term_one;\n\t\t\t$data['term_two'] = $term_two;\n\t\t\t$data['name'] = $name[0]['name'];\n\t\t\t// Layout view is common view containing sidebar and navbar\n\t\t\t// in which respective view is loaded as main content view\n $data['view'] = 'invoice_student_fees_view';\n\t\t\t$data['title'] = 'IQRA | Invoice';\n\t\t\t$data['breadcrumb_1'] = 'Invoice';\n\t\t\t$data['breadcrumb_2'] = 'Invoice';\n\t\t\t$data['breadcrumb_3'] = 'Show Fees';\n $this->load->view('layout_view',$data);\n\t\t}\n\t\telse {\n\t\t\tredirect('login');\n\t\t}\n\t}", "public function getPraposalFinsummary( $param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n $endUseList = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n\n\n $loan = null;\n $loanType = null;\n //$bl_year = MasterData::BalanceSheet_FY();\n $bl_year = $this->setFinancialYears();\n $groupType = Config::get('constants.CONST_FIN_GROUP_TYPE_RATIO');\n $financialGroups = FinancialGroup::with('financialEntries')->where('type', '=', $groupType)->where('status', '=', 1)->orderBy('sortOrder')->get();\n $helper = new ExpressionHelper($loanId);\n $financialDataRecords = BalanceSheet::where('loan_id', '=', $loanId)->get();\n\n\n $financialDataExpressionsMap = $helper->calculateRatios();\n //dd($bl_year, $groupType, $financialGroups, $financialDataExpressionsMap);\n $financialDataMap = new Collection();\n $showFormulaText = true;\n $financialProfitLoss = ProfitLoss::where('loan_id', '=', $loanId)->get();\n $test = Cashflow::where('loan_id', '=', $loanId)->get();\n $fromCashflowTable = Cashflow::periodsCashflowIdMap($loanId);\n //echo $existingPeriodsCashsasflowIdMap[76]->value;\n /* echo \"<pre>\";\n print_r($fromCashflowTable['FY 2017-18(Prov)'][79]->value);\n echo \"</pre>\";*/\n\n \n $ratios = Ratio::where('loan_id', '=', $loanId)->get();\n /* echo \"<pre>\";\n print_r($ratios);\n echo \"</pre>\";\n */ \n $subViewType = 'loans._finsummary';\n $formaction = 'Loans\\LoansController@postPraposalFinsummary';\n //$formaction = 'loans/newlap/uploaddoc/'.$loanId;\n $validLoanHelper = new validLoanUrlhelper();\n //getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n return view('loans.praposalCreditEdit', compact(\n 'subViewType',\n 'loan',\n 'loanId',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'formaction',\n 'bl_year',\n 'financialGroups',\n 'groupType',\n 'financialDataExpressionsMap',\n 'showFormulaText',\n 'financialDataMap',\n 'fromCashflowTable',\n 'validLoanHelper',\n 'userProfileFirm',\n 'loanUserProfile',\n 'companySharePledged',\n 'bscNscCode',\n 'financialProfitLoss',\n 'ratios',\n 'financialDataRecords'\n ));\n }", "public function getDescription()\n {\n return;\n }", "public function getTerms()\n {\n return view('frontend.info.policy');\n }", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "public function getDescription() {}", "abstract function getdescription();", "public function getFees()\n {\n return $this->fees;\n }", "public function getTonicDiscount()\n {\n }", "public function payment_fields() {\n\t\t$description = $this->get_description();\n\n\t\tif ( 'yes' == $this->sandbox ) {\n\t\t\t$description .= ' ' . sprintf( __( 'TEST MODE ENABLED. Use a test card: %s', 'woocommerce' ), '<a href=\"https://www.simplify.com/commerce/docs/tutorial/index#testing\">https://www.simplify.com/commerce/docs/tutorial/index#testing</a>' );\n\t\t}\n\n\t\tif ( $description ) {\n\t\t\techo wpautop( wptexturize( trim( $description ) ) );\n\t\t}\n\t}", "public function getDesignation(){\n\t\treturn \"Un élément\";\n\t}" ]
[ "0.63198", "0.58954066", "0.5836653", "0.5543391", "0.5529834", "0.55213416", "0.55158085", "0.54599667", "0.54230326", "0.54068226", "0.539984", "0.53977805", "0.5396218", "0.5394569", "0.538878", "0.5384064", "0.53805846", "0.53805846", "0.53741974", "0.5330823", "0.5329456", "0.53141266", "0.5305081", "0.5305081", "0.529606", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5286929", "0.5283901", "0.52775174", "0.52695036", "0.52629167", "0.5259494", "0.52536654", "0.5246368", "0.5243755", "0.52246606", "0.5219705", "0.5219146", "0.52078944", "0.5200864", "0.5182745", "0.51763344", "0.51751035", "0.5172359", "0.5162148", "0.5158633", "0.51567686", "0.5151845", "0.514788", "0.5144007", "0.51361465", "0.5135193", "0.5130438", "0.5129486", "0.51240677", "0.51178205", "0.5114966", "0.51121396", "0.50972897", "0.50972897", "0.50911975", "0.50811553", "0.5079844", "0.507948", "0.5070837", "0.5070258", "0.5066817", "0.5066817", "0.5066817", "0.5066817", "0.5066817", "0.5066817", "0.5066817", "0.5066817", "0.5066817", "0.5066026", "0.5066026", "0.5066026", "0.5063422", "0.5057003", "0.5056849", "0.50445116", "0.5042989" ]
0.0
-1